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