You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#jira none #rnx #rb lauren.barnes #preflight 61a7b2fa832ebaf948498706 #ROBOMERGE-AUTHOR: tyson.brochu #ROBOMERGE-SOURCE: CL 18341271 in //UE5/Release-5.0/... via CL 18341312 #ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469) [CL 18341338 by tyson brochu in ue5-release-engine-test branch]
59 lines
2.1 KiB
C++
59 lines
2.1 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "StaticMeshEditorModeUILayer.h"
|
|
#include "WorkspaceMenuStructure.h"
|
|
#include "WorkspaceMenuStructureModule.h"
|
|
#include "Toolkits/IToolkit.h"
|
|
#include "StaticMeshEditor.h"
|
|
#include "StaticMeshEditorModule.h"
|
|
|
|
void UStaticMeshEditorUISubsystem::Initialize(FSubsystemCollectionBase& Collection)
|
|
{
|
|
IStaticMeshEditorModule& StaticMeshEditorModule = FModuleManager::GetModuleChecked<IStaticMeshEditorModule>("StaticMeshEditor");
|
|
StaticMeshEditorModule.OnRegisterLayoutExtensions().AddUObject(this, &UStaticMeshEditorUISubsystem::RegisterLayoutExtensions);
|
|
}
|
|
|
|
void UStaticMeshEditorUISubsystem::Deinitialize()
|
|
{
|
|
IStaticMeshEditorModule& StaticMeshEditorModule = FModuleManager::GetModuleChecked<IStaticMeshEditorModule>("StaticMeshEditor");
|
|
StaticMeshEditorModule.OnRegisterLayoutExtensions().RemoveAll(this);
|
|
}
|
|
|
|
void UStaticMeshEditorUISubsystem::RegisterLayoutExtensions(FLayoutExtender& Extender)
|
|
{
|
|
FTabManager::FTab NewTab(FTabId(UAssetEditorUISubsystem::TopLeftTabID), ETabState::ClosedTab);
|
|
Extender.ExtendLayout(FStaticMeshEditor::SocketManagerTabId, ELayoutExtensionPosition::After, NewTab);
|
|
}
|
|
|
|
FStaticMeshEditorModeUILayer::FStaticMeshEditorModeUILayer(const IToolkitHost* InToolkitHost) :
|
|
FAssetEditorModeUILayer(InToolkitHost)
|
|
{}
|
|
|
|
void FStaticMeshEditorModeUILayer::OnToolkitHostingStarted(const TSharedRef<IToolkit>& Toolkit)
|
|
{
|
|
if (!Toolkit->IsAssetEditor())
|
|
{
|
|
FAssetEditorModeUILayer::OnToolkitHostingStarted(Toolkit);
|
|
HostedToolkit = Toolkit;
|
|
Toolkit->SetModeUILayer(SharedThis(this));
|
|
Toolkit->RegisterTabSpawners(ToolkitHost->GetTabManager().ToSharedRef());
|
|
RegisterModeTabSpawners();
|
|
OnToolkitHostReadyForUI.ExecuteIfBound();
|
|
}
|
|
}
|
|
|
|
void FStaticMeshEditorModeUILayer::OnToolkitHostingFinished(const TSharedRef<IToolkit>& Toolkit)
|
|
{
|
|
if (HostedToolkit.IsValid() && HostedToolkit.Pin() == Toolkit)
|
|
{
|
|
FAssetEditorModeUILayer::OnToolkitHostingFinished(Toolkit);
|
|
}
|
|
}
|
|
|
|
TSharedPtr<FWorkspaceItem> FStaticMeshEditorModeUILayer::GetModeMenuCategory() const
|
|
{
|
|
const IWorkspaceMenuStructure& MenuStructure = WorkspaceMenu::GetMenuStructure();
|
|
return MenuStructure.GetLevelEditorModesCategory();
|
|
}
|
|
|