If you have multiple plugins with the same toolbar name, they no longer use the same toolbar, but create individual ones. This takes up lots of unnecessary space.
I have been able to reproduce the bug 100% of the time just by opening a place in studio. I have a feeling it may be tied to the recent widgets update.
This was an intentional change. Having toolbars with the same name combine caused problems because plugins would sometimes choose conflicting names by accident.
Would it be possible in the future to have multiple plugins made by the same creator (Or which have the same name toolbar) to combine into the same toolbar?
I would like to create a suite of different plugins, but let the user choose which plugins they would like to install, whilst having them fall under the same named toolbar.
Is there any way to get around this because right now I have about 3 of my plugins with the same name taking up so much space that the buttons on my screen are almost too small to read.
There is a way, although it’s a very hacky method of doing so. And be warned: it’s a slightly complicated process.
When you have a ToolBar, you are actually able to change its parent. So you could simply set its parent to game (so that it won’t show up unless someone hair their Studio settings set to see hidden items), then you need to set a name for it like any other Instance, and from there you’d need all of your plugins to check if the toolbar already exists under the name you give it. So then you can create new buttons from that ToolBar. It would look a little like this:
--Let's assume "ToolBarName" is a pre-set variable.
local ToolBar = game:FindFirstChild(ToolBarName)
if not ToolBar then
ToolBar = plugin:CreateToolbar("Part Creators")
ToolBar.Name = ToolBarName
ToolBar.Parent = game
end
Now you’d have to work out how to make this work with updating because depending on which plugin ends up making the ToolBar, it’ll be erased and take away all of the other buttons from the other plugins. So you’ll need your plugins to be able to check if their parent or ancestry has changed, so that they can find the new ToolBar and move them to there.
The other-OTHER issue would be updating plugins that didn’t make the ToolBar. You’d sorta have to do the same thing you did with the ToolBar with the buttons by giving them names and parenting them under the ToolBar Instance, and checking if the toolbar and button already exists. It’d work like this:
--Let's assume ToolBar and ButtonName are pre-set variables.
local Button = ToolBar:FindFirstChild(ButtonName)
or ToolBar:CreateButton(ButtonName,"Creates a cylinder between 2 given points.","rbxassetid://3786505087")
Button.Name = ButtonName
Button.Parent = ToolBar
TL;DR: It’s hard to make it work, but not impossible. That’s about all of the information I can provide for you.
I would not suggest relying on this. This is really weird behavior that we don’t test for, so we may accidentally break plugins that do this in the future.
Your use case is valid though, so I would recommend making a feature request so that we can officially support this.
Right, hence I said it was a hacky method at the start of it. And iirc there are already posts about why the feature was removed and posts from people trying to get it reinstated. So I’ll leave that to them to make the request.
I also forgot to mention that you can get the same behavior if you use the deprecated method of making plugins which the behavior can be seen in older plugins (although idk if that’s been changed by now). However, there’s no script-workaround for that method to make it work via plugin updating so they’ll break if they need to be updated.
Sorry for bumping this, but I really am at a loss. I have all these plugins now floating in the ether in studio and I don’t know how to list them or clean them up. Any thoughts? Some of them have keybindings as well. Not sure how to remove those.