mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-03 23:09:22 +00:00
move bunch of things to depricated folder
This commit is contained in:
parent
86828a94e2
commit
21f8893095
156 changed files with 193 additions and 93 deletions
|
@ -0,0 +1,62 @@
|
|||
using ABI_RC.Core;
|
||||
using ABI_RC.Systems.InputManagement;
|
||||
using ABI_RC.Systems.InputManagement.InputModules;
|
||||
using ABI_RC.Systems.InputManagement.XR.Modules;
|
||||
|
||||
namespace NAK.DesktopVRSwitch.VRModeTrackers;
|
||||
|
||||
public class CVRInputManagerTracker : VRModeTracker
|
||||
{
|
||||
public override void TrackerInit()
|
||||
{
|
||||
VRModeSwitchManager.OnPostVRModeSwitch += OnPostSwitch;
|
||||
}
|
||||
|
||||
public override void TrackerDestroy()
|
||||
{
|
||||
VRModeSwitchManager.OnPostVRModeSwitch -= OnPostSwitch;
|
||||
}
|
||||
|
||||
private void OnPostSwitch(object sender, VRModeSwitchManager.VRModeEventArgs args)
|
||||
{
|
||||
DesktopVRSwitch.Logger.Msg("Resetting CVRInputManager inputs.");
|
||||
|
||||
CVRInputManager.Instance.inputEnabled = true;
|
||||
|
||||
// IM CRYING
|
||||
//CVRInputManager.Instance.reload = true;
|
||||
|
||||
// TODO: MOVE THIS TO DIFFERENT TRACKER
|
||||
RootLogic.Instance.ToggleMouse(args.IsUsingVr);
|
||||
|
||||
//just in case
|
||||
CVRInputManager.Instance.textInputFocused = false;
|
||||
//sometimes head can get stuck, so just in case
|
||||
CVRInputManager.Instance.independentHeadToggle = false;
|
||||
//just nice to load into desktop with idle gesture
|
||||
CVRInputManager.Instance.gestureLeft = 0f;
|
||||
CVRInputManager.Instance.gestureLeftRaw = 0f;
|
||||
CVRInputManager.Instance.gestureRight = 0f;
|
||||
CVRInputManager.Instance.gestureRightRaw = 0f;
|
||||
//turn off finger tracking input
|
||||
CVRInputManager.Instance.individualFingerTracking = false;
|
||||
|
||||
//add input module if you started in desktop
|
||||
if (CVRInputManager._moduleXR == null)
|
||||
{
|
||||
CVRInputManager.Instance.AddInputModule(CVRInputManager._moduleXR = new CVRInputModule_XR());
|
||||
}
|
||||
else
|
||||
{
|
||||
// set to null so input manager doesnt attempt to access it
|
||||
|
||||
if (CVRInputManager._moduleXR._leftModule != null)
|
||||
if (CVRInputManager._moduleXR._leftModule is CVRXRModule_SteamVR leftModule) leftModule._steamVr = null;
|
||||
if (CVRInputManager._moduleXR._rightModule != null)
|
||||
if (CVRInputManager._moduleXR._rightModule is CVRXRModule_SteamVR rightModule) rightModule._steamVr = null;
|
||||
}
|
||||
|
||||
//enable xr input or whatnot
|
||||
CVRInputManager._moduleXR.InputEnabled = args.IsUsingVr;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue