Skip to content

Commit

Permalink
Recolor when capped option
Browse files Browse the repository at this point in the history
  • Loading branch information
d87 committed Dec 28, 2023
1 parent 865e2cc commit 1380950
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion NugEnergy.lua
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ local defaults = {
height = 30,
normalColor = { 0.9, 0.1, 0.1 }, --1
altColor = { 0.9, 0.168, 0.43 }, -- for dispatch and meta 2
useMaxColor = true,
maxColor = { 131/255, 0.2, 0.2 }, --max color 3
lowColor = { 141/255, 31/255, 62/255 }, --low color 4
enableColorByPowerType = false,
Expand Down Expand Up @@ -986,6 +987,9 @@ function NugEnergy:SetNormalColor()
lowColor = NugEnergy.db.profile.lowColor
maxColor = NugEnergy.db.profile.maxColor
end
if not NugEnergy.db.profile.useMaxColor then
maxColor = normalColor
end
end

function NugEnergy:Resize()
Expand Down Expand Up @@ -1875,13 +1879,25 @@ function NugEnergy:CreateGUI()
ColorByPowerType = {
name = L"Color by Power Type",
type = "toggle",
width = "full",
order = 1.1,
get = function(info) return NugEnergy.db.profile.enableColorByPowerType end,
set = function(info, v)
NugEnergy.db.profile.enableColorByPowerType = not NugEnergy.db.profile.enableColorByPowerType
NugEnergy:SetNormalColor()
end
},
useMaxColor = {
name = L"Recolor when Capped",
type = "toggle",
width = "full",
order = 1.11,
get = function(info) return NugEnergy.db.profile.useMaxColor end,
set = function(info, v)
NugEnergy.db.profile.useMaxColor = not NugEnergy.db.profile.useMaxColor
NugEnergy:SetNormalColor()
end
},
customColorGroup = {
type = "group",
name = "Custom Power Colors",
Expand Down Expand Up @@ -2270,7 +2286,7 @@ function NugEnergy:CreateGUI()
specsTable["conf"..specIndex] = {
name = "",
-- width = 1.5,
width = 3.0,
width = 3.2,
type = "select",
values = NugEnergy:GetAvailableConfigsForSpec(specIndex),
get = function(info) return NugEnergy.db.global.classConfig[class][specIndex] end,
Expand Down

0 comments on commit 1380950

Please sign in to comment.