[DesktopVRSwitch] Testing

This commit is contained in:
NotAKidoS 2023-06-19 19:44:23 -05:00
parent 03514305be
commit 61a45f97bc
30 changed files with 957 additions and 524 deletions

View file

@ -1,4 +1,6 @@
using NAK.DesktopVRSwitch.Patches;
/**
using NAK.DesktopVRSwitch.Patches;
using System.Collections;
using UnityEngine;
using UnityEngine.XR;
@ -16,7 +18,7 @@ using ABI_RC.Core;
QualitySettings.vSyncCount = 0;
Time.fixedDeltaTime = Time.timeScale / hmd_DisplayFrequency;
**/
**
namespace NAK.DesktopVRSwitch;
@ -130,35 +132,36 @@ public class DesktopVRSwitcher : MonoBehaviour
public void PostVRModeSwitch(bool enableVR)
{
if (_softVRSwitch) return;
//close the menus
TryCatchHell.CloseCohtmlMenus();
//the base of VR checks
TryCatchHell.SetCheckVR(enableVR);
TryCatchHell.SetMetaPort(enableVR);
//game basics for functional gameplay post switch
TryCatchHell.RepositionCohtmlHud(enableVR);
TryCatchHell.UpdateHudOperations(enableVR);
TryCatchHell.DisableMirrorCanvas();
TryCatchHell.SwitchActiveCameraRigs(enableVR);
TryCatchHell.ResetCVRInputManager();
TryCatchHell.UpdateRichPresence();
TryCatchHell.UpdateGestureReconizerCam();
TryCatchHell.UpdateMenuCoreData(enableVR);
//let tracked objects know we switched
VRModeSwitchTracker.PostVRModeSwitch(enableVR);
//reload avatar by default, optional for debugging
if (_reloadLocalAvatar)
{
TryCatchHell.ReloadLocalAvatar();
}
SetupVR(enableVR);
_switchInProgress = false;
}
public void SetupVR(bool intoVR)
{
List<TryCatchHell.TryAction> actions = new List<TryCatchHell.TryAction>
{
TryCatchHell.SetCheckVR,
TryCatchHell.SetMetaPort,
TryCatchHell.RepositionCohtmlHud,
TryCatchHell.UpdateHudOperations,
TryCatchHell.DisableMirrorCanvas,
TryCatchHell.SwitchActiveCameraRigs,
TryCatchHell.ResetCVRInputManager,
TryCatchHell.UpdateRichPresence,
TryCatchHell.UpdateGestureReconizerCam,
TryCatchHell.UpdateMenuCoreData,
};
foreach (var action in actions)
{
TryCatchHell.TryExecute(action, intoVR);
}
TryCatchHell.TryExecute(VRModeSwitchTracker.PostVRModeSwitch, intoVR);
}
public void ResetSteamVROverrides()
{
// Reset physics time to Desktop default
@ -193,3 +196,6 @@ public class DesktopVRSwitcher : MonoBehaviour
}
}
**/