1 QuestHelper_File
["manager_event.lua"] = "Development Version"
2 QuestHelper_Loadtime
["manager_event.lua"] = GetTime()
4 local frame
= CreateFrame("Frame")
6 local EventRegistrar
= {}
8 local function OnEvent(_
, event
, ...)
9 local tstart
= GetTime()
10 for _
, v
in pairs(EventRegistrar
[event
]) do
13 QH_Timeslice_Increment(GetTime() - tstart
, "manager_event")
16 frame
:UnregisterAllEvents()
17 frame
:SetScript("OnEvent", OnEvent
)
21 function QuestHelper
.EventHookRegistrar(event
, func
)
22 QuestHelper
:Assert(func
)
23 if not EventRegistrar
[event
] then
24 frame
:RegisterEvent(event
)
25 EventRegistrar
[event
] = {}
27 table.insert(EventRegistrar
[event
], func
)
31 function QuestHelper.OnUpdateHookRegistrar(func)
32 QuestHelper: Assert(func)
33 table.insert(OnUpdateRegistrar, func)