From 483e103a97f76532e7487b272ea4f1651acf4a8c Mon Sep 17 00:00:00 2001 From: NotAKidoS <37721153+NotAKidOnSteam@users.noreply.github.com> Date: Thu, 9 Feb 2023 20:17:29 -0600 Subject: [PATCH] organizational changes --- MenuScalePatch/Helpers/MainMenuHelper.cs | 3 ++- MenuScalePatch/Helpers/QuickMenuHelper.cs | 3 ++- MenuScalePatch/MSP_Menus.cs | 13 ++++++------- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/MenuScalePatch/Helpers/MainMenuHelper.cs b/MenuScalePatch/Helpers/MainMenuHelper.cs index 6930cf6..1beed8b 100644 --- a/MenuScalePatch/Helpers/MainMenuHelper.cs +++ b/MenuScalePatch/Helpers/MainMenuHelper.cs @@ -33,7 +33,8 @@ public class MainMenuHelper : MonoBehaviour MSP_MenuInfo.HandleIndependentLookInput(); if (MSP_MenuInfo.PlayerAnchorMenus) UpdateMenuPosition(); - if (NeedsPositionUpdate) UpdateMenuPosition(); + if (NeedsPositionUpdate) + UpdateMenuPosition(); } public void CreateWorldAnchors() diff --git a/MenuScalePatch/Helpers/QuickMenuHelper.cs b/MenuScalePatch/Helpers/QuickMenuHelper.cs index 1c713b9..716ae71 100644 --- a/MenuScalePatch/Helpers/QuickMenuHelper.cs +++ b/MenuScalePatch/Helpers/QuickMenuHelper.cs @@ -31,7 +31,8 @@ public class QuickMenuHelper : MonoBehaviour MSP_MenuInfo.HandleIndependentLookInput(); if (MSP_MenuInfo.PlayerAnchorMenus || MetaPort.Instance.isUsingVr) UpdateMenuPosition(); - if (NeedsPositionUpdate) UpdateMenuPosition(); + if (NeedsPositionUpdate) + UpdateMenuPosition(); } public void CreateWorldAnchors() diff --git a/MenuScalePatch/MSP_Menus.cs b/MenuScalePatch/MSP_Menus.cs index b8e0c92..b0e1617 100644 --- a/MenuScalePatch/MSP_Menus.cs +++ b/MenuScalePatch/MSP_Menus.cs @@ -3,7 +3,6 @@ using ABI_RC.Core.InteractionSystem; using ABI_RC.Core.Player; using ABI_RC.Core.Savior; using ABI_RC.Systems.MovementSystem; -using HarmonyLib; using System.Reflection; using UnityEngine; @@ -28,8 +27,11 @@ public class MSP_MenuInfo internal static bool DisableMMHelper_VR; //reflection (traverse sucks ass) - private static readonly FieldInfo _desktopMouseModeQM = typeof(ViewManager).GetField("_desktopMouseMode", BindingFlags.NonPublic | BindingFlags.Instance); - private static readonly FieldInfo _desktopMouseModeMM = typeof(CVR_MenuManager).GetField("_desktopMouseMode", BindingFlags.NonPublic | BindingFlags.Instance); + internal static readonly FieldInfo _desktopMouseModeQM = typeof(ViewManager).GetField("_desktopMouseMode", BindingFlags.NonPublic | BindingFlags.Instance); + internal static readonly FieldInfo _desktopMouseModeMM = typeof(CVR_MenuManager).GetField("_desktopMouseMode", BindingFlags.NonPublic | BindingFlags.Instance); + internal static readonly FieldInfo ms_followAngleY = typeof(MovementSystem).GetField("_followAngleY", BindingFlags.NonPublic | BindingFlags.Instance); + + internal static bool independentHeadTurn = false; internal static void ToggleDesktopInputMethod(bool flag) { @@ -37,16 +39,13 @@ public class MSP_MenuInfo _desktopMouseModeQM.SetValue(ViewManager.Instance, flag); _desktopMouseModeMM.SetValue(CVR_MenuManager.Instance, flag); - + RootLogic.Instance.ToggleMouse(flag); CVRInputManager.Instance.inputEnabled = !flag; PlayerSetup.Instance._movementSystem.disableCameraControl = flag; CVR_MenuManager.Instance.desktopControllerRay.enabled = !flag; } - internal static readonly FieldInfo ms_followAngleY = typeof(MovementSystem).GetField("_followAngleY", BindingFlags.NonPublic | BindingFlags.Instance); - internal static bool independentHeadTurn = false; - internal static void HandleIndependentLookInput() { //angle of independent look axis