Skip to content

Commit

Permalink
[Feature] Add option to change Class Bar texture
Browse files Browse the repository at this point in the history
  • Loading branch information
Krealle committed Nov 8, 2024
1 parent 376601b commit 8b2a386
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
7 changes: 7 additions & 0 deletions Data/Defaults.lua
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ Defaults.Options.fontWidth = {
---| "shieldBar"
---| "healAbsorb"
---| "unitFrames"
---| "classBar"

---@class Defaults.Colors
Defaults.Colors = {
Expand Down Expand Up @@ -205,6 +206,9 @@ Defaults.Colors = {
lossAlpha = 1,
backgroundAlpha = 1,
},
classBar = {
texture = "Interface\\Buttons\\WHITE8X8",
}
}

Defaults.ColorsMenuOrder = {
Expand Down Expand Up @@ -290,6 +294,9 @@ Defaults.ColorsMenuOrder = {
{ "barAlpha", "slider-percent" },
{ "lossAlpha", "slider-percent" },
{ "backgroundAlpha", "slider-percent" },
},
classBar = {
{ "texture", "texture" },
}
}

Expand Down
3 changes: 2 additions & 1 deletion Menu/ColorTab.lua
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ local function CreateColorPicker(which, colorName, colorTable, parent)
or which == "classResources"
or which == "comboPoints"
or which == "chi"
or which == "runes" then
or which == "runes"
or which == "classBar" then
CUF:Fire("UpdateWidget", DB.GetMasterLayout(), nil, "classBar", const.OPTION_KIND.COLOR)
else
CUF:Fire("UpdateAppearance", "color")
Expand Down
5 changes: 5 additions & 0 deletions Widgets/Bars/ClassBar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,11 @@ local function UpdateColors(self)
SetBarColor(self[i], { r, g, b, 1 })
end
end

for i = 1, self.maxPower do
self[i]:SetStatusBarTexture(DB.GetColors().classBar.texture)
self[i].bg:SetTexture(DB.GetColors().classBar.texture)
end
end

---@param self ClassBarWidget
Expand Down

0 comments on commit 8b2a386

Please sign in to comment.