Give pfUI its own EventRegistry and move event-only frames onto it

pfUI.events was a bare CallbackRegistry for pfUI's custom events. Build it
from ClassicAPI's EventRegistry instead, so the same object also takes game
events through RegisterFrameEventAndCallback, sharing one frame for all of
them.

Move the frames that existed only to listen for a few events onto it:
libspell, focus, pixelperfect, innervatecall, loothistory, unusable,
equipmentmanager (bank + window refresh), the actionbar grid, updatenotify,
turtle-wow's steady shot, nampower's spell queue, superwow's group tracking
and unitxp's notifications, plus newitem and mapreveal, which used the
global EventRegistry. Handlers take their payload as arguments instead of
the event/arg globals, and the per-frame PLAYER_LOGOUT teardown goes away,
since the registry unregisters its frame on logout.
This commit is contained in:
Brues
2026-10-30 12:37:56 -05:00
parent b0f9b7b993
commit f37ea00226
16 changed files with 101 additions and 166 deletions
+7 -8
View File
@@ -38,13 +38,7 @@ pfUI:RegisterModule("unusable", function ()
-- requirement changes (level, proficiency/skill, required spell, reputation,
-- honor rank) don't touch the bags; queue a full rebag through pfUI.bag's
-- coalesced delay, whose UpdateSlot resets the tint before we reapply it
local refresh = CreateFrame("Frame")
refresh:RegisterEvent("PLAYER_LEVEL_UP")
refresh:RegisterEvent("SKILL_LINES_CHANGED")
refresh:RegisterEvent("SPELLS_CHANGED")
refresh:RegisterEvent("FACTION_STANDING_CHANGED")
refresh:RegisterEvent("PLAYER_PVP_RANK_CHANGED")
refresh:SetScript("OnEvent", function()
local function Refresh()
for _, bag in pairs(pfUI.BACKPACK) do
pfUI.bag.delay.UpdateBag[bag] = true
end
@@ -54,5 +48,10 @@ pfUI:RegisterModule("unusable", function ()
pfUI.bag.delay.UpdateBag[bag] = true
end
end
end)
end
for _, event in ipairs({ "PLAYER_LEVEL_UP", "SKILL_LINES_CHANGED", "SPELLS_CHANGED",
"FACTION_STANDING_CHANGED", "PLAYER_PVP_RANK_CHANGED" }) do
pfUI.events:RegisterFrameEventAndCallback(event, Refresh)
end
end)