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
+4 -2
View File
@@ -52,9 +52,11 @@ pfUI.env = {}
-- the flag; one that lacks it should drop the flag and get the safe fallback.
pfUI.handlesHookScript = true
pfUI.events = Mixin({}, CallbackRegistryMixin)
-- pfUI's own EventRegistry: carries pfUI's custom events ("bag:closed",
-- "config:changed", ...) and game events alike. Register game events with
-- RegisterFrameEventAndCallback instead of creating a frame per listener.
pfUI.events = CreateFromMixins(EventRegistry)
pfUI.events:OnLoad()
pfUI.events:SetUndefinedEventsAllowed(true)
-- check if macro addons are loaded (disables macrotweak/macroscan)
function pfUI:MacroAddonsLoaded()