added option to show debuffs only for enemys OR friendly nameplates

added option to show debuffs only for enemys OR friendly nameplates
This commit is contained in:
Meow
2026-02-28 21:32:17 +01:00
parent 988dfc7079
commit bd36d91189
4 changed files with 17 additions and 13 deletions
+2
View File
@@ -803,6 +803,8 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("nameplates", nil, "targetcastbar", "0")
pfUI:UpdateConfig("nameplates", nil, "spellname", "0")
pfUI:UpdateConfig("nameplates", nil, "showdebuffs", "1")
pfUI:UpdateConfig("nameplates", nil, "showdebuffs_hostile", "1")
pfUI:UpdateConfig("nameplates", nil, "showdebuffs_friendly", "0")
pfUI:UpdateConfig("nameplates", nil, "selfdebuff", "0")
pfUI:UpdateConfig("nameplates", nil, "guessdebuffs", "1")
pfUI:UpdateConfig("nameplates", nil, "clickthrough", "0")
+8 -12
View File
@@ -2753,21 +2753,17 @@ function pfUI.uf:ClickAction(button)
-- run click cast action
local is_macro = string.find(this.clickactions[modstring], "^%/(.+)")
if superwow_active and not is_macro then
CastSpellByName(this.clickactions[modstring], unitstr)
local tswitch = UnitIsUnit(unitstr, "target")
TargetUnit(unitstr)
if is_macro then
RunMacroText(this.clickactions[modstring])
else
local tswitch = UnitIsUnit(unitstr, "target")
TargetUnit(unitstr)
if is_macro then
RunMacroText(this.clickactions[modstring])
else
CastSpellByName(this.clickactions[modstring])
end
if not tswitch then TargetLastTarget() end
CastSpellByName(this.clickactions[modstring])
end
if not tswitch then TargetLastTarget() end
return
end
end
+2
View File
@@ -2720,6 +2720,8 @@ pfUI:RegisterModule("gui", "vanilla:tbc", function ()
CreateConfig(nil, T["Debuffs"], nil, nil, "header")
CreateConfig(U["nameplates"], T["Enable Debuffs"], C.nameplates, "showdebuffs", "checkbox")
CreateConfig(U["nameplates"], T["Show Debuffs on Hostile"], C.nameplates, "showdebuffs_hostile", "checkbox")
CreateConfig(U["nameplates"], T["Show Debuffs on Friendly"], C.nameplates, "showdebuffs_friendly", "checkbox")
CreateConfig(U["nameplates"], T["Debuff Position"], C.nameplates.debuffs, "position", "dropdown", pfUI.gui.dropdowns.debuffposition)
CreateConfig(U["nameplates"], T["Debuff Icon Offset"], C.nameplates, "debuffoffset")
CreateConfig(U["nameplates"], T["Debuff Icon Size"], C.nameplates, "debuffsize")
+5 -1
View File
@@ -124,6 +124,8 @@ pfUI:RegisterModule("nameplates", "vanilla", function ()
cfg.spellname = C.nameplates.spellname == "1"
cfg.showhp = C.nameplates.showhp == "1"
cfg.showdebuffs = C.nameplates["showdebuffs"] == "1"
cfg.showdebuffs_hostile = C.nameplates["showdebuffs_hostile"] == "1"
cfg.showdebuffs_friendly = C.nameplates["showdebuffs_friendly"] == "1"
cfg.targetzoom = C.nameplates.targetzoom == "1"
cfg.zoomval = (tonumber(C.nameplates.targetzoomval) or 0.4) + 1
cfg.width = tonumber(C.nameplates.width) or 120
@@ -1168,7 +1170,9 @@ nameplates:RegisterEvent("ZONE_CHANGED_NEW_AREA")
-- update debuffs
local index = 1
if cfg.showdebuffs then
local isFriendly = unittype == "FRIENDLY_PLAYER" or unittype == "FRIENDLY_NPC"
local showDebuffsForType = cfg.showdebuffs and (isFriendly and cfg.showdebuffs_friendly or (not isFriendly and cfg.showdebuffs_hostile))
if showDebuffsForType then
local verify = string.format("%s:%s", (name or ""), (level or ""))
-- update cached debuffs