Add option to not use class colors and instead use a common color for all bars.

This commit is contained in:
Xinhuan
2008-10-29 00:48:43 +08:00
parent 120abe4fbc
commit bf32177063
8 changed files with 63 additions and 11 deletions
+4
View File
@@ -136,6 +136,10 @@ L["Use 'My Bar' color"] = true
L["Use a different colored background for your threat bar in Omen"] = true
L["'My Bar' BG Color"] = true
L["The background color for your threat bar"] = true
L["Use Class Colors"] = true
L["Use standard class colors for the background color of threat bars"] = true
L["Bar BG Color"] = true
L["The background color for all threat bars"] = true
L["Bar Label Options"] = "Optionen für die Beschriftung der Balken"
L["Font"] = "Schriftart"
L["The font that the labels will use"] = "Die Schriftart die die Balken benutzen"
+4
View File
@@ -136,6 +136,10 @@ L["Use 'My Bar' color"] = true
L["Use a different colored background for your threat bar in Omen"] = true
L["'My Bar' BG Color"] = true
L["The background color for your threat bar"] = true
L["Use Class Colors"] = true
L["Use standard class colors for the background color of threat bars"] = true
L["Bar BG Color"] = true
L["The background color for all threat bars"] = true
L["Bar Label Options"] = true
L["Font"] = true
L["The font that the labels will use"] = true
+4
View File
@@ -136,6 +136,10 @@ L["Use 'My Bar' color"] = true
L["Use a different colored background for your threat bar in Omen"] = true
L["'My Bar' BG Color"] = true
L["The background color for your threat bar"] = true
L["Use Class Colors"] = true
L["Use standard class colors for the background color of threat bars"] = true
L["Bar BG Color"] = true
L["The background color for all threat bars"] = true
L["Bar Label Options"] = "Opciones de Etiqueta de Barra"
L["Font"] = "Fuente"
L["The font that the labels will use"] = "El fuente que las etiquetas usarán"
+4
View File
@@ -136,6 +136,10 @@ L["Use 'My Bar' color"] = true
L["Use a different colored background for your threat bar in Omen"] = true
L["'My Bar' BG Color"] = true
L["The background color for your threat bar"] = true
L["Use Class Colors"] = true
L["Use standard class colors for the background color of threat bars"] = true
L["Bar BG Color"] = true
L["The background color for all threat bars"] = true
L["Bar Label Options"] = "Options des labels des barres"
L["Font"] = "Police d'écriture"
L["The font that the labels will use"] = "La police d'écriture que les labels utiliseront."
+4
View File
@@ -136,6 +136,10 @@ L["Use 'My Bar' color"] = "'플레이어 바'에 색상 사용"
L["Use a different colored background for your threat bar in Omen"] = "Omen에서 플레이어(당신)의 바에 다른 색상을 사용합니다. "
L["'My Bar' BG Color"] = "'플레이어 바'의 배경 색상"
L["The background color for your threat bar"] = "플레이어(당신)의 바에 대한 배경색을 지정합니다."
L["Use Class Colors"] = true
L["Use standard class colors for the background color of threat bars"] = true
L["Bar BG Color"] = true
L["The background color for all threat bars"] = true
L["Bar Label Options"] = "바 라벨 옵션"
L["Font"] = "글꼴"
L["The font that the labels will use"] = "라벨에 사용할 글꼴을 설정합니다."
+4
View File
@@ -136,6 +136,10 @@ L["Use 'My Bar' color"] = "使用“My Bar”颜色"
L["Use a different colored background for your threat bar in Omen"] = "在 Omen 中为仇恨计量条使用不同的背景颜色"
L["'My Bar' BG Color"] = "“My Bar”背景颜色"
L["The background color for your threat bar"] = "仇恨计量条的背景颜色"
L["Use Class Colors"] = true
L["Use standard class colors for the background color of threat bars"] = true
L["Bar BG Color"] = true
L["The background color for all threat bars"] = true
L["Bar Label Options"] = "计量条标签选项"
L["Font"] = "字体"
L["The font that the labels will use"] = "标签字体"
+4
View File
@@ -136,6 +136,10 @@ L["Use 'My Bar' color"] = "使用'我的長條棒'顏色"
L["Use a different colored background for your threat bar in Omen"] = "Omen中自己的仇恨條背景使用不同顏色顯示"
L["'My Bar' BG Color"] = "我的長條棒的背景顏色"
L["The background color for your threat bar"] = "自己的仇恨條的背景顏色"
L["Use Class Colors"] = true
L["Use standard class colors for the background color of threat bars"] = true
L["Bar BG Color"] = true
L["The background color for all threat bars"] = true
L["Bar Label Options"] = "長條棒標籤選項"
L["Font"] = "字體"
L["The font that the labels will use"] = "標籤字體"
+35 -11
View File
@@ -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,