Announcement

Collapse
No announcement yet.

Extending a Level Editor Tool Bar Menu

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Extending a Level Editor Tool Bar Menu

    Created a plugin that adds a ComboButton to generate a menu on the Level Editors Tool Bar. Now I'm looking to extend this menu, but the it seems I can't access the extension point.

    Code:
    UMyOtherModule::UMyOtherModule()
    {
        if (IsRunningGame())
            return;
    
        FLevelEditorModule& LevelEditorModule = FModuleManager::LoadModuleChecked<FLevelEditorModule>("LevelEditor");
    
        struct Local
        {
            static void AddMenuCommands(FMenuBuilder& MenuBuilder)
            {
                MenuBuilder.AddSubMenu(FText::FromString("Menu Items"),
                    FText::FromString("Menu Item Tool Tip"),
                    FNewMenuDelegate::CreateStatic(&GenerateMenu)
                );
            }
        };
    
        TSharedRef<FExtender> MenuExtender(new FExtender());
        MenuExtender->AddMenuExtension("MyPluginExtensionPoint", EExtensionHook::After, NULL, FMenuExtensionDelegate::CreateStatic(&Local::AddMenuCommands));
        LevelEditorModule.GetMenuExtensibilityManager()->AddExtender(MenuExtender);
    }
    It seems I can't manage to extend the menu of any other Tool Bar Menu either, like attempting to hook into `ProjectSettingsSection`

    I assume the GetMenuExtensibilityManager I'm looking for is not the one from the LevelEditor but from whichever module it is that Extended the Tool Bar in the first place?
Working...
X