Reorder variable Categories in Class Defaults

Reordering categories is possible, if you are in C++, using the PrioritizeCategories meta-specifier inside the UCLASS macro. It accepts a space-separated list of categories.

UCLASS(Abstract, meta = (PrioritizeCategories ="Sound Content Style"))

There are some caveats I have noticed:

  • The list of categories splits on spaces, not commas. This means you can’t use categories that have spaces in them if you want to use this feature on them, even though it’s technically possible to have a category name with spaces. You can get around this by using PascalCase for your categories.
  • Some categories always come first (such as default)
  • Some categories ignore the sort order and insert themselves wherever they want. I’m assuming this is a bug, but for example, in a class derived from UCommonButtonBase, the Accessibility category always inserts itself after whatever the first category in PrioritizeCategories is. So for the example above, it always displays as Sound, Accessibility, Content, Style, rather that Sound, Content, Style, Accessibility like you’d expect.
4 Likes