From cf7ed3d70736a2aa366555d7fab208791dcfa8f4 Mon Sep 17 00:00:00 2001 From: thisdp <30386052+thisdp@users.noreply.github.com> Date: Mon, 7 Feb 2022 17:23:45 +0800 Subject: [PATCH] Update manager.lua --- manager.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/manager.lua b/manager.lua index f84b27b0..d5140aaf 100644 --- a/manager.lua +++ b/manager.lua @@ -62,6 +62,22 @@ dgsElementData = {[resourceRoot] = {}} ----The Global BuiltIn DGS Element Data --Element Type dgsElementType = {} -- + +--Plugin Creation Manager +addEventHandler("onDgsPluginCreate",resourceRoot,function(theResource) + ChildrenTable[source] = ChildrenTable[source] or {} + insertResource(theResource,source) + local typ = dgsElementData[source].asPlugin + dgsPluginTable[typ] = dgsPluginTable[typ] or {} + table.insert(dgsPluginTable[typ],source) + addEventHandler("onDgsDestroy",source,function() + local id = table.find(dgsPluginTable[typ],source) + if id then + table.remove(dgsPluginTable[typ],id) + end + end,false) +end) +--Layer System function dgsSetLayer(dgsEle,layer,forceDetatch) if not(dgsIsType(dgsEle)) then error(dgsGenAsrt(dgsEle,"dgsSetLayer",1,"dgs-dxelement")) end if dgsElementType[dgsEle] == "dgs-dxtab" then return false end