How to make a reverse "switch on enum" macro?

Dobacetr’s code works as you want

The build file needs some extra modules
All parts after EnhancedInput are needed for it to compile

PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "EnhancedInput" , "BlueprintGraph" , "Slate", "SlateCore", "Kismet" , "UnrealEd", "KismetCompiler" });


works2

just be sure to set BLUEPRINTGRAPH_API to YOURGAMENAME_API where YOURGAMENAME is the name of your game but in capitalized letters.

1 Like