Compare commits
No commits in common. "c50a5dfbfa460123ae60ee33c20bb83ed6a37932" and "f3d643fc9e835a3cc0df410e8d63bf4e4a27a955" have entirely different histories.
c50a5dfbfa
...
f3d643fc9e
14 changed files with 388 additions and 422 deletions
14
README.md
14
README.md
|
@ -1,11 +1,15 @@
|
||||||
# Welcome to sPhone repository!
|
# Welcome to sPhone repository!
|
||||||
|
|
||||||
## Install:
|
![SPK Support](https://raw.githubusercontent.com/BeaconNet/beaconnet.github.io/master/badge.png)
|
||||||
|
|
||||||
|
##Install:
|
||||||
|
|
||||||
Stable: `pastebin run HsJSnhKQ`
|
Stable: `pastebin run HsJSnhKQ`
|
||||||
|
|
||||||
## Dates:
|
Dev: `pastebin run qNz53cR9` (outdated)
|
||||||
|
|
||||||
* Started (Alpha 1): 31st July 2015
|
##Dates:
|
||||||
* Beta 1: 20th November 2016
|
|
||||||
* End of life: 28th October 2019
|
Started (Alpha 1): 31/July/2015
|
||||||
|
|
||||||
|
Beta 1: 20/November/2016
|
||||||
|
|
|
@ -1,95 +1,93 @@
|
||||||
--
|
--
|
||||||
-- Sertex Application Package
|
-- sPhone Application Package
|
||||||
-- Built with SPK builder 1.2
|
-- Built with SPK builder 1.2
|
||||||
--
|
--
|
||||||
{
|
{
|
||||||
files = "{\
|
files = "{\
|
||||||
[ \"appList.lua\" ] = \"local apps = {}\\\
|
[ \"appList.lua\" ] = \"local apps = {}\\r\\\
|
||||||
local function update()\\\
|
local function update()\\r\\\
|
||||||
apps = config.list(\\\"/.sPhone/config/spklist\\\")\\\
|
apps = config.list(\\\"/.sPhone/config/spklist\\\")\\r\\\
|
||||||
for k,v in pairs(apps) do\\\
|
for k,v in pairs(apps) do\\r\\\
|
||||||
local h = config.read(\\\"/.sPhone/apps/spk/\\\"..k..\\\"/.spk\\\",\\\"hidden\\\")\\\
|
local h = config.read(\\\"/.sPhone/apps/spk/\\\"..k..\\\"/.spk\\\",\\\"hidden\\\")\\r\\\
|
||||||
if h then\\\
|
if h then\\r\\\
|
||||||
apps[k] = nil\\\
|
apps[k] = nil\\r\\\
|
||||||
end\\\
|
end\\r\\\
|
||||||
end\\\
|
end\\r\\\
|
||||||
end\\\
|
end\\r\\\
|
||||||
local function menu(id)\\\
|
local function menu(id)\\r\\\
|
||||||
local data = config.list(\\\"/.sPhone/apps/spk/\\\"..id..\\\"/.spk\\\")\\\
|
local data = config.list(\\\"/.sPhone/apps/spk/\\\"..id..\\\"/.spk\\\")\\r\\\
|
||||||
if data then\\\
|
if data then\\r\\\
|
||||||
term.setBackgroundColor(sPhone.theme[\\\"backgroundColor\\\"])\\\
|
term.setBackgroundColor(sPhone.theme[\\\"backgroundColor\\\"])\\r\\\
|
||||||
term.setTextColor(sPhone.theme[\\\"text\\\"])\\\
|
term.setTextColor(sPhone.theme[\\\"text\\\"])\\r\\\
|
||||||
term.clear()\\\
|
term.clear()\\r\\\
|
||||||
sPhone.header(\\\" Apps\\\",\\\"X\\\")\\\
|
sPhone.header(\\\" Apps\\\",\\\"X\\\")\\r\\\
|
||||||
term.setCursorPos(2,3)\\\
|
term.setCursorPos(2,3)\\r\\\
|
||||||
print(data.name)\\\
|
print(data.name)\\r\\\
|
||||||
term.setCursorPos(2,6)\\\
|
term.setCursorPos(2,6)\\r\\\
|
||||||
term.setTextColor(colors.black)\\\
|
term.setTextColor(colors.black)\\r\\\
|
||||||
print(\\\"Author:\\\")\\\
|
print(\\\"Author:\\\")\\r\\\
|
||||||
term.setTextColor(colors.gray)\\\
|
term.setTextColor(colors.gray)\\r\\\
|
||||||
term.setCursorPos(2,7)\\\
|
term.setCursorPos(2,7)\\r\\\
|
||||||
print(data.author)\\\
|
print(data.author)\\r\\\
|
||||||
term.setCursorPos(2,9)\\\
|
term.setCursorPos(2,9)\\r\\\
|
||||||
term.setTextColor(colors.black)\\\
|
term.setTextColor(colors.black)\\r\\\
|
||||||
print(\\\"Type:\\\")\\\
|
print(\\\"Type:\\\")\\r\\\
|
||||||
term.setTextColor(colors.gray)\\\
|
term.setTextColor(colors.gray)\\r\\\
|
||||||
term.setCursorPos(2,10)\\\
|
term.setCursorPos(2,10)\\r\\\
|
||||||
print((data.type or \\\"Normal\\\"))\\\
|
print((data.type or \\\"Normal\\\"))\\r\\\
|
||||||
term.setCursorPos(2,12)\\\
|
term.setCursorPos(2,12)\\r\\\
|
||||||
term.setTextColor(colors.black)\\\
|
term.setTextColor(colors.black)\\r\\\
|
||||||
print(\\\"Version:\\\")\\\
|
print(\\\"Version:\\\")\\r\\\
|
||||||
term.setTextColor(colors.gray)\\\
|
term.setTextColor(colors.gray)\\r\\\
|
||||||
term.setCursorPos(2,13)\\\
|
term.setCursorPos(2,13)\\r\\\
|
||||||
print(data.version)\\\
|
print(data.version)\\r\\\
|
||||||
paintutils.drawLine(19,4,25,4,colors.red)\\\
|
paintutils.drawLine(19,4,25,4,colors.red)\\r\\\
|
||||||
term.setTextColor(colors.white)\\\
|
term.setTextColor(colors.white)\\r\\\
|
||||||
term.setCursorPos(19,4)\\\
|
term.setCursorPos(19,4)\\r\\\
|
||||||
write(\\\"Delete\\\")\\\
|
write(\\\"Delete\\\")\\r\\\
|
||||||
local w,h = term.getSize()\\\
|
local w,h = term.getSize()\\r\\\
|
||||||
while true do\\\
|
while true do\\r\\\
|
||||||
local _,_,mx,my = os.pullEvent(\\\"mouse_click\\\")\\\
|
local _,_,mx,my = os.pullEvent(\\\"mouse_click\\\")\\r\\\
|
||||||
if my == 1 and mx == w then\\\
|
if my == 1 and mx == w then\\r\\\
|
||||||
break\\\
|
break\\r\\\
|
||||||
elseif (mx >= 19 and mx <= 25) and my == 4 then\\\
|
elseif (mx >= 19 and mx <= 25) and my == 4 then\\r\\\
|
||||||
if fs.exists(\\\"/.sPhone/apps/spk/\\\"..data.id) then\\\
|
if fs.exists(\\\"/.sPhone/apps/spk/\\\"..data.id) then\\r\\\
|
||||||
fs.delete(\\\"/.sPhone/apps/spk/\\\"..data.id)\\\
|
fs.delete(\\\"/.sPhone/apps/spk/\\\"..data.id)\\r\\\
|
||||||
end\\\
|
end\\r\\\
|
||||||
config.write(\\\"/.sPhone/config/spklist\\\",data.id,nil)\\\
|
config.write(\\\"/.sPhone/config/spklist\\\",data.id,nil)\\r\\\
|
||||||
break\\\
|
break\\r\\\
|
||||||
end\\\
|
end\\r\\\
|
||||||
end\\\
|
end\\r\\\
|
||||||
end\\\
|
end\\r\\\
|
||||||
end\\\
|
end\\r\\\
|
||||||
\\\
|
\\r\\\
|
||||||
update()\\\
|
update()\\r\\\
|
||||||
\\\
|
\\r\\\
|
||||||
while true do\\\
|
while true do\\r\\\
|
||||||
local id, _, mouse = sPhone.list(nil,{\\\
|
local id, _, mouse = sPhone.list(nil,{\\r\\\
|
||||||
list = apps,\\\
|
list = apps,\\r\\\
|
||||||
pairs = true,\\\
|
pairs = true,\\r\\\
|
||||||
title = \\\" Apps\\\"\\\
|
title = \\\" Apps\\\"\\r\\\
|
||||||
})\\\
|
})\\r\\\
|
||||||
if not id then\\\
|
if not id then\\r\\\
|
||||||
break\\\
|
break\\r\\\
|
||||||
end\\\
|
end\\r\\\
|
||||||
if mouse == 1 then\\\
|
if mouse == 1 then\\r\\\
|
||||||
sPhone.launch(id)\\\
|
sPhone.launch(id)\\r\\\
|
||||||
break\\\
|
break\\r\\\
|
||||||
elseif mouse == 2 then\\\
|
elseif mouse == 2 then\\r\\\
|
||||||
menu(id)\\\
|
menu(id)\\r\\\
|
||||||
update()\\\
|
update()\\r\\\
|
||||||
end\\\
|
end\\r\\\
|
||||||
end\\\
|
end\",\
|
||||||
\\\
|
|
||||||
return true\",\
|
|
||||||
}",
|
}",
|
||||||
config = "{\
|
config = "{\
|
||||||
type = \"app\",\
|
type = \"app\",\
|
||||||
name = \"Apps\",\
|
name = \"Apps\",\
|
||||||
version = 1,\
|
version = 1,\
|
||||||
id = \"sphone.appList\",\
|
|
||||||
author = \"Sertex\",\
|
|
||||||
hidden = true,\
|
|
||||||
main = \"appList.lua\",\
|
main = \"appList.lua\",\
|
||||||
|
id = \"sphone.appList\",\
|
||||||
|
author = \"BeaconNet\",\
|
||||||
|
hidden = true,\
|
||||||
}",
|
}",
|
||||||
}
|
}
|
|
@ -1,5 +1,5 @@
|
||||||
--
|
--
|
||||||
-- Sertex Application Package
|
-- sPhone Application Package
|
||||||
-- Built with SPK builder 1.2
|
-- Built with SPK builder 1.2
|
||||||
--
|
--
|
||||||
{
|
{
|
||||||
|
@ -20,15 +20,16 @@ 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,\
|
||||||
id = \"sphone.chat\",\
|
|
||||||
author = \"Sertex\",\
|
|
||||||
hidden = true,\
|
|
||||||
main = \"chat.lua\",\
|
main = \"chat.lua\",\
|
||||||
|
id = \"sphone.chat\",\
|
||||||
|
author = \"BeaconNet\",\
|
||||||
|
hidden = true,\
|
||||||
}",
|
}",
|
||||||
}
|
}
|
|
@ -1,111 +1,109 @@
|
||||||
--
|
--
|
||||||
-- Sertex Application Package
|
-- sPhone Application Package
|
||||||
-- Built with SPK builder 1.2
|
-- Built with SPK builder 1.2
|
||||||
--
|
--
|
||||||
{
|
{
|
||||||
files = "{\
|
files = "{\
|
||||||
[ \"explorer.lua\" ] = \"local dir = nil\\\
|
[ \"explorer.lua\" ] = \"local dir = nil\\r\\\
|
||||||
\\\
|
\\r\\\
|
||||||
local function split(inputstr, sep)\\\
|
local function split(inputstr, sep)\\r\\\
|
||||||
if sep == nil then\\\
|
if sep == nil then\\r\\\
|
||||||
sep = \\\"%s\\\"\\\
|
sep = \\\"%s\\\"\\r\\\
|
||||||
end\\\
|
end\\r\\\
|
||||||
local t={} ; i=1\\\
|
local t={} ; i=1\\r\\\
|
||||||
for str in string.gmatch(inputstr, \\\"([^\\\"..sep..\\\"]+)\\\") do\\\
|
for str in string.gmatch(inputstr, \\\"([^\\\"..sep..\\\"]+)\\\") do\\r\\\
|
||||||
t[i] = str\\\
|
t[i] = str\\r\\\
|
||||||
i = i + 1\\\
|
i = i + 1\\r\\\
|
||||||
end\\\
|
end\\r\\\
|
||||||
return t\\\
|
return t\\r\\\
|
||||||
end\\\
|
end\\r\\\
|
||||||
\\\
|
\\r\\\
|
||||||
local function run(path, args)\\\
|
local function run(path, args)\\r\\\
|
||||||
return pcall(function()\\\
|
return pcall(function()\\r\\\
|
||||||
os.run(setmetatable({\\\
|
os.run(setmetatable({\\r\\\
|
||||||
shell = shell,\\\
|
shell = shell,\\r\\\
|
||||||
multishell = multishell,\\\
|
multishell = multishell,\\r\\\
|
||||||
}, {__index = getfenv()}), path, args)\\\
|
}, {__index = getfenv()}), path, args)\\r\\\
|
||||||
end)\\\
|
end)\\r\\\
|
||||||
end\\\
|
end\\r\\\
|
||||||
while true do\\\
|
while true do\\r\\\
|
||||||
local path, mouse = sPhone.list(dir,{\\\
|
local path, mouse = sPhone.list(dir,{\\r\\\
|
||||||
fg1b = colors.green,\\\
|
fg1b = colors.green,\\r\\\
|
||||||
})\\\
|
})\\r\\\
|
||||||
if not path then\\\
|
if not path then\\r\\\
|
||||||
break\\\
|
break\\r\\\
|
||||||
end\\\
|
end\\r\\\
|
||||||
if mouse == 1 then\\\
|
if mouse == 1 then\\r\\\
|
||||||
run(path)\\\
|
run(path)\\r\\\
|
||||||
elseif mouse == 2 then\\\
|
elseif mouse == 2 then\\r\\\
|
||||||
while true do\\\
|
while true do\\r\\\
|
||||||
local w,h = term.getSize()\\\
|
local w,h = term.getSize()\\r\\\
|
||||||
term.setBackgroundColor(sPhone.theme[\\\"backgroundColor\\\"])\\\
|
term.setBackgroundColor(sPhone.theme[\\\"backgroundColor\\\"])\\r\\\
|
||||||
term.setTextColor(sPhone.theme[\\\"text\\\"])\\\
|
term.setTextColor(sPhone.theme[\\\"text\\\"])\\r\\\
|
||||||
term.clear()\\\
|
term.clear()\\r\\\
|
||||||
sPhone.header(fs.getName(path),\\\"X\\\")\\\
|
sPhone.header(fs.getName(path),\\\"X\\\")\\r\\\
|
||||||
term.setCursorPos(2,3)\\\
|
term.setCursorPos(2,3)\\r\\\
|
||||||
write(\\\"Size: \\\")\\\
|
write(\\\"Size: \\\")\\r\\\
|
||||||
term.setTextColor(colors.gray)\\\
|
term.setTextColor(colors.gray)\\r\\\
|
||||||
local siz = fs.getSize(path)\\\
|
local siz = fs.getSize(path)\\r\\\
|
||||||
local text\\\
|
local text\\r\\\
|
||||||
if siz == 1 then\\\
|
if siz == 1 then\\r\\\
|
||||||
text = siz..\\\" byte\\\"\\\
|
text = siz..\\\" byte\\\"\\r\\\
|
||||||
else\\\
|
else\\r\\\
|
||||||
text = siz..\\\" bytes\\\"\\\
|
text = siz..\\\" bytes\\\"\\r\\\
|
||||||
end\\\
|
end\\r\\\
|
||||||
print(text)\\\
|
print(text)\\r\\\
|
||||||
term.setTextColor(sPhone.theme[\\\"text\\\"])\\\
|
term.setTextColor(sPhone.theme[\\\"text\\\"])\\r\\\
|
||||||
term.setCursorPos(2,5)\\\
|
term.setCursorPos(2,5)\\r\\\
|
||||||
write(\\\"Type: \\\")\\\
|
write(\\\"Type: \\\")\\r\\\
|
||||||
term.setTextColor(colors.gray)\\\
|
term.setTextColor(colors.gray)\\r\\\
|
||||||
print(string.getExtension(fs.getName(path)) or \\\"none\\\")\\\
|
print(string.getExtension(fs.getName(path)) or \\\"none\\\")\\r\\\
|
||||||
term.setTextColor(sPhone.theme[\\\"text\\\"])\\\
|
term.setTextColor(sPhone.theme[\\\"text\\\"])\\r\\\
|
||||||
term.setCursorPos(2,8)\\\
|
term.setCursorPos(2,8)\\r\\\
|
||||||
print(\\\"Actions\\\")\\\
|
print(\\\"Actions\\\")\\r\\\
|
||||||
term.setTextColor(colors.gray)\\\
|
term.setTextColor(colors.gray)\\r\\\
|
||||||
term.setCursorPos(2,10)\\\
|
term.setCursorPos(2,10)\\r\\\
|
||||||
print(\\\"Run with arguments\\\")\\\
|
print(\\\"Run with arguments\\\")\\r\\\
|
||||||
term.setCursorPos(2,11)\\\
|
term.setCursorPos(2,11)\\r\\\
|
||||||
print(\\\"Edit\\\")\\\
|
print(\\\"Edit\\\")\\r\\\
|
||||||
term.setCursorPos(2,12)\\\
|
term.setCursorPos(2,12)\\r\\\
|
||||||
print(\\\"Rename\\\")\\\
|
print(\\\"Rename\\\")\\r\\\
|
||||||
term.setCursorPos(2,13)\\\
|
term.setCursorPos(2,13)\\r\\\
|
||||||
print(\\\"Delete\\\")\\\
|
print(\\\"Delete\\\")\\r\\\
|
||||||
term.setTextColor(sPhone.theme[\\\"text\\\"])\\\
|
term.setTextColor(sPhone.theme[\\\"text\\\"])\\r\\\
|
||||||
local _,_,x,y = os.pullEvent(\\\"mouse_click\\\")\\\
|
local _,_,x,y = os.pullEvent(\\\"mouse_click\\\")\\r\\\
|
||||||
if y == 1 and x == w then\\\
|
if y == 1 and x == w then\\r\\\
|
||||||
break\\\
|
break\\r\\\
|
||||||
elseif y == 10 then\\\
|
elseif y == 10 then\\r\\\
|
||||||
term.setCursorPos(2,h-1)\\\
|
term.setCursorPos(2,h-1)\\r\\\
|
||||||
write(\\\"Args: \\\")\\\
|
write(\\\"Args: \\\")\\r\\\
|
||||||
term.setTextColor(colors.gray)\\\
|
term.setTextColor(colors.gray)\\r\\\
|
||||||
shell.run(path..\\\" \\\"..read())\\\
|
shell.run(path..\\\" \\\"..read())\\r\\\
|
||||||
elseif y == 11 then\\\
|
elseif y == 11 then\\r\\\
|
||||||
shell.run(\\\"edit\\\",path)\\\
|
shell.run(\\\"edit\\\",path)\\r\\\
|
||||||
elseif y == 12 then\\\
|
elseif y == 12 then\\r\\\
|
||||||
term.setCursorPos(2,h-1)\\\
|
term.setCursorPos(2,h-1)\\r\\\
|
||||||
write(\\\"Rename: \\\")\\\
|
write(\\\"Rename: \\\")\\r\\\
|
||||||
term.setTextColor(colors.gray)\\\
|
term.setTextColor(colors.gray)\\r\\\
|
||||||
local oldPath = path\\\
|
local oldPath = path\\r\\\
|
||||||
path = fs.getDir(path)..\\\"/\\\"..read()\\\
|
path = fs.getDir(path)..\\\"/\\\"..read()\\r\\\
|
||||||
fs.move(oldPath,path)\\\
|
fs.move(oldPath,path)\\r\\\
|
||||||
elseif y == 13 then\\\
|
elseif y == 13 then\\r\\\
|
||||||
fs.delete(path)\\\
|
fs.delete(path)\\r\\\
|
||||||
break\\\
|
break\\r\\\
|
||||||
end\\\
|
end\\r\\\
|
||||||
end\\\
|
end\\r\\\
|
||||||
end\\\
|
end\\r\\\
|
||||||
dir = fs.getDir(path)\\\
|
dir = fs.getDir(path)\\r\\\
|
||||||
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,\
|
|
||||||
}",
|
}",
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
--
|
--
|
||||||
-- Sertex Application Package
|
-- sPhone Application Package
|
||||||
-- Built with SPK builder 1.2
|
-- Built with SPK builder 1.2
|
||||||
--
|
--
|
||||||
{
|
{
|
||||||
|
@ -13,16 +13,15 @@ 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,\
|
||||||
id = \"sphone.gps\",\
|
|
||||||
author = \"Sertex\",\
|
|
||||||
hidden = true,\
|
|
||||||
main = \"gps.lua\",\
|
main = \"gps.lua\",\
|
||||||
|
id = \"sphone.gps\",\
|
||||||
|
author = \"BeaconNet\",\
|
||||||
|
hidden = true,\
|
||||||
}",
|
}",
|
||||||
}
|
}
|
|
@ -1,168 +1,128 @@
|
||||||
--
|
--
|
||||||
-- Sertex Application Package
|
-- sPhone Application Package
|
||||||
-- Built with SPK builder 1.2
|
-- Built with SPK builder 1.2
|
||||||
--
|
--
|
||||||
{
|
{
|
||||||
files = "{\
|
files = "{\
|
||||||
[ \"home.lua\" ] = \"local currentTime\\\
|
[ \"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()\\\
|
||||||
|
term.setBackgroundColor(sPhone.theme[\\\"backgroundColor\\\"])\\\
|
||||||
|
term.clear()\\\
|
||||||
|
term.setCursorPos(1,1)\\\
|
||||||
|
term.setTextColor(sPhone.theme[\\\"text\\\"])\\\
|
||||||
|
end\\\
|
||||||
\\\
|
\\\
|
||||||
local function launch(id)\\\
|
local function drawHome()\\\
|
||||||
\\\
|
clear()\\\
|
||||||
local ok, par = sPhone.launch(id);\\\
|
visum.buttons(buttonsInHome,true)\\\
|
||||||
\\\
|
\\\
|
||||||
if not ok then\\\
|
local w, h = term.getSize()\\\
|
||||||
term.setBackgroundColor(colors.black)\\\
|
paintutils.drawLine(1,1,w,1, sPhone.theme[\\\"header\\\"])\\\
|
||||||
term.setTextColor(colors.white)\\\
|
term.setTextColor(sPhone.theme[\\\"headerText\\\"])\\\
|
||||||
term.clear()\\\
|
visum.align(\\\"right\\\",\\\"vvv \\\",false,1)\\\
|
||||||
term.setCursorPos(1,1)\\\
|
end\\\
|
||||||
print(id .. \\\" has errored:\\\")\\\
|
local function footerMenu()\\\
|
||||||
printError(par)\\\
|
sPhone.isFooterMenuOpen = true\\\
|
||||||
print(\\\"Press any key to continue\\\")\\\
|
function redraw()\\\
|
||||||
os.pullEvent(\\\"key\\\")\\\
|
drawHome()\\\
|
||||||
\\\
|
local w, h = term.getSize()\\\
|
||||||
else\\\
|
paintutils.drawFilledBox(1,2,w,4,sPhone.theme[\\\"header\\\"])\\\
|
||||||
if #par == 0 or not par[1] and par[1] ~= nil then\\\
|
term.setTextColor(sPhone.theme[\\\"headerText\\\"])\\\
|
||||||
term.setBackgroundColor(colors.black)\\\
|
term.setBackgroundColor(sPhone.theme[\\\"header\\\"])\\\
|
||||||
term.setTextColor(colors.white)\\\
|
visum.align(\\\"right\\\",\\\"^^^ \\\",false,1)\\\
|
||||||
print(\\\"Press any key to continue\\\")\\\
|
visum.align(\\\"right\\\", \\\"Reboot \\\",false,3)\\\
|
||||||
os.pullEvent(\\\"key\\\")\\\
|
term.setCursorPos(11,3)\\\
|
||||||
end\\\
|
write(\\\"Settings\\\")\\\
|
||||||
end\\\
|
term.setCursorPos(2,3)\\\
|
||||||
end\\\
|
write(\\\"Shutdown\\\")\\\
|
||||||
\\\
|
end\\\
|
||||||
local buttonsInHome = {\\\
|
while true do\\\
|
||||||
{\\\"sphone.header\\\",23,1,25,1,sPhone.theme[\\\"header\\\"],sPhone.theme[\\\"headerText\\\"],\\\"vvv\\\"},\\\
|
term.redirect(sPhone.mainTerm)\\\
|
||||||
{\\\"sphone.appList\\\",12,20,14,20,sPhone.theme[\\\"backgroundColor\\\"],sPhone.theme[\\\"header\\\"],\\\"===\\\"},\\\
|
drawHome()\\\
|
||||||
{\\\"sphone.shell\\\",2,3,8,5,colors.black,colors.yellow,\\\" Shell\\\",2},\\\
|
redraw()\\\
|
||||||
{\\\"sphone.explorer\\\",11,3,17,5,colors.blue,colors.white,\\\" Files\\\",2},\\\
|
local _,_,x,y = os.pullEvent(\\\"mouse_click\\\")\\\
|
||||||
{\\\"sphone.lock\\\",20,3,25,5,colors.lightGray,colors.black,\\\" Lock\\\",2},\\\
|
if y == 3 then\\\
|
||||||
{\\\"sphone.gps\\\",11,7,15,9,colors.red,colors.black,\\\" GPS\\\",2},\\\
|
if x > 1 and x < 10 then\\\
|
||||||
{\\\"sphone.info\\\",18,7,23,9,colors.lightGray,colors.black,\\\" Info\\\",2},\\\
|
os.shutdown()\\\
|
||||||
{\\\"sphone.store\\\",2,7,8,9,colors.green,colors.white,\\\" Store\\\",2},\\\
|
sPhone.inHome = true\\\
|
||||||
}\\\
|
elseif x > 19 and x < 26 then\\\
|
||||||
\\\
|
os.reboot()\\\
|
||||||
local function clear()\\\
|
sPhone.inHome = true\\\
|
||||||
term.setBackgroundColor(sPhone.theme[\\\"backgroundColor\\\"])\\\
|
elseif x > 10 and x < 19 then\\\
|
||||||
term.clear()\\\
|
sPhone.inHome = false\\\
|
||||||
term.setCursorPos(1,1)\\\
|
sPhone.launch(\\\"sphone.settings\\\")\\\
|
||||||
term.setTextColor(sPhone.theme[\\\"text\\\"])\\\
|
sPhone.inHome = true\\\
|
||||||
end\\\
|
drawHome()\\\
|
||||||
\\\
|
end\\\
|
||||||
local function drawClock(time)\\\
|
elseif y == 1 then\\\
|
||||||
term.setBackgroundColor(sPhone.theme[\\\"header\\\"])\\\
|
if x < 26 and x > 22 then\\\
|
||||||
term.setTextColor(sPhone.theme[\\\"headerText\\\"])\\\
|
sPhone.isFooterMenuOpen = false\\\
|
||||||
term.setCursorPos(1,1)\\\
|
return\\\
|
||||||
write(\\\" \\\")\\\
|
end\\\
|
||||||
term.setCursorPos(1,1)\\\
|
end\\\
|
||||||
write(\\\" \\\"..time)\\\
|
end\\\
|
||||||
end\\\
|
end\\\
|
||||||
\\\
|
local function buttonHomeLoop()\\\
|
||||||
local function drawHome()\\\
|
while true do\\\
|
||||||
clear()\\\
|
drawHome()\\\
|
||||||
visum.buttons(buttonsInHome,true)\\\
|
term.setCursorBlink(false)\\\
|
||||||
\\\
|
local autoLockTimer = os.startTimer(10)\\\
|
||||||
local w, h = term.getSize()\\\
|
local id = visum.buttons(buttonsInHome)\\\
|
||||||
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\\\
|
|
||||||
\\\
|
\\\
|
||||||
drawHome()\\\
|
if id == \\\"sphone.header\\\" then\\\
|
||||||
break\\\
|
footerMenu()\\\
|
||||||
end\\\
|
elseif id == \\\"sphone.lock\\\" then\\\
|
||||||
elseif y == 1 then\\\
|
sPhone.inHome = false\\\
|
||||||
if x < 26 and x > 22 then\\\
|
sPhone.login()\\\
|
||||||
sPhone.isFooterMenuOpen = false\\\
|
sPhone.inHome = true\\\
|
||||||
return\\\
|
else\\\
|
||||||
end\\\
|
sPhone.inHome = false\\\
|
||||||
end\\\
|
os.pullEvent = os.oldPullEvent\\\
|
||||||
end\\\
|
sPhone.launch(id)\\\
|
||||||
end\\\
|
os.pullEvent = os.pullEventRaw\\\
|
||||||
local function buttonHomeLoop()\\\
|
sPhone.inHome = true\\\
|
||||||
drawHome()\\\
|
end\\\
|
||||||
while true do\\\
|
end\\\
|
||||||
term.setCursorBlink(false)\\\
|
\\\
|
||||||
local autoLockTimer = os.startTimer(10)\\\
|
sPhone.inHome = false\\\
|
||||||
local id = visum.buttons(buttonsInHome)\\\
|
\\\
|
||||||
\\\
|
end\\\
|
||||||
if id == \\\"sphone.header\\\" then\\\
|
\\\
|
||||||
footerMenu()\\\
|
local function updateClock()\\\
|
||||||
drawHome()\\\
|
while true do\\\
|
||||||
elseif id == \\\"sphone.lock\\\" then\\\
|
if sPhone.inHome then\\\
|
||||||
sPhone.inHome = false\\\
|
term.setCursorPos(1,1)\\\
|
||||||
sPhone.login()\\\
|
term.setBackgroundColor(sPhone.theme[\\\"header\\\"])\\\
|
||||||
drawHome()\\\
|
term.setTextColor(sPhone.theme[\\\"headerText\\\"])\\\
|
||||||
sPhone.inHome = true\\\
|
term.setCursorPos(1,1)\\\
|
||||||
else\\\
|
write(\\\" \\\")\\\
|
||||||
sPhone.inHome = false\\\
|
term.setCursorPos(1,1)\\\
|
||||||
os.pullEvent = os.oldPullEvent\\\
|
write(\\\" \\\"..textutils.formatTime(os.time(), not config.read(\\\"/.sPhone/config/sPhone\\\",\\\"format12time\\\")))\\\
|
||||||
launch(id)\\\
|
end\\\
|
||||||
drawHome()\\\
|
sleep(0)\\\
|
||||||
os.pullEvent = os.pullEventRaw\\\
|
end\\\
|
||||||
sPhone.inHome = true\\\
|
end\\\
|
||||||
end\\\
|
\\\
|
||||||
end\\\
|
parallel.waitForAll(buttonHomeLoop, updateClock)\\\
|
||||||
\\\
|
\",\
|
||||||
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\",\
|
||||||
id = \"sphone.home\",\
|
|
||||||
author = \"Sertex\",\
|
|
||||||
hidden = true,\
|
|
||||||
version = 1,\
|
version = 1,\
|
||||||
|
id = \"sphone.home\",\
|
||||||
|
author = \"BeaconNet\",\
|
||||||
|
hidden = true,\
|
||||||
}",
|
}",
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
--
|
--
|
||||||
-- Sertex Application Package
|
-- sPhone Application Package
|
||||||
-- Built with SPK builder 1.2
|
-- Built with SPK builder 1.2
|
||||||
--
|
--
|
||||||
{
|
{
|
||||||
|
@ -29,17 +29,18 @@ 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 true\\\
|
return\\\
|
||||||
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,\
|
|
||||||
}",
|
}",
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
--
|
--
|
||||||
-- Sertex Application Package
|
-- sPhone Application Package
|
||||||
-- Built with SPK builder 1.2
|
-- Built with SPK builder 1.2
|
||||||
--
|
--
|
||||||
{
|
{
|
||||||
|
@ -239,7 +239,6 @@ local function editTheme()\\\
|
||||||
\\\"Background Color\\\",\\\
|
\\\"Background Color\\\",\\\
|
||||||
\\\"Window Options\\\",\\\
|
\\\"Window Options\\\",\\\
|
||||||
\\\"Login Options\\\",\\\
|
\\\"Login Options\\\",\\\
|
||||||
\\\"\\\",\\\
|
|
||||||
\\\"Save\\\",\\\
|
\\\"Save\\\",\\\
|
||||||
\\\"Load\\\",\\\
|
\\\"Load\\\",\\\
|
||||||
\\\"Reset\\\",\\\
|
\\\"Reset\\\",\\\
|
||||||
|
@ -308,7 +307,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 == 10 then\\\
|
elseif id == 9 then\\\
|
||||||
local saveTheme\\\
|
local saveTheme\\\
|
||||||
sPhone.header(sPhone.user)\\\
|
sPhone.header(sPhone.user)\\\
|
||||||
term.setCursorPos(w,1)\\\
|
term.setCursorPos(w,1)\\\
|
||||||
|
@ -335,7 +334,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 == 11 then\\\
|
elseif id == 10 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\\\
|
||||||
|
@ -350,7 +349,7 @@ local function editTheme()\\\
|
||||||
sPhone.winOk(\\\"Theme not found!\\\")\\\
|
sPhone.winOk(\\\"Theme not found!\\\")\\\
|
||||||
end\\\
|
end\\\
|
||||||
end\\\
|
end\\\
|
||||||
elseif id == 12 then\\\
|
elseif id == 11 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\\\")\\\
|
||||||
|
@ -410,8 +409,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 true\\\
|
return\\\
|
||||||
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\\\
|
||||||
|
@ -429,15 +428,16 @@ 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,\
|
|
||||||
}",
|
}",
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
--
|
--
|
||||||
-- Sertex Application Package
|
-- sPhone Application Package
|
||||||
-- Built with SPK builder 1.2
|
-- Built with SPK builder 1.2
|
||||||
--
|
--
|
||||||
{
|
{
|
||||||
|
@ -9,16 +9,15 @@ 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,\
|
||||||
id = \"sphone.shell\",\
|
|
||||||
author = \"Sertex\",\
|
|
||||||
hidden = true,\
|
|
||||||
main = \"shell.lua\",\
|
main = \"shell.lua\",\
|
||||||
|
id = \"sphone.shell\",\
|
||||||
|
author = \"BeaconNet\",\
|
||||||
|
hidden = true,\
|
||||||
}",
|
}",
|
||||||
}
|
}
|
|
@ -1,5 +1,5 @@
|
||||||
--
|
--
|
||||||
-- Sertex Application Package
|
-- sPhone 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 true\\\
|
return\\\
|
||||||
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,15 +132,16 @@ 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\",\
|
|
||||||
}",
|
}",
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,51 +1,50 @@
|
||||||
--
|
--
|
||||||
-- Sertex Application Package
|
-- sPhone Application Package
|
||||||
-- Built with SPK builder 1.2
|
-- Built with SPK builder 1.2
|
||||||
--
|
--
|
||||||
{
|
{
|
||||||
files = "{\
|
files = "{\
|
||||||
[ \"themes.lua\" ] = \"if not sPhone then\\\
|
[ \"themes.lua\" ] = \"if not sPhone then\\r\\\
|
||||||
printError(\\\"sPhone must be installed and loaded before running this program\\\")\\\
|
printError(\\\"sPhone must be installed and loaded before running this program\\\")\\r\\\
|
||||||
return\\\
|
return\\r\\\
|
||||||
end\\\
|
end\\r\\\
|
||||||
\\\
|
\\r\\\
|
||||||
\\\
|
\\r\\\
|
||||||
print(\\\"Downloading theme list\\\")\\\
|
print(\\\"Downloading theme list\\\")\\r\\\
|
||||||
local url = \\\"https://raw.github.com/Ale32bit/sPhone-Mods/master/themes.lua\\\"\\\
|
local url = \\\"https://raw.github.com/Ale32bit/sPhone-Mods/master/themes.lua\\\"\\r\\\
|
||||||
\\\
|
\\r\\\
|
||||||
local ht = http.get(url)\\\
|
local ht = http.get(url)\\r\\\
|
||||||
local themesRaw = ht.readAll()\\\
|
local themesRaw = ht.readAll()\\r\\\
|
||||||
local themes = textutils.unserialize(themesRaw)\\\
|
local themes = textutils.unserialize(themesRaw)\\r\\\
|
||||||
ht.close()\\\
|
ht.close()\\r\\\
|
||||||
\\\
|
\\r\\\
|
||||||
local li = {}\\\
|
local li = {}\\r\\\
|
||||||
for k,v in pairs(themes) do\\\
|
for k,v in pairs(themes) do\\r\\\
|
||||||
table.insert(li,k)\\\
|
table.insert(li,k)\\r\\\
|
||||||
end\\\
|
end\\r\\\
|
||||||
while true do\\\
|
while true do\\r\\\
|
||||||
local g, c = sPhone.menu(li,\\\" Themes\\\",\\\"X\\\")\\\
|
local g, c = sPhone.menu(li,\\\" Themes\\\",\\\"X\\\")\\r\\\
|
||||||
if c == 0 then\\\
|
if c == 0 then\\r\\\
|
||||||
return\\\
|
return\\r\\\
|
||||||
elseif c > #li then\\\
|
elseif c > #li then\\r\\\
|
||||||
\\\
|
\\r\\\
|
||||||
else\\\
|
else\\r\\\
|
||||||
for k,v in pairs(themes[g]) do\\\
|
for k,v in pairs(themes[g]) do\\r\\\
|
||||||
sPhone.applyTheme(k,v)\\\
|
sPhone.applyTheme(k,v)\\r\\\
|
||||||
end\\\
|
end\\r\\\
|
||||||
sPhone.winOk(\\\"Theme applied\\\")\\\
|
sPhone.winOk(\\\"Theme applied\\\")\\r\\\
|
||||||
break\\\
|
break\\r\\\
|
||||||
end\\\
|
end\\r\\\
|
||||||
end\\\
|
end\\r\\\
|
||||||
\\\
|
\",\
|
||||||
return true\",\
|
|
||||||
}",
|
}",
|
||||||
config = "{\
|
config = "{\
|
||||||
type = \"app\",\
|
type = \"app\",\
|
||||||
name = \"Theme List\",\
|
name = \"Theme List\",\
|
||||||
version = 1,\
|
version = 1,\
|
||||||
id = \"sphone.themes\",\
|
|
||||||
author = \"Sertex\",\
|
|
||||||
hidden = true,\
|
|
||||||
main = \"themes.lua\",\
|
main = \"themes.lua\",\
|
||||||
|
id = \"sphone.themes\",\
|
||||||
|
author = \"BeaconNet\",\
|
||||||
|
hidden = true,\
|
||||||
}",
|
}",
|
||||||
}
|
}
|
|
@ -8,6 +8,13 @@ end
|
||||||
local old = os.pullEvent
|
local old = os.pullEvent
|
||||||
os.pullEvent = os.pullEventRaw
|
os.pullEvent = os.pullEventRaw
|
||||||
|
|
||||||
|
local license = [[
|
||||||
|
The MIT License (MIT)
|
||||||
|
Copyright (c) 2017 Sertex
|
||||||
|
|
||||||
|
Read full license here:
|
||||||
|
https://raw.github.com/SertexTeam/sPhone/master/LICENSE]]
|
||||||
|
|
||||||
local files = {
|
local files = {
|
||||||
["src/init.lua"] = "/.sPhone/init",
|
["src/init.lua"] = "/.sPhone/init",
|
||||||
["src/sPhone.lua"] = "/.sPhone/sPhone",
|
["src/sPhone.lua"] = "/.sPhone/sPhone",
|
||||||
|
@ -148,7 +155,8 @@ gui()
|
||||||
term.setCursorPos(2,3)
|
term.setCursorPos(2,3)
|
||||||
print("License\n")
|
print("License\n")
|
||||||
printError("You must accept the license to install sPhone\n")
|
printError("You must accept the license to install sPhone\n")
|
||||||
print("The MIT License (MIT)\nCopyright (c) 2017 Sertex\n\nRead full license here:\nhttps://raw.github.com/SertexTeam/sPhone/master/LICENSE")
|
print(license)
|
||||||
|
|
||||||
paintutils.drawFilledBox(2,17,9,19,colors.lime)
|
paintutils.drawFilledBox(2,17,9,19,colors.lime)
|
||||||
term.setCursorPos(3,18)
|
term.setCursorPos(3,18)
|
||||||
term.setTextColor(colors.white)
|
term.setTextColor(colors.white)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
local function kernel(...)
|
local function kernel(...)
|
||||||
_G.sPhone = {
|
_G.sPhone = {
|
||||||
version = "Beta 1.2.2",
|
version = "Beta 1.2",
|
||||||
user = "Guest",
|
user = "Guest",
|
||||||
devMode = false,
|
devMode = false,
|
||||||
mainTerm = term.current(),
|
mainTerm = term.current(),
|
||||||
|
@ -828,8 +828,8 @@ local function kernel(...)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
redraw()
|
|
||||||
while true do
|
while true do
|
||||||
|
redraw()
|
||||||
local eventData = {os.pullEventRaw()}
|
local eventData = {os.pullEventRaw()}
|
||||||
if eventData[1] == 'mouse_click' then
|
if eventData[1] == 'mouse_click' then
|
||||||
if eventData[4] == 1 and eventData[3] == termWidth then
|
if eventData[4] == 1 and eventData[3] == termWidth then
|
||||||
|
@ -1089,10 +1089,8 @@ end
|
||||||
if not script then
|
if not script then
|
||||||
return false, "config corrupted"
|
return false, "config corrupted"
|
||||||
end
|
end
|
||||||
|
|
||||||
local result = {}
|
|
||||||
local ok, err = pcall(function()
|
local ok, err = pcall(function()
|
||||||
result = {setfenv(loadfile(fs.combine("/.sPhone/apps/spk",_config.id.."/files/".._config.main)), setmetatable({
|
setfenv(loadfile(fs.combine("/.sPhone/apps/spk",_config.id.."/files/".._config.main)), setmetatable({
|
||||||
spk = {
|
spk = {
|
||||||
getName = function()
|
getName = function()
|
||||||
return (_config.name or nil)
|
return (_config.name or nil)
|
||||||
|
@ -1128,13 +1126,13 @@ end
|
||||||
},
|
},
|
||||||
string = string,
|
string = string,
|
||||||
sPhone = sPhone,
|
sPhone = sPhone,
|
||||||
}, {__index = getfenv()}))()}
|
}, {__index = getfenv()}))()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
if not ok then
|
if not ok then
|
||||||
return false, err
|
return false, err
|
||||||
end
|
end
|
||||||
return true, result
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
local function home()
|
local function home()
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Beta 1.2.2
|
Beta 1.2.1
|
||||||
|
|
Loading…
Reference in a new issue