Plugin UI Toolkit

Tired of writing UI code instead of plugins? Me too, this is probably the sixth time I’ve done this. But I finally like this one!

I’ve been working on a little UI toolkit to make life easier for plugin makers (myself), and I’m wondering if there’s enough interest in such a thing to justify cleaning up the code and releasing it. So far, I’ve been working on some quick functionals, like a flexible dialog window:



Making these happen (sequentially!) is really easy!. The easier it is, the more likely you are to actually use them when you should… right?

--First, a warning!
UI.WarnDialog("Warning", "A bad thing happened, but it's okay!")


--Then an error :(
local response = UI.ErrorDialog("Something very bad happened! What do you want to do?", UI.ErrorDialogButtons.RetryIgnore)
if response == UI.ErrorDialogResponse.Retry then
	--retry the operation
else
	--ignore and continue
end


--Then... a question.
local option = UI.PromptDialog("Prompt", "What would you like to do?", {
	[1] = { Text = "Wait and see", Id = "Wait" },
	[2] = { Text = "Go right now", Id = "Go" }
})
if option.Id == "Wait" then
	wait()
	see()
elseif option.Id == "Go" then
	go()
end

I’m planning on adding (for my own sake) the following:

  • List view
  • Grid view
  • Framed 3D object with billboard background
  • Textbox (custom, with text selection and multiline navigation if possible!)
  • Number picker
  • Checkbox
  • Color3 picker
  • Node editor (think dialog or AI behavior trees)

Any interest at all?

Oh, and it’s also somewhat customizable:

31 Likes

this’d be helpful :stuck_out_tongue: but the rest of our UI would need to look like that.

1 Like

That’s the idea! I’m going to continue this and release it, so that it can be used as a full solution for a plugin’s on-screen interface.

If you want a headstart, I’m publishing and updating this model: Plugin UI Toolkit - Roblox

UPDATE: I added documentation and uploaded the icons as decals for anyone to access. Go ahead and jump in; windows, dialogs, and basic text buttons are good to go. I’d love to see this get adopted so that we can have some intuitive interfaces with common standards. Common UI means that if someone gets good at using it elsewhere, they’re automatically good at using yours!

UPDATE 2: Just added the listview. If you can figure out how it works, props! It’s not quite done yet, though.


I’d definitely consider using this. UI code can be time consuming and I always find myself rewriting it.Specifically grid views, I always rewrite grid views because they’re ugly, but they never get any better.

Could you add an option to change the background, and the top bar/button colours?

I really like this idea, and I’ll be sure to use it!

Those are all customizable!

1 Like

jeebers you reminded me I accidently wiped my plugin UI lib from my computer several months ago :frowning:
I should probably restart that project.

In your code examples, why does the error dialog not have title customization? Or is that a flaw in the example?

That’s by design. You still have access to UI.YieldDialog, see the implementation of ErrorDialog if you want to do a different title per dialog!

If you need any help with this or need ideas, I made a plugin called Color+, which has 3 different color pickers.

1 Like

Some progress updates:



The code used to make this:

local UI = require(script.Parent:WaitForChild("UI"))


if UI.YesNoDialog("Continue?", "Would you like to open the listview and splitter test window?") then
	local window = UI.BaseWindow("Test Window", 100, 100, 200, 200, function() 
		UI.WarnDialog("Warning!", "You closed the window. Just thought you should know.")
	end, true, true)
	window:fillParent(200)
	
	local vertSplit = UI.VerticalSplit(window.content, 0.2, true)
	local horzSplit = UI.HorizontalSplit(vertSplit.left, 0.2, false)
	
	UI.Label(horzSplit.top, "The splitter to the right of this text can be dragged!")
	
	local list = UI.ListView(horzSplit.bottom, 30, false, true, false, true, true)
	for i = 1, 100 do
		local item = list:newItem()
		UI.FillLabel(item.frame, "Item " .. i, 10, true)
	end
end

Buttons are a bit big, but other than that it looks fantastic

Kind of bothering that the padding between the vertical edges is different from the padding between the horizontal edges when it comes to the buttons at the bottom of popups

1 Like

Well, they’re large and easy to click on. It’s meant for productivity rather than a game UI. I wouldn’t recommend using it for a game!

Better?

Kind of. Padding between the Yes/No buttons is different still.

Not sure I like this, seems wasteful.

1 Like

Here’s the image you just posted:

Notice how the vertical padding is 15p but the horizontal is 20p? That looks awkward because it switches up formatting. By equal padding, I mean they should be the same all around, like this:

You don’t have to increase the padding to 20 like you did in that image. 15 was fine – you just needed it to be 15 across the board.

Oh, I was in a hurry, didn’t notice it still wasn’t right. I’ll check it out later, lunch is over!

I should chime in that I’ve very interested. Some of the things you have listed as “planned to include” are important to me, such as list views (which recycle elements), custom textboxes, etc.

I have a build tool project with which I’m messing around a bit, but it definitely needs a good plugin solution so I don’t spend all my time debugging small issues in guis and so that I feel more comfortable using more advanced widgets which might better suit the situation. For example, using a number slider instead of a textbox for inputting your resizing increment is super desirable (way faster; more productive), but because it’s harder to code, I’m less likely to use it. :stuck_out_tongue:

I’m working on a gui solution of my own, but I would rather use someone else’s as it would streamline the process. Do you have an ETA as to when this is completed?

For the time being, I’ll work on my own solution, but I may switch over if you surpass me in development. I’m not making the fastest progress. :stuck_out_tongue: