Allow triggers/indicators to be configured.
Also adds priest test config and expands shaman test config.
This commit is contained in:
@@ -73,32 +73,45 @@ function UnitFrame:Init(unit, config)
|
||||
self.overlays = overlays
|
||||
self:CreateName()
|
||||
|
||||
self.auras:AddTrigger(
|
||||
AuraTrigger:new(
|
||||
SquareIndicator:new(self, 14, "TOPLEFT", 2, -2, colors.white),
|
||||
383648, -- Second Earthshield on self
|
||||
true
|
||||
)
|
||||
)
|
||||
self.auras:AddTrigger(
|
||||
AuraTrigger:new(
|
||||
SquareIndicator:new(self, 14, "TOPLEFT", 2, -2, colors.white),
|
||||
974, -- Earthshield
|
||||
true
|
||||
)
|
||||
)
|
||||
self.auras:AddTrigger(
|
||||
AuraTrigger:new(
|
||||
SquareIndicator:new(self, 14, "BOTTOMLEFT", 2, 2, colors.cyan),
|
||||
61295, -- Riptide
|
||||
true
|
||||
)
|
||||
)
|
||||
self:CreateTriggers(config.triggers)
|
||||
|
||||
self:RegisterEvents()
|
||||
self:Enable()
|
||||
end
|
||||
|
||||
function UnitFrame:CreateTriggers(triggers)
|
||||
for _, trigger in ipairs(triggers) do
|
||||
local kind = trigger.kind
|
||||
if kind == "AuraTrigger" then
|
||||
self.auras:AddTrigger(
|
||||
AuraTrigger:new(
|
||||
self:CreateIndicator(trigger.indicator),
|
||||
trigger.spellId,
|
||||
trigger.own,
|
||||
trigger.requiredCount,
|
||||
trigger.invert
|
||||
)
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function UnitFrame:CreateIndicator(indicator)
|
||||
local kind = indicator.kind
|
||||
if kind == "SquareIndicator" then
|
||||
return SquareIndicator:new(
|
||||
self,
|
||||
indicator.size,
|
||||
indicator.point,
|
||||
indicator.x,
|
||||
indicator.y,
|
||||
indicator.color
|
||||
)
|
||||
else
|
||||
error(string.format("Invalid Indicator kind `%s` requested", indicator.kind))
|
||||
end
|
||||
end
|
||||
|
||||
function UnitFrame:StartRangeTicker()
|
||||
if self.rangeTicker then
|
||||
return
|
||||
|
Reference in New Issue
Block a user