CancelAura via C_Spell.CancelSpellByID; stop [focus] no-focus warning

- CancelAura: cancel matched buffs through ClassicAPI's
  C_Spell.CancelSpellByID instead of nampower CancelPlayerAuraSpellId
  and the legacy slot-based CancelPlayerBuff + tooltip-scan path. The
  buff scan (SuperWoW GetPlayerBuffID / nampower raw GetPlayerAuraDuration
  + overflow tracking) and the boolean return are preserved, so the
  ~spell cancel-vs-cast toggle still works. CancelSpellByName isn't usable
  here because it reports no match.
- Focus: GetFocusUnitId no longer warns when no focus is set. In a
  fallback macro ([@focus] as one alternative) that's a normal state;
  the clause now silently falls through like any unresolved @unit.
  Dropped the unused warn parameter and updated both callers.
This commit is contained in:
Brues
2026-06-21 02:10:52 -05:00
parent f926ac5521
commit d4df0a3b26
2 changed files with 50 additions and 93 deletions
+5 -8
View File
@@ -1707,9 +1707,9 @@ end
-- Prefers pfUI's emulated focus (resolves to a real token like "party2"/"raid5")
-- for pfUI users, then falls back to ClassicAPI's native "focus" token (which
-- every UnitX function accepts) for everyone else.
-- Returns the resolved token or nil if no focus is set.
-- warn: if true, prints a chat message when no focus is set.
function CleveRoids.GetFocusUnitId(warn)
-- Returns the resolved token, or nil when no focus is set so @focus clauses
-- silently fall through to the next macro alternative (no warning spam).
function CleveRoids.GetFocusUnitId()
if pfUI and pfUI.uf and pfUI.uf.focus and pfUI.uf.focus.label and pfUI.uf.focus.id
and UnitExists(pfUI.uf.focus.label .. pfUI.uf.focus.id) then
return pfUI.uf.focus.label .. pfUI.uf.focus.id
@@ -1718,9 +1718,6 @@ function CleveRoids.GetFocusUnitId(warn)
if UnitExists("focus") then
return "focus"
end
if warn then
DEFAULT_CHAT_FRAME:AddMessage("|cffff6600SuperCleveRoidMacros:|r [focus] used but no focus is set. Use /focus or the FOCUSTARGET keybind.", 1, 0.4, 0)
end
return nil
end
@@ -2518,7 +2515,7 @@ function CleveRoids.DoWithConditionals(msg, hook, fixEmptyTargetFunc, targetBefo
if conditionals.target == "focus" or conditionals.target == "focustarget" then
local isFocusTarget = conditionals.target == "focustarget"
local focusUnitId = CleveRoids.GetFocusUnitId(true)
local focusUnitId = CleveRoids.GetFocusUnitId()
if focusUnitId then
-- Use the resolved pfUI unit token directly (avoids changing the player's target)
@@ -2897,7 +2894,7 @@ function CleveRoids.DoTarget(msg)
if unitTok == "focus" or unitTok == "focustarget" then
local isFocusTarget = unitTok == "focustarget"
local fTok = CleveRoids.GetFocusUnitId(true)
local fTok = CleveRoids.GetFocusUnitId()
if fTok then
unitTok = fTok .. (isFocusTarget and "target" or "")
if not UnitExists(unitTok) then unitTok = nil end