Add files via upload

This commit is contained in:
Ale32bit 2016-10-31 19:39:50 +01:00 committed by GitHub
parent ff68272a15
commit 2c97acf7d4

32
src/apps/themes Normal file
View file

@ -0,0 +1,32 @@
if not sPhone then
printError("sPhone must be installed and loaded before running this program")
return
end
print("Downloading theme list")
local url = "https://raw.github.com/Ale32bit/sPhone-Mods/master/themes.lua"
local ht = http.get(url)
local themesRaw = ht.readAll()
local themes = textutils.unserialize(themesRaw)
ht.close()
local li = {}
for k,v in pairs(themes) do
table.insert(li,k)
end
while true do
local g, c = sPhone.menu(li," Themes","X")
if c == 0 then
return
elseif c > #li then
else
for k,v in pairs(themes[g]) do
sPhone.applyTheme(k,v)
end
sPhone.winOk("Theme applied")
break
end
end