Update sPhone.lua

This commit is contained in:
Ale2610 2015-09-02 14:41:09 +02:00
parent 22f15e379e
commit 919452cc56

View file

@ -42,7 +42,7 @@ end
local function kernel() local function kernel()
_G.sPhone = { _G.sPhone = {
version = "Alpha 1", version = "Alpha 1",
user = "Unknown", user = "Run sID",
devMode = false, devMode = false,
} }
@ -216,7 +216,7 @@ local function kernel()
end end
end end
function lChat() local function lChat()
clear() clear()
local w, h = term.getSize() local w, h = term.getSize()
paintutils.drawLine(1,1,w,1,colors.gray) paintutils.drawLine(1,1,w,1,colors.gray)
@ -252,7 +252,11 @@ local function kernel()
term.setTextColor(colors.white) term.setTextColor(colors.white)
sertextext.right(1,"vvv") sertextext.right(1,"vvv")
term.setCursorPos(1,1) term.setCursorPos(1,1)
write(" "..sPhone.user) if not sPhone.newUpdate then
write(" "..sPhone.user)
else
write(" New Update!")
end
box(2,3,"Shell",colors.black,colors.yellow) box(2,3,"Shell",colors.black,colors.yellow)
box(19,3,"Lock",colors.lightGray,colors.black) box(19,3,"Lock",colors.lightGray,colors.black)
box(11,3,"sID",colors.red,colors.white) box(11,3,"sID",colors.red,colors.white)
@ -550,6 +554,14 @@ local function kernel()
end end
login() login()
local newVersion = http.get("https://raw.githubusercontent.com/Sertex-Team/sPhone/master/src/version").readAll()
if newVersion ~= sPhone.version then
sPhone.newUpdate = true
else
sPhone.newUpdate = false
end
end end
if sPhone then if sPhone then