2016-02-10, 20:13
First, move your controls 401 and 307 somewhere out of the way and make them invisible. You'll be sending clicks to them so they still need to be in the window, but the user won't interact with them directly. In place of 401:-
And the same for 307, obviously with a different ID and SendClick to 307. (You can use any arbitrary ID as long as its not one of Skin Shortcuts, and isn't already in use in the window).
Now, when you click on your replacement buttons they should* show the groupings as normal for the main menu, and show your custom groupings in the submenu.
* I'm typing this blind, so obviously double-check I haven't made any howlers and, if its not working, enable Kodi + the scripts debug logging option and see what it says
Code:
<control type="button" id="8000">
<width>1200</width>
<label>Choose Addons in Home</label>
<onclick condition="!StringCompare(Window.Property(groupname),mainmenu)">SetProperty(custom-grouping,submenu-1)</onclick>
<onclick>SendClick(401)</onclick>
</control>
And the same for 307, obviously with a different ID and SendClick to 307. (You can use any arbitrary ID as long as its not one of Skin Shortcuts, and isn't already in use in the window).
Now, when you click on your replacement buttons they should* show the groupings as normal for the main menu, and show your custom groupings in the submenu.
* I'm typing this blind, so obviously double-check I haven't made any howlers and, if its not working, enable Kodi + the scripts debug logging option and see what it says