mirror of
https://github.com/brues-code/ClassicAPI.git
synced 2026-11-16 08:00:42 +00:00
The vanilla CreateMacro / EditMacro globals take an icon INDEX into the GetMacroIconInfo list, and that list omits INV_* item icons entirely -- so item icons are unreachable through the stock API even though the engine stores and renders them fine. C_Macro.CreateMacro / EditMacro accept the icon as a texture string (a full Interface\Icons\<name> path or a bare <name> basename) instead, writing the basename directly to the macro struct; GetMacroInfo re-prefixes it as Interface\Icons\%s on read, so any Interface\Icons\ texture round-trips. Both go straight to the engine's own workers (FUN_004f1010 create / FUN_004f1280 edit), which do the bounded copy, re-run the primary-spell parser, set the persist-on-logout dirty flag, and refresh the action bars. EditMacro resolves its index arg as a slot number or a macro name (via the GetMacroIndexByName resolver), leaves any nil field unchanged, and reads back the entry's local flag so the worker's unconditional rewrite of it is a no-op. The legacy globals stay untouched (index-only); string-icon callers opt in through the C_Macro namespace. Verified in-game incl. an INV_* item icon surviving a relog. Unblocks a pfUI macro-UI remodel.