PDA

View Full Version : Removing Radial Menu Options



Sterno
March 25th, 2021, 15:59
I'm working on an extension that adds a radial menu to the "Attack" button and lets you quickly roll an attack with a modifier applied, saving the user the time of opening the Modifiers window and clicking on one.

I noticed that when I create a radial menu on the attack button, it inherits the menu options of the control above it.

https://i.imgur.com/KfXQn1e.gif

Note in the gif above that the "Rest" option from the other radial menu is coming along in my attack button's radial menu. The other options all were as well (you can see the "Clone Item" option in the bottom right, too), but I can replace all but one of these options with my own by repositioning things. I'm short one item to actually "override" all those slots, though, and it doesn't make any sense to me to have any of those inherited menu options come along. I want them gone.

Things I tried:

1. resetMenuItems() - no effect, all the old options still appear unless overridden
2. calling registerMenuItem("", "", 8); to try to see if that would clear it out. It just ignores that (maybe because it can't find an image named ""?)

Interestingly, the documentation for registerMenuItem says "Trying to redefine an existing menu item will fail.", and that clearly isn't the case here (I replaced all those other options), making me think I don't really understand the relationship of how those items are chaining down from some control up above to the attack button control.

Moon Wizard
March 30th, 2021, 00:29
I really wish everyone would stop using animated GIFs. It makes it hard to see what is happening at beginning and end of segment; as well as impossible to stop and review what is happening.

Radial options are added up the chain of inheritance. If a containing window defines a radial menu, it will always appear in the radial slot unless specifically overriden.

Regards,
JPG