Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Launch game with OpenVR flag if VR is required" #142

Merged
merged 2 commits into from
Jul 3, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 7 additions & 14 deletions OWML.Launcher/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -153,12 +150,13 @@ private bool HasVrMod(IList<IModData> mods)
return hasVrMod;
}

private void PatchGame(bool enableVR)
private void PatchGame(IList<IModData> mods)
{
_owPatcher.PatchGame();
_vrPatcher.PatchVR(enableVR);

try
{
var enableVR = HasVrMod(mods);
_vrPatcher.PatchVR(enableVR);
}
catch (Exception ex)
Expand All @@ -167,17 +165,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)
{
Expand Down