
I needed to create a category panel for placeable items in the UI — like the ones you see in city-building games. As a legacy, I inherited a ready-made UENUM
, which may be modified in the future.
Naturally, I didn’t want to manually create and tweak every single widget — especially knowing that the list of categories might change later. I wanted something simple and reusable: just run a For each loop
, generate everything on the fly, and ideally make it work for any enum, not just this one.
And there was a way! When you define a UENUM
, Unreal automatically generates all the metadata and creates a corresponding UEnum
object, which is a UObject
. All you have to do is use that data properly.