Commit Graph

51 Commits

Author SHA1 Message Date
Brues eddc49fc60 Make [button:N] mean the invoking button, as retail does
[button:N] was a held-state modifier: IsMouseButtonDown(name), true while you
physically hold that button. Retail's is a property of the activation -- which
button clicked the action button -- and a keybind press counts as button 1
because it activates through the left-click path. Different in kind, and the
visible break was [button:1] Rejuvenation; Regrowth casting Regrowth from a
keybind, where retail casts Rejuvenation.

It now reads ClassicAPI's GetMouseButtonClicked, defaulting to LeftButton when
no click dispatch is running. That default IS the keybind rule: Button:Click()
with no argument reports LeftButton, and a macro run from anywhere else answers
button 1 the same way.

This also reverts 891467c. That commit refreshed the action bar on
GLOBAL_MOUSE_DOWN/UP so the icon could track the held state -- under the real
semantics there is no such state to track, and the icon correctly sits on
whatever button 1 resolves to. PLAYER_TOTEM_UPDATE stays; it shared the comment
and inherits it.

Requires ClassicAPI v1.15.8, up from v1.15.0. v1.15.8 scoped
GetMouseButtonClicked to the click dispatch; before it a HELD button kept the
value alive (by design -- OnDragStart reads it), so turning the camera with
right-click down made every keybind press read RightButton. The function exists
below v1.15.8 and answers wrongly, and a conditional that is quietly wrong is
worse than one that warns, so the floor moved rather than the conditional being
gated.

Bare [button] / [nobutton] survive as an extension retail has no equivalent for,
now meaning "a click dispatch is running" -- the practical "activated by a
keybind, not a click" test, and no longer leaning on anything but the documented
nil.
2026-09-15 01:17:06 -05:00
Brues 5e27e6fe58 Name the macro slot count
Three loops walked 1..36 by hand, two of them re-arguing in comments why 36
is the right number. It is: the client addresses 18 account-wide macros at
1-18 and 18 character-specific ones at 19-36, and that range is what
GetMacroInfo and C_Macro.SetMacroDisplay index. Nothing in the API hands it
back -- GetNumMacros() returns how many of each tab are used, which cannot be
summed into a range, because the character block still starts at 19 when the
account block is empty. Blizzard's MAX_MACROS is no better: it lives in the
load-on-demand Blizzard_MacroUI and is nil until the macro window is opened.

So CleveRoids.MAX_MACRO_SLOTS in Init.lua, carrying that reasoning once.
ValidateAllMacros also dropped a numAccountMacros it computed and never read.

ReleaseDisplays keeps sweeping the full range rather than the macros it knows
it published: PublishAllDisplays clears that record on each re-parse, so a
macro claimed before one and gone after it would keep our last published value
forever. Releasing a slot we never claimed costs nothing, and it runs once.
2026-09-11 13:57:11 -05:00
Brues 6edd37a76f Require ClassicAPI v1.15.0
An out-of-date ClassicAPI did not degrade the addon, it decapitated it.
Utility.lua calls ev:RegisterUnitEvent at file scope (v1.15.0), so on an
older build that call raises and Lua abandons the rest of the chunk --
every definition below line 4118 of a 10040-line file, some 6000 lines,
silently never happens. What the user sees is the first one a common path
reaches: PLAYER_TARGET_CHANGED calling a nil ClearResistState, once per
target swap, forever.

The requirement check still said v1.12.1 (the positional
C_UnitAuras.UnitAura), so the affected client sailed through it and the
warning it did print promised only that "dispel-type conditionals will be
unavailable" -- describing a graceful degradation that was not happening.
The gate is now v1.15.0 and says the addon cannot finish loading, with the
installed version in the message the way the Nampower branch does it.
ClassicAPI.lua gains GetVersion() to decode CLASSIC_API_VERSION, keeping
the X*10000 + Y*100 + Z encoding inside that module, and its header notes
that the minimum has to rise with any ClassicAPI call adopted at file
scope -- that is the property that turns a version mismatch into a silent
half-load rather than a missing feature.

