Square- and BorderIndicator now use trigger data for changing color
If the field color is supplied from trigger data, these indicators will now change their color. Currently this change is permanent and not bound to the trigger.
This commit is contained in:
@@ -70,10 +70,20 @@ end
|
||||
--- Show the square indicator.
|
||||
---@param data table
|
||||
function BorderIndicator:Show(data)
|
||||
if data.color then
|
||||
self.color = data.color
|
||||
end
|
||||
local frame, stacks = self:GetFrame()
|
||||
frame:Show()
|
||||
end
|
||||
|
||||
|
||||
function BorderIndicator:Update(data)
|
||||
if data.color then
|
||||
self:SetColor(data.color)
|
||||
end
|
||||
end
|
||||
|
||||
function BorderIndicator:GetFrame()
|
||||
local frame, new = borderPool:Acquire()
|
||||
if new then
|
||||
|
@@ -77,7 +77,11 @@ function SquareIndicator:Show(data)
|
||||
stacks:SetText(numStacks)
|
||||
stacks:Show()
|
||||
end
|
||||
frame:SetBackdropColor(unpack(self.color))
|
||||
if data.color then
|
||||
self:SetColor(data.color)
|
||||
else
|
||||
frame:SetBackdropColor(unpack(self.color))
|
||||
end
|
||||
frame:Show()
|
||||
end
|
||||
|
||||
@@ -110,6 +114,9 @@ end
|
||||
|
||||
---@param data table
|
||||
function SquareIndicator:Update(data)
|
||||
if data.color then
|
||||
self:SetColor(data.color)
|
||||
end
|
||||
local numStacks = data.stacks or 0
|
||||
if numStacks > 0 then
|
||||
self.stacks:SetText(numStacks)
|
||||
|
Reference in New Issue
Block a user