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,
} }
@ -88,7 +88,7 @@ local function kernel()
sPhone.doneShutdown = true sPhone.doneShutdown = true
clear() clear()
w, h = term.getSize() w, h = term.getSize()
term.setCursorPos( (w / 2) - 1, h / 2) term.setCursorPos( (w / 2) - 1, h / 2)
for i = 1,3 do for i = 1,3 do
sleep(0.3) sleep(0.3)
write(".") write(".")
@ -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,10 +129,12 @@ 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 sPhone.user then if not hideUser
write(" sPhone") if not sPhone.user then
else write(" sPhone")
write(" "..sPhone.user) else
write(" "..sPhone.user)
end
end end
term.setCursorPos(1,3) term.setCursorPos(1,3)
term.setBackgroundColor(colors.white) term.setBackgroundColor(colors.white)
@ -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()