You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Merging //UE4/Dev-Main to Dev-Mobile (//UE4/Dev-Mobile)
#rb None [CL 5577958 by Jack Porter in Dev-Mobile branch]
This commit is contained in:
@@ -137,9 +137,9 @@ void FLiveCodingModule::EnableForSession(bool bEnable)
|
||||
UE_LOG(LogLiveCoding, Display, TEXT("Console will be hidden but remain running in the background. Restart to disable completely."));
|
||||
LppSetActive(false);
|
||||
LppSetVisible(false);
|
||||
bEnabledForSession = false;
|
||||
}
|
||||
}
|
||||
bEnabledForSession = bEnable;
|
||||
}
|
||||
|
||||
bool FLiveCodingModule::IsEnabledForSession() const
|
||||
@@ -147,6 +147,18 @@ bool FLiveCodingModule::IsEnabledForSession() const
|
||||
return bEnabledForSession;
|
||||
}
|
||||
|
||||
bool FLiveCodingModule::CanEnableForSession() const
|
||||
{
|
||||
#if !IS_MONOLITHIC
|
||||
FModuleManager& ModuleManager = FModuleManager::Get();
|
||||
if(ModuleManager.HasAnyOverridenModuleFilename())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
bool FLiveCodingModule::HasStarted() const
|
||||
{
|
||||
return bStarted;
|
||||
@@ -193,6 +205,13 @@ bool FLiveCodingModule::StartLiveCoding()
|
||||
{
|
||||
if(!bStarted)
|
||||
{
|
||||
// Make sure there aren't any hot reload modules already active
|
||||
if (!CanEnableForSession())
|
||||
{
|
||||
UE_LOG(LogLiveCoding, Error, TEXT("Unable to start live coding session. Some modules have already been hot reloaded."));
|
||||
return false;
|
||||
}
|
||||
|
||||
// Setup the console path
|
||||
GLiveCodingConsolePath = ConsolePathVariable->GetString();
|
||||
if (!FPaths::FileExists(GLiveCodingConsolePath))
|
||||
@@ -239,7 +258,7 @@ void FLiveCodingModule::UpdateModules()
|
||||
#if IS_MONOLITHIC
|
||||
wchar_t FullFilePath[WINDOWS_MAX_PATH];
|
||||
verify(GetModuleFileName(hInstance, FullFilePath, ARRAY_COUNT(FullFilePath)));
|
||||
EnableModule(FullFilePath);
|
||||
LppEnableModule(FullFilePath);
|
||||
#else
|
||||
TArray<FModuleStatus> ModuleStatuses;
|
||||
FModuleManager::Get().QueryModules(ModuleStatuses);
|
||||
@@ -261,24 +280,6 @@ void FLiveCodingModule::UpdateModules()
|
||||
#endif
|
||||
}
|
||||
|
||||
void FLiveCodingModule::EnableModule(const FString& FullFilePath)
|
||||
{
|
||||
if (!EnabledModules.Contains(FullFilePath))
|
||||
{
|
||||
LppEnableModule(*FullFilePath);
|
||||
EnabledModules.Add(FullFilePath);
|
||||
}
|
||||
}
|
||||
|
||||
void FLiveCodingModule::DisableModule(const FString& FullFilePath)
|
||||
{
|
||||
if(EnabledModules.Contains(FullFilePath))
|
||||
{
|
||||
LppDisableModule(*FullFilePath);
|
||||
EnabledModules.Remove(FullFilePath);
|
||||
}
|
||||
}
|
||||
|
||||
void FLiveCodingModule::OnModulesChanged(FName ModuleName, EModuleChangeReason Reason)
|
||||
{
|
||||
#if !IS_MONOLITHIC
|
||||
@@ -297,42 +298,42 @@ void FLiveCodingModule::OnModulesChanged(FName ModuleName, EModuleChangeReason R
|
||||
void FLiveCodingModule::ConfigureModule(const FName& Name, const FString& FullFilePath)
|
||||
{
|
||||
#if !IS_MONOLITHIC
|
||||
if (ShouldEnableModule(Name, FullFilePath))
|
||||
if (!ConfiguredModules.Contains(Name))
|
||||
{
|
||||
EnableModule(FullFilePath);
|
||||
}
|
||||
else
|
||||
{
|
||||
DisableModule(FullFilePath);
|
||||
if (ShouldPreloadModule(Name, FullFilePath))
|
||||
{
|
||||
LppEnableModule(*FullFilePath);
|
||||
}
|
||||
else
|
||||
{
|
||||
LppEnableLazyLoadedModule(*FullFilePath);
|
||||
}
|
||||
ConfiguredModules.Add(Name);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
bool FLiveCodingModule::ShouldEnableModule(const FName& Name, const FString& FullFilePath) const
|
||||
bool FLiveCodingModule::ShouldPreloadModule(const FName& Name, const FString& FullFilePath) const
|
||||
{
|
||||
if (Settings->ExcludeSpecificModules.Contains(Name))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (Settings->IncludeSpecificModules.Contains(Name))
|
||||
if (Settings->PreloadNamedModules.Contains(Name))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (FullFilePath.StartsWith(FullProjectDir))
|
||||
{
|
||||
if (Settings->bIncludeProjectModules == Settings->bIncludeProjectPluginModules)
|
||||
if (Settings->bPreloadProjectModules == Settings->bPreloadProjectPluginModules)
|
||||
{
|
||||
return Settings->bIncludeProjectModules;
|
||||
return Settings->bPreloadProjectModules;
|
||||
}
|
||||
|
||||
if(FullFilePath.StartsWith(FullProjectPluginsDir))
|
||||
{
|
||||
return Settings->bIncludeProjectPluginModules;
|
||||
return Settings->bPreloadProjectPluginModules;
|
||||
}
|
||||
else
|
||||
{
|
||||
return Settings->bIncludeProjectModules;
|
||||
return Settings->bPreloadProjectModules;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -342,18 +343,18 @@ bool FLiveCodingModule::ShouldEnableModule(const FName& Name, const FString& Ful
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Settings->bIncludeEngineModules == Settings->bIncludeEnginePluginModules)
|
||||
if (Settings->bPreloadEngineModules == Settings->bPreloadEnginePluginModules)
|
||||
{
|
||||
return Settings->bIncludeEngineModules;
|
||||
return Settings->bPreloadEngineModules;
|
||||
}
|
||||
|
||||
if(FullFilePath.StartsWith(FullEnginePluginsDir))
|
||||
{
|
||||
return Settings->bIncludeEnginePluginModules;
|
||||
return Settings->bPreloadEnginePluginModules;
|
||||
}
|
||||
else
|
||||
{
|
||||
return Settings->bIncludeEngineModules;
|
||||
return Settings->bPreloadEngineModules;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user