From 5999425951e4c37b46f56b02ebc9546488c69a23 Mon Sep 17 00:00:00 2001 From: Adrian L Lange Date: Tue, 7 Nov 2023 16:09:14 +0100 Subject: [PATCH] colors: Update stagger logic to upstream (#660) --- colors.lua | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/colors.lua b/colors.lua index 177c7885..3cf23453 100644 --- a/colors.lua +++ b/colors.lua @@ -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)