Add option to not use class colors and instead use a common color for all bars.
This commit is contained in:
@@ -124,6 +124,8 @@ local defaults = {
|
||||
MyBarColor = {r = 1, g = 0, b = 0, a = 1,},
|
||||
ShowPercent = true,
|
||||
ShowValue = true,
|
||||
UseClassColors = true,
|
||||
BarColor = {r = 1, g = 0, b = 0, a = 1,},
|
||||
},
|
||||
ShowWith = {
|
||||
Pet = true,
|
||||
@@ -164,12 +166,6 @@ Omen.Timers = timers
|
||||
Omen.Bars = bars
|
||||
setmetatable(guidNameLookup, {__index = function(self, guid) return L["<Unknown>"] end})
|
||||
|
||||
local default_color = { -- Default bar color for units not in the player's raid/party
|
||||
r = 1,
|
||||
g = 0,
|
||||
b = 0,
|
||||
a = 1
|
||||
}
|
||||
local pet_color = { -- Default pet color for all pets in the player's raid/party
|
||||
r = 0.83, -- This is a light green-ish color, or sort of a washed out
|
||||
g = 0.98, -- version of the Hunter color
|
||||
@@ -1287,7 +1283,7 @@ function Omen:UpdateBars()
|
||||
local dbBar = db.Bar
|
||||
myGUID = UnitGUID("player")
|
||||
i = 1
|
||||
if db.Bar.ShowHeadings then
|
||||
if dbBar.ShowHeadings then
|
||||
if db.Autocollapse and i <= db.NumBars or i*dbBar.Height + (i-1)*dbBar.Spacing <= h then
|
||||
i = i + 1
|
||||
bars[0].texture:SetWidth(w)
|
||||
@@ -1323,8 +1319,13 @@ function Omen:UpdateBars()
|
||||
else
|
||||
bar.Text2:SetFormattedText("%d%%", tankThreat == 0 and 0 or threat / tankThreat * 100)
|
||||
end
|
||||
local c = (class == "PET" and pet_color) or (db.Bar.UseMyBarColor and guid == myGUID and db.Bar.MyBarColor) or RAID_CLASS_COLORS[class] or default_color
|
||||
bar.texture:SetVertexColor(c.r, c.g, c.b, c.a or 1)
|
||||
if dbBar.UseClassColors then
|
||||
local c = (class == "PET" and pet_color) or (guid == myGUID and dbBar.UseMyBarColor and dbBar.MyBarColor) or RAID_CLASS_COLORS[class] or dbBar.BarColor
|
||||
bar.texture:SetVertexColor(c.r, c.g, c.b, c.a or 1)
|
||||
else
|
||||
local c = (guid == myGUID and dbBar.UseMyBarColor and dbBar.MyBarColor) or dbBar.BarColor
|
||||
bar.texture:SetVertexColor(c.r, c.g, c.b, c.a or 1)
|
||||
end
|
||||
local width = w * threat / topthreat
|
||||
if width == 0 then width = 1 end
|
||||
if dbBar.AnimateBars and self.Anchor.IsMovingOrSizing ~= 2 then
|
||||
@@ -1338,7 +1339,7 @@ function Omen:UpdateBars()
|
||||
end
|
||||
end
|
||||
-- And hide the rest
|
||||
for j = db.Bar.ShowHeadings and i-1 or i, #bars do
|
||||
for j = dbBar.ShowHeadings and i-1 or i, #bars do
|
||||
bars[j]:Hide()
|
||||
end
|
||||
if db.Autocollapse then
|
||||
@@ -2076,9 +2077,32 @@ local options = {
|
||||
end,
|
||||
disabled = function() return not db.Bar.UseMyBarColor end,
|
||||
},
|
||||
UseClassColors = {
|
||||
type = "toggle",
|
||||
order = 17,
|
||||
name = L["Use Class Colors"],
|
||||
desc = L["Use standard class colors for the background color of threat bars"],
|
||||
},
|
||||
BarColor = {
|
||||
type = "color",
|
||||
order = 18,
|
||||
name = L["Bar BG Color"],
|
||||
desc = L["The background color for all threat bars"],
|
||||
hasAlpha = true,
|
||||
get = function(info)
|
||||
local t = db.Bar.BarColor
|
||||
return t.r, t.g, t.b, t.a
|
||||
end,
|
||||
set = function(info, r, g, b, a)
|
||||
local t = db.Bar.BarColor
|
||||
t.r, t.g, t.b, t.a = r, g, b, a
|
||||
Omen:UpdateBars()
|
||||
end,
|
||||
disabled = function() return db.Bar.UseClassColors end,
|
||||
},
|
||||
Texture = {
|
||||
type = "select", dialogControl = 'LSM30_Statusbar',
|
||||
order = 15,
|
||||
order = 19,
|
||||
name = L["Bar Texture"],
|
||||
desc = L["The texture that the bar will use"],
|
||||
values = AceGUIWidgetLSMlists.statusbar,
|
||||
|
||||
Reference in New Issue
Block a user