Update sPhone.lua

This commit is contained in:
Ale2610 2015-09-02 14:47:30 +02:00
parent 013cd43d47
commit 000d744034

View file

@ -41,7 +41,7 @@ end
local function kernel() local function kernel()
_G.sPhone = { _G.sPhone = {
version = "Alpha 1", version = "Alpha 2",
user = "Run sID", user = "Run sID",
devMode = false, devMode = false,
} }
@ -120,16 +120,7 @@ local function kernel()
sPhone.forceReboot() sPhone.forceReboot()
end end
function byte(string) function sPhone.yesNo(title, desc, hideUser)
local newString = ""
for i = 1, #string do
addString = string.byte(string.sub(string, i))
newString = newString .. addString
end
return newString
end
function sPhone.yesNo(title, desc)
term.setBackgroundColor(colors.white) term.setBackgroundColor(colors.white)
term.clear() term.clear()
term.setCursorPos(1,1) term.setCursorPos(1,1)
@ -138,11 +129,13 @@ local function kernel()
paintutils.drawLine(1,1,w,1, colors.gray) paintutils.drawLine(1,1,w,1, colors.gray)
term.setTextColor(colors.white) term.setTextColor(colors.white)
term.setCursorPos(1,1) term.setCursorPos(1,1)
if not hideUser
if not sPhone.user then if not sPhone.user then
write(" sPhone") write(" sPhone")
else else
write(" "..sPhone.user) write(" "..sPhone.user)
end end
end
term.setCursorPos(1,3) term.setCursorPos(1,3)
term.setBackgroundColor(colors.white) term.setBackgroundColor(colors.white)
term.setTextColor(colors.black) term.setTextColor(colors.black)
@ -467,7 +460,7 @@ local function kernel()
sleep(2) sleep(2)
else else
local choose = sPhone.yesNo("Setup Sertex ID", "Do you have a Sertex ID?") local choose = sPhone.yesNo("Setup Sertex ID", "Do you have a Sertex ID?", true)
if not choose then if not choose then
term.setBackgroundColor(colors.white) term.setBackgroundColor(colors.white)
term.clear() term.clear()