diff --git a/api/config.lua b/api/config.lua index 23f8832a..b26828f2 100644 --- a/api/config.lua +++ b/api/config.lua @@ -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") diff --git a/api/unitframes.lua b/api/unitframes.lua index 63306525..1c66af91 100644 --- a/api/unitframes.lua +++ b/api/unitframes.lua @@ -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 diff --git a/modules/gui.lua b/modules/gui.lua index 30503a4f..0ed0165c 100644 --- a/modules/gui.lua +++ b/modules/gui.lua @@ -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") diff --git a/modules/nameplates.lua b/modules/nameplates.lua index 4e51a3f5..c807a1f5 100644 --- a/modules/nameplates.lua +++ b/modules/nameplates.lua @@ -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