Files
UnrealEngine/Engine/Plugins/Chooser/Source/ProxyTableEditor/Private/ProxyTableEditorModule.cpp
2025-05-18 13:04:45 +08:00

48 lines
1.3 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "ProxyTableEditorModule.h"
#include "ProxyTableEditor.h"
#include "ProxyTableEditorCommands.h"
#include "StructOutputDataCustomization.h"
#include "PropertyEditorModule.h"
#include "ProxyTableEditorStyle.h"
#include "Modules/ModuleManager.h"
#define LOCTEXT_NAMESPACE "ProxyTableEditorModule"
namespace UE::ProxyTableEditor
{
void FModule::StartupModule()
{
FProxyTableEditorStyle::Initialize();
FProxyTableEditor::RegisterWidgets();
FProxyTableEditorCommands::Register();
FPropertyEditorModule& PropertyModule = FModuleManager::LoadModuleChecked<FPropertyEditorModule>("PropertyEditor");
PropertyModule.RegisterCustomPropertyTypeLayout(FProxyStructOutput::StaticStruct()->GetFName(), FOnGetPropertyTypeCustomizationInstance::CreateLambda([] { return MakeShared<FStructOutputDataCustomization>(); }));
}
void FModule::ShutdownModule()
{
FProxyTableEditorCommands::Unregister();
if (UObjectInitialized() && !IsEngineExitRequested())
{
if (FPropertyEditorModule* PropertyModule = FModuleManager::GetModulePtr<FPropertyEditorModule>("PropertyEditor"))
{
PropertyModule->UnregisterCustomPropertyTypeLayout(FProxyStructOutput::StaticStruct()->GetFName());
}
}
FProxyTableEditorStyle::Shutdown();
}
}
IMPLEMENT_MODULE(UE::ProxyTableEditor::FModule, ProxyTableEditor);
#undef LOCTEXT_NAMESPACE