Skip to content

Instantly share code, notes, and snippets.

@timoxley
Created January 24, 2024 17:11
Show Gist options
  • Save timoxley/9557f285cb64b48eed9f4048dcf3f308 to your computer and use it in GitHub Desktop.
Save timoxley/9557f285cb64b48eed9f4048dcf3f308 to your computer and use it in GitHub Desktop.
Auto-generate custom sections for your game + use emoji in custom section name
static const FName PropertyEditor("PropertyEditor");
void FMyGameEditorModule::InitCategories()
{
FPropertyEditorModule& PropertyModule = FModuleManager::GetModuleChecked<FPropertyEditorModule>(PropertyEditor);
for (const auto* const Class : TObjectRange<UClass>())
{
if (!Class->GetClassPathName().ToString().StartsWith("/Script/MyGame")) { continue; }
const TSharedRef<FPropertySection> Section = PropertyModule.FindOrCreateSection(
Class->GetFName(),
TEXT("MyGame"),
LOCTEXT("MyGame", "💛 My Game")
);
Section->AddCategory(TEXT("Default"));
Section->AddCategory(Class->GetFName());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment