So I got bored and made a simple UI element that allows you to set enums of something with a dropdown
Now this UI element was made in a day so don’t expect much of it.
Enum_Dropdown instantly scans the enum type you set for it and returns a bunch of enums represented by a button you can click.
This also features a autocomplete function as well if you feel like typing into the text box.
Simply place the frame named “Dropdown” into to any UI object
To get the enum, you can grab the enum from the dropdown’s “Enum” attribute.
local Dropdown = script.parent.Dropdown --or where ever you placed the dropdown
local EnumValue = Dropdown:GetAttribute("Enum")
script.Parent.Font = script.Parent.Parent.Dropdown:GetAttribute("Enum") -- do what you want with the enum value, in this case, I used it to set my text label's font.
When you first get the Dropdown model, you would notice that It is targeted towards fonts. You can change EnumUsed to whatever you like
local EnumUsed = Enum.Font -- <- change this to what ever you like
script.Parent.ScrollingFrame.Visible = false
script.Parent.ScrollingFrame.EnumObj.Visible = false
script.Parent.TextBox.Text = EnumUsed:GetEnumItems().Name
-- blah blah blah pretend this is the source code
You can customise the UI elements to your own style. Please do the original UI looks so uglyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
Here’s a quick demo:
If you want to toy around with the demo place
Enum_Dropdown DEMO.rbxl (69.4 KB)
Here’s the model
Click for Enum_Dropdown
I wanted to make a search function but I couldn’t get it to work. I’ll fix that later.
Feedback is appreciated