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:
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)
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?
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)
-- 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)