Rework the way triggers and indicators work
Triggers are now a link between link between a datasource (for now only AuraList) and an indicator (for now only SquareIndicator).
This commit is contained in:
@@ -18,7 +18,8 @@ local omif = select(2, ...)
|
||||
local types = omif.GetModule("types")
|
||||
local StatusBar = types.StatusBar
|
||||
local AuraList = types.AuraList
|
||||
local Indicator = types.Indicator
|
||||
local SquareIndicator = types.SquareIndicator
|
||||
local AuraTrigger = types.AuraTrigger
|
||||
|
||||
types.UnitFrame = types.CreateClass("UnitFrame")
|
||||
local UnitFrame = types.UnitFrame
|
||||
@@ -59,11 +60,29 @@ function UnitFrame:Init(unit, width, height, hideInRaid)
|
||||
overlays:Show()
|
||||
self.overlays = overlays
|
||||
self:CreateName()
|
||||
self.indicators = {
|
||||
Indicator:new(self, self.auras, 14, "TOPLEFT", 2, -2, colors.white, 383648),
|
||||
Indicator:new(self, self.auras, 14, "TOPLEFT", 2, -2, colors.white, 974),
|
||||
Indicator:new(self, self.auras, 14, "BOTTOMLEFT", 2, 2, colors.cyan, 61295)
|
||||
}
|
||||
|
||||
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:RegisterEvents()
|
||||
self:Enable()
|
||||
end
|
||||
@@ -143,7 +162,7 @@ function UnitFrame:PrepareWheelBinds()
|
||||
self:SetBindingClick(false, "ALT-MOUSEWHEELUP", "BUTTONNAME", "alt-wheel-up")
|
||||
self:SetBindingClick(false, "ALT-MOUSEWHEELDOWN", "BUTTONNAME", "alt-wheel-down")
|
||||
]]):gsub("BUTTONNAME", "OmicronSecureFrame" .. self.unit)
|
||||
|
||||
|
||||
local removeBindScript = [[
|
||||
self:ClearBindings()
|
||||
]]
|
||||
@@ -297,7 +316,7 @@ function UnitFrame:UNIT_HEALTH()
|
||||
self:UpdateAll(true)
|
||||
return
|
||||
end
|
||||
self:UpdateHealth()
|
||||
self:UpdateHealth()
|
||||
self:UpdateHealthColor()
|
||||
end
|
||||
|
||||
@@ -306,7 +325,7 @@ function UnitFrame:UNIT_MAXHEALTH()
|
||||
self:UpdateAll(true)
|
||||
return
|
||||
end
|
||||
self:UpdateHealth()
|
||||
self:UpdateHealth()
|
||||
self:UpdateHealthColor()
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user