Hello folks,
I am currently trying to program a Toolbar button but for the blueprint editor only. So my current way shown below adds the button to the level editor toolbar but I want the button to be in the blueprint editor toolbar. What do I need to change “LevelEditor.LevelEditorToolBar.PlayToolBar” to for this to work?
void FBAS_BPToCPPModule::RegisterMenus()
{
// Owner will be used for cleanup in call to UToolMenus::UnregisterOwner
FToolMenuOwnerScoped OwnerScoped(this);
{
UToolMenu* Menu = UToolMenus::Get()->ExtendMenu("LevelEditor.MainMenu.Window");
{
FToolMenuSection& Section = Menu->FindOrAddSection("WindowLayout");
Section.AddMenuEntryWithCommandList(FBAS_BPToCPPCommands::Get().OpenPluginWindow, PluginCommands);
}
}
{
UToolMenu* ToolbarMenu = UToolMenus::Get()->ExtendMenu("LevelEditor.LevelEditorToolBar.PlayToolBar");
{
FToolMenuSection& Section = ToolbarMenu->FindOrAddSection("Settings");
{
FToolMenuEntry& Entry = Section.AddEntry(FToolMenuEntry::InitToolBarButton(FBAS_BPToCPPCommands::Get().OpenPluginWindow));
Entry.SetCommandList(PluginCommands);
}
}
}
}