Files
UnrealEngineUWP/Engine/Source/Editor/EnvironmentLightingViewer/Private/EnvironmentLightingModule.cpp
Lauren Barnes 6248f8d412 Replacing legacy EditorStyle calls with AppStyle
#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]
2022-05-09 13:12:28 -04:00

74 lines
2.4 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "EnvironmentLightingModule.h"
#include "SEnvironmentLightingViewer.h"
#include "Widgets/SWidget.h"
#include "Modules/ModuleManager.h"
#include "Widgets/DeclarativeSyntaxSupport.h"
#include "Framework/Application/SlateApplication.h"
#include "Editor/WorkspaceMenuStructure/Public/WorkspaceMenuStructure.h"
#include "Editor/WorkspaceMenuStructure/Public/WorkspaceMenuStructureModule.h"
#include "Textures/SlateIcon.h"
#include "Framework/Docking/TabManager.h"
#include "Styling/AppStyle.h"
#include "Widgets/Docking/SDockTab.h"
#include "Modules/ModuleManager.h"
#include "ISettingsModule.h"
#define LOCTEXT_NAMESPACE "EnvironmentLightingViewer"
IMPLEMENT_MODULE(FEnvironmentLightingViewerModule, EnvironmentLightingViewer);
namespace EnvironmentLightingViewerModule
{
static const FName EnvironmentLightingViewerApp = FName("EnvironmentLightingViewerApp");
}
TSharedRef<SDockTab> CreateEnvLightTab(const FSpawnTabArgs& Args)
{
return SNew(SDockTab)
.TabRole(ETabRole::NomadTab)
[
SNew(SEnvironmentLightingViewer)
];
}
void FEnvironmentLightingViewerModule::StartupModule()
{
FGlobalTabmanager::Get()->RegisterNomadTabSpawner(EnvironmentLightingViewerModule::EnvironmentLightingViewerApp, FOnSpawnTab::CreateStatic(&CreateEnvLightTab))//TODO picker tab
.SetDisplayName(NSLOCTEXT("EnvironmentLightingViewerApp", "TabTitle", "EnvironmentLighting Viewer"))
.SetTooltipText(NSLOCTEXT("EnvironmentLightingViewerApp", "TooltipText", "Environment lighting window."))
.SetGroup(WorkspaceMenu::GetMenuStructure().GetDeveloperToolsDebugCategory())
.SetIcon(FSlateIcon(FAppStyle::GetAppStyleSetName(), "ClassViewer.TabIcon"));
// TODO setting module ISettingsModule* SettingsModule = FModuleManager::GetModulePtr<ISettingsModule>("Settings");
}
void FEnvironmentLightingViewerModule::ShutdownModule()
{
if (FSlateApplication::IsInitialized())
{
FGlobalTabmanager::Get()->UnregisterNomadTabSpawner(EnvironmentLightingViewerModule::EnvironmentLightingViewerApp);
}
// Unregister the setting
ISettingsModule* SettingsModule = FModuleManager::GetModulePtr<ISettingsModule>("Settings");
if (SettingsModule)
{
SettingsModule->UnregisterSettings("Project", "Editor", "EnvironmentLightingViewer");
}
}
TSharedRef<SWidget> FEnvironmentLightingViewerModule::CreateEnvironmentLightingViewer()
{
return SNew(SEnvironmentLightingViewer);
}
#undef LOCTEXT_NAMESPACE