Commit Graph

50 Commits

Author SHA1 Message Date
Brues 1de455f96e Support Blizzard-style bracket groups: [a][b] Spell and [] fall-through
A clause may now carry a leading run of [group] blocks sharing one action;
groups are OR'd, first pass wins, and [] always passes. The existing
;-separated single-block form is unchanged and mixes freely.

The OR loop lives in the two single-clause evaluators, DoWithConditionals
and TestAction, which expand a multi-group clause into one-group variants
and recurse. That covers every ;-split site, /castsequence (where ; is not
a separator and the sequence is keyed by the full args), /cancelaura,
/stopmacro and the editor highlight without rewriting strings, so
action.args, the ParsedMsg/Sequences caches and highlight offsets keep
their identity.

ParseMsg scans the leading group run (quote-aware) instead of the greedy
%[(.+)%], which previously turned [a][b] into the bogus key a][b and made
such clauses fail silently on both the cast and icon paths. The flag
pattern still runs on the whole clause when there are no groups, so !Spell
is byte-identical.

TestAction reports which variant passed and TestForActiveAction stores its
conditionals, so range/usable colouring follows the passing group's @unit
rather than group 1's. /target gains ; and group support; /pfcast injects
the resolved unit into every group, not just the first. The macro checker
validates every leading block, drops the EMPTY_CONDITIONAL error, and
catches a missing action after the last group.
2026-09-10 17:17:08 -05:00
Brues daaab2fd11 Retire the hasPfUI76 flag and the pfUI 7.6 branches it gated
Assume a modern pfUI, and drop the version-tiered branching entirely: 31 call
sites across five files, plus the flag and its detector.

Note which side was actually dead. HasPfUI76() required four things -- pfUI
version >= 7.6, Nampower >= 2.40, pfUI.libdebuff_objects_guid, and
pfUI.libdebuff_casts. The last one does not exist: pfUI exports 28 libdebuff_*
tables and libdebuff_casts is not among them (libdebuff_recent_casts is a
dedup table keyed [targetGuid][spellName][casterGuid], a different shape). So
the detector returned false at any version, and it was the hasPfUI76-TRUE
branches that never ran, not the fallbacks. Removing those is behaviour-
preserving; keeping SCRM as the owner of castTracking is what the code has
always actually done.

Removed accordingly:
- lib:HasPfUI76(), both flag declarations, and the block that would have aliased
  castTracking to pfUI.libdebuff_casts and re-pointed lib.objects/iconCache.
- HookPfUILibdebuff's "7.6 handles durations internally" early return, so the
  GetDuration/AddEffect hooks below it are visibly the live path again.
- The SPELL_START_OTHER / SPELL_FAILED_OTHER unregister arm, the pfUI branch of
  GetAuraTrackingData, the pfUI76 arm of the libdebuff zone/death cleanup, the
  pfUI backing table in the /cleveroid aura dump, and two status-string suffixes.
- SyncComboDurationToPfUI (77 lines) with its two call sites: it returned
  immediately whenever hasPfUI76, and is inert once the tier split is gone.

Unconditionalised the paths that were gated on `not hasPfUI76`: the castTracking
populate/clear/sweep, InitPfUIIntegration on login, and ten libdebuff duration
lookups.

Verified no hasPfUI76 reference remains, and that per-file block balance is
unchanged from HEAD.
2026-09-10 14:40:16 -05:00
Brues c5ddc6c313 Publish resolved macro actions to ClassicAPI's C_Macro.SetMacroDisplay
Hands ClassicAPI the action this addon resolved for each macro, so the icon,
tooltip, cooldown sweep, range and usable state come from the client instead of
from replaced action-bar globals. That also reaches the drag cursor and the macro
window grid, which Lua cannot touch, and lets the client answer range for a macro
slot directly rather than borrowing a proxy slot.

- CleveRoids.useClassicAPIDisplay feature-detects C_Macro.SetMacroDisplay rather
  than checking CLASSIC_API_VERSION, which reports a dev sentinel while the API is
  unreleased. ClassicAPIMacroDisplay tells ClassicAPI we drive macro display, which
  it otherwise stands down from when it sees this addon.
- macro.actions.macroID back-references the Blizzard index, since the update loop
  walks actions objects rather than macros. nil for SuperMacro macros, which have
  no index and so cannot be published.
- PublishDisplay sends false, not nothing, when no action matched: that claims the
  macro and shows the question mark, where silence would hand it back to
  ClassicAPI's own #showtooltip parser.
- PublishAllDisplays runs once the addon is ready and after every re-parse, since
  ClassicAPI re-evaluates nothing for us. It covers macros that aren't on a bar,
  which is what keeps the macro window grid correct. Deferred past load because
  SetMacroDisplay returns false until the player is in the world.
- ReleaseDisplays hands every macro back on DisableAddon.

The per-slot ACTIONBAR_SLOT_CHANGED fan-out is kept for the non-integrated path.
Publishing repaints every slot holding the macro through the client's own notifier,
so it is redundant when the API is present, but removing it outright would leave
buttons never repainting on a ClassicAPI build without the API.
2026-09-10 14:40:16 -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
Jrc13245 fb359993b2 Initial Commit 2025-08-18 16:15:25 -04:00