Enum Script Properties

Script Properties are awesome, but I would like have an option to define enum/multiple-choice properties that would give you a dropdown selector in the editor.

You can use hash properties, but then the user has to know exactly what the acceptable values are, and not make any mistakes typing them in—not great UX, especially for someone using a script from a library. You could also use a bunch of boolean properties, but that gets pretty messy too.

Perhaps you would define them like this:

go.property("species", { hash("Dog"), hash("Vorticon"), hash("Orc") })

It wouldn’t really matter if accessing it just gives you the index or the hash value, either way would do the trick.

15 Likes

+1 for this

3 Likes

This would be great for more user-friendly Lua libraries. :slight_smile: