From aaa3a584aa3137574ed59d584becf30b33e6ac66 Mon Sep 17 00:00:00 2001 From: shagu Date: Mon, 7 Apr 2025 09:20:33 +0200 Subject: [PATCH] nameplates: add option to disable infight text color --- api/config.lua | 2 +- modules/gui.lua | 1 + modules/nameplates.lua | 12 +++++++++--- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/api/config.lua b/api/config.lua index 0d57d2f3..9b252f76 100644 --- a/api/config.lua +++ b/api/config.lua @@ -717,7 +717,7 @@ function pfUI:LoadConfig() pfUI:UpdateConfig("nameplates", nil, "raidiconoffy", "-5") pfUI:UpdateConfig("nameplates", nil, "fullhealth", "1") pfUI:UpdateConfig("nameplates", nil, "target", "1") - + pfUI:UpdateConfig("nameplates", nil, "namefightcolor", "1") pfUI:UpdateConfig("nameplates", nil, "enemynpc", "0") pfUI:UpdateConfig("nameplates", nil, "enemyplayer", "0") pfUI:UpdateConfig("nameplates", nil, "neutralnpc", "0") diff --git a/modules/gui.lua b/modules/gui.lua index 84c099c1..28f24a57 100644 --- a/modules/gui.lua +++ b/modules/gui.lua @@ -2227,6 +2227,7 @@ pfUI:RegisterModule("gui", "vanilla:tbc", function () CreateConfig(U["nameplates"], T["Inactive Nameplate Alpha"], C.nameplates, "notargalpha", "dropdown", pfUI.gui.dropdowns.percent_small) CreateConfig(U["nameplates"], T["Draw Glow Around Target Nameplate"], C.nameplates, "targetglow", "checkbox") CreateConfig(U["nameplates"], T["Glow Color Around Target Nameplate"], C.nameplates, "glowcolor", "color") + CreateConfig(U["nameplates"], T["Red Name Text On Infight Units"], C.nameplates, "namefightcolor", "checkbox") CreateConfig(U["nameplates"], T["Zoom Target Nameplate"], C.nameplates, "targetzoom", "checkbox") CreateConfig(U["nameplates"], T["Target Nameplate Zoom Factor"], C.nameplates, "targetzoomval", "dropdown", pfUI.gui.dropdowns.percent_small) CreateConfig(U["nameplates"], T["Nameplate Width"], C.nameplates, "width") diff --git a/modules/nameplates.lua b/modules/nameplates.lua index 1fbeac6f..58c3327b 100644 --- a/modules/nameplates.lua +++ b/modules/nameplates.lua @@ -855,6 +855,7 @@ pfUI:RegisterModule("nameplates", "vanilla:tbc", function () local name = original.name:GetText() local target = UnitExists("target") and frame:GetAlpha() == 1 or nil local mouseover = UnitExists("mouseover") and original.glow:IsShown() or nil + local namefightcolor = C.nameplates.namefightcolor == "1" -- trigger queued event update if nameplate.eventcache then @@ -909,10 +910,15 @@ pfUI:RegisterModule("nameplates", "vanilla:tbc", function () local r, g, b = original.name:GetTextColor() if r + g + b ~= nameplate.cache.namecolor then nameplate.cache.namecolor = r + g + b - if r > .9 and g < .2 and b < .2 then - nameplate.name:SetTextColor(1,0.4,0.2,1) -- infight + + if namefightcolor then + if r > .9 and g < .2 and b < .2 then + nameplate.name:SetTextColor(1,0.4,0.2,1) -- infight + else + nameplate.name:SetTextColor(r,g,b,1) + end else - nameplate.name:SetTextColor(r,g,b,1) + nameplate.name:SetTextColor(1,1,1,1) end update = true end