Two macros with same name cause unpredictable behavior
Ketrel opened this issue ยท 4 comments
I have macros named 'Automount 01' on both global blizzard macros and on toon specific macros. For example, the one with that name specific to my Paladin are class mounts.
The problem is when I drag (from the blizzard UI) the macro from the toon specific macros to a button slot, it adds the tooltip icon from the global macros, but the text shows as the macros from the toon macros. When used, it calls the global macro, and then if I reload UI, it fully becomes the global macro.
However, what also seems to happen is if I do NOT reload UI, and additional macros I drag are also added as the global version of the one I originally added (that shared a name with the toon on)
Right now I worked around this (and verified the conditions causing it) by renaming the toon specific macro.
Oh and as I know my writing style can be a bit unclear
Steps to Reproduce
- Make a global macro with name
Automount 01
with contents
#showtooltip
/stopmacro [flying]
/use [flyable,nomod][noflyable,mod]Pureblood Fire Hawk;Flametalon of Alysrazor
- Make a character specific macro ALSO with name
Automount 01
with contents
#showtooltip
/stopmacro [flying]
/use [nomod]Highlord's Golden Charger;[mod:alt]Highlord's Valorous Charger;[mod:ctrl]Highlord's Vengeful Charger;Highlord's Vigilant Charger
- Drag the character specific macro to an empty spot on a bar
3b. First symptom will show here, the macro will look like the global one - Drag any other macro, for example
4b. This will look inconsistant
#showtooltip
/stopmacro [flying]
/cast [nomod]Cindermane Charger;Hearthsteed
- Reload the UI
5b. Both macros will be the global macro from step #1
Can you please test the latest code from MASTER and report back if it's still an issue?
What happened this time, it added what appears to be the right macro to the bar, with the additional issues I mentioned #339 (comment) and the reply.
However,
what also seems to happen is if I do NOT reload UI, and additional macros I drag are also added as the global version of the one I originally added (that shared a name with the toon on)
That changed to be the second macro (any other macro) I add to another slot, after reloading, both are now that second macro. (vs both being the first)
So looking at the code, we parse the list of Blizzard macros and settle on the correct one to parse the contents of via the name. So yes, if two have the same name it's always going to stop at the first in the list. I'm unsure how to get around this sadly :-/ We have limited means with which to search through the list of stock macros, and the name makes the most sense