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:
-- Doesn't need to be done, but saves some (not all) processing
TargetFrame:UnregisterEvent("UNIT_AURA");
FocusFrame:UnregisterEvent("UNIT_AURA");
local function ReleaseAllAuras(self)
for obj in self.auraPools:EnumerateActive() do obj:Hide(); end
self.auraPools:ReleaseAll()-- Cleanup
self.auraRows,self.spellbarAnchor=0,nil;-- Revert to initial values
if self.spellbar then Target_Spellbar_AdjustPosition(self.spellbar); end-- Update anchor
end
hooksecurefunc(TargetFrame,"UpdateAuras",ReleaseAllAuras);
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.