View Single Post
10-29-22, 06:53 PM   #2
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,335
Surprisingly, it's simpler in Dragon Flight.
Lua Code:
  1. --  Doesn't need to be done, but saves some (not all) processing
  2. TargetFrame:UnregisterEvent("UNIT_AURA");
  3. FocusFrame:UnregisterEvent("UNIT_AURA");
  4.  
  5. local function ReleaseAllAuras(self)
  6.     for obj in self.auraPools:EnumerateActive() do obj:Hide(); end
  7.     self.auraPools:ReleaseAll()
  8. end
  9.  
  10. hooksecurefunc(TargetFrame,"UpdateAuras",ReleaseAllAuras);
  11. hooksecurefunc(FocusFrame,"UpdateAuras",ReleaseAllAuras);

Blizzard switched to using Mixins for most of TargetFrame's functions, meaning we can hook the Target and Focus frames directly without other inheriting frames triggering our hook. Secondly, buffs and debuffs are handled by frame pools now, which makes iterating through them easier as well.



Note: There's a bug in EditMode which throws taint errors if any addon touches any managed frame.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 10-30-22 at 03:03 PM.
  Reply With Quote