As a Roblox plugin developer, it is currently impossible to create a MenuPopupButton. (special Plugin Button w/ a Plugin Menu, referred to as “MenuPopupButton” in RobloxStudioRibbon.xml file)
I am referring to this type of button (labeled as “3” in images below, button for inserting Parts is a MenuPopupButton)
→
When I said this above…
That statement isn’t completely true, we could achieve a similar effect by connecting a Plugin Menu’s :ShowAsync() method to a regular Plugin Button’s .Click event. However that doesn’t provide us with this button’s special feature, which is once you click the Button’s icon, the Plugin Button’s .Click event fires (in images above: inserting a part), but when you press anywhere else on the button, a dropdown appears. (in images above: allowing the user to choose a Part Type)
Using this method would somewhat slow down the user’s workflow, since the user would need to always go thru a Plugin menu instead of just clicking the Plugin Button’s icon to trigger the functionality of the plugin.
I suggest the following API to be added to PluginToolbars;
Creates PluginToolbarMenuButton that allows the user to initiate a single action in Roblox Studio through the Click event once the user clicks the upper part of the button or displays a PluginMenu once the user clicks the lower part of the button.
PluginToolbarMenuButton.MenuDisplayed or PluginToolbarMenuButton.MenuItemChoosen
It’s from an version API dump tool by MaximumADHD, @BackspaceRGB captured a moment when they added the :CreatePopupButton() function.
To this day, I still don’t know why they haven’t released this function. It exists in the production version of Studio but is locked to RobloxScriptSecurity. Perhaps they moved on to something more important, or maybe this function isn’t even related to the contents of this post (although highly unlikely).
The implementation of this specific button isn’t how I’d personally implement it, the drop down should be a PluginMenu-like object, not just a trigger to do something else.
Toolbars and plugin buttons generally need a complete rework because there are many features in the Qt ribbon that plugins cant use.
I am not sure how the current MenuPopupButton is handled internally, but I thought that the drop down was a PluginMenu object.
If you are referring to PluginToolbarButton.DropdownClick(), then I personally would leave it to be a trigger, since you could implement your own logic behind the dropdown click.