nameplates: combat state bar 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
2025-02-17 20:01:21 +01:00
parent 3351b7fd00
commit c05e46684c
3 changed files with 22 additions and 3 deletions
+1
View File
@@ -729,6 +729,7 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("nameplates", nil, "showguildname", "0")
pfUI:UpdateConfig("nameplates", nil, "outcombatstate", "1")
pfUI:UpdateConfig("nameplates", nil, "barcombatstate", "0")
pfUI:UpdateConfig("nameplates", nil, "outfriendly", "0")
pfUI:UpdateConfig("nameplates", nil, "outfriendlynpc", "1")
pfUI:UpdateConfig("nameplates", nil, "outneutral", "1")
+4 -1
View File
@@ -2269,7 +2269,6 @@ 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")
@@ -2288,6 +2287,10 @@ pfUI:RegisterModule("gui", "vanilla:tbc", function ()
CreateConfig(U["nameplates"], T["Always Show On Units With Missing HP"], C.nameplates, "fullhealth", "checkbox")
CreateConfig(U["nameplates"], T["Always Show On Target Units"], C.nameplates, "target", "checkbox")
CreateConfig(U["nameplates"], T["Vertical Healthbar"], C.nameplates, "verticalhealth", "checkbox")
CreateConfig(nil, T["SuperWoW Settings"], nil, nil, "header")
CreateConfig(U["nameplates"], T["Overwrite Border Color With Combat State"], C.nameplates, "outcombatstate", "checkbox")
CreateConfig(U["nameplates"], T["Overwrite Health Color With Combat State"], C.nameplates, "barcombatstate", "checkbox")
end)
CreateGUIEntry(T["Thirdparty"], T["Integrations"], function()
+17 -2
View File
@@ -586,9 +586,9 @@ pfUI:RegisterModule("nameplates", "vanilla:tbc", function ()
local guid = plate.parent:GetName(1) or ""
local target = guid.."target"
if UnitAffectingCombat(guid) then
if UnitAffectingCombat("player") and UnitAffectingCombat(guid) and not UnitCanAssist("player", guid) then
if UnitIsUnit(target, "player") then
plate.health.backdrop:SetBackdropBorderColor(.7,.2,.3,1)
plate.health.backdrop:SetBackdropBorderColor(.7,.2,.2,1)
elseif UnitExists(target) or UnitIsPlayer(guid) then
plate.health.backdrop:SetBackdropBorderColor(.7,.7,.2,1)
else
@@ -712,6 +712,21 @@ pfUI:RegisterModule("nameplates", "vanilla:tbc", function ()
r, g, b, a = .5, .5, .5, .8
end
if superwow_active and C.nameplates.barcombatstate == "1" then
local guid = plate.parent:GetName(1) or ""
local target = guid.."target"
if UnitAffectingCombat("player") and UnitAffectingCombat(guid) and not UnitCanAssist("player", guid) then
if UnitIsUnit(target, "player") then
r, g, b, a = .7, .2, .2, 1
elseif UnitExists(target) or UnitIsPlayer(guid) then
r, g, b, a = .7, .7, .2, 1
else
r, g, b, a = .2, .7, .7, 1
end
end
end
if r ~= plate.cache.r or g ~= plate.cache.g or b ~= plate.cache.b then
plate.health:SetStatusBarColor(r, g, b, a)
plate.cache.r, plate.cache.g, plate.cache.b = r, g, b