Files
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

65 lines
1.3 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "CoreMinimal.h"
#include "Modules/ModuleManager.h"
#include "Interfaces/IEditorStyleModule.h"
#include "SlateEditorStyle.h"
#include "StarshipStyle.h"
#include "Styling/CoreStyle.h"
#include "Styling/StyleColors.h"
/**
* Implements the Editor style module, loaded by SlateApplication dynamically at startup.
*/
class FEditorStyleModule
: public IEditorStyleModule
{
public:
// IEditorStyleModule interface
virtual void StartupModule( ) override
{
if (FCoreStyle::IsStarshipStyle())
{
#if ALLOW_THEMES
USlateThemeManager::Get().ValidateActiveTheme();
#endif
bUsingStarshipStyle = true;
FStarshipEditorStyle::Initialize();
// set the application style to be the editor style
FAppStyle::SetAppStyleSetName(FStarshipEditorStyle::GetStyleSetName());
}
else
{
FSlateEditorStyle::Initialize();
// set the application style to be the editor style
FAppStyle::SetAppStyleSetName(FAppStyle::GetAppStyleSetName());
}
}
virtual void ShutdownModule( ) override
{
if (bUsingStarshipStyle)
{
FStarshipEditorStyle::Shutdown();
}
else
{
FSlateEditorStyle::Shutdown();
}
}
// End IModuleInterface interface
private:
bool bUsingStarshipStyle = false;
};
IMPLEMENT_MODULE(FEditorStyleModule, EditorStyle)