Add option to change the Pet Color.

This commit is contained in:
Xinhuan
2008-11-03 07:21:14 +08:00
parent dbe3740447
commit c6d780f9df
9 changed files with 43 additions and 16 deletions
+27 -16
View File
@@ -138,6 +138,7 @@ local defaults = {
AlwaysShowSelf = true,
ShowAggroBar = true,
AggroBarColor = {r = 1, g = 0, b = 0, a = 1,},
PetBarColor = {r = 0.83, g = 0.98, b = 0.74, a = 1},
},
ShowWith = {
UseShowWith = true,
@@ -186,13 +187,6 @@ Omen.Timers = timers
Omen.Bars = bars
setmetatable(guidNameLookup, {__index = function(self, guid) return L["<Unknown>"] end})
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
b = 0.74,
a = 0.6
}
-- For speedups. Rather than concantenating every time we need a unitID, we just look
-- it up instead. That is rID[i] is much faster than format("raid%d", i) or "raid"..i
local pID = {}
@@ -1447,7 +1441,7 @@ function Omen:UpdateBars()
local c = (guid == myGUID and dbBar.UseMyBarColor and dbBar.MyBarColor) or
(guid == tankGUID and dbBar.UseTankBarColor and dbBar.TankBarColor) or
(guid == "AGGRO" and dbBar.AggroBarColor) or
(dbBar.UseClassColors and (RAID_CLASS_COLORS[class] or (class == "PET" and pet_color))) or
(dbBar.UseClassColors and (RAID_CLASS_COLORS[class] or (class == "PET" and dbBar.PetBarColor))) or
dbBar.BarColor
bar.texture:SetVertexColor(c.r, c.g, c.b, c.a or 1)
@@ -2390,9 +2384,32 @@ local options = {
name = L["Use Class Colors"],
desc = L["Use standard class colors for the background color of threat bars"],
},
BarColor = {
PetBarColor = {
type = "color",
order = 21,
name = L["Pet Bar Color"],
desc = L["The background color for pets"],
hasAlpha = true,
get = function(info)
local t = db.Bar.PetBarColor
return t.r, t.g, t.b, t.a
end,
set = function(info, r, g, b, a)
local t = db.Bar.PetBarColor
t.r, t.g, t.b, t.a = r, g, b, a
Omen:UpdateBars()
end,
disabled = function() return not db.Bar.UseClassColors end,
},
AlwaysShowSelf = {
type = "toggle",
order = 26,
name = L["Always Show Self"],
desc = L["Always show your threat bar on Omen (ignores class filter settings), showing your bar on the last row if necessary"],
},
BarColor = {
type = "color",
order = 27,
name = L["Bar BG Color"],
desc = L["The background color for all threat bars"],
hasAlpha = true,
@@ -2407,15 +2424,9 @@ local options = {
end,
disabled = function() return db.Bar.UseClassColors end,
},
AlwaysShowSelf = {
type = "toggle",
order = 24,
name = L["Always Show Self"],
desc = L["Always show your threat bar on Omen (ignores class filter settings), showing your bar on the last row if necessary"],
},
Texture = {
type = "select", dialogControl = 'LSM30_Statusbar',
order = 25,
order = 29,
name = L["Bar Texture"],
desc = L["The texture that the bar will use"],
values = AceGUIWidgetLSMlists.statusbar,