mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-03 23:09:22 +00:00
[DesktopVRSwitch] More fixes for 2023r171.
This commit is contained in:
parent
9f01f8e6a7
commit
3d6b1f75a4
17 changed files with 67 additions and 62 deletions
|
@ -1,5 +1,4 @@
|
|||
using ABI_RC.Core.Savior;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NAK.DesktopVRSwitch.VRModeTrackers;
|
||||
|
||||
|
@ -21,4 +20,4 @@ public class CVRGestureRecognizerTracker : VRModeTracker
|
|||
|
||||
CVRGestureRecognizer.Instance._camera = args.PlayerCamera;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,5 +1,4 @@
|
|||
using ABI_RC.Core.Savior;
|
||||
using ABI_RC.Systems.InputManagement;
|
||||
using ABI_RC.Systems.InputManagement;
|
||||
using ABI_RC.Systems.InputManagement.InputModules;
|
||||
|
||||
namespace NAK.DesktopVRSwitch.VRModeTrackers;
|
||||
|
|
|
@ -20,14 +20,14 @@ public class CVRPickupObjectTracker : MonoBehaviour
|
|||
|
||||
public void OnPostSwitch(object sender, VRModeSwitchManager.VRModeEventArgs args)
|
||||
{
|
||||
if (_pickupObject != null)
|
||||
{
|
||||
// Drop the object if it is being held locally
|
||||
if (_pickupObject._controllerRay != null)
|
||||
_pickupObject._controllerRay.DropObject(true);
|
||||
if (_pickupObject == null)
|
||||
return;
|
||||
|
||||
// Drop the object if it is being held locally
|
||||
if (_pickupObject._controllerRay != null)
|
||||
_pickupObject._controllerRay.DropObject(true);
|
||||
|
||||
// Swap the grip origins
|
||||
(_storedGripOrigin, _pickupObject.gripOrigin) = (_pickupObject.gripOrigin, _storedGripOrigin);
|
||||
}
|
||||
// Swap the grip origins
|
||||
(_storedGripOrigin, _pickupObject.gripOrigin) = (_pickupObject.gripOrigin, _storedGripOrigin);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,8 +16,9 @@ public class CVR_InteractableManagerTracker : VRModeTracker
|
|||
|
||||
private void OnPostSwitch(object sender, VRModeSwitchManager.VRModeEventArgs args)
|
||||
{
|
||||
DesktopVRSwitch.Logger.Msg($"Setting CVRInputManager inputEnabled & CVR_InteractableManager enableInteractions to {!args.IsUsingVr}");
|
||||
DesktopVRSwitch.Logger.Msg($"Enabling CVR_InteractableManager enableInteractions.");
|
||||
|
||||
CVR_InteractableManager.enableInteractions = !args.IsUsingVr;
|
||||
// ?
|
||||
CVR_InteractableManager.enableInteractions = true;
|
||||
}
|
||||
}
|
|
@ -29,7 +29,6 @@ public class CVR_MenuManagerTracker : VRModeTracker
|
|||
DesktopVRSwitch.Logger.Msg("Updating CVR_Menu_Data core data.");
|
||||
|
||||
CVR_MenuManager.Instance.coreData.core.inVr = args.IsUsingVr;
|
||||
CVR_MenuManager.Instance.quickMenu.transform.localPosition = Vector3.zero;
|
||||
CVR_MenuManager.Instance.quickMenu.transform.localRotation = Quaternion.identity;
|
||||
CVR_MenuManager.Instance.quickMenu.transform.SetLocalPositionAndRotation(Vector3.zero, Quaternion.identity);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -21,10 +21,14 @@ public class CohtmlHudTracker : VRModeTracker
|
|||
DesktopVRSwitch.Logger.Msg("Configuring new hud affinity for CohtmlHud.");
|
||||
|
||||
CohtmlHud.Instance.gameObject.transform.parent = Utils.GetPlayerCameraObject(args.IsUsingVr).transform;
|
||||
|
||||
// This handles rotation and position
|
||||
CVRTools.ConfigureHudAffinity();
|
||||
CohtmlHud.Instance.gameObject.transform.localScale = new Vector3(1.2f, 1f, 1.2f);
|
||||
|
||||
CohtmlHud.Instance.markMenuAsReady();
|
||||
// required to set menu vr mode (why is it offset in js?)
|
||||
CohtmlHud.uiCoreGameData.isVr = args.IsUsingVr;
|
||||
if (CohtmlHud.Instance._isReady)
|
||||
CohtmlHud.Instance.hudView.View.TriggerEvent("updateCoreGameVars", CohtmlHud.uiCoreGameData);
|
||||
}
|
||||
}
|
|
@ -64,7 +64,7 @@ public class IKSystemTracker : VRModeTracker
|
|||
|
||||
private void SetupSteamVRTrackingModule(bool enableVR)
|
||||
{
|
||||
var openVRModule = IKSystem.Instance._trackingModules.OfType<SteamVRTrackingModule>().FirstOrDefault();
|
||||
SteamVRTrackingModule openVRModule = IKSystem.Instance._trackingModules.OfType<SteamVRTrackingModule>().FirstOrDefault();
|
||||
|
||||
if (openVRModule != null)
|
||||
{
|
||||
|
@ -75,8 +75,7 @@ public class IKSystemTracker : VRModeTracker
|
|||
}
|
||||
else if (enableVR)
|
||||
{
|
||||
var newVRModule = new SteamVRTrackingModule();
|
||||
IKSystem.Instance.AddTrackingModule(newVRModule);
|
||||
IKSystem.Instance.AddTrackingModule(new SteamVRTrackingModule());
|
||||
}
|
||||
}
|
||||
}
|
|
@ -59,7 +59,7 @@ public class MovementSystemTracker : VRModeTracker
|
|||
DesktopVRSwitch.Logger.Msg("Resetting MovementSystem mobility and applying stored position and rotation.");
|
||||
|
||||
MovementSystem.Instance.rotationPivot = Utils.GetPlayerCameraObject(intoVR).transform;
|
||||
MovementSystem.Instance.TeleportToPosRot(preSwitchWorldPosition, preSwitchWorldRotation, false);
|
||||
MovementSystem.Instance.TeleportToPosRot(preSwitchWorldPosition, preSwitchWorldRotation);
|
||||
|
||||
if (!intoVR)
|
||||
MovementSystem.Instance.UpdateColliderCenter(MovementSystem.Instance.transform.position);
|
||||
|
@ -67,7 +67,5 @@ public class MovementSystemTracker : VRModeTracker
|
|||
MovementSystem.Instance.ChangeCrouch(false);
|
||||
MovementSystem.Instance.ChangeProne(false);
|
||||
MovementSystem.Instance.SetImmobilized(false);
|
||||
|
||||
yield break;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue