View Single Post
01-09-23, 02:17 PM   #4
Vremon
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Jan 2022
Posts: 14
Originally Posted by SDPhantom View Post
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.
i recive this error on this script Usage: hooksecurefunc([table,] "function", hookfunc)
  Reply With Quote