xpbar: add option to change colors

This commit is contained in:
shagu
2020-04-06 21:08:15 +02:00
parent 32420c0800
commit c774b6f563
3 changed files with 13 additions and 3 deletions
+2
View File
@@ -509,6 +509,8 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("panel", "xp", "xp_mode", "VERTICAL")
pfUI:UpdateConfig("panel", "xp", "xp_anchor", "pfChatLeft")
pfUI:UpdateConfig("panel", "xp", "xp_position", "RIGHT")
pfUI:UpdateConfig("panel", "xp", "xp_color", ".25,.25,1,1")
pfUI:UpdateConfig("panel", "xp", "rest_color", "1,.25,1,.5")
pfUI:UpdateConfig("panel", "xp", "rep_always", "0")
pfUI:UpdateConfig("panel", "xp", "rep_timeout", "5")
+4
View File
@@ -1968,6 +1968,10 @@ pfUI:RegisterModule("gui", "vanilla:tbc", function ()
CreateConfig(U["xpbar"], T["Orientation"], C.panel.xp, "xp_mode", "dropdown", pfUI.gui.dropdowns.orientation)
CreateConfig(U["xpbar"], T["Frame Anchor"], C.panel.xp, "xp_anchor", "dropdown", pfUI.gui.dropdowns.xpanchors)
CreateConfig(U["xpbar"], T["Aligned Position"], C.panel.xp, "xp_position", "dropdown", pfUI.gui.dropdowns.xp_position)
CreateConfig(nil, T["Colors"], nil, nil, "header")
CreateConfig(U["xpbar"], T["Experience Color"], C.panel.xp, "xp_color", "color")
CreateConfig(U["xpbar"], T["Rested Color"], C.panel.xp, "rest_color", "color")
end)
CreateGUIEntry(T["XP Bar"], T["Reputation Bar"], function()
+7 -3
View File
@@ -32,7 +32,8 @@ pfUI:RegisterModule("xpbar", "vanilla:tbc", function ()
local xp_always = C.panel.xp.xp_always == "1" and true or nil
local xp_position = C.panel.xp.xp_position
local xp_anchor = C.panel.xp.xp_anchor
local xp_color = C.panel.xp.xp_color
local rest_color = C.panel.xp.rest_color
local rep_timeout = tonumber(C.panel.xp.rep_timeout)
local rep_width = C.panel.xp.rep_width
@@ -66,7 +67,9 @@ pfUI:RegisterModule("xpbar", "vanilla:tbc", function ()
b.bar:ClearAllPoints()
b.bar:SetAllPoints(b)
b.bar:SetFrameStrata("LOW")
b.bar:SetStatusBarColor(.25,.25,1,1)
local cr, cg, cb, ca = pfUI.api.GetStringColor(xp_color)
b.bar:SetStatusBarColor(cr,cg,cb,ca)
b.bar:SetMinMaxValues(0, 100)
b.bar:SetOrientation(mode)
b.bar:SetValue(0)
@@ -76,7 +79,8 @@ pfUI:RegisterModule("xpbar", "vanilla:tbc", function ()
b.restedbar:ClearAllPoints()
b.restedbar:SetAllPoints(b)
b.restedbar:SetFrameStrata("MEDIUM")
b.restedbar:SetStatusBarColor(1,.25,1,.5)
local cr, cg, cb, ca = pfUI.api.GetStringColor(rest_color)
b.restedbar:SetStatusBarColor(cr,cg,cb,ca)
b.restedbar:SetMinMaxValues(0, 100)
b.restedbar:SetOrientation(mode)
b.restedbar:SetValue(0)