From 056ca2fae26578b2c568fe7624cc5def154fd298 Mon Sep 17 00:00:00 2001 From: Brook Jensen Date: Fri, 17 Sep 2021 16:07:57 -0700 Subject: [PATCH] Warning dialog if Live Coding is enabled during import --- .../Private/CodeGeneration/CodeGenerator.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Source/ArticyEditor/Private/CodeGeneration/CodeGenerator.cpp b/Source/ArticyEditor/Private/CodeGeneration/CodeGenerator.cpp index 211e331c..65f0a79c 100644 --- a/Source/ArticyEditor/Private/CodeGeneration/CodeGenerator.cpp +++ b/Source/ArticyEditor/Private/CodeGeneration/CodeGenerator.cpp @@ -25,6 +25,9 @@ #include "Misc/MessageDialog.h" #include "Dialogs/Dialogs.h" #include "ISourceControlModule.h" +#ifdef WITH_LIVE_CODING +#include "Windows/LiveCoding/Public/ILiveCodingModule.h" +#endif //---------------------------------------------------------------------------// //---------------------------------------------------------------------------// @@ -184,6 +187,22 @@ bool CodeGenerator::DeleteGeneratedAssets() void CodeGenerator::Compile(UArticyImportData* Data) { +#ifdef WITH_LIVE_CODING + ILiveCodingModule& LiveCodingModule = FModuleManager::LoadModuleChecked("LiveCoding"); + if (LiveCodingModule.IsEnabledForSession()) + { + // Cancel + FText ErrorTitle = FText(LOCTEXT("LiveReloadErrorTitle", "Disable Experimental Live Reload")); + FText ErrorText = FText(LOCTEXT("LiveReloadErrorMessage", "Unable to reimport Articy:Draft project changes because Experimental Live Reload is enabled. Please disable Live Reload and run a Full Reimport to continue.")); +#if ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION <= 24 + EAppReturnType::Type ReturnType = OpenMsgDlgInt(EAppMsgType::Ok, ErrorText, ErrorTitle); +#else + EAppReturnType::Type ReturnType = FMessageDialog::Open(EAppMsgType::Ok, ErrorText, &ErrorTitle); +#endif + return; + } +#endif + bool bWaitingForOtherCompile = false; // We can only hot-reload via DoHotReloadFromEditor when we already had code in our project