Hi [USER=“685049”]Elias Kremer[/USER] first you can use the FGlobalTabManager to register a new tab and spawn your new brand widget there, you can do that inside the StartupModule override, here is the example I made for one of my plugins:
FGlobalTabmanager::Get()->RegisterNomadTabSpawner(PluginDistributorTabName, FOnSpawnTab::CreateRaw(this, &FPluginDistributorModule::OnSpawnPluginTab))
.SetDisplayName(LOCTEXT("FPluginDistributorTabTitle", "PluginDistributor"))
.SetMenuType(ETabSpawnerMenuType::Hidden);
the delegate OnSpawnPluginTab will call the next function when you open your tab:
TSharedRef<SDockTab> FPluginDistributorModule::OnSpawnPluginTab(const FSpawnTabArgs& SpawnTabArgs)
{
return SNew(SDockTab)
.TabRole(ETabRole::NomadTab)
SNew(SPluginDistributor)
];
}
In my case I am using of course my own widget called SPluginDistributor, but now at this point you need a way to call this tab somehow, for this all you need to do is call the next function, this can be call from a button or whatever: FGlobalTabmanager::Get()->InvokeTab(PluginDistributorTabName);
if you want to be fancy you can register your own button to appear in the editor, and is totally the same case in the StartupModule override you can use something like this:
PluginCommands = MakeShareable(new FUICommandList);
PluginCommands->MapAction(
FPluginDistributorCommands::Get().OpenPluginWindow,
FExecuteAction::CreateRaw(this, &FPluginDistributorModule::PluginButtonClicked),
FCanExecuteAction());
FLevelEditorModule& LevelEditorModule = FModuleManager::LoadModuleChecked<FLevelEditorModule>("LevelEditor");
{
TSharedPtr<FExtender> MenuExtender = MakeShareable(new FExtender());
MenuExtender->AddMenuExtension("LevelEditor", EExtensionHook::After, PluginCommands, FMenuExtensionDelegate::CreateRaw(this, &FPluginDistributorModule::AddMenuExtension));
LevelEditorModule.GetMenuExtensibilityManager()->AddExtender(MenuExtender);
}
and like I said inside the method PluginButtonClicked is called the function to open your tab:
void FPluginDistributorModule::PluginButtonClicked()
{
FGlobalTabmanager::Get()->InvokeTab(PluginDistributorTabName);
}
hope that works for you, this is 4.20.1 don’t know what version you are
Cheers