From dc15f869ae91fc37d7eff539f6fee992d10a7987 Mon Sep 17 00:00:00 2001 From: Martin Franc Date: Sat, 14 Jun 2025 18:58:00 +0200 Subject: [PATCH] unitframes: add support for native superwow click casting --- api/unitframes.lua | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/api/unitframes.lua b/api/unitframes.lua index 3a898c68..1472e629 100644 --- a/api/unitframes.lua +++ b/api/unitframes.lua @@ -2085,16 +2085,23 @@ function pfUI.uf:ClickAction(button) showmenu = nil else -- run click cast action - local tswitch = UnitIsUnit(unitstr, "target") - TargetUnit(unitstr) + local is_macro = string.find(this.clickactions[modstring], "^%/(.+)") - if string.find(this.clickactions[modstring], "^%/(.+)") then - RunMacroText(this.clickactions[modstring]) + if superwow_active and not is_macro then + CastSpellByName(this.clickactions[modstring], unitstr) else - CastSpellByName(this.clickactions[modstring]) + 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 end - if not tswitch then TargetLastTarget() end return end end