Last active
February 2, 2023 20:17
-
-
Save pasotee/58074a202b994a1cde8890b3badf82a1 to your computer and use it in GitHub Desktop.
Snippet to add your own actions inside Unreal's main toolbar
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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