From d7e980ce7fb1ebee5fdb812bccc5b4426591fdd1 Mon Sep 17 00:00:00 2001 From: Ale32bit Date: Sat, 19 Mar 2016 23:31:00 +0100 Subject: [PATCH] Update sPhone.lua --- src/sPhone.lua | 42 ++++++++++++++++++------------------------ 1 file changed, 18 insertions(+), 24 deletions(-) diff --git a/src/sPhone.lua b/src/sPhone.lua index 6fbf079..56f19cc 100644 --- a/src/sPhone.lua +++ b/src/sPhone.lua @@ -152,30 +152,24 @@ local function kernel() sPhone.forceReboot() end - function sPhone.header(butt) - - if not sPhone then - 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 + function sPhone.header(title, butt) - upd() + if not title then + title = "sPhone" + end + + 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 function sPhone.menu(items, title, closeButton) @@ -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"