2022-04-01 14:21:11 -04:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
|
|
|
|
#include "ModelViewViewModelBlueprintModule.h"
|
|
|
|
|
#include "Modules/ModuleManager.h"
|
|
|
|
|
|
2022-04-13 16:06:35 -04:00
|
|
|
#include "ViewModel/MVVMViewModelBlueprint.h"
|
|
|
|
|
#include "ViewModel/MVVMViewModelBlueprintCompiler.h"
|
2022-04-01 14:21:11 -04:00
|
|
|
|
2022-04-13 16:06:35 -04:00
|
|
|
|
|
|
|
|
class FModelViewViewModelBlueprintModule : public IModuleInterface
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
virtual void StartupModule() override
|
|
|
|
|
{
|
2023-02-06 09:20:10 -05:00
|
|
|
#if UE_MVVM_WITH_VIEWMODEL_EDITOR
|
2022-04-13 16:06:35 -04:00
|
|
|
IKismetCompilerInterface& KismetCompilerModule = FModuleManager::GetModuleChecked<IKismetCompilerInterface>("KismetCompiler");
|
|
|
|
|
KismetCompilerModule.GetCompilers().Add(&ViewModelBlueprintCompiler);
|
|
|
|
|
|
|
|
|
|
FKismetCompilerContext::RegisterCompilerForBP(UMVVMViewModelBlueprint::StaticClass(), &UMVVMViewModelBlueprint::GetCompilerForViewModelBlueprint);
|
2023-02-06 09:20:10 -05:00
|
|
|
#endif
|
2022-04-13 16:06:35 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
virtual void ShutdownModule() override
|
|
|
|
|
{
|
2023-02-06 09:20:10 -05:00
|
|
|
#if UE_MVVM_WITH_VIEWMODEL_EDITOR
|
2022-04-13 16:06:35 -04:00
|
|
|
if (IKismetCompilerInterface* KismetCompilerModule = FModuleManager::GetModulePtr<IKismetCompilerInterface>("KismetCompiler"))
|
|
|
|
|
{
|
|
|
|
|
KismetCompilerModule->GetCompilers().Remove(&ViewModelBlueprintCompiler);
|
|
|
|
|
}
|
2023-02-06 09:20:10 -05:00
|
|
|
#endif
|
2022-04-13 16:06:35 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
UE::MVVM::FViewModelBlueprintCompiler ViewModelBlueprintCompiler;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2022-09-20 19:24:01 -04:00
|
|
|
IMPLEMENT_MODULE(FModelViewViewModelBlueprintModule, ModelViewViewModelBlueprint);
|