mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 06:19:22 +00:00
[ThirdPerson] Quick fix for DesktopVRSwitch.
This commit is contained in:
parent
30d37aefa1
commit
fb67a08c08
2 changed files with 9 additions and 0 deletions
|
@ -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; }
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue