mirror of
https://github.com/brues-code/ClassicAPI.git
synced 2026-11-16 08:00:42 +00:00
Ports the three remaining cast-family commands from FrameXML, including the macro icon, which is half the feature: a sequence whose button does not show the current step is barely usable. The sequence state lives in Lua and the icon asks for it by name. That is Blizzard's own split -- 3.3.5's macro code calls the Lua global QueryCastSequence through lua_pcall and takes the item over the spell -- so execution and display read one index and cannot disagree about which step is current. Macro::ShowTooltip mirrors that call for any option line that came from a castsequence command. The random pair is faithful to 3.3.5 rather than nicer than it: the binary has no query beside QueryCastSequence, so a comma list reaches the resolver whole, names nothing, and greys the button. Being a static line it also ends the collection, so a /castrandom above a /cast takes the icon. #showtooltip gives one of these macros an icon. QueryCastSequence stops answering if the contested-command pass hands /castsequence to another macro addon: our table only advances while our handler runs, so a frozen step one on a sequence somebody else drives would be worse than no icon at all. Three adaptations the 1.12 client forces: item detection uses the carried-item test, since there is no name to item lookup here; the cast events carry the spell in different argument positions per event; and CastSpellByName takes no unit, so a targeted step routes through C_Spell.CastAtUnit like /cast already does. /cast, /use and both random commands now share one action dispatch instead of four copies of it.