Update impl.lua
This commit is contained in:
parent
cddb2ff6ad
commit
499d1d00ef
15
impl.lua
15
impl.lua
|
@ -114,11 +114,18 @@ end
|
||||||
function Impl:Destroy()
|
function Impl:Destroy()
|
||||||
self.destroyed = true
|
self.destroyed = true
|
||||||
main:LogInfo("%s destroyed", self.name)
|
main:LogInfo("%s destroyed", self.name)
|
||||||
|
for k, v in pairs(self.eventHandlers) do
|
||||||
|
RemoveEventHandler(v)
|
||||||
|
end
|
||||||
|
self:OnDestroy()
|
||||||
end
|
end
|
||||||
|
|
||||||
function Impl:OnReady(...)
|
function Impl:OnReady(...)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function Impl:OnDestroy(...)
|
||||||
|
end
|
||||||
|
|
||||||
function Impl:HookMethod(method, hookFn)
|
function Impl:HookMethod(method, hookFn)
|
||||||
local oldMethod = self[method]
|
local oldMethod = self[method]
|
||||||
if not oldMethod then
|
if not oldMethod then
|
||||||
|
@ -196,6 +203,14 @@ function Impl:Off(name, handler)
|
||||||
main:LogError("Event %s:%s not registered", self.name, name)
|
main:LogError("Event %s:%s not registered", self.name, name)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function Impl:AddEventHandler(eventName, ...)
|
||||||
|
self.eventHandlers[eventName] = AddEventHandler(eventName, ...)
|
||||||
|
end
|
||||||
|
|
||||||
|
function Impl:RegisterNetEvent(eventName, ...)
|
||||||
|
self.eventHandlers[eventName] = RegisterNetEvent(eventName, ...)
|
||||||
|
end
|
||||||
|
|
||||||
if env == 'sv' then
|
if env == 'sv' then
|
||||||
function Impl:Callback(impl, name, source, ...)
|
function Impl:Callback(impl, name, source, ...)
|
||||||
if type(impl) == "object" then
|
if type(impl) == "object" then
|
||||||
|
|
Loading…
Reference in New Issue
Block a user