Add button to UMG Editor

I want to extend editor by adding a button to UMG editor toolbar and File menu.

I’ve created a blank plugin that already adds a button to LevelEditor toolbar and Window menu, but when I try to move that button to UMG Editor it doesn’t appear.

I’ve already seen several tutorials but they all add a button to LevelEditor module, and I have no idea what am I doing wrong.

I’ve added “LevelEditor” and “UMGEditor” module to PrivateDependencyModuleNames

Mo code:

MyPlugin.cpp

#include "LevelEditor.h"
#include "UMGEditorModule.h"

//...........

void FFutureUISystemModule::StartupModule()
{
//.............
FLevelEditorModule& LevelEditorModule = FModuleManager::LoadModuleChecked<FLevelEditorModule>("LevelEditor");
	IUMGEditorModule& UMGEditorModule = FModuleManager::LoadModuleChecked<IUMGEditorModule>("UMGEditor");

{

TSharedPtr<FExtender> MenuExtender = MakeShareable(new FExtender());
MenuExtender->AddMenuExtension("FileLoadAndSave", EExtensionHook::After, PluginCommands, FMenuExtensionDelegate::CreateRaw(this, &FFutureUISystemModule::AddMenuExtension));

UMGEditorModule.GetMenuExtensibilityManager()->AddExtender(MenuExtender);

}

{

TSharedPtr<FExtender> MenuExtender = MakeShareable(new FExtender());
MenuExtender->AddMenuExtension("FileLoadAndSave", EExtensionHook::After, PluginCommands, FMenuExtensionDelegate::CreateRaw(this, &FFutureUISystemModule::AddMenuExtension));

LevelEditorModule.GetMenuExtensibilityManager()->AddExtender(MenuExtender);

}
}

I can see my button in LevelEditor file menu, but it doesn’t appead in UMGEditor file menu. Same thing is happening when I’m trying to extend toolbars.

I guess I’m doing something wrong in this line:

IUMGEditorModule& UMGEditorModule = FModuleManager::LoadModuleChecked("UMGEditor");

but I’m not sure.

Thanks for any help.

did you ever have any luck with this?