1
0
mirror of https://github.com/20kdc/OC-KittenOS.git synced 2025-04-05 04:08:39 +11:00

Nobody wanted translations anyway

This commit is contained in:
20kdc 2018-03-20 15:19:36 +00:00
parent 6d81533afe
commit 53db9fd2cb
3 changed files with 19 additions and 24 deletions

BIN
code.tar

Binary file not shown.

View File

@ -10,11 +10,6 @@ local gpu, screen = nil, nil
local shutdownEmergency = neo.requestAccess("k.computer").shutdown local shutdownEmergency = neo.requestAccess("k.computer").shutdown
neo.requestAccess("s.h.key_down") neo.requestAccess("s.h.key_down")
-- glacier hasn't started yet - this will be dealt with later
local function _(tx)
return tx
end
local scrW, scrH local scrW, scrH
local warnings = { local warnings = {
"", "",
@ -38,13 +33,13 @@ end
local function basicDraw() local function basicDraw()
scrW, scrH = gpu.getResolution() scrW, scrH = gpu.getResolution()
gpu.fill(1, 1, scrW, scrH, " ") gpu.fill(1, 1, scrW, scrH, " ")
gpu.set(2, 2, _("KittenOS NEO")) gpu.set(2, 2, "KittenOS NEO")
end end
local function advDraw() local function advDraw()
basicDraw() basicDraw()
local usage = math.floor((os.totalMemory() - os.freeMemory()) / 1024) local usage = math.floor((os.totalMemory() - os.freeMemory()) / 1024)
gpu.set(2, 3, _("RAM Usage: ") .. usage .. "K / " .. math.floor(os.totalMemory() / 1024) .. "K") gpu.set(2, 3, "RAM Usage: " .. usage .. "K / " .. math.floor(os.totalMemory() / 1024) .. "K")
for i = 1, #warnings do for i = 1, #warnings do
gpu.set(2, 6 + i, warnings[i]) gpu.set(2, 6 + i, warnings[i])
end end
@ -98,7 +93,7 @@ local function retrieveNssMonitor(nss)
end end
end end
if not subpool[1] then error(_("Unable to claim any monitor.")) end if not subpool[1] then error("Unable to claim any monitor.") end
gpu = subpool[1][1]() -- BAD gpu = subpool[1][1]() -- BAD
screen = subpool[1][2] screen = subpool[1][2]
end end
@ -147,19 +142,19 @@ local function finalPrompt()
if nsm then if nsm then
password = nsm.getSetting("password") password = nsm.getSetting("password")
end end
warnings[1] = _("TAB to change option,") warnings[1] = "TAB to change option,"
warnings[2] = _("ENTER to select...") warnings[2] = "ENTER to select..."
-- The actual main prompt loop -- The actual main prompt loop
while waiting do while waiting do
advDraw() advDraw()
local entry = "" local entry = ""
local entry2 = "" local entry2 = ""
local active = true local active = true
local shButton = _("<Shutdown>") local shButton = "<Shutdown>"
local rbButton = _("<Reboot>") local rbButton = "<Reboot>"
local smButton = _("<Safe Mode>") local smButton = "<Safe Mode>"
local pw = {function () local pw = {function ()
return _("Password: ") .. entry2 return "Password: " .. entry2
end, function (key) end, function (key)
if key >= 32 then if key >= 32 then
entry = entry .. unicode.char(key) entry = entry .. unicode.char(key)
@ -177,7 +172,7 @@ local function finalPrompt()
end, 2, 5, scrW - 2} end, 2, 5, scrW - 2}
if password == "" then if password == "" then
pw = {function () pw = {function ()
return _("Log in...") return "Log in..."
end, function (key) end, function (key)
if key == 13 then if key == 13 then
waiting = false waiting = false
@ -191,7 +186,7 @@ local function finalPrompt()
end, function (key) end, function (key)
if key == 13 then if key == 13 then
basicDraw() basicDraw()
gpu.set(2, 4, _("Shutting down...")) gpu.set(2, 4, "Shutting down...")
shutdown(false) shutdown(false)
end end
end, 2, scrH - 1, unicode.len(shButton)}, end, 2, scrH - 1, unicode.len(shButton)},
@ -200,7 +195,7 @@ local function finalPrompt()
end, function (key) end, function (key)
if key == 13 then if key == 13 then
basicDraw() basicDraw()
gpu.set(2, 4, _("Rebooting...")) gpu.set(2, 4, "Rebooting...")
shutdown(true) shutdown(true)
end end
end, 3 + unicode.len(shButton), scrH - 1, unicode.len(rbButton)}, end, 3 + unicode.len(shButton), scrH - 1, unicode.len(rbButton)},
@ -209,7 +204,7 @@ local function finalPrompt()
end, function (key) end, function (key)
if key == 13 then if key == 13 then
basicDraw() basicDraw()
gpu.set(2, 4, _("Login to activate Safe Mode.")) gpu.set(2, 4, "Login to activate Safe Mode.")
sleep(1) sleep(1)
safeModeActive = true safeModeActive = true
advDraw() advDraw()
@ -259,10 +254,10 @@ local function postPrompt()
if everests then if everests then
local s, e = pcall(everests.startSession) local s, e = pcall(everests.startSession)
if not s then if not s then
table.insert(warnings, _("Everest failed to create a session")) table.insert(warnings, "Everest failed to create a session")
table.insert(warnings, tostring(e)) table.insert(warnings, tostring(e))
else else
warnings = {_("Transferring to Everest...")} warnings = {"Transferring to Everest..."}
advDraw() advDraw()
if performDisclaim then if performDisclaim then
performDisclaim() performDisclaim()
@ -272,7 +267,7 @@ local function postPrompt()
return return
end end
else else
table.insert(warnings, _("Couldn't communicate with Everest...")) table.insert(warnings, "Couldn't communicate with Everest...")
end end
advDraw() advDraw()
sleep(1) sleep(1)
@ -342,7 +337,7 @@ local function initializeSystem()
if steps[w] == "INJECT" then if steps[w] == "INJECT" then
local nsm = neo.requestAccess("x.neo.sys.manage") local nsm = neo.requestAccess("x.neo.sys.manage")
if not nsm then if not nsm then
table.insert(warnings, _("Settings not available for INJECT.")) table.insert(warnings, "Settings not available for INJECT.")
else else
local nextstepsA = {} local nextstepsA = {}
local nextstepsB = {} local nextstepsB = {}
@ -398,7 +393,7 @@ if finalPrompt() then
basicDraw() basicDraw()
local nsm = neo.requestAccess("x.neo.sys.manage") local nsm = neo.requestAccess("x.neo.sys.manage")
if nsm then if nsm then
gpu.set(2, 4, _("Rebooting for Safe Mode...")) gpu.set(2, 4, "Rebooting for Safe Mode...")
for _, v in ipairs(nsm.listSettings()) do for _, v in ipairs(nsm.listSettings()) do
if v ~= "password" then if v ~= "password" then
nsm.delSetting(v) nsm.delSetting(v)

View File

@ -52,7 +52,7 @@ local function tA(s)
else else
tFN = s:sub(1, 100):gsub("\x00", "") tFN = s:sub(1, 100):gsub("\x00", "")
local sz = convoct(s:sub(125, 135)) local sz = convoct(s:sub(125, 135))
if tFN:sub(1, 5) ~= "code/" then if tFN:sub(1, 5) ~= "work/" then
tW = math.ceil(sz / 512) tW = math.ceil(sz / 512)
else else
tFN = tFN:sub(6) tFN = tFN:sub(6)