v1.12.5 - Added some new minor functions to cormgr and fixed a bug with lscor.
This commit is contained in:
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
local agcfg = {
|
local agcfg = {
|
||||||
["halyde"] = {
|
["halyde"] = {
|
||||||
["maindir"] = "",
|
["maindir"] = "",
|
||||||
["version"] = "1.12.4",
|
["version"] = "1.12.5",
|
||||||
["description"] = "A universal, customizable and feature-packed operating system for OpenComputers.",
|
["description"] = "A universal, customizable and feature-packed operating system for OpenComputers.",
|
||||||
["directories"] = {
|
["directories"] = {
|
||||||
"halyde/apps",
|
"halyde/apps",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
local loadfile = ...
|
local loadfile = ...
|
||||||
local filesystem = loadfile("/halyde/lib/filesystem.lua")(loadfile)
|
local filesystem = loadfile("/halyde/lib/filesystem.lua")(loadfile)
|
||||||
|
|
||||||
_G._OSVERSION = "Halyde 1.12.4"
|
_G._OSVERSION = "Halyde 1.12.5"
|
||||||
_G._OSLOGO = ""
|
_G._OSLOGO = ""
|
||||||
local handle, tmpdata = filesystem.open("/halyde/config/oslogo.ans", "r"), nil
|
local handle, tmpdata = filesystem.open("/halyde/config/oslogo.ans", "r"), nil
|
||||||
repeat
|
repeat
|
||||||
|
|||||||
+20
-6
@@ -2,16 +2,15 @@ _G.cormgr = {}
|
|||||||
_G.cormgr.corList = {}
|
_G.cormgr.corList = {}
|
||||||
_G.cormgr.labelList = {}
|
_G.cormgr.labelList = {}
|
||||||
|
|
||||||
--local ocelot = component.proxy(component.list("ocelot")())
|
|
||||||
|
|
||||||
local component = import("component")
|
local component = import("component")
|
||||||
local filesystem = import("filesystem")
|
local filesystem = import("filesystem")
|
||||||
local json = import("json")
|
local json = import("json")
|
||||||
local gpu = component.gpu
|
local gpu = component.gpu
|
||||||
|
--local ocelot = component.ocelot
|
||||||
|
|
||||||
function _G.cormgr.loadCoroutine(path,...)
|
function _G.cormgr.loadCoroutine(path,...)
|
||||||
local args = {...}
|
local args = {...}
|
||||||
local cor = coroutine.create(function()
|
local function corFunction()
|
||||||
local result, errorMessage = xpcall(function(...)
|
local result, errorMessage = xpcall(function(...)
|
||||||
import(...)
|
import(...)
|
||||||
end, function(errorMessage)
|
end, function(errorMessage)
|
||||||
@@ -26,9 +25,22 @@ function _G.cormgr.loadCoroutine(path,...)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
--import(path, table.unpack(args))
|
--import(path, table.unpack(args))
|
||||||
end)
|
end
|
||||||
table.insert(_G.cormgr.labelList, string.match(tostring(path), "([^/]+)%.lua$"))
|
cormgr.addCoroutine(corFunction, string.match(tostring(path), "([^/]+)%.lua$"))
|
||||||
table.insert(_G.cormgr.corList, cor)
|
end
|
||||||
|
|
||||||
|
function _G.cormgr.addCoroutine(func, name)
|
||||||
|
local cor = coroutine.create(func)
|
||||||
|
table.insert(cormgr.corList, cor)
|
||||||
|
table.insert(cormgr.labelList, name)
|
||||||
|
return cor
|
||||||
|
end
|
||||||
|
|
||||||
|
function _G.cormgr.removeCoroutine(name)
|
||||||
|
local index = table.find(cormgr.labelList, cor)
|
||||||
|
table.remove(cormgr.corList, index)
|
||||||
|
table.remove(cormgr.labelList, index)
|
||||||
|
coroutine.close(cor)
|
||||||
end
|
end
|
||||||
|
|
||||||
function handleError(errormsg)
|
function handleError(errormsg)
|
||||||
@@ -49,6 +61,8 @@ local function runCoroutines()
|
|||||||
end
|
end
|
||||||
if coroutine.status(cormgr.corList[i]) == "dead" then
|
if coroutine.status(cormgr.corList[i]) == "dead" then
|
||||||
table.remove(cormgr.corList, i)
|
table.remove(cormgr.corList, i)
|
||||||
|
table.remove(cormgr.labelList, i)
|
||||||
|
--ocelot.log("Removed coroutine")
|
||||||
i = i - 1
|
i = i - 1
|
||||||
end
|
end
|
||||||
--computer.pullSignal(0)
|
--computer.pullSignal(0)
|
||||||
|
|||||||
Reference in New Issue
Block a user