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!)
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.
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
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
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.
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.
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.