Merge pull request #15 from SertexTeam/final

Final
This commit is contained in:
Alessandro 2019-10-28 19:34:13 +01:00 committed by GitHub
commit fae9a8d9e9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 402 additions and 358 deletions

View file

@ -1,93 +1,95 @@
-- --
-- sPhone Application Package -- Sertex Application Package
-- Built with SPK builder 1.2 -- Built with SPK builder 1.2
-- --
{ {
files = "{\ files = "{\
[ \"appList.lua\" ] = \"local apps = {}\\r\\\ [ \"appList.lua\" ] = \"local apps = {}\\\
local function update()\\r\\\ local function update()\\\
apps = config.list(\\\"/.sPhone/config/spklist\\\")\\r\\\ apps = config.list(\\\"/.sPhone/config/spklist\\\")\\\
for k,v in pairs(apps) do\\r\\\ for k,v in pairs(apps) do\\\
local h = config.read(\\\"/.sPhone/apps/spk/\\\"..k..\\\"/.spk\\\",\\\"hidden\\\")\\r\\\ local h = config.read(\\\"/.sPhone/apps/spk/\\\"..k..\\\"/.spk\\\",\\\"hidden\\\")\\\
if h then\\r\\\ if h then\\\
apps[k] = nil\\r\\\ apps[k] = nil\\\
end\\r\\\ end\\\
end\\r\\\ end\\\
end\\r\\\ end\\\
local function menu(id)\\r\\\ local function menu(id)\\\
local data = config.list(\\\"/.sPhone/apps/spk/\\\"..id..\\\"/.spk\\\")\\r\\\ local data = config.list(\\\"/.sPhone/apps/spk/\\\"..id..\\\"/.spk\\\")\\\
if data then\\r\\\ if data then\\\
term.setBackgroundColor(sPhone.theme[\\\"backgroundColor\\\"])\\r\\\ term.setBackgroundColor(sPhone.theme[\\\"backgroundColor\\\"])\\\
term.setTextColor(sPhone.theme[\\\"text\\\"])\\r\\\ term.setTextColor(sPhone.theme[\\\"text\\\"])\\\
term.clear()\\r\\\ term.clear()\\\
sPhone.header(\\\" Apps\\\",\\\"X\\\")\\r\\\ sPhone.header(\\\" Apps\\\",\\\"X\\\")\\\
term.setCursorPos(2,3)\\r\\\ term.setCursorPos(2,3)\\\
print(data.name)\\r\\\ print(data.name)\\\
term.setCursorPos(2,6)\\r\\\ term.setCursorPos(2,6)\\\
term.setTextColor(colors.black)\\r\\\ term.setTextColor(colors.black)\\\
print(\\\"Author:\\\")\\r\\\ print(\\\"Author:\\\")\\\
term.setTextColor(colors.gray)\\r\\\ term.setTextColor(colors.gray)\\\
term.setCursorPos(2,7)\\r\\\ term.setCursorPos(2,7)\\\
print(data.author)\\r\\\ print(data.author)\\\
term.setCursorPos(2,9)\\r\\\ term.setCursorPos(2,9)\\\
term.setTextColor(colors.black)\\r\\\ term.setTextColor(colors.black)\\\
print(\\\"Type:\\\")\\r\\\ print(\\\"Type:\\\")\\\
term.setTextColor(colors.gray)\\r\\\ term.setTextColor(colors.gray)\\\
term.setCursorPos(2,10)\\r\\\ term.setCursorPos(2,10)\\\
print((data.type or \\\"Normal\\\"))\\r\\\ print((data.type or \\\"Normal\\\"))\\\
term.setCursorPos(2,12)\\r\\\ term.setCursorPos(2,12)\\\
term.setTextColor(colors.black)\\r\\\ term.setTextColor(colors.black)\\\
print(\\\"Version:\\\")\\r\\\ print(\\\"Version:\\\")\\\
term.setTextColor(colors.gray)\\r\\\ term.setTextColor(colors.gray)\\\
term.setCursorPos(2,13)\\r\\\ term.setCursorPos(2,13)\\\
print(data.version)\\r\\\ print(data.version)\\\
paintutils.drawLine(19,4,25,4,colors.red)\\r\\\ paintutils.drawLine(19,4,25,4,colors.red)\\\
term.setTextColor(colors.white)\\r\\\ term.setTextColor(colors.white)\\\
term.setCursorPos(19,4)\\r\\\ term.setCursorPos(19,4)\\\
write(\\\"Delete\\\")\\r\\\ write(\\\"Delete\\\")\\\
local w,h = term.getSize()\\r\\\ local w,h = term.getSize()\\\
while true do\\r\\\ while true do\\\
local _,_,mx,my = os.pullEvent(\\\"mouse_click\\\")\\r\\\ local _,_,mx,my = os.pullEvent(\\\"mouse_click\\\")\\\
if my == 1 and mx == w then\\r\\\ if my == 1 and mx == w then\\\
break\\r\\\ break\\\
elseif (mx >= 19 and mx <= 25) and my == 4 then\\r\\\ elseif (mx >= 19 and mx <= 25) and my == 4 then\\\
if fs.exists(\\\"/.sPhone/apps/spk/\\\"..data.id) then\\r\\\ if fs.exists(\\\"/.sPhone/apps/spk/\\\"..data.id) then\\\
fs.delete(\\\"/.sPhone/apps/spk/\\\"..data.id)\\r\\\ fs.delete(\\\"/.sPhone/apps/spk/\\\"..data.id)\\\
end\\r\\\ end\\\
config.write(\\\"/.sPhone/config/spklist\\\",data.id,nil)\\r\\\ config.write(\\\"/.sPhone/config/spklist\\\",data.id,nil)\\\
break\\r\\\ break\\\
end\\r\\\ end\\\
end\\r\\\ end\\\
end\\r\\\ end\\\
end\\r\\\ end\\\
\\r\\\ \\\
update()\\r\\\ update()\\\
\\r\\\ \\\
while true do\\r\\\ while true do\\\
local id, _, mouse = sPhone.list(nil,{\\r\\\ local id, _, mouse = sPhone.list(nil,{\\\
list = apps,\\r\\\ list = apps,\\\
pairs = true,\\r\\\ pairs = true,\\\
title = \\\" Apps\\\"\\r\\\ title = \\\" Apps\\\"\\\
})\\r\\\ })\\\
if not id then\\r\\\ if not id then\\\
break\\r\\\ break\\\
end\\r\\\ end\\\
if mouse == 1 then\\r\\\ if mouse == 1 then\\\
sPhone.launch(id)\\r\\\ sPhone.launch(id)\\\
break\\r\\\ break\\\
elseif mouse == 2 then\\r\\\ elseif mouse == 2 then\\\
menu(id)\\r\\\ menu(id)\\\
update()\\r\\\ update()\\\
end\\r\\\ end\\\
end\",\ end\\\
\\\
return true\",\
}", }",
config = "{\ config = "{\
type = \"app\",\ type = \"app\",\
name = \"Apps\",\ name = \"Apps\",\
version = 1,\ version = 1,\
main = \"appList.lua\",\
id = \"sphone.appList\",\ id = \"sphone.appList\",\
author = \"BeaconNet\",\ author = \"Sertex\",\
hidden = true,\ hidden = true,\
main = \"appList.lua\",\
}", }",
} }

View file

@ -1,5 +1,5 @@
-- --
-- sPhone Application Package -- Sertex Application Package
-- Built with SPK builder 1.2 -- Built with SPK builder 1.2
-- --
{ {
@ -20,16 +20,15 @@ if not peripheral.isPresent(\\\"back\\\") or not peripheral.getType(\\\"back\\\"
end\\\ end\\\
write(\\\"Host: \\\")\\\ write(\\\"Host: \\\")\\\
local h = read() term.setCursorPos(2,6)\\\ local h = read() term.setCursorPos(2,6)\\\
shell.run(\\\"/rom/programs/rednet/chat\\\", \\\"join\\\", h, sPhone.user)\\\ shell.run(\\\"/rom/programs/rednet/chat\\\", \\\"join\\\", h, sPhone.user)\",\
\",\
}", }",
config = "{\ config = "{\
type = \"app\",\ type = \"app\",\
name = \"RedNet Chat\",\ name = \"RedNet Chat\",\
version = 1,\ version = 1,\
main = \"chat.lua\",\
id = \"sphone.chat\",\ id = \"sphone.chat\",\
author = \"BeaconNet\",\ author = \"Sertex\",\
hidden = true,\ hidden = true,\
main = \"chat.lua\",\
}", }",
} }

View file

@ -1,109 +1,111 @@
-- --
-- sPhone Application Package -- Sertex Application Package
-- Built with SPK builder 1.2 -- Built with SPK builder 1.2
-- --
{ {
files = "{\ files = "{\
[ \"explorer.lua\" ] = \"local dir = nil\\r\\\ [ \"explorer.lua\" ] = \"local dir = nil\\\
\\r\\\ \\\
local function split(inputstr, sep)\\r\\\ local function split(inputstr, sep)\\\
if sep == nil then\\r\\\ if sep == nil then\\\
sep = \\\"%s\\\"\\r\\\ sep = \\\"%s\\\"\\\
end\\r\\\ end\\\
local t={} ; i=1\\r\\\ local t={} ; i=1\\\
for str in string.gmatch(inputstr, \\\"([^\\\"..sep..\\\"]+)\\\") do\\r\\\ for str in string.gmatch(inputstr, \\\"([^\\\"..sep..\\\"]+)\\\") do\\\
t[i] = str\\r\\\ t[i] = str\\\
i = i + 1\\r\\\ i = i + 1\\\
end\\r\\\ end\\\
return t\\r\\\ return t\\\
end\\r\\\ end\\\
\\r\\\ \\\
local function run(path, args)\\r\\\ local function run(path, args)\\\
return pcall(function()\\r\\\ return pcall(function()\\\
os.run(setmetatable({\\r\\\ os.run(setmetatable({\\\
shell = shell,\\r\\\ shell = shell,\\\
multishell = multishell,\\r\\\ multishell = multishell,\\\
}, {__index = getfenv()}), path, args)\\r\\\ }, {__index = getfenv()}), path, args)\\\
end)\\r\\\ end)\\\
end\\r\\\ end\\\
while true do\\r\\\ while true do\\\
local path, mouse = sPhone.list(dir,{\\r\\\ local path, mouse = sPhone.list(dir,{\\\
fg1b = colors.green,\\r\\\ fg1b = colors.green,\\\
})\\r\\\ })\\\
if not path then\\r\\\ if not path then\\\
break\\r\\\ break\\\
end\\r\\\ end\\\
if mouse == 1 then\\r\\\ if mouse == 1 then\\\
run(path)\\r\\\ run(path)\\\
elseif mouse == 2 then\\r\\\ elseif mouse == 2 then\\\
while true do\\r\\\ while true do\\\
local w,h = term.getSize()\\r\\\ local w,h = term.getSize()\\\
term.setBackgroundColor(sPhone.theme[\\\"backgroundColor\\\"])\\r\\\ term.setBackgroundColor(sPhone.theme[\\\"backgroundColor\\\"])\\\
term.setTextColor(sPhone.theme[\\\"text\\\"])\\r\\\ term.setTextColor(sPhone.theme[\\\"text\\\"])\\\
term.clear()\\r\\\ term.clear()\\\
sPhone.header(fs.getName(path),\\\"X\\\")\\r\\\ sPhone.header(fs.getName(path),\\\"X\\\")\\\
term.setCursorPos(2,3)\\r\\\ term.setCursorPos(2,3)\\\
write(\\\"Size: \\\")\\r\\\ write(\\\"Size: \\\")\\\
term.setTextColor(colors.gray)\\r\\\ term.setTextColor(colors.gray)\\\
local siz = fs.getSize(path)\\r\\\ local siz = fs.getSize(path)\\\
local text\\r\\\ local text\\\
if siz == 1 then\\r\\\ if siz == 1 then\\\
text = siz..\\\" byte\\\"\\r\\\ text = siz..\\\" byte\\\"\\\
else\\r\\\ else\\\
text = siz..\\\" bytes\\\"\\r\\\ text = siz..\\\" bytes\\\"\\\
end\\r\\\ end\\\
print(text)\\r\\\ print(text)\\\
term.setTextColor(sPhone.theme[\\\"text\\\"])\\r\\\ term.setTextColor(sPhone.theme[\\\"text\\\"])\\\
term.setCursorPos(2,5)\\r\\\ term.setCursorPos(2,5)\\\
write(\\\"Type: \\\")\\r\\\ write(\\\"Type: \\\")\\\
term.setTextColor(colors.gray)\\r\\\ term.setTextColor(colors.gray)\\\
print(string.getExtension(fs.getName(path)) or \\\"none\\\")\\r\\\ print(string.getExtension(fs.getName(path)) or \\\"none\\\")\\\
term.setTextColor(sPhone.theme[\\\"text\\\"])\\r\\\ term.setTextColor(sPhone.theme[\\\"text\\\"])\\\
term.setCursorPos(2,8)\\r\\\ term.setCursorPos(2,8)\\\
print(\\\"Actions\\\")\\r\\\ print(\\\"Actions\\\")\\\
term.setTextColor(colors.gray)\\r\\\ term.setTextColor(colors.gray)\\\
term.setCursorPos(2,10)\\r\\\ term.setCursorPos(2,10)\\\
print(\\\"Run with arguments\\\")\\r\\\ print(\\\"Run with arguments\\\")\\\
term.setCursorPos(2,11)\\r\\\ term.setCursorPos(2,11)\\\
print(\\\"Edit\\\")\\r\\\ print(\\\"Edit\\\")\\\
term.setCursorPos(2,12)\\r\\\ term.setCursorPos(2,12)\\\
print(\\\"Rename\\\")\\r\\\ print(\\\"Rename\\\")\\\
term.setCursorPos(2,13)\\r\\\ term.setCursorPos(2,13)\\\
print(\\\"Delete\\\")\\r\\\ print(\\\"Delete\\\")\\\
term.setTextColor(sPhone.theme[\\\"text\\\"])\\r\\\ term.setTextColor(sPhone.theme[\\\"text\\\"])\\\
local _,_,x,y = os.pullEvent(\\\"mouse_click\\\")\\r\\\ local _,_,x,y = os.pullEvent(\\\"mouse_click\\\")\\\
if y == 1 and x == w then\\r\\\ if y == 1 and x == w then\\\
break\\r\\\ break\\\
elseif y == 10 then\\r\\\ elseif y == 10 then\\\
term.setCursorPos(2,h-1)\\r\\\ term.setCursorPos(2,h-1)\\\
write(\\\"Args: \\\")\\r\\\ write(\\\"Args: \\\")\\\
term.setTextColor(colors.gray)\\r\\\ term.setTextColor(colors.gray)\\\
shell.run(path..\\\" \\\"..read())\\r\\\ shell.run(path..\\\" \\\"..read())\\\
elseif y == 11 then\\r\\\ elseif y == 11 then\\\
shell.run(\\\"edit\\\",path)\\r\\\ shell.run(\\\"edit\\\",path)\\\
elseif y == 12 then\\r\\\ elseif y == 12 then\\\
term.setCursorPos(2,h-1)\\r\\\ term.setCursorPos(2,h-1)\\\
write(\\\"Rename: \\\")\\r\\\ write(\\\"Rename: \\\")\\\
term.setTextColor(colors.gray)\\r\\\ term.setTextColor(colors.gray)\\\
local oldPath = path\\r\\\ local oldPath = path\\\
path = fs.getDir(path)..\\\"/\\\"..read()\\r\\\ path = fs.getDir(path)..\\\"/\\\"..read()\\\
fs.move(oldPath,path)\\r\\\ fs.move(oldPath,path)\\\
elseif y == 13 then\\r\\\ elseif y == 13 then\\\
fs.delete(path)\\r\\\ fs.delete(path)\\\
break\\r\\\ break\\\
end\\r\\\ end\\\
end\\r\\\ end\\\
end\\r\\\ end\\\
dir = fs.getDir(path)\\r\\\ dir = fs.getDir(path)\\\
end\",\ end\\\
\\\
return true\",\
}", }",
config = "{\ config = "{\
type = \"app\",\ type = \"app\",\
main = \"explorer.lua\",\ main = \"explorer.lua\",\
name = \"File Explorer\",\ name = \"File Explorer\",\
version = 1,\
id = \"sphone.explorer\",\ id = \"sphone.explorer\",\
author = \"Sertex\",\ author = \"Sertex\",\
hidden = true,\ hidden = true,\
version = 1,\
}", }",
} }

View file

@ -1,5 +1,5 @@
-- --
-- sPhone Application Package -- Sertex Application Package
-- Built with SPK builder 1.2 -- Built with SPK builder 1.2
-- --
{ {
@ -13,15 +13,16 @@ if tonumber(x) then\\\
else\\\ else\\\
sPhone.winOk(\\\"X Y Z\\\",\\\"? ? ?\\\")\\\ sPhone.winOk(\\\"X Y Z\\\",\\\"? ? ?\\\")\\\
end\\\ end\\\
\",\ \\\
return true\",\
}", }",
config = "{\ config = "{\
type = \"app\",\ type = \"app\",\
name = \"GPS\",\ name = \"GPS\",\
version = 1,\ version = 1,\
main = \"gps.lua\",\
id = \"sphone.gps\",\ id = \"sphone.gps\",\
author = \"BeaconNet\",\ author = \"Sertex\",\
hidden = true,\ hidden = true,\
main = \"gps.lua\",\
}", }",
} }

View file

@ -1,128 +1,168 @@
-- --
-- sPhone Application Package -- Sertex Application Package
-- Built with SPK builder 1.2 -- Built with SPK builder 1.2
-- --
{ {
files = "{\ files = "{\
[ \"home.lua\" ] = \"local buttonsInHome = {\\\ [ \"home.lua\" ] = \"local currentTime\\\
{\\\"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()\\\
term.setBackgroundColor(sPhone.theme[\\\"backgroundColor\\\"])\\\
term.clear()\\\
term.setCursorPos(1,1)\\\
term.setTextColor(sPhone.theme[\\\"text\\\"])\\\
end\\\
\\\ \\\
local function drawHome()\\\ local function launch(id)\\\
clear()\\\ \\\
visum.buttons(buttonsInHome,true)\\\ local ok, par = sPhone.launch(id);\\\
\\\ \\\
local w, h = term.getSize()\\\ if not ok then\\\
paintutils.drawLine(1,1,w,1, sPhone.theme[\\\"header\\\"])\\\ term.setBackgroundColor(colors.black)\\\
term.setTextColor(sPhone.theme[\\\"headerText\\\"])\\\ term.setTextColor(colors.white)\\\
visum.align(\\\"right\\\",\\\"vvv \\\",false,1)\\\ term.clear()\\\
end\\\ term.setCursorPos(1,1)\\\
local function footerMenu()\\\ print(id .. \\\" has errored:\\\")\\\
sPhone.isFooterMenuOpen = true\\\ printError(par)\\\
function redraw()\\\ print(\\\"Press any key to continue\\\")\\\
drawHome()\\\ os.pullEvent(\\\"key\\\")\\\
local w, h = term.getSize()\\\ \\\
paintutils.drawFilledBox(1,2,w,4,sPhone.theme[\\\"header\\\"])\\\ else\\\
term.setTextColor(sPhone.theme[\\\"headerText\\\"])\\\ if #par == 0 or not par[1] and par[1] ~= nil then\\\
term.setBackgroundColor(sPhone.theme[\\\"header\\\"])\\\ term.setBackgroundColor(colors.black)\\\
visum.align(\\\"right\\\",\\\"^^^ \\\",false,1)\\\ term.setTextColor(colors.white)\\\
visum.align(\\\"right\\\", \\\"Reboot \\\",false,3)\\\ print(\\\"Press any key to continue\\\")\\\
term.setCursorPos(11,3)\\\ os.pullEvent(\\\"key\\\")\\\
write(\\\"Settings\\\")\\\ end\\\
term.setCursorPos(2,3)\\\ end\\\
write(\\\"Shutdown\\\")\\\ end\\\
end\\\ \\\
while true do\\\ local buttonsInHome = {\\\
term.redirect(sPhone.mainTerm)\\\ {\\\"sphone.header\\\",23,1,25,1,sPhone.theme[\\\"header\\\"],sPhone.theme[\\\"headerText\\\"],\\\"vvv\\\"},\\\
drawHome()\\\ {\\\"sphone.appList\\\",12,20,14,20,sPhone.theme[\\\"backgroundColor\\\"],sPhone.theme[\\\"header\\\"],\\\"===\\\"},\\\
redraw()\\\ {\\\"sphone.shell\\\",2,3,8,5,colors.black,colors.yellow,\\\" Shell\\\",2},\\\
local _,_,x,y = os.pullEvent(\\\"mouse_click\\\")\\\ {\\\"sphone.explorer\\\",11,3,17,5,colors.blue,colors.white,\\\" Files\\\",2},\\\
if y == 3 then\\\ {\\\"sphone.lock\\\",20,3,25,5,colors.lightGray,colors.black,\\\" Lock\\\",2},\\\
if x > 1 and x < 10 then\\\ {\\\"sphone.gps\\\",11,7,15,9,colors.red,colors.black,\\\" GPS\\\",2},\\\
os.shutdown()\\\ {\\\"sphone.info\\\",18,7,23,9,colors.lightGray,colors.black,\\\" Info\\\",2},\\\
sPhone.inHome = true\\\ {\\\"sphone.store\\\",2,7,8,9,colors.green,colors.white,\\\" Store\\\",2},\\\
elseif x > 19 and x < 26 then\\\ }\\\
os.reboot()\\\ \\\
sPhone.inHome = true\\\ local function clear()\\\
elseif x > 10 and x < 19 then\\\ term.setBackgroundColor(sPhone.theme[\\\"backgroundColor\\\"])\\\
sPhone.inHome = false\\\ term.clear()\\\
sPhone.launch(\\\"sphone.settings\\\")\\\ term.setCursorPos(1,1)\\\
sPhone.inHome = true\\\ term.setTextColor(sPhone.theme[\\\"text\\\"])\\\
drawHome()\\\ end\\\
end\\\ \\\
elseif y == 1 then\\\ local function drawClock(time)\\\
if x < 26 and x > 22 then\\\ term.setBackgroundColor(sPhone.theme[\\\"header\\\"])\\\
sPhone.isFooterMenuOpen = false\\\ term.setTextColor(sPhone.theme[\\\"headerText\\\"])\\\
return\\\ term.setCursorPos(1,1)\\\
end\\\ write(\\\" \\\")\\\
end\\\ term.setCursorPos(1,1)\\\
end\\\ write(\\\" \\\"..time)\\\
end\\\ end\\\
local function buttonHomeLoop()\\\ \\\
while true do\\\ local function drawHome()\\\
drawHome()\\\ clear()\\\
term.setCursorBlink(false)\\\ visum.buttons(buttonsInHome,true)\\\
local autoLockTimer = os.startTimer(10)\\\ \\\
local id = visum.buttons(buttonsInHome)\\\ local w, h = term.getSize()\\\
paintutils.drawLine(1,1,w,1, sPhone.theme[\\\"header\\\"])\\\
term.setTextColor(sPhone.theme[\\\"headerText\\\"])\\\
visum.align(\\\"right\\\",\\\"vvv \\\",false,1)\\\
drawClock(currentTime or \\\"\\\")\\\
end\\\
local function footerMenu()\\\
sPhone.isFooterMenuOpen = true\\\
function redraw()\\\
drawHome()\\\
drawClock(currentTime)\\\
local w, h = term.getSize()\\\
paintutils.drawFilledBox(1,2,w,4,sPhone.theme[\\\"header\\\"])\\\
term.setTextColor(sPhone.theme[\\\"headerText\\\"])\\\
term.setBackgroundColor(sPhone.theme[\\\"header\\\"])\\\
visum.align(\\\"right\\\",\\\"^^^ \\\",false,1)\\\
visum.align(\\\"right\\\", \\\"Reboot \\\",false,3)\\\
term.setCursorPos(11,3)\\\
write(\\\"Settings\\\")\\\
term.setCursorPos(2,3)\\\
write(\\\"Shutdown\\\")\\\
end\\\
redraw()\\\
while true do\\\
term.redirect(sPhone.mainTerm)\\\
local _,_,x,y = os.pullEvent(\\\"mouse_click\\\")\\\
if y == 3 then\\\
if x > 1 and x < 10 then\\\
os.shutdown()\\\
sPhone.inHome = true\\\
elseif x > 19 and x < 26 then\\\
os.reboot()\\\
sPhone.inHome = true\\\
elseif x > 10 and x < 19 then\\\
sPhone.inHome = false\\\
launch(\\\"sphone.settings\\\")\\\
sPhone.inHome = true\\\
\\\ \\\
if id == \\\"sphone.header\\\" then\\\ drawHome()\\\
footerMenu()\\\ break\\\
elseif id == \\\"sphone.lock\\\" then\\\ end\\\
sPhone.inHome = false\\\ elseif y == 1 then\\\
sPhone.login()\\\ if x < 26 and x > 22 then\\\
sPhone.inHome = true\\\ sPhone.isFooterMenuOpen = false\\\
else\\\ return\\\
sPhone.inHome = false\\\ end\\\
os.pullEvent = os.oldPullEvent\\\ end\\\
sPhone.launch(id)\\\ end\\\
os.pullEvent = os.pullEventRaw\\\ end\\\
sPhone.inHome = true\\\ local function buttonHomeLoop()\\\
end\\\ drawHome()\\\
end\\\ while true do\\\
\\\ term.setCursorBlink(false)\\\
sPhone.inHome = false\\\ local autoLockTimer = os.startTimer(10)\\\
\\\ local id = visum.buttons(buttonsInHome)\\\
end\\\ \\\
\\\ if id == \\\"sphone.header\\\" then\\\
local function updateClock()\\\ footerMenu()\\\
while true do\\\ drawHome()\\\
if sPhone.inHome then\\\ elseif id == \\\"sphone.lock\\\" then\\\
term.setCursorPos(1,1)\\\ sPhone.inHome = false\\\
term.setBackgroundColor(sPhone.theme[\\\"header\\\"])\\\ sPhone.login()\\\
term.setTextColor(sPhone.theme[\\\"headerText\\\"])\\\ drawHome()\\\
term.setCursorPos(1,1)\\\ sPhone.inHome = true\\\
write(\\\" \\\")\\\ else\\\
term.setCursorPos(1,1)\\\ sPhone.inHome = false\\\
write(\\\" \\\"..textutils.formatTime(os.time(), not config.read(\\\"/.sPhone/config/sPhone\\\",\\\"format12time\\\")))\\\ os.pullEvent = os.oldPullEvent\\\
end\\\ launch(id)\\\
sleep(0)\\\ drawHome()\\\
end\\\ os.pullEvent = os.pullEventRaw\\\
end\\\ sPhone.inHome = true\\\
\\\ end\\\
parallel.waitForAll(buttonHomeLoop, updateClock)\\\ end\\\
\",\ \\\
sPhone.inHome = false\\\
\\\
end\\\
\\\
local function updateClock()\\\
local old\\\
while true do\\\
if sPhone.inHome then\\\
local time = textutils.formatTime(os.time(), not config.read(\\\"/.sPhone/config/sPhone\\\",\\\"format12time\\\"))\\\
if time ~= old then\\\
old = time\\\
currentTime = time\\\
drawClock(time)\\\
end\\\
end\\\
sleep(0.3)\\\
end\\\
end\\\
\\\
parallel.waitForAll(buttonHomeLoop, updateClock)\",\
}", }",
config = "{\ config = "{\
type = \"home\",\ type = \"home\",\
main = \"home.lua\",\ main = \"home.lua\",\
name = \"sPhone Home\",\ name = \"sPhone Home\",\
version = 1,\
id = \"sphone.home\",\ id = \"sphone.home\",\
author = \"BeaconNet\",\ author = \"Sertex\",\
hidden = true,\ hidden = true,\
version = 1,\
}", }",
} }

View file

@ -1,5 +1,5 @@
-- --
-- sPhone Application Package -- Sertex Application Package
-- Built with SPK builder 1.2 -- Built with SPK builder 1.2
-- --
{ {
@ -29,18 +29,17 @@ while true do\\\
local w, h = term.getSize()\\\ local w, h = term.getSize()\\\
local _, _, x, y = os.pullEvent(\\\"mouse_click\\\")\\\ local _, _, x, y = os.pullEvent(\\\"mouse_click\\\")\\\
if y == 1 and x == w then\\\ if y == 1 and x == w then\\\
return\\\ return true\\\
end\\\ end\\\
end\\\ end\",\
\",\
}", }",
config = "{\ config = "{\
type = \"system\",\ type = \"system\",\
name = \"Info\",\ name = \"Info\",\
main = \"info.lua\",\ main = \"info.lua\",\
version = 1,\
id = \"sphone.info\",\ id = \"sphone.info\",\
author = \"Sertex\",\ author = \"Sertex\",\
hidden = true,\ hidden = true,\
version = 1,\
}", }",
} }

View file

@ -1,5 +1,5 @@
-- --
-- sPhone Application Package -- Sertex Application Package
-- Built with SPK builder 1.2 -- Built with SPK builder 1.2
-- --
{ {
@ -239,6 +239,7 @@ local function editTheme()\\\
\\\"Background Color\\\",\\\ \\\"Background Color\\\",\\\
\\\"Window Options\\\",\\\ \\\"Window Options\\\",\\\
\\\"Login Options\\\",\\\ \\\"Login Options\\\",\\\
\\\"\\\",\\\
\\\"Save\\\",\\\ \\\"Save\\\",\\\
\\\"Load\\\",\\\ \\\"Load\\\",\\\
\\\"Reset\\\",\\\ \\\"Reset\\\",\\\
@ -307,7 +308,7 @@ local function editTheme()\\\
sPhone.applyTheme(\\\"lock.error\\\", sPhone.colorPicker(\\\"Error\\\",sPhone.getTheme(\\\"lock.error\\\")))\\\ sPhone.applyTheme(\\\"lock.error\\\", sPhone.colorPicker(\\\"Error\\\",sPhone.getTheme(\\\"lock.error\\\")))\\\
end\\\ end\\\
end\\\ end\\\
elseif id == 9 then\\\ elseif id == 10 then\\\
local saveTheme\\\ local saveTheme\\\
sPhone.header(sPhone.user)\\\ sPhone.header(sPhone.user)\\\
term.setCursorPos(w,1)\\\ term.setCursorPos(w,1)\\\
@ -334,7 +335,7 @@ local function editTheme()\\\
end\\\ end\\\
fs.copy(\\\"/.sPhone/config/theme\\\", saveTheme)\\\ fs.copy(\\\"/.sPhone/config/theme\\\", saveTheme)\\\
sPhone.winOk(\\\"Theme saved!\\\")\\\ sPhone.winOk(\\\"Theme saved!\\\")\\\
elseif id == 10 then\\\ elseif id == 11 then\\\
local loadTheme = sPhone.list()\\\ local loadTheme = sPhone.list()\\\
if loadTheme then\\\ if loadTheme then\\\
if fs.exists(loadTheme) and not fs.isDir(loadTheme) then\\\ if fs.exists(loadTheme) and not fs.isDir(loadTheme) then\\\
@ -349,7 +350,7 @@ local function editTheme()\\\
sPhone.winOk(\\\"Theme not found!\\\")\\\ sPhone.winOk(\\\"Theme not found!\\\")\\\
end\\\ end\\\
end\\\ end\\\
elseif id == 11 then\\\ elseif id == 12 then\\\
fs.delete(\\\"/.sPhone/config/theme\\\")\\\ fs.delete(\\\"/.sPhone/config/theme\\\")\\\
sPhone.theme = sPhone.defaultTheme\\\ sPhone.theme = sPhone.defaultTheme\\\
sPhone.winOk(\\\"Removed Theme\\\")\\\ sPhone.winOk(\\\"Removed Theme\\\")\\\
@ -409,8 +410,8 @@ while true do\\\
end\\\ end\\\
local name, id = sPhone.menu(menu, \\\"Settings\\\",\\\"X\\\")\\\ local name, id = sPhone.menu(menu, \\\"Settings\\\",\\\"X\\\")\\\
if id == 0 then\\\ if id == 0 then\\\
task.kill(temp.get(\\\"homePID\\\"))\\\ --task.kill(temp.get(\\\"homePID\\\"))\\\
return\\\ return true\\\
elseif id == 1 then\\\ elseif id == 1 then\\\
setfenv(loadstring(http.get(\\\"https://raw.githubusercontent.com/SertexTeam/sPhone/master/src/installer.lua\\\").readAll()),getfenv())()\\\ setfenv(loadstring(http.get(\\\"https://raw.githubusercontent.com/SertexTeam/sPhone/master/src/installer.lua\\\").readAll()),getfenv())()\\\
elseif id == 2 then\\\ elseif id == 2 then\\\
@ -428,16 +429,15 @@ while true do\\\
elseif id == 8 then\\\ elseif id == 8 then\\\
config.write(\\\"/.sPhone/config/sPhone\\\",\\\"showUpdate\\\", not config.read(\\\"/.sPhone/config/sPhone\\\",\\\"showUpdate\\\"))\\\ config.write(\\\"/.sPhone/config/sPhone\\\",\\\"showUpdate\\\", not config.read(\\\"/.sPhone/config/sPhone\\\",\\\"showUpdate\\\"))\\\
end\\\ end\\\
end\\\ end\",\
\",\
}", }",
config = "{\ config = "{\
type = \"system\",\ type = \"system\",\
name = \"Settings\",\ name = \"Settings\",\
main = \"settings.lua\",\ main = \"settings.lua\",\
version = 1,\
id = \"sphone.settings\",\ id = \"sphone.settings\",\
author = \"Sertex\",\ author = \"Sertex\",\
hidden = true,\ hidden = true,\
version = 1,\
}", }",
} }

View file

@ -1,5 +1,5 @@
-- --
-- sPhone Application Package -- Sertex Application Package
-- Built with SPK builder 1.2 -- Built with SPK builder 1.2
-- --
{ {
@ -9,15 +9,16 @@ term.setTextColor(colors.white)\\\
term.clear()\\\ term.clear()\\\
term.setCursorPos(1,1)\\\ term.setCursorPos(1,1)\\\
shell.run(\\\"/rom/programs/shell\\\")\\\ shell.run(\\\"/rom/programs/shell\\\")\\\
\",\ \\\
return true\",\
}", }",
config = "{\ config = "{\
type = \"app\",\ type = \"app\",\
name = \"Shell\",\ name = \"Shell\",\
version = 1,\ version = 1,\
main = \"shell.lua\",\
id = \"sphone.shell\",\ id = \"sphone.shell\",\
author = \"BeaconNet\",\ author = \"Sertex\",\
hidden = true,\ hidden = true,\
main = \"shell.lua\",\
}", }",
} }

View file

@ -1,5 +1,5 @@
-- --
-- sPhone Application Package -- Sertex Application Package
-- Built with SPK builder 1.2 -- Built with SPK builder 1.2
-- --
{ {
@ -69,7 +69,7 @@ while true do\\\
})\\\ })\\\
\\\ \\\
if not path then\\\ if not path then\\\
return\\\ return true\\\
end\\\ end\\\
\\\ \\\
local data = http.get(\\\"https://raw.github.com/SertexTeam/sPhone-Store/master/apps/\\\"..path).readAll()\\\ local data = http.get(\\\"https://raw.github.com/SertexTeam/sPhone-Store/master/apps/\\\"..path).readAll()\\\
@ -132,16 +132,15 @@ while true do\\\
\\\ \\\
\\\ \\\
\\\ \\\
end\\\ end\",\
\",\
}", }",
config = "{\ config = "{\
type = \"app\",\ type = \"app\",\
name = \"Store\",\ name = \"Store\",\
version = 1,\ version = 1,\
main = \"store.lua\",\
id = \"sphone.store\",\ id = \"sphone.store\",\
author = \"Sertex\",\ author = \"Sertex\",\
hidden = true,\ hidden = true,\
main = \"store.lua\",\
}", }",
} }

