Set Enum with a String Parameter

Hi,

I would like some advice on how you set a Enum property when you just have the “string” representing this enum.

In some places I used the UEnum LookupEnumName or FindEnumIndex but the current enum I want to map is : EInviteStatus (from OnlineSubSystem) and it has not been marked as UENUM!! so FindObject<UEnum>(ANY_PACKAGE, TEXT(“EInviteStatus”), true); return null :smiley:
So all the previous method can’t work.

As of now, I made a Switch Statement on the String to find the appropriate value, but I was wondering is there was another way to do it more efficiently.

Thanks,

If it’s not a reflected enum, there is no simple way. More to the point though, how would you ever end up holding a string representation of a non-reflected enum value?

EInviteStatus is part of the OnlineSubSystem. So if you need to get the value of this enum from your OSS system, you may end up with a string representation that’s coming from a JSon Object (by example).

Otherwise, you need to map the Enum Bit representation on both side and be sure that’s it won’t change.

So in case case, you need to do weird things ^^

Okay, afraid I know nothing about the OSS. :wink:
Still, if it’s intended for you to handle string representations, I’d guess it must just be an oversight for the type not to be reflected. Maybe put a bug report up on Answer Hub.