2020-10-28 06:51:40 -04:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
|
|
|
|
#include "DataLayerEditorModule.h"
|
|
|
|
|
#include "PropertyEditorModule.h"
|
|
|
|
|
#include "Widgets/SWidget.h"
|
|
|
|
|
#include "Widgets/DeclarativeSyntaxSupport.h"
|
|
|
|
|
#include "Editor.h"
|
|
|
|
|
#include "Modules/ModuleManager.h"
|
|
|
|
|
#include "DataLayer/DataLayerPropertyTypeCustomization.h"
|
|
|
|
|
#include "DataLayer/SDataLayerBrowser.h"
|
|
|
|
|
#include "WorldPartition/DataLayer/DataLayer.h"
|
|
|
|
|
|
|
|
|
|
IMPLEMENT_MODULE(FDataLayerEditorModule, DataLayerEditor );
|
|
|
|
|
|
2020-12-04 12:48:56 -04:00
|
|
|
static const FName NAME_ActorDataLayer(TEXT("ActorDataLayer"));
|
|
|
|
|
|
2020-10-28 06:51:40 -04:00
|
|
|
void FDataLayerEditorModule::StartupModule()
|
|
|
|
|
{
|
|
|
|
|
FPropertyEditorModule& PropertyModule = FModuleManager::LoadModuleChecked<FPropertyEditorModule>("PropertyEditor");
|
2020-12-04 12:48:56 -04:00
|
|
|
PropertyModule.RegisterCustomPropertyTypeLayout(NAME_ActorDataLayer, FOnGetPropertyTypeCustomizationInstance::CreateLambda([] { return MakeShared<FDataLayerPropertyTypeCustomization>(); }));
|
2020-10-28 06:51:40 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FDataLayerEditorModule::ShutdownModule()
|
|
|
|
|
{
|
|
|
|
|
if (FPropertyEditorModule* PropertyModule = FModuleManager::GetModulePtr<FPropertyEditorModule>("PropertyEditor"))
|
|
|
|
|
{
|
2020-12-04 12:48:56 -04:00
|
|
|
PropertyModule->UnregisterCustomPropertyTypeLayout(NAME_ActorDataLayer);
|
2020-10-28 06:51:40 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TSharedRef<SWidget> FDataLayerEditorModule::CreateDataLayerBrowser()
|
|
|
|
|
{
|
|
|
|
|
return SNew(SDataLayerBrowser);
|
|
|
|
|
}
|