Update sPhone.lua
This commit is contained in:
parent
1fd97525b8
commit
d7e980ce7f
1 changed files with 18 additions and 24 deletions
|
@ -152,30 +152,24 @@ local function kernel()
|
||||||
sPhone.forceReboot()
|
sPhone.forceReboot()
|
||||||
end
|
end
|
||||||
|
|
||||||
function sPhone.header(butt)
|
function sPhone.header(title, butt)
|
||||||
|
|
||||||
if not sPhone then
|
if not title then
|
||||||
sPhone = {
|
title = "sPhone"
|
||||||
user = "Unknown",
|
|
||||||
}
|
|
||||||
end
|
|
||||||
local function upd()
|
|
||||||
local w, h = term.getSize()
|
|
||||||
|
|
||||||
paintutils.drawLine(1,1,w,1, colors.blue)
|
|
||||||
term.setTextColor(colors.white)
|
|
||||||
term.setCursorPos(1,1)
|
|
||||||
write(" "..sPhone.user)
|
|
||||||
term.setCursorPos(w,1)
|
|
||||||
if butt then
|
|
||||||
write(butt)
|
|
||||||
end
|
|
||||||
term.setBackgroundColor(colors.white)
|
|
||||||
term.setTextColor(colors.black)
|
|
||||||
term.setCursorPos(1,3)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
upd()
|
local w, h = term.getSize()
|
||||||
|
paintutils.drawLine(1,1,w,1, colors.blue)
|
||||||
|
term.setTextColor(colors.white)
|
||||||
|
term.setCursorPos(1,1)
|
||||||
|
write(" "..title)
|
||||||
|
term.setCursorPos(w,1)
|
||||||
|
if butt then
|
||||||
|
write(butt)
|
||||||
|
end
|
||||||
|
term.setBackgroundColor(colors.white)
|
||||||
|
term.setTextColor(colors.black)
|
||||||
|
term.setCursorPos(1,3)
|
||||||
end
|
end
|
||||||
|
|
||||||
function sPhone.menu(items, title, closeButton)
|
function sPhone.menu(items, title, closeButton)
|
||||||
|
@ -245,7 +239,7 @@ local function kernel()
|
||||||
term.setTextColor(colors.black)
|
term.setTextColor(colors.black)
|
||||||
term.clear()
|
term.clear()
|
||||||
term.setCursorPos(1,1)
|
term.setCursorPos(1,1)
|
||||||
sPhone.header(closeButton)
|
sPhone.header("",closeButton)
|
||||||
term.setCursorPos(1,3)
|
term.setCursorPos(1,3)
|
||||||
if not title then
|
if not title then
|
||||||
title = " sPhone"
|
title = " sPhone"
|
||||||
|
|
Loading…
Reference in a new issue