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()
|
||||
self.destroyed = true
|
||||
main:LogInfo("%s destroyed", self.name)
|
||||
for k, v in pairs(self.eventHandlers) do
|
||||
RemoveEventHandler(v)
|
||||
end
|
||||
self:OnDestroy()
|
||||
end
|
||||
|
||||
function Impl:OnReady(...)
|
||||
end
|
||||
|
||||
function Impl:OnDestroy(...)
|
||||
end
|
||||
|
||||
function Impl:HookMethod(method, hookFn)
|
||||
local oldMethod = self[method]
|
||||
if not oldMethod then
|
||||
|
@ -196,6 +203,14 @@ function Impl:Off(name, handler)
|
|||
main:LogError("Event %s:%s not registered", self.name, name)
|
||||
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
|
||||
function Impl:Callback(impl, name, source, ...)
|
||||
if type(impl) == "object" then
|
||||
|
|
Loading…
Reference in New Issue
Block a user