Skip to content
Snippets Groups Projects
Commit 5df82bfc authored by Sebastian Pape's avatar Sebastian Pape
Browse files

Merge branch 'fix/revertingConfigStuffFromLastCommit' into 'develop'

Reverting the last commit, which alters the config. Another (temporary) fix...

See merge request VR-Group/unreal-development/NDisplayLaunchButton!7
parents b4fc375c 7f13927a
Branches
No related tags found
2 merge requests!9Update current master to develop,!7Reverting the last commit, which alters the config. Another (temporary) fix...
......@@ -45,46 +45,6 @@ void FNDisplayLaunchButtonModule::ShutdownModule()
FNDisplayLaunchButtonCommands::Unregister();
}
/*
* Copied from DisplayClusterEditorSettings.cpp:
* Switches on the nDisplay Plugin and changes the Editor Runtime
*/
void FNDisplayLaunchButtonModule::ChangeNDisplayStateAndStoreConfig(bool NewState, bool& OldState)
{
static const FString PlatformName = FPlatformProperties::PlatformName();
static const FString DefaultEnginePath = FString::Printf(TEXT("%s/DefaultEngine.ini"), *FPaths::SourceConfigDir());
static const FString DefaultPlatformEnginePath = FString::Printf(TEXT("%s%s/%sEngine.ini"), *FPaths::SourceConfigDir(), *PlatformName, *PlatformName);
static const FString DefaultGamePath = FString::Printf(TEXT("%sDefaultGame.ini"), *FPaths::SourceConfigDir());
FString OldValue;
GConfig->GetString(TEXT("/Script/DisplayClusterEditor.DisplayClusterEditorSettings"), TEXT("bEnabled"), OldValue, DefaultEnginePath);
OldState = OldValue.ToBool();
if (NewState)
{
// DefaultEngine.ini
GConfig->SetString(TEXT("/Script/Engine.Engine"), TEXT("GameEngine"), TEXT("/Script/DisplayCluster.DisplayClusterGameEngine"), DefaultPlatformEnginePath);
GConfig->SetString(TEXT("/Script/Engine.Engine"), TEXT("UnrealEdEngine"), TEXT("/Script/DisplayClusterEditor.DisplayClusterEditorEngine"), DefaultPlatformEnginePath);
GConfig->SetString(TEXT("/Script/Engine.Engine"), TEXT("GameViewportClientClassName"), TEXT("/Script/DisplayCluster.DisplayClusterViewportClient"), DefaultPlatformEnginePath);
// DefaultGame.ini
GConfig->SetString(TEXT("/Script/EngineSettings.GeneralProjectSettings"), TEXT("bUseBorderlessWindow"), TEXT("True"), DefaultGamePath);
}
else
{
GConfig->SetString(TEXT("/Script/Engine.Engine"), TEXT("GameEngine"), TEXT("/Script/Engine.GameEngine"), DefaultPlatformEnginePath);
GConfig->SetString(TEXT("/Script/Engine.Engine"), TEXT("UnrealEdEngine"), TEXT("/Script/UnrealEd.UnrealEdEngine"), DefaultPlatformEnginePath);
GConfig->SetString(TEXT("/Script/Engine.Engine"), TEXT("GameViewportClientClassName"), TEXT("/Script/Engine.GameViewportClient"), DefaultPlatformEnginePath);
// DefaultGame.ini
GConfig->SetString(TEXT("/Script/EngineSettings.GeneralProjectSettings"), TEXT("bUseBorderlessWindow"), TEXT("False"), DefaultGamePath);
}
GConfig->Flush(false, DefaultPlatformEnginePath);
GConfig->Flush(false, DefaultGamePath);
}
/**
* Since some plugins interfere with nDisplay execution, this function can disable them
* @param PluginName - Name of the plugin to enable/disable
......@@ -201,7 +161,6 @@ void FNDisplayLaunchButtonModule::PluginButtonClicked()
/* Enable/Disable Plugins temporarily */
if(!ChangePluginStateAndStoreConfig("SteamVR", false, SteamVRState)) return;
if(!ChangePluginStateAndStoreConfig("OculusVR", false, OculusVRState)) return;
ChangeNDisplayStateAndStoreConfig(true, nDisplayState);
/* Trigger Editor save. Needed, else old version will be launched every time */
if (!UEditorLoadingAndSavingUtils::SaveDirtyPackagesWithDialog(true, true)) return;
......@@ -312,7 +271,6 @@ void FNDisplayLaunchButtonModule::PluginButtonClicked()
/* Restore Plugin States */
ChangePluginStateAndStoreConfig("SteamVR", SteamVRState, SteamVRState);
ChangePluginStateAndStoreConfig("OculusVR", OculusVRState, OculusVRState);
ChangeNDisplayStateAndStoreConfig(nDisplayState, nDisplayState);
}
/**
......
......@@ -20,7 +20,6 @@ public:
/** IModuleInterface implementation */
virtual void StartupModule() override;
virtual void ShutdownModule() override;
static void ChangeNDisplayStateAndStoreConfig(bool NewState, bool& OldState);
bool ChangePluginStateAndStoreConfig(FString PluginName, bool NewState, bool& OldState) const;
static FString GetEditorExecutableName();
static FString GetFilePathInProject(FString FileName);
......@@ -35,5 +34,4 @@ public:
private:
bool SteamVRState = false;
bool OculusVRState = false;
bool nDisplayState = false;
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment