nameplates: combat state border colors

* red: attacking player
* yellow: attacking other
* blue: no target (npc only)
* none: out of combat

This only works if super-wow is enabled.
This commit is contained in:
shagu
2024-09-02 16:38:44 +02:00
parent 67f366dd47
commit b8d23a0e28
3 changed files with 18 additions and 1 deletions
+1
View File
@@ -704,6 +704,7 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("nameplates", nil, "totemicons", "0")
pfUI:UpdateConfig("nameplates", nil, "showguildname", "0")
pfUI:UpdateConfig("nameplates", nil, "outcombatstate", "1")
pfUI:UpdateConfig("nameplates", nil, "outfriendly", "0")
pfUI:UpdateConfig("nameplates", nil, "outfriendlynpc", "1")
pfUI:UpdateConfig("nameplates", nil, "outneutral", "1")
+1
View File
@@ -2236,6 +2236,7 @@ pfUI:RegisterModule("gui", "vanilla:tbc", function ()
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(U["nameplates"], T["Overwrite Border Color With Combat State"], C.nameplates, "outcombatstate", "checkbox")
CreateConfig(nil, T["Healthbar"], nil, nil, "header")
CreateConfig(U["nameplates"], T["Healthbar Vertical Offset"], C.nameplates.health, "offset")
+16 -1
View File
@@ -545,7 +545,22 @@ pfUI:RegisterModule("nameplates", "vanilla:tbc", function ()
end
-- target indicator
if target and C.nameplates.targethighlight == "1" then
if superwow_active and C.nameplates.outcombatstate == "1" then
local guid = plate.parent:GetName(1) or ""
local target = guid.."target"
if UnitAffectingCombat(guid) then
if UnitIsUnit(target, "player") then
plate.health.backdrop:SetBackdropBorderColor(.7,.2,.3,1)
elseif UnitExists(target) or UnitIsPlayer(guid) then
plate.health.backdrop:SetBackdropBorderColor(.7,.7,.2,1)
else
plate.health.backdrop:SetBackdropBorderColor(.2,.7,.7,1)
end
else
plate.health.backdrop:SetBackdropBorderColor(.2,.2,.2,1)
end
elseif 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)