Thread: UnitBuff help
View Single Post
05-14-14, 05:56 AM   #9
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
Alright, get rid of the UpdateIndicators function, leave indicatorPositions and indicatorBackdrop above the Shared function, and change the "if cfg.indicators.enable then" block to this..
Lua Code:
  1. if cfg.indicators.enable then
  2.         local indicators = CreateFrame("Frame", nil ,self)
  3.         indicators:SetAllPoints(true)
  4.         indicators:EnableMouse(false)
  5.         self.indicators = indicators
  6.  
  7.         -- Build the indicators
  8.         for i = 1, #indicatorPositions do
  9.                 local position = indicatorPositions[i]
  10.                 local indicator = CreateFrame("Frame", nil, indicators)
  11.                 indicator:SetPoint(position)
  12.                 indicator:SetSize(5, 5)
  13.                 indicator:SetBackdrop(indicatorBackdrop)
  14.  
  15.                 indicator.aura = cfg.indicators["aura"..i]
  16.                 indicators[position] = indicator
  17.         end
  18.  
  19.         -- Register the event on the frame itself
  20.         self:RegisterEvent("UNIT_AURA", function(self, event, unit)
  21.             for i = 1, #indicatorPositions do
  22.                 local position = indicatorPositions[i]
  23.                 local indicator = indicators[position]
  24.                 indicator:SetShown(UnitBuff(unit, indicator.aura))
  25.             end
  26.         end)
  27. end
or possibly change "local indicator = indicators[position]" to "local indicator = self.indicators[position]" in your UpdateIndicators function, try that before you replace the whole block of code.

Last edited by semlar : 05-14-14 at 05:58 AM.
  Reply With Quote