From ac27bc0425f7186960cf388244209c71cbdf9f22 Mon Sep 17 00:00:00 2001 From: Ale32bit Date: Thu, 24 Nov 2016 22:24:57 +0100 Subject: [PATCH] Add files via upload --- src/apps/spks/home.spk | 16 +++------------- src/apps/spks/settings.spk | 28 +++++++++++++++++++--------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/apps/spks/home.spk b/src/apps/spks/home.spk index 86b4f27..85c3968 100644 --- a/src/apps/spks/home.spk +++ b/src/apps/spks/home.spk @@ -4,9 +4,7 @@ -- { files = "{\ - [ \"home.lua\" ] = \"\\\ - \\\ - local buttonsInHome = {\\\ + [ \"home.lua\" ] = \"local buttonsInHome = {\\\ {\\\"sphone.header\\\",23,1,25,1,sPhone.theme[\\\"header\\\"],sPhone.theme[\\\"headerText\\\"],\\\"vvv\\\"},\\\ {\\\"sphone.appList\\\",12,20,14,20,sPhone.theme[\\\"backgroundColor\\\"],sPhone.theme[\\\"header\\\"],\\\"===\\\"},\\\ {\\\"sphone.shell\\\",2,3,8,5,colors.black,colors.yellow,\\\" Shell\\\",2},\\\ @@ -25,15 +23,7 @@ end\\\ \\\ local function drawHome()\\\ - local function box(x,y,text,bg,colorText,page)\\\ - graphics.box(x,y,x+1+#text,y+2,bg)\\\ - term.setCursorPos(x+1,y+1)\\\ - term.setTextColor(colorText)\\\ - write(text)\\\ - end\\\ clear()\\\ - \\\ - \\\ visum.buttons(buttonsInHome,true)\\\ \\\ local w, h = term.getSize()\\\ @@ -46,7 +36,7 @@ function redraw()\\\ drawHome()\\\ local w, h = term.getSize()\\\ - graphics.box(1,2,w,4,sPhone.theme[\\\"header\\\"])\\\ + paintutils.drawFilledBox(1,2,w,4,sPhone.theme[\\\"header\\\"])\\\ term.setTextColor(sPhone.theme[\\\"headerText\\\"])\\\ term.setBackgroundColor(sPhone.theme[\\\"header\\\"])\\\ visum.align(\\\"right\\\",\\\"^^^ \\\",false,1)\\\ @@ -135,4 +125,4 @@ author = \"BeaconNet\",\ hidden = true,\ }", -} +} \ No newline at end of file diff --git a/src/apps/spks/settings.spk b/src/apps/spks/settings.spk index 226c93c..9536b55 100644 --- a/src/apps/spks/settings.spk +++ b/src/apps/spks/settings.spk @@ -11,15 +11,20 @@ local w,h = term.getSize()\\\ local password\\\ \\\ local menu = {\\\ - \\\"Update\\\",\\\ - \\\"Edit Theme\\\",\\\ - \\\"Change Username\\\",\\\ - \\\"Change Password\\\",\\\ - \\\"Set Label\\\",\\\ - \\\"Clear Label\\\",\\\ - \\\"Default Apps\\\",\\\ + \\\"Update\\\", --1\\\ + \\\"Edit Theme\\\", --2\\\ + \\\"Change Username\\\", --3\\\ + \\\"Change Password\\\", --4\\\ + \\\"Set Label\\\", --5\\\ + \\\"Clear Label\\\", --6\\\ + \\\"Default Apps\\\", --7\\\ + \\\"Hide Update\\\", --8\\\ }\\\ \\\ +if not config.read(\\\"/.sPhone/config/sPhone\\\",\\\"showUpdate\\\") then\\\ + menu[8] = \\\"Show Update\\\"\\\ +end\\\ +\\\ local function clear()\\\ term.setBackgroundColor(sPhone.theme[\\\"backgroundColor\\\"])\\\ term.setTextColor(sPhone.theme[\\\"text\\\"])\\\ @@ -397,8 +402,11 @@ local function defaultApps()\\\ end\\\ \\\ while true do\\\ - clear()\\\ - sPhone.header(\\\"\\\",\\\"X\\\")\\\ + if not config.read(\\\"/.sPhone/config/sPhone\\\",\\\"showUpdate\\\") then\\\ + menu[8] = \\\"Show Update\\\"\\\ + else\\\ + menu[8] = \\\"Hide Update\\\"\\\ + end\\\ local name, id = sPhone.menu(menu, \\\"Settings\\\",\\\"X\\\")\\\ if id == 0 then\\\ task.kill(temp.get(\\\"homePID\\\"))\\\ @@ -417,6 +425,8 @@ while true do\\\ clearLabel()\\\ elseif id == 7 then\\\ defaultApps()\\\ + elseif id == 8 then\\\ + config.write(\\\"/.sPhone/config/sPhone\\\",\\\"showUpdate\\\", not config.read(\\\"/.sPhone/config/sPhone\\\",\\\"showUpdate\\\"))\\\ end\\\ end\\\ \",\