From 093d4aab15e684df06f7283684f4c9af1de2bc29 Mon Sep 17 00:00:00 2001 From: shagu Date: Sun, 12 Jul 2020 11:14:41 +0200 Subject: [PATCH] nameplates: add option to set highlight color --- api/config.lua | 1 + modules/gui.lua | 1 + modules/nameplates.lua | 4 +++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/api/config.lua b/api/config.lua index 55a8e1eb..e4a8c57a 100644 --- a/api/config.lua +++ b/api/config.lua @@ -653,6 +653,7 @@ function pfUI:LoadConfig() pfUI:UpdateConfig("nameplates", nil, "heightcast", "8") pfUI:UpdateConfig("nameplates", nil, "cpdisplay", "0") pfUI:UpdateConfig("nameplates", nil, "targethighlight", "0") + pfUI:UpdateConfig("nameplates", nil, "highlightcolor", "1,1,1,1") pfUI:UpdateConfig("nameplates", nil, "targetglow", "1") pfUI:UpdateConfig("nameplates", nil, "glowcolor", "1,1,1,1") pfUI:UpdateConfig("nameplates", nil, "targetzoom", "0") diff --git a/modules/gui.lua b/modules/gui.lua index 7f443f00..92c4ab68 100644 --- a/modules/gui.lua +++ b/modules/gui.lua @@ -2086,6 +2086,7 @@ pfUI:RegisterModule("gui", "vanilla:tbc", function () CreateConfig(U["nameplates"], T["Show On Friendly Units"], C.nameplates, "showfriendly", "checkbox") CreateConfig(U["nameplates"], T["Inactive Nameplate Alpha"], C.nameplates, "notargalpha", "dropdown", pfUI.gui.dropdowns.percent_small) CreateConfig(U["nameplates"], T["Draw Border Around Target Nameplate"], C.nameplates, "targethighlight", "checkbox") + CreateConfig(U["nameplates"], T["Border Color Around Target Nameplate"], C.nameplates, "highlightcolor", "color") 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["Zoom Target Nameplate"], C.nameplates, "targetzoom", "checkbox") diff --git a/modules/nameplates.lua b/modules/nameplates.lua index 45eaabe1..24227d02 100644 --- a/modules/nameplates.lua +++ b/modules/nameplates.lua @@ -339,6 +339,7 @@ pfUI:RegisterModule("nameplates", "vanilla:tbc", function () local font_size = C.nameplates.use_unitfonts == "1" and C.global.font_unit_size or C.global.font_size local font_style = C.nameplates.name.fontstyle local glowr, glowg, glowb, glowa = GetStringColor(C.nameplates.glowcolor) + local hlr, hlg, hlb, hla = GetStringColor(C.nameplates.highlightcolor) local hptexture = pfUI.media[C.nameplates.healthtexture] local rawborder, default_border = GetBorderSize("nameplates") @@ -361,6 +362,7 @@ pfUI:RegisterModule("nameplates", "vanilla:tbc", function () nameplate.health:SetStatusBarTexture(hptexture) nameplate.health:SetWidth(C.nameplates.width) nameplate.health:SetHeight(C.nameplates.heighthealth) + nameplate.health.hlr, nameplate.health.hlg, nameplate.health.hlb, nameplate.health.hla = hlr, hlg, hlb, hla CreateBackdrop(nameplate.health, default_border) nameplate.health.text:SetFont(font, font_size - 2, "OUTLINE") @@ -459,7 +461,7 @@ pfUI:RegisterModule("nameplates", "vanilla:tbc", function () -- target indicator if target and C.nameplates.targethighlight == "1" then - plate.health.backdrop:SetBackdropBorderColor(1,1,1,1) + plate.health.backdrop:SetBackdropBorderColor(plate.health.hlr, plate.health.hlg, plate.health.hlb, plate.health.hla) else plate.health.backdrop:SetBackdropBorderColor(er,eg,eb,ea) end