mirror of
https://github.com/brues-code/pfUI.git
synced 2026-09-27 09:56:03 +00:00
add pfUI.events callback registry, replace addoncompat OnUpdate poll
Introduce a central pfUI.events registry (ClassicAPI's CallbackRegistryMixin, undefined events allowed) initialized in pfUI.lua before any module body runs, so publishers/subscribers don't depend on module load order. firstrun sets `pfUI.firstrun.completed` and fires `firstrun:complete` at the point NextStep detects no pending steps. PLAYER_ENTERING_WORLD re- enters this path on every zone, so the flag is a one-shot guard. addoncompat drops its 0.1s OnUpdate poll and either RunQueues immediately (returning user, all steps already done) or subscribes to the event.
This commit is contained in:
@@ -46,6 +46,11 @@ pfUI:RegisterModule("firstrun", function ()
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
if not self.completed then
|
||||
self.completed = true
|
||||
pfUI.events:TriggerEvent("firstrun:complete")
|
||||
end
|
||||
end
|
||||
|
||||
-- main function to create wizard windows
|
||||
|
||||
Reference in New Issue
Block a user