diff --git a/modules/addoncompat.lua b/modules/addoncompat.lua index 8068f0a3..6acca64a 100644 --- a/modules/addoncompat.lua +++ b/modules/addoncompat.lua @@ -134,19 +134,9 @@ pfUI:RegisterModule("addoncompat", function () end -- run the addonconflict queue when firstrun is ready - local delay = CreateFrame("Frame") - delay:SetScript("OnUpdate", function() - -- throttle to to one query per .1 second - if ( this.tick or 1) > GetTime() then return else this.tick = GetTime() + .1 end - - -- make sure the firstrun dialog has finished - if pfUI.firstrun and pfUI.firstrun.steps then - for _, step in pairs(pfUI.firstrun.steps) do - if not pfUI_init[step.name] then return end - end - end - + if pfUI.firstrun and pfUI.firstrun.completed then RunQueue() - this:SetScript("OnUpdate", nil) - end) + else + pfUI.events:RegisterCallback("firstrun:complete", RunQueue, "addoncompat") + end end) diff --git a/modules/firstrun.lua b/modules/firstrun.lua index 31fdb659..5e55c12d 100644 --- a/modules/firstrun.lua +++ b/modules/firstrun.lua @@ -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 diff --git a/pfUI.lua b/pfUI.lua index c0a2e9b9..fb03d647 100644 --- a/pfUI.lua +++ b/pfUI.lua @@ -102,6 +102,10 @@ pfUI.version = {} pfUI.hooks = {} pfUI.env = {} +pfUI.events = Mixin({}, CallbackRegistryMixin) +pfUI.events:OnLoad() +pfUI.events:SetUndefinedEventsAllowed(true) + -- check if macro addons are loaded (disables macrotweak/macroscan) function pfUI:MacroAddonsLoaded() return IsAddOnLoaded("Supermacro") or IsAddOnLoaded("SuperCleveRoidMacros") or IsAddOnLoaded("UltimaMacros")