You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#preflight 6272a74d2f6d177be3c6fdda #rb Matt.Kuhlenschmidt #ROBOMERGE-OWNER: Lauren.Barnes #ROBOMERGE-AUTHOR: lauren.barnes #ROBOMERGE-SOURCE: CL 20057269 via CL 20070159 via CL 20072035 via CL 20072203 #ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690) #ROBOMERGE-CONFLICT from-shelf [CL 20105363 by Lauren Barnes in ue5-main branch]
100 lines
2.8 KiB
C++
100 lines
2.8 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "Modules/ModuleManager.h"
|
|
#include "Widgets/DeclarativeSyntaxSupport.h"
|
|
#include "Textures/SlateIcon.h"
|
|
#include "Framework/Docking/TabManager.h"
|
|
#include "Styling/AppStyle.h"
|
|
#include "ISessionManager.h"
|
|
#include "Widgets/Browser/SSessionBrowser.h"
|
|
#include "Widgets/Console/SSessionConsole.h"
|
|
#include "Widgets/SSessionFrontend.h"
|
|
#include "ISessionFrontendModule.h"
|
|
#include "Widgets/Docking/SDockTab.h"
|
|
#include "WorkspaceMenuStructure.h"
|
|
#include "WorkspaceMenuStructureModule.h"
|
|
|
|
|
|
static const FName SessionFrontendTabName("SessionFrontend");
|
|
|
|
|
|
/**
|
|
* Implements the SessionFrontend module.
|
|
*/
|
|
class FSessionFrontendModule
|
|
: public ISessionFrontendModule
|
|
{
|
|
public:
|
|
|
|
// ISessionFrontendModule interface
|
|
|
|
virtual TSharedRef<class SWidget> CreateSessionBrowser( const TSharedRef<ISessionManager>& SessionManager ) override
|
|
{
|
|
return SNew(SSessionBrowser, SessionManager);
|
|
}
|
|
|
|
virtual TSharedRef<class SWidget> CreateSessionConsole( const TSharedRef<ISessionManager>& SessionManager ) override
|
|
{
|
|
return SNew(SSessionConsole, SessionManager);
|
|
}
|
|
|
|
virtual void InvokeSessionFrontend(FName SubTabToActivate = NAME_None) override
|
|
{
|
|
FGlobalTabmanager::Get()->TryInvokeTab(SessionFrontendTabName);
|
|
if ( WeakFrontend.IsValid() )
|
|
{
|
|
if ( SubTabToActivate != NAME_None )
|
|
{
|
|
WeakFrontend.Pin()->GetTabManager()->TryInvokeTab(SubTabToActivate);
|
|
}
|
|
}
|
|
}
|
|
|
|
public:
|
|
|
|
// IModuleInterface interface
|
|
|
|
virtual void StartupModule() override
|
|
{
|
|
auto& TabSpawnerEntry = FGlobalTabmanager::Get()->RegisterNomadTabSpawner(SessionFrontendTabName, FOnSpawnTab::CreateRaw(this, &FSessionFrontendModule::SpawnSessionFrontendTab))
|
|
.SetDisplayName(NSLOCTEXT("FSessionFrontendModule", "FrontendTabTitle", "Session Frontend"))
|
|
.SetTooltipText(NSLOCTEXT("FSessionFrontendModule", "FrontendTooltipText", "Open the Session Frontend tab."))
|
|
.SetIcon(FSlateIcon(FAppStyle::GetAppStyleSetName(), "SessionFrontEnd.TabIcon"));
|
|
|
|
TabSpawnerEntry.SetGroup(WorkspaceMenu::GetMenuStructure().GetToolsCategory());
|
|
}
|
|
|
|
virtual void ShutdownModule() override
|
|
{
|
|
FGlobalTabmanager::Get()->UnregisterNomadTabSpawner(SessionFrontendTabName);
|
|
}
|
|
|
|
private:
|
|
|
|
/**
|
|
* Creates a new session front-end tab.
|
|
*
|
|
* @param SpawnTabArgs The arguments for the tab to spawn.
|
|
* @return The spawned tab.
|
|
*/
|
|
TSharedRef<SDockTab> SpawnSessionFrontendTab( const FSpawnTabArgs& SpawnTabArgs )
|
|
{
|
|
const TSharedRef<SDockTab> DockTab = SNew(SDockTab)
|
|
.TabRole(ETabRole::MajorTab);
|
|
|
|
TSharedRef<SSessionFrontend> Frontend = SNew(SSessionFrontend, DockTab, SpawnTabArgs.GetOwnerWindow());
|
|
WeakFrontend = Frontend;
|
|
|
|
DockTab->SetContent(Frontend);
|
|
|
|
return DockTab;
|
|
}
|
|
|
|
private:
|
|
TWeakPtr<SSessionFrontend> WeakFrontend;
|
|
};
|
|
|
|
|
|
IMPLEMENT_MODULE(FSessionFrontendModule, SessionFrontend);
|