Update sPhone.lua

This commit is contained in:
Ale32bit 2016-03-19 23:31:00 +01:00
parent 1fd97525b8
commit d7e980ce7f

View file

@ -152,20 +152,17 @@ local function kernel()
sPhone.forceReboot()
end
function sPhone.header(butt)
function sPhone.header(title, butt)
if not sPhone then
sPhone = {
user = "Unknown",
}
if not title then
title = "sPhone"
end
local function upd()
local w, h = term.getSize()
local w, h = term.getSize()
paintutils.drawLine(1,1,w,1, colors.blue)
term.setTextColor(colors.white)
term.setCursorPos(1,1)
write(" "..sPhone.user)
write(" "..title)
term.setCursorPos(w,1)
if butt then
write(butt)
@ -175,9 +172,6 @@ local function kernel()
term.setCursorPos(1,3)
end
upd()
end
function sPhone.menu(items, title, closeButton)
local function cprint(text)
if type(text) ~= 'table' then
@ -245,7 +239,7 @@ local function kernel()
term.setTextColor(colors.black)
term.clear()
term.setCursorPos(1,1)
sPhone.header(closeButton)
sPhone.header("",closeButton)
term.setCursorPos(1,3)
if not title then
title = " sPhone"