How to make a UI based plugin?

So, instead of a widget, which looks absolutely terrible and bad on for my plugin, i want it to be just the ui. I do not know where to start.

Here is my current widget based code:

local toolbar = plugin:CreateToolbar("UITools")

local pluginButton = toolbar:CreateButton(
	"UITools", --Text that will appear below button
	"Open", --Text that will appear if you hover your mouse on button
	"http://www.roblox.com/asset/?id=9212837534")                                                   


local info = DockWidgetPluginGuiInfo.new(
	Enum.InitialDockState.Right, 
	false, 
	false, 
	200, 
	300, 
	150, 
	150 
) 

local widget = plugin:CreateDockWidgetPluginGui(
	"TestPlugin", 
	info  

)
widget.Title = "UITools"  
script.Parent.UITools.Parent = widget
pluginButton.Click:Connect(function()
	widget.Enabled = not widget.Enabled 


	
end) 

The script is inside of a Folder called UITools in workspace, along with the UI Frame, i want it to look just like this:
UItoolsExamlesdre

Not like this, which isnt very fitting…

Any help is totally appreciated!

Also, some stuff is edited out because its for an new update for the plugin, yet i dont wanna show any leaks, lol.

1 Like

Still dealing with this issue, any help is appreciated!

1 Like

DockWidgetPluginGui is a PluginGui that displays its contents inside a dockable Roblox Studio window. (from here)

Old versions of Studio Plugins (like the Terrain Tools) used CoreGui to display GUI without creating an docked PluginGui.

If you’re using Roact, mount your tree in an ScreenGui there, like this:

--[[ Roact example ]]
local tree = -- Roact tree
local screenGui = Instance.new("ScreenGui", game:GetService("CoreGui"))
Roact.mount(tree, screenGui)

If you’re using an ScreenGui, you can simply parent it to CoreGui:

--[[ ScreenGui example ]]
-- I don't know the structure of your plugin, I'm just assuming this is it.
local screenGui = script.Parent:FindFirstChild("ScreenGui")
screenGui.Parent = game:GetService("CoreGui")

Do note this may not be supported (and most if not all plugins in Studio switched over to dockable Guis)

1 Like

when trying to parent to CoreUI, ā€œattempt to index nil with ā€˜Parent’.

I can’t really help you without knowing more about the project, what does the structure look like? and more importantly, is it Roact-based, Fusion-based or just plain ScreenGuis?

ScreenGUI. With the frame inside. The parent of the UI is a folder in workspace.

What does your current code look like?

local toolbar = plugin:CreateToolbar("UITools")

local pluginButton = toolbar:CreateButton(
	"UITools", --Text that will appear below button
	"Open", --Text that will appear if you hover your mouse on button
	"http://www.roblox.com/asset/?id=9212837534")                                                   


 

pluginButton.Click:Connect(function() 
	local UI = script.Parent:FindFirstChild("ScreenGUI")   
local 	CoreUI = game.CoreGui
	UI.Parent = CoreUI
	UI.Enabled = not UI.Enabled 


	
end) 

Try this:

-- Note this will not work if used in an game
local CoreGUI = game:GetService("CoreGui")

local toolbar = plugin:CreateToolbar("UITools")

... 

pluginButton.Click:Connect(function()
       local UI = script.Parent:WaitForChild("ScreenGui")
       UI.Parent = CoreGUI
       UI.Enabled = not UI.Enabled
end)

Infinite yield possible on 'user_UITools.rbxmx.UITools:WaitForChild(ā€œScreenGuiā€)

I have fixed the infinite yield, the coreui parenting is still errorring…

I have it working now by parenting the screengui into the script, then parenting to coregui… i do not know how this worked but it does.

EDIT: None of the scripts inside are working, thats my last issue. When button clicked, no error, but nothing opens up.