Last active
February 2, 2023 20:17
-
-
Save pasotee/beb6b31b7c7c3a579788aa282efb2569 to your computer and use it in GitHub Desktop.
Snippet to add your own button inside Unreal's blueprint editor 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* ToolBarMenu = UToolMenus::Get()->ExtendMenu("AssetEditor.BlueprintEditor.ToolBar"); | |
FToolMenuSection& Section = ToolBarMenu->AddSection("MySection", INVTEXT("My Section Name")); | |
Section.AddEntry(FToolMenuEntry::InitToolBarButton( | |
FName("MyAction"), | |
FUIAction(FExecuteAction::CreateLambda( | |
[]() | |
{ | |
UE_LOG(LogTemp, Warning, TEXT("MyAction was executed")); | |
} | |
)), | |
INVTEXT("My Action Name"), | |
INVTEXT("My Action Tooltip"), | |
FSlateIcon(FName("OutputLogStyle"), "Log.TabIcon") | |
)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment