Option 1: Adding a Menu Button Action
cppCopy code// MyModule.cpp
void MyModule::StartupModule()
{
MyModuleCommands::Register();
FGlobalTabmanager::Get()->RegisterNomadTabSpawner(MyModuleName, FOnSpawnTab::CreateRaw(this, &MyModule::SpawnMyPluginTab));
}
void MyModule::RegisterMenus()
{
FToolMenuOwnerScoped OwnerScoped(this);
UToolMenu* Menu = UToolMenus::Get()->ExtendMenu("LevelEditor.MainMenu.Tools");
FToolMenuSection& Section = Menu->AddSection("MyModuleCommands", LOCTEXT("MyCommands", "My Module Commands"));
Section.AddMenuEntryWithCommandList(
MyModuleCommands::Get().OpenPluginWindow,
PluginCommands,
NAME_None,
LOCTEXT("OpenMyWindow", "Open My Window"),
LOCTEXT("OpenMyWindowTooltip", "Opens my custom plugin window."),
FSlateIcon(FMyModuleStyle::GetStyleSetName(), "MyCommandIcon")
);
}Option 2: Creating a Submenu with Various Options
PreviousUnreal Editor: adding a custom menuNextSpawning a tab when button clicked (similar to content directory etc)
Last updated