Final update

Bug fixes
This commit is contained in:
Alessandro 2019-10-28 19:31:10 +01:00 committed by GitHub
parent b2a5b6c10a
commit 4823d5a78b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,6 +1,6 @@
local function kernel(...) local function kernel(...)
_G.sPhone = { _G.sPhone = {
version = "Beta 1.2.1", version = "Beta 1.2.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
while true do
redraw() redraw()
while true do
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,8 +1089,10 @@ 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()
setfenv(loadfile(fs.combine("/.sPhone/apps/spk",_config.id.."/files/".._config.main)), setmetatable({ result = {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)
@ -1126,13 +1128,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 return true, result
end end
local function home() local function home()