Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

colors: Update color fetching #667

Merged
merged 1 commit into from Jan 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 11 additions & 7 deletions colors.lua
Expand Up @@ -144,21 +144,25 @@ local staggerIndices = {

for power, color in next, PowerBarColor do
if (type(power) == 'string') then
if(type(select(2, next(color))) == 'table') then
if(color.r) then
colors.power[power] = oUF:CreateColor(color.r, color.g, color.b)

if(color.atlas) then
colors.power[power]:SetAtlas(color.atlas)
end
else
-- special handling for stagger
colors.power[power] = {}

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)

if(color.atlas) then
colors.power[power]:SetAtlas(color.atlas)
if(color_.atlas) then
colors.power[power][index]:SetAtlas(color_.atlas)
end
end
end
end
end
Expand Down