View Single Post
01-01-23, 06:21 AM   #3
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,304
A lot has changed with how the TargetFrame shows auras.

Lua Code:
  1. local function TargetFrame_UpdateAuras(self)
  2.     if UnitIsEnemy("player",self.unit) then
  3.         for buff in self.auraPools:GetPool("TargetBuffFrameTemplate"):EnumerateActive() do
  4.             local data=C_UnitAuras.GetAuraDataByAuraInstanceID(buff.unit,buff.auraInstanceID);
  5.             buff.Stealable:SetShown(data.isStealable or data.dispelName=="Magic");
  6.         end
  7.     end
  8. end
  9.  
  10. hooksecurefunc(TargetFrame,"UpdateAuras",TargetFrame_UpdateAuras);
  11. hooksecurefunc(FocusFrame,"UpdateAuras",TargetFrame_UpdateAuras);

First to note, most of TargetFrame's functions were moved to a mixin. This is basically a table that is copied when inherited. The buff/debuff frames are now allocated by frame pools that provide a different way to iterate over them. Lastly, using .auraInstanceID, we can use the new C_UnitAuras.GetAuraDataByAuraInstanceID() to query the buff each individual button is assigned to.
__________________
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 : 01-09-23 at 09:41 PM.
  Reply With Quote