Skip to content

Commit

Permalink
colors: Update stagger logic to upstream (#660)
Browse files Browse the repository at this point in the history
  • Loading branch information
p3lim authored Nov 7, 2023
1 parent f987d20 commit 5999425
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions colors.lua
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,23 @@ for eclass, color in next, _G.FACTION_BAR_COLORS do
colors.reaction[eclass] = oUF:CreateColor(color.r, color.g, color.b)
end

local staggerIndices = {
green = 1,
yellow = 2,
red = 3,
}

for power, color in next, PowerBarColor do
if (type(power) == 'string') then
if(type(select(2, next(color))) == 'table') then
-- special handling for stagger
colors.power[power] = {}

for index, color_ in next, color do
colors.power[power][index] = oUF:CreateColor(color_.r, color_.g, color_.b)
for name, color_ in next, color do
local index = staggerIndices[name]
if(index) then
colors.power[power][index] = oUF:CreateColor(color_.r, color_.g, color_.b)
end
end
else
colors.power[power] = oUF:CreateColor(color.r, color.g, color.b)
Expand Down

0 comments on commit 5999425

Please sign in to comment.