A lot has changed with how the
TargetFrame shows auras.
Lua Code:
local function TargetFrame_UpdateAuras(self)
if UnitIsEnemy("player",self.unit) then
for buff in self.auraPools:GetPool("TargetBuffFrameTemplate"):EnumerateActive() do
local data=C_UnitAuras.GetAuraDataByAuraInstanceID(buff.unit,buff.auraInstanceID);
buff.Stealable:SetShown(data.isStealable or data.dispelName=="Magic");
end
end
end
hooksecurefunc(TargetFrame,"UpdateAuras",TargetFrame_UpdateAuras);
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.