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

Fix game starting SteamVR in replay and/or when switching FPFC #61

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
17 changes: 16 additions & 1 deletion SiraUtil/Tools/FPFC/FPFCToggle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using SiraUtil.Zenject;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
Expand Down Expand Up @@ -180,7 +181,21 @@ private void DisableFPFC()
foreach (var listener in _fpfcListeners)
listener.Disabled();

InitializeXRLoader();
if (IsProcessRunning("vrserver") && IsProcessRunning("vrcompositor")) // Not sure how to check for Oculus if vrmode oculus is not working anymore
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Realisticaly there is no need to reinitialize openxr, since the game can function fine in FPFC without it, but this makes it impossible for oculus only users to start the game in FPFC and still have the headset bind on toggle...

One way would be to see if there is an oculus specific process that could be checked, but I dont own an oculus headset anymore so I cant see if there is one

InitializeXRLoader();
}

private bool IsProcessRunning(string targetProcessName)
{
var processes = Process.GetProcessesByName(targetProcessName);
foreach (var process in processes)
{
if (!process.HasExited)
{
return true;
}
}
return false;
}

public void Dispose()
Expand Down