From 06bd10065fb1363ce5952255977a0606b16dbb27 Mon Sep 17 00:00:00 2001 From: Ale32bit Date: Sat, 19 Mar 2016 23:01:34 +0100 Subject: [PATCH] Update settings.lua --- src/apps/system/settings.lua | 55 ++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/src/apps/system/settings.lua b/src/apps/system/settings.lua index 725ee33..3e40696 100644 --- a/src/apps/system/settings.lua +++ b/src/apps/system/settings.lua @@ -145,30 +145,31 @@ local w, h = term.getSize() local function redraw() clear() local w, h = term.getSize() - paintutils.drawLine(1,1,w,1, colors.blue) - term.setTextColor(colors.white) - term.setCursorPos(2,1) - write(sPhone.user) - term.setCursorPos(w,1) - write("X") - term.setCursorPos(1,3) - term.setBackgroundColor(colors.white) - term.setTextColor(colors.black) - end - redraw() - - while true do - redraw() - local name, id = sPhone.menu(menu, "Settings",true) - if id == 0 then - return - elseif id == 1 then - setfenv(loadstring(http.get("https://raw.githubusercontent.com/Sertex-Team/sPhone/master/src/installer.lua").readAll()),getfenv())() - elseif id == 2 then - changePassword() - elseif id == 3 then - changeLabel() - elseif id == 4 then - clearLabel() - end - end + paintutils.drawLine(1,1,w,1, colors.blue) + term.setTextColor(colors.white) + term.setCursorPos(2,1) + write(sPhone.user) + term.setCursorPos(w,1) + write("X") + term.setCursorPos(1,3) + term.setBackgroundColor(colors.white) + term.setTextColor(colors.black) +end +redraw() + +while true do + redraw() + local name, id = sPhone.menu(menu, "Settings","X") + if id == 0 then + return + elseif id == 1 then + setfenv(loadstring(http.get("https://raw.githubusercontent.com/Sertex-Team/sPhone/master/src/installer.lua").readAll()),getfenv())() + elseif id == 2 then + changePassword() + elseif id == 3 then + changeLabel() + elseif id == 4 then + clearLabel() + end +end +