Skip to content

Instantly share code, notes, and snippets.

@pasotee
Last active February 2, 2023 20:17
Show Gist options
  • Save pasotee/beb6b31b7c7c3a579788aa282efb2569 to your computer and use it in GitHub Desktop.
Save pasotee/beb6b31b7c7c3a579788aa282efb2569 to your computer and use it in GitHub Desktop.
Snippet to add your own button inside Unreal's blueprint editor toolbar
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