View file

@ -1,50 +1,51 @@
-- --
-- sPhone Application Package -- Sertex Application Package
-- Built with SPK builder 1.2 -- Built with SPK builder 1.2
-- --
{ {
files = "{\ files = "{\
[ \"themes.lua\" ] = \"if not sPhone then\\r\\\ [ \"themes.lua\" ] = \"if not sPhone then\\\
printError(\\\"sPhone must be installed and loaded before running this program\\\")\\r\\\ printError(\\\"sPhone must be installed and loaded before running this program\\\")\\\
return\\r\\\ return\\\
end\\r\\\ end\\\
\\r\\\ \\\
\\r\\\ \\\
print(\\\"Downloading theme list\\\")\\r\\\ print(\\\"Downloading theme list\\\")\\\
local url = \\\"https://raw.github.com/Ale32bit/sPhone-Mods/master/themes.lua\\\"\\r\\\ local url = \\\"https://raw.github.com/Ale32bit/sPhone-Mods/master/themes.lua\\\"\\\
\\r\\\ \\\
local ht = http.get(url)\\r\\\ local ht = http.get(url)\\\
local themesRaw = ht.readAll()\\r\\\ local themesRaw = ht.readAll()\\\
local themes = textutils.unserialize(themesRaw)\\r\\\ local themes = textutils.unserialize(themesRaw)\\\
ht.close()\\r\\\ ht.close()\\\
\\r\\\ \\\
local li = {}\\r\\\ local li = {}\\\
for k,v in pairs(themes) do\\r\\\ for k,v in pairs(themes) do\\\
table.insert(li,k)\\r\\\ table.insert(li,k)\\\
end\\r\\\ end\\\
while true do\\r\\\ while true do\\\
local g, c = sPhone.menu(li,\\\" Themes\\\",\\\"X\\\")\\r\\\ local g, c = sPhone.menu(li,\\\" Themes\\\",\\\"X\\\")\\\
if c == 0 then\\r\\\ if c == 0 then\\\
return\\r\\\ return\\\
elseif c > #li then\\r\\\ elseif c > #li then\\\
\\r\\\ \\\
else\\r\\\ else\\\
for k,v in pairs(themes[g]) do\\r\\\ for k,v in pairs(themes[g]) do\\\
sPhone.applyTheme(k,v)\\r\\\ sPhone.applyTheme(k,v)\\\
end\\r\\\ end\\\
sPhone.winOk(\\\"Theme applied\\\")\\r\\\ sPhone.winOk(\\\"Theme applied\\\")\\\
break\\r\\\ break\\\
end\\r\\\ end\\\
end\\r\\\ end\\\
\",\ \\\
return true\",\
}", }",
config = "{\ config = "{\
type = \"app\",\ type = \"app\",\
name = \"Theme List\",\ name = \"Theme List\",\
version = 1,\ version = 1,\
main = \"themes.lua\",\
id = \"sphone.themes\",\ id = \"sphone.themes\",\
author = \"BeaconNet\",\ author = \"Sertex\",\
hidden = true,\ hidden = true,\
main = \"themes.lua\",\
}", }",
} }