Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How do you use Dock Widgets for plugins?

Asked by 5 years ago

I'm fairly new to plugin development and I'm having some trouble with the new DockWidgetPluginGui thing where it creates pop out windows, I'm trying to make a personal plugin where I can edit properties of a part as a test because I'm working on my first plugin, but I don't know how to make it so the window is visible when they click the button.

So far, I have it to where it shows up in the toolbar with the button there and an image but it creates the window when I load up studio, how do I make it so when you click the plugin button it shows the docked window and when you click it again it will close? I don't think there is a property of it called 'Visible' like regular frames and I'm stumped.

local toolbar = plugin:CreateToolbar('')
local button = toolbar:CreateButton('Property Adjuster', 'Adjusts properties.', 'rbxassetid://208075646')

local ChangeHistoryService = game:GetService('ChangeHistoryService')

local info = DockWidgetPluginGuiInfo.new(
    Enum.InitialDockState.Float,
    true,
    false,
    250,
    250,
    250,
    250
)

local interface = plugin:CreateDockWidgetPluginGui(
    'Property Adjuster',
    info
)

button.Click:Connect(function()

end)

1 answer

Log in to vote
0
Answered by 5 years ago

Hi!

To make the Dock widget toggle, simply change the Enabled property of the dock widget that you create.

button.Click:Connect(function()
    interface.Enabled = not interface.Enabled
end)

This should toggle the UI. Keep in mind that you will also need to insert UIs into the dock widget later.

Hope this helped, make sure to accept my answer if it did.

0
Don’t remind people to accept your answer, because if you helped them, it’s nature to accept the answer. You’re just greedy for reputation. User#19524 175 — 5y
0
Alrighty Incapaz, you can stop commenting on all my posts now. :) Thundermaker300 554 — 5y
Ad

Answer this question