From bf3217706318376c55b5f3f308fbfa9b07e0dc64 Mon Sep 17 00:00:00 2001 From: Xinhuan Date: Wed, 29 Oct 2008 00:48:43 +0800 Subject: [PATCH] Add option to not use class colors and instead use a common color for all bars. --- Localization/deDE.lua | 4 ++++ Localization/enUS.lua | 4 ++++ Localization/esES.lua | 4 ++++ Localization/frFR.lua | 4 ++++ Localization/koKR.lua | 4 ++++ Localization/zhCN.lua | 4 ++++ Localization/zhTW.lua | 4 ++++ Omen.lua | 46 ++++++++++++++++++++++++++++++++----------- 8 files changed, 63 insertions(+), 11 deletions(-) diff --git a/Localization/deDE.lua b/Localization/deDE.lua index 969109f..d866670 100644 --- a/Localization/deDE.lua +++ b/Localization/deDE.lua @@ -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" diff --git a/Localization/enUS.lua b/Localization/enUS.lua index c37eb83..a3e0e61 100644 --- a/Localization/enUS.lua +++ b/Localization/enUS.lua @@ -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 diff --git a/Localization/esES.lua b/Localization/esES.lua index 203e8bf..81c176d 100644 --- a/Localization/esES.lua +++ b/Localization/esES.lua @@ -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" diff --git a/Localization/frFR.lua b/Localization/frFR.lua index 5122bba..24aff5f 100644 --- a/Localization/frFR.lua +++ b/Localization/frFR.lua @@ -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." diff --git a/Localization/koKR.lua b/Localization/koKR.lua index f1a545e..e026ad8 100644 --- a/Localization/koKR.lua +++ b/Localization/koKR.lua @@ -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"] = "라벨에 사용할 글꼴을 설정합니다." diff --git a/Localization/zhCN.lua b/Localization/zhCN.lua index fcd9c0d..bea4f56 100644 --- a/Localization/zhCN.lua +++ b/Localization/zhCN.lua @@ -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"] = "标签字体" diff --git a/Localization/zhTW.lua b/Localization/zhTW.lua index 6d9668e..3b54988 100644 --- a/Localization/zhTW.lua +++ b/Localization/zhTW.lua @@ -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"] = "標籤字體" diff --git a/Omen.lua b/Omen.lua index cad78ce..8f8154d 100644 --- a/Omen.lua +++ b/Omen.lua @@ -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[""] 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,