How to edit 'display name' of an enum in BP?

I currently have a variable of type ENUM with 20 entries.
I’m using ENUM because it displays a convenient selectable drop-down list when displayed in the details panel.
Each one of the 20 enum entries has a display name that I need to change dynamically.

Creating the enum asset and naming the items (via “display name”) is fine.
I am able to extract the display name for e.g. enum[7], however, there appears to be no way to set/change/edit the display name for enum item after creation.

Is there some other way to change the display name of an enum index in blueprint?

If not, is there another way to display a drop-down list similar to an enum variable with selectable items with text that can be changed at any time?

Basically, I want the ability to select an item/option from a variable’s drop down list (when displayed in the details panel) and also the ability to edit the name of the item when required. (An array is not suitable for my purposes.)

Any ideas?

Thanks.

Hi ClockworkOcean,
Yes, I read that post earlier today, but it didn’t have a solution other than using arrays which doesn’t have the same functionality as a drop-down enum list. Thanks anyway.

I saw this:

When are you using the drop down? Are you developing an asset or is this just during BP usage?

Yes, see what you mean, I don’t think it’s gonna happen :slight_smile:

Just during BP usage.

E.g.

The original enum asset is created containing ENUM: cat,dog,bird.

The variable’s drop-down list in the details panel shows:

[cat]

[dog]

[bird]

Basically, I wanted to change the enum.[0].display_name from “cat” to “fish” from the BP construction script.

I know the Enum asset is ‘baked’ at compile time, but I was hoping the display name was somehow editable. I suspect that it isn’t possible. I need to remain ‘BlueprintOnly’ so I don’t want to use a customised C++ enum.

I don’t think it’s gonna happen :slight_smile:

Me either!

Thanks for responding nonetheless.

I’ve seen something similar to what you’re looking for based on data tables instead of enums. For example:
https://forums.unrealengine.com/unreal-engine/feedback-for-epic/10317-dynamic-enums-or-custom-drop-downs-for-the-details-panels

If you would like to stick to enums, maybe you could use C++ and check FEnumEditorUtils. Here’s an example that updates the display name at index 0 of a UUserDefinedEnum called MyEnumType:

// Updating an existing display name using its index
FEnumEditorUtils::SetEnumeratorDisplayName(MyEnumType, 0, FText::FromString("an updated name!"));
    
// You can also add a brand new possible values for the enum in its last index...
FEnumEditorUtils::AddNewEnumeratorForUserDefinedEnum(MyEnumType);
    
// You can also remove an existing possible value using its index
FEnumEditorUtils::RemoveEnumeratorFromUserDefinedEnum(MyEnumType, 2);

Maybe you could use this function to create your own blueprint that does what you want?

Hope that helps!

Hi Tapioca Dreams,
Thanks for the suggestion. I was working purely in BP at the time (no custom C+±>blueprint nodes) so it wouldn’t have helped. Nonetheless, it’s a good suggestion. I will bookmark it as a potential future solution. Thanks.