View Single Post
10-30-22, 03:39 PM   #7
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,327
Originally Posted by Lightspark
I'd be careful with self.auraPools:ReleaseAll() tho, if you start getting weird errors related to UF auras while in combat, comment out that line.
-- self.auraPools:ReleaseAll()
I'm imagining they're referring to taint issues. Nothing running that should be susceptible to taint though.
Also figures I would leave something (the function keyword) out while dry-coding.



I neglected to put in anchor correction for the castbar, though it would add another taint vector.
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()--   Cleanup
  8.  
  9.     self.auraRows,self.spellbarAnchor=0,nil;--  Revert to initial values
  10.     if self.spellbar then Target_Spellbar_AdjustPosition(self.spellbar); end--  Update anchor
  11. end
  12.  
  13. hooksecurefunc(TargetFrame,"UpdateAuras",ReleaseAllAuras);
  14. hooksecurefunc(FocusFrame,"UpdateAuras",ReleaseAllAuras);

Ideally, you'll always want to clean up after yourself. This is what self.auraPools:ReleaseAll() is for. Considering the original function already does this right before updating, it isn't as important in a practical sense.

The castbar reanchoring could be done with less taint, but if we can get away with reusing existing logic rather than recreating it, that would be better.
__________________
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)
  Reply With Quote