From 48d3340b178539c2d83bada544a9fa4a61bd9339 Mon Sep 17 00:00:00 2001 From: shagu Date: Sun, 15 Nov 2020 17:11:14 +0100 Subject: [PATCH] nameplates: option to draw colored reaction border --- api/config.lua | 9 +++++++-- modules/gui.lua | 10 ++++++++-- modules/nameplates.lua | 8 ++++++++ 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/api/config.lua b/api/config.lua index b1ff8aec..5a4d178d 100644 --- a/api/config.lua +++ b/api/config.lua @@ -651,6 +651,13 @@ function pfUI:LoadConfig() pfUI:UpdateConfig("nameplates", nil, "totems", "1") pfUI:UpdateConfig("nameplates", nil, "totemicons", "0") + pfUI:UpdateConfig("nameplates", nil, "outfriendly", "0") + pfUI:UpdateConfig("nameplates", nil, "outfriendlynpc", "1") + pfUI:UpdateConfig("nameplates", nil, "outneutral", "1") + pfUI:UpdateConfig("nameplates", nil, "outenemy", "1") + pfUI:UpdateConfig("nameplates", nil, "targethighlight", "0") + pfUI:UpdateConfig("nameplates", nil, "highlightcolor", "1,1,1,1") + pfUI:UpdateConfig("nameplates", nil, "showhp", "0") pfUI:UpdateConfig("nameplates", nil, "alwaysperc", "0") pfUI:UpdateConfig("nameplates", nil, "vpos", "-10") @@ -659,8 +666,6 @@ function pfUI:LoadConfig() pfUI:UpdateConfig("nameplates", nil, "heighthealth", "8") 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 006fba78..cc3a32ad 100644 --- a/modules/gui.lua +++ b/modules/gui.lua @@ -2103,8 +2103,6 @@ pfUI:RegisterModule("gui", "vanilla:tbc", function () CreateConfig(U["nameplates"], T["Show On Hostile Units"], C.nameplates, "showhostile", "checkbox") 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") @@ -2137,6 +2135,14 @@ pfUI:RegisterModule("gui", "vanilla:tbc", function () CreateConfig(U["nameplates"], T["Blacklist"], C.nameplates.debuffs, "blacklist", "list") CreateConfig(U["nameplates"], T["Whitelist"], C.nameplates.debuffs, "whitelist", "list") + CreateConfig(nil, T["Outlines"], nil, nil, "header") + CreateConfig(U["nameplates"], T["Blue Border On Friendly Players"], C.nameplates, "outfriendly", "checkbox") + CreateConfig(U["nameplates"], T["Green Border On Friendly NPCs"], C.nameplates, "outfriendlynpc", "checkbox") + CreateConfig(U["nameplates"], T["Yellow Border On Neutral Units"], C.nameplates, "outneutral", "checkbox") + CreateConfig(U["nameplates"], T["Red Border On Enemy Units"], C.nameplates, "outenemy", "checkbox") + CreateConfig(U["nameplates"], T["Border Around Target Unit"], C.nameplates, "targethighlight", "checkbox") + CreateConfig(U["nameplates"], T["Border Color Around Target Unit"], C.nameplates, "highlightcolor", "color") + CreateConfig(nil, T["Healthbar"], nil, nil, "header") CreateConfig(U["nameplates"], T["Healthbar Vertical Offset"], C.nameplates.health, "offset") CreateConfig(U["nameplates"], T["Healthbar Height"], C.nameplates, "heighthealth") diff --git a/modules/nameplates.lua b/modules/nameplates.lua index f63cb0d1..c62f7450 100644 --- a/modules/nameplates.lua +++ b/modules/nameplates.lua @@ -499,6 +499,14 @@ pfUI:RegisterModule("nameplates", "vanilla:tbc", function () -- target indicator if target and C.nameplates.targethighlight == "1" then plate.health.backdrop:SetBackdropBorderColor(plate.health.hlr, plate.health.hlg, plate.health.hlb, plate.health.hla) + elseif C.nameplates.outfriendlynpc == "1" and unittype == "FRIENDLY_NPC" then + plate.health.backdrop:SetBackdropBorderColor(.2,.7,.3,1) + elseif C.nameplates.outfriendly == "1" and unittype == "FRIENDLY_PLAYER" then + plate.health.backdrop:SetBackdropBorderColor(.2,.3,.7,1) + elseif C.nameplates.outneutral == "1" and strfind(unittype, "NEUTRAL") then + plate.health.backdrop:SetBackdropBorderColor(.7,.7,.2,1) + elseif C.nameplates.outenemy == "1" and strfind(unittype, "ENEMY") then + plate.health.backdrop:SetBackdropBorderColor(.7,.3,.2,1) else plate.health.backdrop:SetBackdropBorderColor(er,eg,eb,ea) end