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:
if cfg.indicators.enable then
local indicators = CreateFrame("Frame", nil ,self)
indicators:SetAllPoints(true)
indicators:EnableMouse(false)
self.indicators = indicators
-- Build the indicators
for i = 1, #indicatorPositions do
local position = indicatorPositions[i]
local indicator = CreateFrame("Frame", nil, indicators)
indicator:SetPoint(position)
indicator:SetSize(5, 5)
indicator:SetBackdrop(indicatorBackdrop)
indicator.aura = cfg.indicators["aura"..i]
indicators[position] = indicator
end
-- Register the event on the frame itself
self:RegisterEvent("UNIT_AURA", function(self, event, unit)
for i = 1, #indicatorPositions do
local position = indicatorPositions[i]
local indicator = indicators[position]
indicator:SetShown(UnitBuff(unit, indicator.aura))
end
end)
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.