From 3720b1f3c8c7a86cf5ff1eaa42008aca7d47ce3b Mon Sep 17 00:00:00 2001 From: NotAKidoS <37721153+NotAKidOnSteam@users.noreply.github.com> Date: Fri, 28 Jul 2023 23:13:35 -0500 Subject: [PATCH] [GestureLock] Fixes for 2023r171 --- GestureLock/HarmonyPatches.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/GestureLock/HarmonyPatches.cs b/GestureLock/HarmonyPatches.cs index 2c5fd24..cb59a01 100644 --- a/GestureLock/HarmonyPatches.cs +++ b/GestureLock/HarmonyPatches.cs @@ -11,7 +11,7 @@ internal class CVRInputModule_XRPatches { // Get input from SteamVR because new input system is nerfed for OpenXR... private static readonly SteamVR_Action_Boolean _gestureToggleButton = SteamVR_Input.GetAction("ControllerToggleGestures", false); - + private static bool _isLocked; private static float _oldGestureLeft; private static float _oldGestureRight; @@ -20,7 +20,7 @@ internal class CVRInputModule_XRPatches [HarmonyPatch(typeof(CVRInputModule_XR), nameof(CVRInputModule_XR.Update_Emotes))] private static void Postfix_CVRInputModule_XR_Update_Emotes(ref CVRInputModule_XR __instance) { - if (!MetaPort.Instance.isUsingVr) + if (!MetaPort.Instance.isUsingVr) return; bool leftInput = _gestureToggleButton.GetLastStateDown(SteamVR_Input_Sources.LeftHand); @@ -31,7 +31,7 @@ internal class CVRInputModule_XRPatches if (rightInput && __instance._rightModule.Type == EXRControllerType.Index || __instance._inputManager.oneHanded) return; - + if (leftInput || rightInput) { _isLocked = !_isLocked; @@ -42,7 +42,7 @@ internal class CVRInputModule_XRPatches if (!_isLocked) return; - + __instance._inputManager.gestureLeft = _oldGestureLeft; __instance._inputManager.gestureRight = _oldGestureRight; }