Merge branch 'Pre-Alpha-3.0.0' of https://github.com/Team-Cerulean-Blue/Halyde into Pre-Alpha-3.0.0

This commit is contained in:
2025-09-15 08:14:39 +03:00
19 changed files with 102 additions and 68 deletions
+15 -1
View File
@@ -19,7 +19,11 @@ function compLib.virtual.add(address, componentType, proxy)
checkArg(2, componentType, "string")
checkArg(3, proxy, "table")
proxy["address"] = address
componentlib.additions[address] = {["componentType"] = componentType, ["proxy"] = proxy}
local proc
if _PUBLIC.tsched then
proc = _PUBLIC.tsched.getCurrentTask()
end
componentlib.additions[address] = {["componentType"] = componentType, ["proxy"] = proxy, ["proc"] = proc}
if componentlib.removals[address] then
componentlib.removals[address] = nil
end
@@ -34,6 +38,15 @@ function compLib.virtual.remove(address)
end
end
function compLib.virtual.check(address)
checkArg(1, address, "string")
if _G.componentlib.additions[address] then
return true, _G.componentlib.additions[address].proc
else
return false
end
end
function compLib.list(componentType)
checkArg(1, componentType, "string", "nil")
local componentList = table.copy(LLcomponent.list(componentType))
@@ -66,6 +79,7 @@ function compLib.invoke(address, funcName, ...)
--ocelot.log("Invoking " .. funcName .. " from " .. address)
if componentlib.additions[address] then
--ocelot.log("vcomponent")
if not componentlib.additions[address].proxy[funcName] then error("no such method") end
return componentlib.additions[address].proxy[funcName](...)
else
return LLcomponent.invoke(address, funcName, ...)