C_Macro.SetMacroDisplay also ships in v1.15.0, which retires the last
pre-ClassicAPI display path:

  useClassicAPIDisplay folds into ClassicAPIMacroDisplay. The two were
  always equal -- set together at load, cleared together in
  ReleaseDisplays -- and one of them is a handshake ClassicAPI reads, so
  a second name for the same state could only ever drift.

  TestForAllActiveActions loses the per-slot ACTIONBAR_SLOT_CHANGED
  fan-out. Publishing repaints every slot holding the macro through the
  client's own notifier; the fan-out was what ran when SetMacroDisplay
  was unavailable, and its one remaining reachable state was after
  DisableAddon, where ReleaseDisplays has already handed all 36 macros
  back and ClassicAPI repaints them itself.

The load-time feature detect stays, with a new reason: below the minimum
the addon is already broken, so a nil SetMacroDisplay now means ClassicAPI
is absent outright -- the case the requirement check warns about and then
keeps running.
2026-09-11 13:44:09 -05:00
Brues 5213bd5474 Migrate to ClassicAPI for macro display, auras and timing
Squash of the classicapi_next branch (10 commits). ClassicAPI is now a hard
requirement, and the Lua-side reimplementations it supersedes are gone:
net -1087 lines across 12 files.

Macro display: resolved macro actions are published through
C_Macro.SetMacroDisplay, so the client draws macro buttons and the
action-bar function overrides this addon used to install are removed.
Ownership is per macro -- ClassicAPI keeps the macros we never claim.

Auras and timing: ClassicAPI is the source of truth for non-player aura
timing via the positional C_UnitAuras.UnitAura, replacing the write-only
buff tracking tables and the overflow-slot fallback.

Cleanup: the hasPfUI76 flag and the pfUI 7.6 branches it gated, two
silently-shadowed code paths, and per-call allocations in the event and
publish paths (SPELL_CAST_EVENT merged). Packaging moves to
brues-code/packager@vCAPI.

Macro syntax: a clause may carry a leading run of [group] blocks sharing
one action, Blizzard-style -- groups are OR'd, first pass wins, and []
always passes. The ;-separated form is unchanged and mixes freely. @focus
clauses with no focus set now fail quietly instead of printing
"Invalid target" on the way past.
2026-09-11 00:30:36 -05:00
Brues 77c0dba2c4 Alias [mouseuse] to [cursor] via a conditional alias table
Adds CleveRoids.conditionalAliases, applied in ParseMsg so a deprecated name
is rewritten to its current keyword before anything downstream (evaluation,
_groups) sees it. This is the mechanism for renamed modifiers, which -- unlike
predicates such as [stl] -> [stealth] -- have no Keywords function an alias
could simply point at.

[mouseuse] now resolves to [cursor], routing old macros through ClassicAPI's
C_Spell.CastAtCursor / C_Item.UseAtCursor. Drops the post-cast block that cast
normally and then faked a mouse click via CameraOrSelectOrMoveStart/Stop to
place the AoE circle, along with its workaround for that call spuriously
starting auto-attack.

MacroErrorChecker seeds VALID_CONDITIONALS from the alias table, so the old
names stay valid syntax without needing a placeholder ignoreKeywords entry.
2026-09-09 02:18:36 -05:00
Seraphic8x2244 d5baecaf41 new command feedpet, new conditional pethappiness 2026-08-25 09:26:59 -05:00
Brues ae09b23afd Resolve item sets via ClassicAPI; drop Reliquary dependency
Item-set membership and set info now read ItemSet.dbc directly through
ClassicAPI instead of the nampower/Reliquary glue, so set features no
longer require the Reliquary DLL to be installed.

- ClassicAPI.lua: add GetItemSetIDByID and GetItemSetInfo wrappers.
- Utility.lua: repoint ResolveSetItems, CountEquippedSetItemsBySetId,
  GetEquippedItemSetInfo, and GetEquippedSetPieceCount at the ClassicAPI
  accessors. Set-name matching now uses the DBC name (localized; identical
  to the old enUS path on English clients).
