Update home.spk
This commit is contained in:
parent
8d43c6c434
commit
08e460821d
1 changed files with 21 additions and 42 deletions
|
@ -4,28 +4,15 @@
|
|||
--
|
||||
{
|
||||
files = "{\
|
||||
[ \"home.lua\" ] = \"\\\
|
||||
\\\
|
||||
local buttonsInHome = {\\\
|
||||
{\\\"sPhone.header\\\",23,1,25,1,sPhone.theme[\\\"header\\\"],sPhone.theme[\\\"headerText\\\"],\\\"vvv\\\"},\\\
|
||||
{\\\"sPhone.appsButton\\\",12,20,14,20,sPhone.theme[\\\"backgroundColor\\\"],sPhone.theme[\\\"header\\\"],\\\"===\\\"},\\\
|
||||
{\\\"sPhone.shell\\\",2,3,8,5,colors.black,colors.yellow,\\\" Shell\\\",2},\\\
|
||||
{\\\"sPhone.lock\\\",19,3,24,5,colors.lightGray,colors.black,\\\" Lock\\\",2},\\\
|
||||
{\\\"sPhone.chat\\\",11,3,16,5,colors.black,colors.white,\\\" Chat\\\",2},\\\
|
||||
{\\\"sPhone.gps\\\",11,7,15,9,colors.red,colors.black,\\\" GPS\\\",2},\\\
|
||||
{\\\"sPhone.info\\\",18,7,23,9,colors.lightGray,colors.black,\\\" Info\\\",2},\\\
|
||||
{\\\"sPhone.store\\\",2,7,8,9,colors.green,colors.white,\\\" Store\\\",2},\\\
|
||||
}\\\
|
||||
\\\
|
||||
\\\
|
||||
local appsOnHome = {\\\
|
||||
[\\\"sPhone.shell\\\"] = \\\"/.sPhone/apps/shell\\\",\\\
|
||||
[\\\"sPhone.chat\\\"] = \\\"/.sPhone/apps/chat\\\",\\\
|
||||
[\\\"sPhone.gps\\\"] = \\\"/.sPhone/apps/gps\\\",\\\
|
||||
[\\\"sPhone.info\\\"] = \\\"/.sPhone/apps/system/info\\\",\\\
|
||||
[\\\"sPhone.store\\\"] = \\\"/.sPhone/apps/store\\\",\\\
|
||||
[\\\"sPhone.appsButton\\\"] = \\\"/.sPhone/apps/appList\\\",\\\
|
||||
\\\
|
||||
[ \"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},\\\
|
||||
{\\\"sphone.explorer\\\",11,3,17,5,colors.blue,colors.white,\\\" Files\\\",2},\\\
|
||||
{\\\"sphone.lock\\\",20,3,25,5,colors.lightGray,colors.black,\\\" Lock\\\",2},\\\
|
||||
{\\\"sphone.gps\\\",11,7,15,9,colors.red,colors.black,\\\" GPS\\\",2},\\\
|
||||
{\\\"sphone.info\\\",18,7,23,9,colors.lightGray,colors.black,\\\" Info\\\",2},\\\
|
||||
{\\\"sphone.store\\\",2,7,8,9,colors.green,colors.white,\\\" Store\\\",2},\\\
|
||||
}\\\
|
||||
\\\
|
||||
local function clear()\\\
|
||||
|
@ -36,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()\\\
|
||||
|
@ -57,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)\\\
|
||||
|
@ -81,7 +60,7 @@
|
|||
sPhone.inHome = true\\\
|
||||
elseif x > 10 and x < 19 then\\\
|
||||
sPhone.inHome = false\\\
|
||||
shell.run(\\\"/.sPhone/apps/system/settings\\\")\\\
|
||||
sPhone.launch(\\\"sphone.settings\\\")\\\
|
||||
sPhone.inHome = true\\\
|
||||
drawHome()\\\
|
||||
end\\\
|
||||
|
@ -100,16 +79,16 @@
|
|||
local autoLockTimer = os.startTimer(10)\\\
|
||||
local id = visum.buttons(buttonsInHome)\\\
|
||||
\\\
|
||||
if id == \\\"sPhone.header\\\" then\\\
|
||||
if id == \\\"sphone.header\\\" then\\\
|
||||
footerMenu()\\\
|
||||
elseif id == \\\"sPhone.lock\\\" then\\\
|
||||
elseif id == \\\"sphone.lock\\\" then\\\
|
||||
sPhone.inHome = false\\\
|
||||
sPhone.login()\\\
|
||||
sPhone.inHome = true\\\
|
||||
elseif appsOnHome[id] then\\\
|
||||
else\\\
|
||||
sPhone.inHome = false\\\
|
||||
os.pullEvent = os.oldPullEvent\\\
|
||||
shell.run(appsOnHome[id])\\\
|
||||
sPhone.launch(id)\\\
|
||||
os.pullEvent = os.pullEventRaw\\\
|
||||
sPhone.inHome = true\\\
|
||||
end\\\
|
||||
|
@ -138,12 +117,12 @@
|
|||
\",\
|
||||
}",
|
||||
config = "{\
|
||||
main = \"home.lua\",\
|
||||
id = \"sphone.home\",\
|
||||
name = \"sPhone Home\",\
|
||||
hidden = true,\
|
||||
author = \"BeaconNet\",\
|
||||
version = 1,\
|
||||
type = \"home\",\
|
||||
main = \"home.lua\",\
|
||||
name = \"sPhone Home\",\
|
||||
version = 1,\
|
||||
id = \"sphone.home\",\
|
||||
author = \"BeaconNet\",\
|
||||
hidden = true,\
|
||||
}",
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue