diff --git a/MenuScalePatch/HarmonyPatches.cs b/MenuScalePatch/HarmonyPatches.cs index 0f59836..ac38eb2 100644 --- a/MenuScalePatch/HarmonyPatches.cs +++ b/MenuScalePatch/HarmonyPatches.cs @@ -91,7 +91,6 @@ internal class HarmonyPatches { QuickMenuHelper helper = __instance.quickMenu.gameObject.AddComponent(); helper.handAnchor = ____leftVrAnchor.transform; - helper.enabled = false; } catch (System.Exception e) { @@ -106,8 +105,7 @@ internal class HarmonyPatches { try { - MainMenuHelper helper = __instance.gameObject.AddComponent(); - helper.enabled = false; + __instance.gameObject.AddComponent(); } catch (System.Exception e) { @@ -126,7 +124,7 @@ internal class HarmonyPatches ____quickMenuOpen = show; __instance.quickMenu.enabled = true; __instance.quickMenuAnimator.SetBool("Open", show); - QuickMenuHelper.Instance.enabled = show; + QuickMenuHelper.Instance.MenuIsOpen = show; QuickMenuHelper.Instance.UpdateWorldAnchors(show); //shouldnt run if switching menus on desktop if (!MetaPort.Instance.isUsingVr) @@ -154,7 +152,7 @@ internal class HarmonyPatches ____gameMenuOpen = show; __instance.gameMenuView.enabled = true; __instance.uiMenuAnimator.SetBool("Open", show); - MainMenuHelper.Instance.enabled = show; + MainMenuHelper.Instance.MenuIsOpen = show; MainMenuHelper.Instance.UpdateWorldAnchors(show); //shouldnt run if switching menus on desktop if (!MetaPort.Instance.isUsingVr) diff --git a/MenuScalePatch/Helpers/MainMenuHelper.cs b/MenuScalePatch/Helpers/MainMenuHelper.cs index 1beed8b..d1d2ef4 100644 --- a/MenuScalePatch/Helpers/MainMenuHelper.cs +++ b/MenuScalePatch/Helpers/MainMenuHelper.cs @@ -21,6 +21,7 @@ public class MainMenuHelper : MonoBehaviour public static MainMenuHelper Instance; public Transform worldAnchor; public bool NeedsPositionUpdate; + public bool MenuIsOpen; void Awake() { @@ -29,12 +30,15 @@ public class MainMenuHelper : MonoBehaviour void LateUpdate() { - if (MSP_MenuInfo.UseIndependentHeadTurn) - MSP_MenuInfo.HandleIndependentLookInput(); - if (MSP_MenuInfo.PlayerAnchorMenus) - UpdateMenuPosition(); - if (NeedsPositionUpdate) - UpdateMenuPosition(); + if (MenuIsOpen) + { + if (MSP_MenuInfo.UseIndependentHeadTurn) + MSP_MenuInfo.HandleIndependentLookInput(); + if (MSP_MenuInfo.PlayerAnchorMenus) + UpdateMenuPosition(); + if (NeedsPositionUpdate) + UpdateMenuPosition(); + } } public void CreateWorldAnchors() diff --git a/MenuScalePatch/Helpers/QuickMenuHelper.cs b/MenuScalePatch/Helpers/QuickMenuHelper.cs index 716ae71..5836f89 100644 --- a/MenuScalePatch/Helpers/QuickMenuHelper.cs +++ b/MenuScalePatch/Helpers/QuickMenuHelper.cs @@ -19,6 +19,7 @@ public class QuickMenuHelper : MonoBehaviour public Transform worldAnchor; public Transform handAnchor; public bool NeedsPositionUpdate; + public bool MenuIsOpen; void Awake() { @@ -27,12 +28,15 @@ public class QuickMenuHelper : MonoBehaviour void LateUpdate() { - if (MSP_MenuInfo.UseIndependentHeadTurn) - MSP_MenuInfo.HandleIndependentLookInput(); - if (MSP_MenuInfo.PlayerAnchorMenus || MetaPort.Instance.isUsingVr) - UpdateMenuPosition(); - if (NeedsPositionUpdate) - UpdateMenuPosition(); + if (MenuIsOpen) + { + if (MSP_MenuInfo.UseIndependentHeadTurn) + MSP_MenuInfo.HandleIndependentLookInput(); + if (MSP_MenuInfo.PlayerAnchorMenus || MetaPort.Instance.isUsingVr) + UpdateMenuPosition(); + if (NeedsPositionUpdate) + UpdateMenuPosition(); + } } public void CreateWorldAnchors() diff --git a/MenuScalePatch/Properties/AssemblyInfo.cs b/MenuScalePatch/Properties/AssemblyInfo.cs index cf44392..2c4d733 100644 --- a/MenuScalePatch/Properties/AssemblyInfo.cs +++ b/MenuScalePatch/Properties/AssemblyInfo.cs @@ -25,6 +25,6 @@ using System.Reflection; namespace NAK.Melons.MenuScalePatch.Properties; internal static class AssemblyInfoParams { - public const string Version = "4.2.2"; + public const string Version = "4.2.3"; public const string Author = "NotAKidoS"; } \ No newline at end of file