- NampowerAPI.lua: remove the now-unused GetItemSet/GetItemSetId/
  GetItemSetItems/GetItemSetBonuses, the dead GetSpellEffectRadius (no
  callers, only radius source was Reliquary), and the orphaned RQ_SafeCall.
- Init.lua: drop hasReliquary detection and its startup feature line.
- Conditionals.lua: update the [set:] comment (no longer Reliquary-gated).
2026-06-21 14:29:28 -05:00
Brues a8bf7fbc0f Identify equipped weapon type by item subclass, not localized name
HasWeaponEquipped matched the localized GetItemInfo subtype string, which
required a hand-maintained translation of all 13 weapon/shield subtypes per
locale plus brittle "^Fist"/last-word string parsing.

Use the locale-independent class/subclass IDs from C_Item.GetItemInfoInstant
instead:
- Init.lua: WeaponTypeNames entries now carry numeric class + subClass set
  (Axes/Swords/Maces span their 1H+2H subclasses; Shields are armor class 4).
- Conditionals.lua: HasWeaponEquipped resolves the slot's itemID via
  ClassicAPI GetInventoryItemID, then compares classID/subClassID -- no link
  parsing, no string munging.
- Localization.lua: drop the now-unused weapon-subtype strings from every
  locale block (112 lines).
2026-06-21 14:16:56 -05:00
Brues 9f10dab560 Use ClassicAPI CastSpellNoToggle for the ! anti-toggle prefix
Unify both ! mechanisms (bare !spell gate-injection and bracketed
[cond] !spell dispatch skip) on ClassicAPI's CastSpellNoToggle, which
no-ops auto-repeat (Shoot/Auto Shot/Wand) and toggle auras
(forms/stances/aspects/seals) instead of toggling them off.

- Bare !spell now just sets conditionals.noSpam (no injected gate
  conditional); removed spamConditions and GetSpammableConditional.
