Skip to content

Instantly share code, notes, and snippets.

@pasotee
Last active February 2, 2023 20:17
Show Gist options
  • Save pasotee/58074a202b994a1cde8890b3badf82a1 to your computer and use it in GitHub Desktop.
Save pasotee/58074a202b994a1cde8890b3badf82a1 to your computer and use it in GitHub Desktop.
Snippet to add your own actions inside Unreal's main toolbar
void FYourModuleModule::StartupModule()
{
UToolMenu* MainTabFileMenu = UToolMenus::Get()->RegisterMenu("MainFrame.MainTabMenu.File", "MainFrame.MainMenu.File");
FToolMenuSection& Section = MainTabFileMenu->AddSection("MySection", INVTEXT("My Section Name"));
Section.AddMenuEntry(
FName("MyAction"),
INVTEXT("My Action Name"),
INVTEXT("My Action Tooltip"),
FSlateIcon(FName("OutputLogStyle"), "Log.TabIcon"),
FUIAction(FExecuteAction::CreateLambda(
[]()
{
UE_LOG(LogTemp, Warning, TEXT("MyAction was executed"));
}
))
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment