From f88be075532a54be49d49129ac470b855d9e7738 Mon Sep 17 00:00:00 2001 From: Xinhuan Date: Fri, 2 Jan 2009 10:45:34 +0800 Subject: [PATCH] Add Fade/MI Color to the options. This color is used on players under the effects of MI/Fade. --- Localization/deDE.lua | 2 ++ Localization/enUS.lua | 2 ++ Localization/esES.lua | 2 ++ Localization/frFR.lua | 2 ++ Localization/koKR.lua | 2 ++ Localization/ruRU.lua | 2 ++ Localization/zhCN.lua | 2 ++ Localization/zhTW.lua | 2 ++ Omen.lua | 35 ++++++++++++++++++++++++++++------- 9 files changed, 44 insertions(+), 7 deletions(-) diff --git a/Localization/deDE.lua b/Localization/deDE.lua index 37ab527..90e0b25 100644 --- a/Localization/deDE.lua +++ b/Localization/deDE.lua @@ -174,6 +174,8 @@ L["Use Class Colors"] = "Klassenfarben benutzen" L["Use standard class colors for the background color of threat bars"] = "Benutze die Standard Klassenfarben für den Hintergrund der Bedrohungsbalken" L["Pet Bar Color"] = "Begleiterleistenfarbe" L["The background color for pets"] = "Die Hintergrundfarbe für Begleiter" +L["Fade/MI Bar Color"] = true +L["The background color for players under the effects of Fade and Mirror Image (they will be at negative 4 million threat)"] = true L["Bar BG Color"] = "Balkenhintergrundfarbe" L["The background color for all threat bars"] = "Die Hintergrundfarbe für alle Bedrohungsbalken" L["Always Show Self"] = "Selbst immer anzeigen" diff --git a/Localization/enUS.lua b/Localization/enUS.lua index e737528..03c9a58 100644 --- a/Localization/enUS.lua +++ b/Localization/enUS.lua @@ -174,6 +174,8 @@ L["Use Class Colors"] = true L["Use standard class colors for the background color of threat bars"] = true L["Pet Bar Color"] = true L["The background color for pets"] = true +L["Fade/MI Bar Color"] = true +L["The background color for players under the effects of Fade and Mirror Image (they will be at negative 4 million threat)"] = true L["Bar BG Color"] = true L["The background color for all threat bars"] = true L["Always Show Self"] = true diff --git a/Localization/esES.lua b/Localization/esES.lua index d01fa96..471576b 100644 --- a/Localization/esES.lua +++ b/Localization/esES.lua @@ -174,6 +174,8 @@ L["Use Class Colors"] = true L["Use standard class colors for the background color of threat bars"] = true L["Pet Bar Color"] = true L["The background color for pets"] = true +L["Fade/MI Bar Color"] = true +L["The background color for players under the effects of Fade and Mirror Image (they will be at negative 4 million threat)"] = true L["Bar BG Color"] = true L["The background color for all threat bars"] = true L["Always Show Self"] = true diff --git a/Localization/frFR.lua b/Localization/frFR.lua index 9952cb2..9d7b007 100644 --- a/Localization/frFR.lua +++ b/Localization/frFR.lua @@ -174,6 +174,8 @@ L["Use Class Colors"] = "Couleurs de classe" L["Use standard class colors for the background color of threat bars"] = "Utilise les couleurs de classes standards comme couleur d'arrière-plan des barres de menace." L["Pet Bar Color"] = true L["The background color for pets"] = true +L["Fade/MI Bar Color"] = true +L["The background color for players under the effects of Fade and Mirror Image (they will be at negative 4 million threat)"] = true L["Bar BG Color"] = "Couleur A-P des barres" L["The background color for all threat bars"] = "La couleur de l'arrière-plan de toutes les barres de menace." L["Always Show Self"] = "Tj afficher soi-même" diff --git a/Localization/koKR.lua b/Localization/koKR.lua index b7914ca..3e7189b 100644 --- a/Localization/koKR.lua +++ b/Localization/koKR.lua @@ -174,6 +174,8 @@ L["Use Class Colors"] = "직업 색상 사용" L["Use standard class colors for the background color of threat bars"] = "위협 바의 배경 색상을 기본 직업 색상으로 사용합니다." L["Pet Bar Color"] = "소환수 바 색상" L["The background color for pets"] = "소환수에 대한 배경 색상을 지정합니다." +L["Fade/MI Bar Color"] = true +L["The background color for players under the effects of Fade and Mirror Image (they will be at negative 4 million threat)"] = true L["Bar BG Color"] = "배경 색상 바" L["The background color for all threat bars"] = "모든 위협 바들에 대한 배경 색상을 지정합니다." L["Always Show Self"] = "항상 자신 표시" diff --git a/Localization/ruRU.lua b/Localization/ruRU.lua index 8a55660..2078fae 100644 --- a/Localization/ruRU.lua +++ b/Localization/ruRU.lua @@ -174,6 +174,8 @@ L["Use Class Colors"] = "Цвет класса" L["Use standard class colors for the background color of threat bars"] = "Использовать стандартный цвет уласса в качестве цвета фона полосы угрозы" L["Pet Bar Color"] = "Цвет полосы питомца" L["The background color for pets"] = "Цвет фона питомцев" +L["Fade/MI Bar Color"] = true +L["The background color for players under the effects of Fade and Mirror Image (they will be at negative 4 million threat)"] = true L["Bar BG Color"] = "Цвет фона полос" L["The background color for all threat bars"] = "Цвет фона для всех полос угрозы" L["Always Show Self"] = "Всегда показ себя" diff --git a/Localization/zhCN.lua b/Localization/zhCN.lua index 5b2bd61..17c6696 100644 --- a/Localization/zhCN.lua +++ b/Localization/zhCN.lua @@ -174,6 +174,8 @@ L["Use Class Colors"] = "使用职业颜色" L["Use standard class colors for the background color of threat bars"] = "使用标准职业颜色威胁计量条背景颜色" L["Pet Bar Color"] = true L["The background color for pets"] = true +L["Fade/MI Bar Color"] = true +L["The background color for players under the effects of Fade and Mirror Image (they will be at negative 4 million threat)"] = true L["Bar BG Color"] = "计量条背景颜色" L["The background color for all threat bars"] = "所有威胁计量条背景颜色" L["Always Show Self"] = "总是显示自己" diff --git a/Localization/zhTW.lua b/Localization/zhTW.lua index 5c51a39..a5ec68e 100644 --- a/Localization/zhTW.lua +++ b/Localization/zhTW.lua @@ -174,6 +174,8 @@ L["Use Class Colors"] = "使用職業顏色" L["Use standard class colors for the background color of threat bars"] = "使用標準職業顏色威脅棒條背景顏色" L["Pet Bar Color"] = "寵物棒條顏色" L["The background color for pets"] = "寵物棒條背景顏色" +L["Fade/MI Bar Color"] = true +L["The background color for players under the effects of Fade and Mirror Image (they will be at negative 4 million threat)"] = true L["Bar BG Color"] = "棒條背景顏色" L["The background color for all threat bars"] = "所有威脅棒條背景顏色" L["Always Show Self"] = "總是顯示自己" diff --git a/Omen.lua b/Omen.lua index 0bfb090..bda9230 100644 --- a/Omen.lua +++ b/Omen.lua @@ -148,6 +148,7 @@ local defaults = { ShowAggroBar = true, AggroBarColor = {r = 1, g = 0, b = 0, a = 1,}, PetBarColor = {r = 0.77, g = 0, b = 1, a = 1}, + FadeBarColor = {r = 0.5, g = 0.5, b = 0.5, a = 1}, }, ShowWith = { UseShowWith = true, @@ -1283,6 +1284,7 @@ local lastWarn = { -- Used to store information for threat warnings } local threatStore = {} -- Format: threatStore[i] = threatTable[guid] -- used for storing past threatTables local threatStoreTime = {} -- Format: threatStoreTime[i] = GetTime() +local negativeTable = {} -- Format: negativeTable[guid] = true -- stores if someone is under the effects of Fade or Mirror Image local function sortfunction(a, b) return threatTable[a] > threatTable[b] @@ -1296,6 +1298,7 @@ local function updatethreat(unitid, mobunitid) -- Threat can be negative due to temporary threat reduction effects such as Fade and Mirror Image (-410065408). if threatValue < 0 then threatValue = threatValue + 410065408 + negativeTable[guid] = true end if threatValue > topthreat then topthreat = threatValue end if isTanking then tankGUID = guid end @@ -1404,6 +1407,7 @@ function Omen:UpdateBarsReal() threatTable = newTable() threatTable[mobGUID] = -1 tankGUID = nil + wipe(negativeTable) -- Get data for threat on mob by scanning the whole raid if inParty or inRaid then @@ -1535,7 +1539,8 @@ function Omen:UpdateBarsReal() end -- Update the color of the bar - local c = (guid == myGUID and dbBar.UseMyBarColor and dbBar.MyBarColor) or + local c = (negativeTable[guid] and dbBar.FadeBarColor) or + (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 dbBar.PetBarColor))) or @@ -2584,13 +2589,13 @@ local options = { }, UseClassColors = { type = "toggle", - order = 20, + order = 21, name = L["Use Class Colors"], desc = L["Use standard class colors for the background color of threat bars"], }, PetBarColor = { type = "color", - order = 21, + order = 22, name = L["Pet Bar Color"], desc = L["The background color for pets"], hasAlpha = true, @@ -2605,11 +2610,21 @@ local options = { end, disabled = function() return not db.Bar.UseClassColors end, }, - AlwaysShowSelf = { - type = "toggle", + FadeBarColor = { + type = "color", 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"], + name = L["Fade/MI Bar Color"], + desc = L["The background color for players under the effects of Fade and Mirror Image (they will be at negative 4 million threat)"], + hasAlpha = true, + get = function(info) + local t = db.Bar.FadeBarColor + return t.r, t.g, t.b, t.a + end, + set = function(info, r, g, b, a) + local t = db.Bar.FadeBarColor + t.r, t.g, t.b, t.a = r, g, b, a + Omen:UpdateBars() + end, }, BarColor = { type = "color", @@ -2628,6 +2643,12 @@ local options = { end, disabled = function() return db.Bar.UseClassColors end, }, + AlwaysShowSelf = { + type = "toggle", + order = 28, + 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 = 29,