- Dispatch: melee Attack still uses AttackTarget (CastSpellNoToggle
  doesn't cover the melee swing). For everything else under !, keep the
  ValidatePlayerBuff anti-refresh skip (CastSpellNoToggle only covers
  true toggle auras, not regular self-buffs like Mark of the Wild),
  otherwise CastSpellNoToggle. This is more reliable for auto-repeat
  than the old CheckChanneled path.

CheckChanneled is retained (still used by the [channeled]/[checkchanneled]
conditionals).
2026-06-21 02:55:40 -05:00
Brues a561d0ed20 Make cursor a [cursor] modifier instead of an @cursor token
Per design preference, drop the @ and the ParseMsg special-casing:
[cursor] is now a normal modifier keyword (added to ignoreKeywords,
mirroring [mouseuse]) rather than a pseudo unit token. The cast/use
dispatch still routes through ClassicAPI's CastAtCursor / UseAtCursor
(checked via conditionals.cursor). Reverts the @cursor ParseMsg branch.
2026-06-21 02:36:09 -05:00
Jrc13245 fbbbb1fcce updates for unified tracking 2026-04-01 16:11:47 -04:00
Jrc13245 719021ff65 Add set conditional, rmarkorder, Reliquary DBC integration, and fix immunity tracking false positives 2026-03-27 16:01:34 -04:00
Jrc13245 cb5ce8f824 warn when pfui macrotweak is enabled 2026-03-24 07:22:11 -04:00
Jrc13245 cc87fac66f fix table error 2026-03-19 13:49:09 -04:00
Jrc13245 137e08a209 fix target overflowframe and possible immunity system fix 2026-03-17 18:25:20 -04:00
Jrc13245 348c621c5d remove cleartarget conditional, update stopattack 2026-03-07 11:00:29 -05:00
Jrc13245 0de2747175 update stopattack and cleartarget 2026-03-06 21:16:38 -05:00
Jrc13245 aca7b2af3b retarget conditional, fix defer frame to use polling approach 2026-03-06 20:36:24 -05:00
Jrc13245 52b831c2c2 stopattack and cleartarget conditionals 2026-03-06 20:14:08 -05:00
Jrc13245 17f28dcdfd feature mouseuse and attempt to fix stopattack 2026-03-06 19:43:36 -05:00
Jrc13245 82b2ab889f remove superwow requirement by using nampower, update nampower support to 3_1_0 2026-03-02 19:55:53 -05:00
Jrc13245 9811d9c894 update for nampower 2_41_0 and update readme 2026-02-22 20:00:21 -05:00
Jrc13245 ec43a636d6 update for pfui buff tracking and nampower buff tracking fallback 2026-02-17 19:19:07 -05:00
Jrc13245 37afbd047c update pfui compatibility 2026-02-16 21:32:37 -05:00
Jrc13245 f5e3b862be fix ! prefix with explicit conditionals and Judgement of Light debuff detection 2026-02-16 15:57:41 -05:00
Jrc13245 dae56dbb16 slashcommand whitelist 2026-02-14 10:38:03 -05:00
Jrc13245 ee2de33001 update nampower support to 2_27_2 and pfUI 7_6+ 2026-02-04 16:23:34 -05:00
Jrc13245 f0e2f6f5d9 update immunity system to include acknowledging reflection and invulnerability spells, fix firstaction and nofirstaction slashcommands 2026-01-15 17:11:54 -05:00
Jrc13245 7acfa22e72 add some more memory optimizations 2026-01-10 13:06:45 -05:00
Jrc13245 64c0d9949d re add trinket and ring slashcommands and implement cursive support 2026-01-02 23:37:27 -05:00
Jrc13245 003d230e52 revert multi target tracker 2026-01-02 23:16:57 -05:00
Jrc13245 fe6982ddf6 add equip11 equip12 equip13 and equip14 commands for trinket swapping and ring swapping as theres two choice of slots 2026-01-02 18:45:47 -05:00
Jrc13245 62371a4bc5 fully update immunities system and force clear for version usage 2025-12-29 16:20:47 -05:00
Jrc13245 5b6d8268e0 add pcall to more nampower functions 2025-12-28 11:41:45 -05:00
Jrc13245 370167b3a7 update for nampower errors 2025-12-27 14:38:24 -05:00
Jrc13245 145ed92f77 multiscan targeting based on pepopos cursive 2025-12-26 14:57:54 -05:00
Jrc13245 da23987449 fix nampower errors 2025-12-24 15:05:51 -05:00
Jrc13245 d8b4a097b3 reduce garbage creation and fix channel spell range checks 2025-12-20 13:46:06 -05:00
Jrc13245 f3791c4562 further fixes for debuffs above 16 slots and fixes for item usage 2025-12-19 20:32:52 -05:00
Jrc13245 8a97fa849c fix stopmacro usability broken due to removal of nampower handling 2025-12-15 08:34:57 -05:00
Jrc13245 04f4eacac8 nested macro showtooltip support, nampower queue casting integration, relic slot optimizations, performance updates 2025-12-04 18:10:30 -05:00
Jrc13245 30ed4e2bf9 improve targeting function and further improve equipment mid combat lag. 2025-12-03 08:22:46 -05:00
Jrc13245 442eeb9cbc fix lag of casting and channeling conditionals. 2025-12-02 15:24:48 -05:00
Jrc13245 964df2133b fix toggle spells icon swaps like prowl and shadowmeld and fix debuff conditionals correctly filtering by caster for shared and individual debuffs 2025-11-29 21:54:59 -05:00
Jrc13245 a33f3f21db clarify actual multi and noable multi usage, add AND operator for multi, and fix swintimer to be more intuitive. 2025-11-25 14:23:54 -05:00
Jrc13245 c5a57af024 Fix combo point tracking and queue glow for instant finishers
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-17 20:28:22 -05:00
Jrc13245 c8017c5485 implement UnitXP functions and update nampower and superwow functions 2025-11-08 17:38:35 -05:00
Jrc13245 c86875849f swimming conditional for druid only 2025-10-26 14:53:42 -04:00
Jrc13245 4c9c6fff60 new pet conditional 2025-10-08 20:46:03 -04:00
Plokertonne 22ff5c430f update hunter reactive spells
remove mongoose bite as now non conditional
add Baited Shot for Beast Mastery tree
add Lacerate for Survival tree
2025-08-19 13:36:12 +03:00