1 QuestHelper_File
["collect_notifier.lua"] = "Development Version"
2 QuestHelper_Loadtime
["collect_notifier.lua"] = GetTime()
4 local NotificationsPending
= {}
6 local function OnUpdate()
7 while #NotificationsPending
> 0 and GetTime() >= NotificationsPending
[1].time
do
8 NotificationsPending
[1].func()
9 table.remove(NotificationsPending
, 1) -- okay okay n^2 deal with it
13 local function AddItem(time
, func
)
14 QuestHelper
: Assert(time
)
15 QuestHelper
: Assert(func
)
16 table.insert(NotificationsPending
, {time
= time
, func
= func
})
17 table.sort(NotificationsPending
, function (a
, b
) return a
.time
< b
.time
end) -- haha who cares about efficiency anyway, NOT ME that is for certain
20 function QH_Collect_Notifier_Init(_
, API
)
21 API
.Utility_Notifier
= AddItem
23 API
.Registrar_OnUpdateHook(OnUpdate
)