UIElements EnumField Custom Display

Hi all,

I’m making an editor window in UI Elements, and trying to get an EnumField to display custom strings rather than just the straight Enum values, as I want a single-item dropdown selector but the options I would like have special characters.

I’ve looked through the xds config file trying to find an attribute I could work with to no avail, as ‘choices’ doesn’t seem to do anything, I can’t figure out how to make a string-enum dictionary play nice with it, and I’m hoping there’s something less intimidating than writing an extension for uxml :face_with_spiral_eyes:

Sorry if this is a stupid question, I’m just not sure where to go on this one.

Many thanks

You could create your own PropertyDrawer:

In that link you can see an example where they created an IngredientDrawer for their Ingredient enum. Of course their example draws a wildly different UI for ‘Ingredient’ than you want. But you can see how it works and change it to meet your needs.

1 Like

Yeah, this is the way to get it done. I’m wrestling with making the UI Elements system actually accept it but it’s clearly the way to get it done. Thank you :slight_smile:

I’d ask in the UI Toolkit subforum, the devs are pretty active there.