Commit Graph

12 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 2ce4d11698 Use ClassicAPI EventUtil for addon-load/login extension wiring
Replace hand-rolled ADDON_LOADED/PLAYER_LOGIN handlers with
EventUtil.ContinueOnAddOnLoaded / ContinueOnPlayerLogin, which fire
immediately if the event already happened -- removing the "we loaded before
the target addon and missed its ADDON_LOADED" workarounds.

- pfUI compat: ContinueOnAddOnLoaded("pfUI") + ContinueOnPlayerLogin; drops
  the missed-event fallback (login path still re-runs SetupCompatibility).
- MacroErrorUI / MacroLengthWarn: ContinueOnAddOnLoaded("Blizzard_MacroUI"),
  folding their manual "already loaded" checks.
- 9 Mouseover extensions (ag_UnitFrames, CT_RaidAssist, CT_UnitFrames,
  DiscordUnitFrames, Grid, NotGrid, Cursive, sRaidFrames, PerfectRaid):
  ContinueOnAddOnLoaded("<AddonName>", OnLoad). Since immediate-fire passes no
  event args, the old `arg1 == "X"` checks are replaced by the addon-name gate
  (global guards kept where present); also removes the buggy
  UnregisterEvent("ADDON_LOADED", "Onload") no-ops that never fired.

Addon names match file names; drops support for renamed folders (e.g. -master).
2026-07-26 14:53:34 -05:00
Brues 963ad21297 Show resolved icon for question-mark macros in the macro list
Macros with no chosen icon (e.g. "#showtooltip Shoot") display Blizzard's
default question mark in the macro UI. After each MacroFrame_Update, swap
that placeholder for the icon the action bar would show, resolved from the
macro's #showtooltip/first action via GetMacroByIndex.

- Only replaces icons that are currently the question mark, so user-chosen
  icons are never touched.
- Covers both the list buttons (MacroButtonNIcon) and the selected-macro
  detail icon.
- Purely cosmetic: never changes the saved icon; Blizzard repaints the
  default on the next refresh if resolution fails or the macro changes.
- Installed in MacroErrorUI's existing hook path (gated on Blizzard_MacroUI
  load and the SuperMacro guard).
2026-06-22 00:35:19 -05:00
Brues c710ccf832 Identify action-bar macros by slot/index; drop name restrictions
Resolve a slot's macro by its Blizzard macro index via ClassicAPI's
GetActionInfo instead of GetActionText -> name -> GetMacro, so action-bar
macros no longer depend on the macro name.

- Core.lua: GetAction uses GetActionInfo(slot) -> macro index ->
  GetMacroByIndex; falls back to the name path for SuperMacro (no index).
  ParseMacro split into a shared BuildMacro + ParseMacroByIndex (caches by
  index) + ParseMacro(name). Added GetMacroByIndex. The macro cache is now
  keyed by index for action-bar macros, so blank/duplicate names no longer
  collide. GetMacroIndexByName remains only for genuine name references
  ({MacroName}, /runmacro, /macrocheck).
- MacroErrorUI.lua: remove the now-obsolete macro-name warnings (duplicate,
  blank, spell-conflict, item-conflict) from both the live editor validation
  and the on-close report; delete the unused name-set helpers.
- README: update the known-issue to note only name-referenced macros need
  unique names.
2026-06-21 00:30:30 -05:00
Jrc13245 7577c76050 fix highlight 2026-03-29 10:24:13 -04:00
Jrc13245 3aa3d616c1 fix highlights with multiline 2026-03-29 08:58:51 -04:00
Jrc13245 5bb8ebe9b7 add item count support for inbag/noinbag conditional, fix macro frame whitelist and error log on macro frame 2026-03-21 12:03:46 -04:00
Jrc13245 d380fe314c feature live passing conditional checker 2026-03-15 12:17:45 -04:00
Jrc13245 e3cfde0506 add full disable command to macrochecker and temporarily disable swimming conditional ddue to lack of dll support 2026-02-15 10:09:34 -05:00
Jrc13245 dae56dbb16 slashcommand whitelist 2026-02-14 10:38:03 -05:00
Jrc13245 3a3719a37a initial overflowtest 2026-02-12 21:19:20 -05:00
Jrc13245 b0cd1c0657 ingame error checker gui 2026-02-08 21:24:46 -05:00