Focus target: follow its token, not its GUID

The focus target frame filtered its unit events on the unit's GUID, which
only arrive while nampower fires its raw-GUID events (NP_EnableUnitEventsGuid
on, NP_EnableUnitEventsGuidFiltering off) and SuperWoW watches every unit.
Without them the bars froze until the focus switched targets (#76).

ClassicAPI fires the focus target's unit events as "focustarget" and the
focus's UNIT_TARGET as "focus" whatever nampower does, so the frame follows
those tokens. The swap check keeps its own GUID cache, since eventunit is
no longer a GUID for that frame.
This commit is contained in:
Brues
2026-11-02 01:06:17 -06:00
parent ebb4b056c3
commit 23d25c4791
2 changed files with 22 additions and 11 deletions
+4 -3
View File
@@ -17,9 +17,10 @@ pfUI:RegisterModule("focus", function ()
-- PLAYER_FOCUS_CHANGED drives immediate refresh on focus assign / clear.
-- Between events, ClassicAPI fires UNIT_* (health/mana/aura/...) with
-- arg1 == "focus", so the bars update event-driven like target.
-- focustarget is a chained unit like targettarget: UNIT_TARGET follows the
-- focus retargeting, and a new focus only needs its visibility re-checked,
-- which queues the full refresh when its target is a different unit.
-- focustarget is a chained unit like targettarget, but ClassicAPI fires its
-- UNIT_* as "focustarget", and UNIT_TARGET on "focus" follows the focus
-- retargeting. A new focus only needs its visibility re-checked, which
-- queues the full refresh when its target is a different unit.
pfUI.events:RegisterFrameEventAndCallback("PLAYER_FOCUS_CHANGED", function()
pfUI.uf:RefreshUnit(pfUI.uf.focus, "all")
pfUI.uf.focustarget:UpdateVisibility()