void FUESlateModule::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");
FToolMenuSection& Section = Menu->FindOrAddSection("Log");
Section.AddMenuEntryWithCommandList(FUESlateCommands::Get().OpenPluginWindow, PluginCommands);
}
}
{
// 关卡编辑器工具条,5.4没看到在哪里!!!
UToolMenu* ToolbarMenu = UToolMenus::Get()->ExtendMenu("LevelEditor.LevelEditorToolBar");
{
FToolMenuSection& Section = ToolbarMenu->FindOrAddSection("Settings");
{
FToolMenuEntry& Entry = Section.AddEntry(FToolMenuEntry::InitToolBarButton(FUESlateCommands::Get().OpenPluginWindow));
Entry.SetCommandList(PluginCommands);
}
}
}
}
In UE5.4 ,Plugins Template —Editor Standalone Window,
In code “UToolMenu* ToolbarMenu = UToolMenus::Get()->ExtendMenu(“LevelEditor.LevelEditorToolBar”);”, LevelEditor.LevelEditorToolBar Can’t find,Where’s the problem?