Add Tank Bar Color option.

This commit is contained in:
Xinhuan
2008-10-29 22:16:48 +08:00
parent 1eb3dbd14a
commit 5845422112
8 changed files with 58 additions and 7 deletions
+30 -7
View File
@@ -126,6 +126,8 @@ local defaults = {
ShowValue = true,
UseClassColors = true,
BarColor = {r = 1, g = 0, b = 0, a = 1,},
UseTankBarColor = true,
TankBarColor = {r = 1, g = 0, b = 0, a = 1,},
},
ShowWith = {
Pet = true,
@@ -1319,13 +1321,11 @@ function Omen:UpdateBars()
else
bar.Text2:SetFormattedText("%d%%", tankThreat == 0 and 0 or threat / tankThreat * 100)
end
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 c = (guid == myGUID and dbBar.UseMyBarColor and dbBar.MyBarColor) or
(guid == tankGUID and dbBar.UseTankBarColor and dbBar.TankBarColor) or
(dbBar.UseClassColors and (RAID_CLASS_COLORS[class] or (class == "PET" and pet_color))) or
dbBar.BarColor
bar.texture:SetVertexColor(c.r, c.g, c.b, c.a or 1)
local width = w * threat / topthreat
if width == 0 then width = 1 end
if dbBar.AnimateBars and self.Anchor.IsMovingOrSizing ~= 2 then
@@ -2077,6 +2077,29 @@ local options = {
end,
disabled = function() return not db.Bar.UseMyBarColor end,
},
UseTankBarColor = {
type = "toggle",
order = 15,
name = L["Use Tank Bar color"],
desc = L["Use a different colored background for the tank's threat bar in Omen"],
},
TankBarColor = {
type = "color",
order = 16,
name = L["Tank Bar Color"],
desc = L["The background color for your tank's threat bar"],
hasAlpha = true,
get = function(info)
local t = db.Bar.TankBarColor
return t.r, t.g, t.b, t.a
end,
set = function(info, r, g, b, a)
local t = db.Bar.TankBarColor
t.r, t.g, t.b, t.a = r, g, b, a
Omen:UpdateBars()
end,
disabled = function() return not db.Bar.UseTankBarColor end,
},
UseClassColors = {
type = "toggle",
order = 17,