View Single Post
01-28-16, 07:18 PM   #11
Clamsoda
A Frostmaul Preserver
Join Date: Nov 2011
Posts: 269
This is a quick re-hash of the old code and seems to work for me.

The FocusFrame's buff handling piggybacks off of TargetFrame_UpdateAuras by being passed into the function as the self argument. My code identifies the name of the frame that self is referring to, and uses that to look up the appropriate icon frame to hide.

Simple enough, this has been happening in the background of this script the entire time, there has just been no work done to the FocusFrame's buff icons.

Lua Code:
  1. hooksecurefunc("TargetFrame_UpdateAuras", function(self)
  2.     for i = 1, MAX_TARGET_BUFFS do
  3.         local _, _, icon, _, dispelType = UnitBuff(self.unit, i)
  4.  
  5.         if (icon and (not self.maxBuffs or i <= self.maxBuffs) ) then
  6.             if (dispelType ~= "Magic") then
  7.                 _G[self:GetName().."Buff"..i]:Hide()
  8.             end
  9.         end
  10.     end
  11. end)

Last edited by Clamsoda : 01-28-16 at 07:30 PM.
  Reply With Quote