You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#rb simon.therriault #jira UETOOL-4463 #preflight 62424a85c61d8a458f223a59 [CL 19540648 by George Rolfe in ue5-main branch]
56 lines
1.4 KiB
C++
56 lines
1.4 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "WebAPILiquidJSModule.h"
|
|
|
|
#include "IWebAPIEditorModule.h"
|
|
#include "WebAPILiquidJSCodeGenerator.h"
|
|
#include "WebAPILiquidJSProcess.h"
|
|
#include "Misc/CoreDelegates.h"
|
|
|
|
#define LOCTEXT_NAMESPACE "WebAPILiquidJS"
|
|
|
|
void FWebAPILiquidJSModule::StartupModule()
|
|
{
|
|
IWebAPIEditorModuleInterface& WebAPIEditorModule = IWebAPIEditorModuleInterface::Get();
|
|
|
|
WebAPIEditorModule.AddCodeGenerator(TEXT("LiquidJS"), UWebAPILiquidJSCodeGenerator::StaticClass());
|
|
|
|
WebApp = MakeShared<FWebAPILiquidJSProcess>();
|
|
TSharedPtr<FWebAPILiquidJSProcess> WebAppLocal = WebApp;
|
|
FCoreDelegates::OnFEngineLoopInitComplete.AddLambda([WebAppLocal]
|
|
{
|
|
WebAppLocal->TryStart();
|
|
});
|
|
}
|
|
|
|
void FWebAPILiquidJSModule::ShutdownModule()
|
|
{
|
|
WebApp->Shutdown();
|
|
FCoreDelegates::OnFEngineLoopInitComplete.RemoveAll(this);
|
|
|
|
static FName WebAPIEditorModuleName = TEXT("WebAPIEditorModule");
|
|
if(FModuleManager::Get().IsModuleLoaded(WebAPIEditorModuleName))
|
|
{
|
|
IWebAPIEditorModuleInterface& WebAPIEditorModule = IWebAPIEditorModuleInterface::Get();
|
|
WebAPIEditorModule.RemoveCodeGenerator(TEXT("LiquidJS"));
|
|
}
|
|
}
|
|
|
|
bool FWebAPILiquidJSModule::TryStartWebApp() const
|
|
{
|
|
if(!WebApp.IsValid())
|
|
{
|
|
return false;
|
|
}
|
|
else if(WebApp->GetStatus() >= FWebAPILiquidJSProcess::EStatus::Launching)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
return WebApp->TryStart();
|
|
}
|
|
|
|
#undef LOCTEXT_NAMESPACE
|
|
|
|
IMPLEMENT_MODULE(FWebAPILiquidJSModule, WebAPILiquidJS)
|