diff --git a/ThirdPerson/CameraLogic.cs b/ThirdPerson/CameraLogic.cs index 1047a26..158537e 100644 --- a/ThirdPerson/CameraLogic.cs +++ b/ThirdPerson/CameraLogic.cs @@ -1,5 +1,6 @@ using ABI_RC.Core.Base; using ABI_RC.Core.Player; +using ABI_RC.Core.Savior; using ABI_RC.Core.Util.Object_Behaviour; using Aura2API; using BeautifyEffect; @@ -187,7 +188,9 @@ internal static class CameraLogic } } + private static void ResetDist() => _dist = 0; internal static void ScrollDist(float sign) { _dist += sign * 0.25f; RelocateCam(CurrentLocation); } internal static void AdjustScale(float height) { _scale = height; RelocateCam(CurrentLocation); } + internal static void CheckVRMode() { if (MetaPort.Instance.isUsingVr) State = false; } } diff --git a/ThirdPerson/Patches.cs b/ThirdPerson/Patches.cs index e80c204..6c176a3 100644 --- a/ThirdPerson/Patches.cs +++ b/ThirdPerson/Patches.cs @@ -3,6 +3,7 @@ using ABI_RC.Core.Player; using MelonLoader; using System.Reflection; using static NAK.ThirdPerson.CameraLogic; +using ABI_RC.Core; namespace NAK.ThirdPerson; @@ -22,10 +23,15 @@ internal static class Patches typeof(PlayerSetup).GetMethod(nameof(PlayerSetup.SetupIKScaling), BindingFlags.NonPublic | BindingFlags.Instance), postfix: typeof(Patches).GetMethod(nameof(OnScaleAdjusted), BindingFlags.NonPublic | BindingFlags.Static).ToNewHarmonyMethod() ); + harmony.Patch( + typeof(CVRTools).GetMethod(nameof(CVRTools.ConfigureHudAffinity), BindingFlags.Public | BindingFlags.Static), + postfix: typeof(Patches).GetMethod(nameof(OnConfigureHudAffinity), BindingFlags.NonPublic | BindingFlags.Static).ToNewHarmonyMethod() + ); } //Copy camera settings & postprocessing components private static void OnWorldStart() => CopyPlayerCamValues(); //Adjust camera distance with height as modifier private static void OnScaleAdjusted(float height) => AdjustScale(height); + private static void OnConfigureHudAffinity() => CheckVRMode(); } \ No newline at end of file