From 0be5743d79ef0dcbf58419224245b38043397d17 Mon Sep 17 00:00:00 2001 From: Ricardo Lopes Date: Thu, 2 Jul 2020 23:41:45 +0200 Subject: [PATCH 1/2] Revert "Launch game with OpenVR flag if VR is required (#124)" This reverts commit 0df846441027ec5aed5935845e57c94e01710cde. --- OWML.Launcher/App.cs | 31 +++++++++---------------------- 1 file changed, 9 insertions(+), 22 deletions(-) diff --git a/OWML.Launcher/App.cs b/OWML.Launcher/App.cs index e04ed595a..ae0b4861a 100644 --- a/OWML.Launcher/App.cs +++ b/OWML.Launcher/App.cs @@ -21,8 +21,6 @@ public class App private readonly OWPatcher _owPatcher; private readonly VRPatcher _vrPatcher; - private const string VrArgument = " -vrmode openvr"; - public App(IOwmlConfig owmlConfig, IModManifest owmlManifest, IModConsole writer, IModFinder modFinder, OutputListener listener, PathFinder pathFinder, OWPatcher owPatcher, VRPatcher vrPatcher) { @@ -57,10 +55,9 @@ public void Run(string[] args) ShowModList(mods); - var hasVrMod = HasVrMod(mods); - PatchGame(hasVrMod); + PatchGame(mods); - StartGame(args, hasVrMod); + StartGame(args); if (hasPortArgument) { @@ -145,18 +142,13 @@ private void OnOutput(string s) } } - private bool HasVrMod(IList mods) - { - var vrMod = mods.FirstOrDefault(x => x.Config.RequireVR && x.Config.Enabled); - var hasVrMod = vrMod != null; - _writer.WriteLine(hasVrMod ? $"{vrMod.Manifest.UniqueName} requires VR." : "No mods require VR."); - return hasVrMod; - } - - private void PatchGame(bool enableVR) + private void PatchGame(IList mods) { _owPatcher.PatchGame(); - _vrPatcher.PatchVR(enableVR); + + var vrMod = mods.FirstOrDefault(x => x.Config.RequireVR && x.Config.Enabled); + var enableVR = vrMod != null; + _writer.WriteLine(enableVR ? $"{vrMod.Manifest.UniqueName} requires VR." : "No mods require VR."); try { _vrPatcher.PatchVR(enableVR); @@ -167,17 +159,12 @@ private void PatchGame(bool enableVR) } } - private void StartGame(string[] args, bool enableVR) + private void StartGame(string[] args) { _writer.WriteLine("Starting game..."); try { - var gameArgs = string.Join(" ", args); - if (enableVR) - { - gameArgs += VrArgument; - } - Process.Start($"{_owmlConfig.GamePath}/OuterWilds.exe", gameArgs); + Process.Start($"{_owmlConfig.GamePath}/OuterWilds.exe", string.Join(" ", args)); } catch (Exception ex) { From 5e2aeef97ed62fd389e54ab821ec5bd4325c68d3 Mon Sep 17 00:00:00 2001 From: Ricardo Lopes Date: Fri, 3 Jul 2020 19:41:14 +0200 Subject: [PATCH 2/2] Re-revert HasVrMod --- OWML.Launcher/App.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/OWML.Launcher/App.cs b/OWML.Launcher/App.cs index ae0b4861a..0ba3ec59b 100644 --- a/OWML.Launcher/App.cs +++ b/OWML.Launcher/App.cs @@ -142,15 +142,21 @@ private void OnOutput(string s) } } + private bool HasVrMod(IList mods) + { + var vrMod = mods.FirstOrDefault(x => x.Config.RequireVR && x.Config.Enabled); + var hasVrMod = vrMod != null; + _writer.WriteLine(hasVrMod ? $"{vrMod.Manifest.UniqueName} requires VR." : "No mods require VR."); + return hasVrMod; + } + private void PatchGame(IList mods) { _owPatcher.PatchGame(); - var vrMod = mods.FirstOrDefault(x => x.Config.RequireVR && x.Config.Enabled); - var enableVR = vrMod != null; - _writer.WriteLine(enableVR ? $"{vrMod.Manifest.UniqueName} requires VR." : "No mods require VR."); try { + var enableVR = HasVrMod(mods); _vrPatcher.PatchVR(enableVR); } catch (Exception ex)