[ThirdPerson] Quick fix for DesktopVRSwitch.

This commit is contained in:
NotAKidoS 2023-06-20 21:01:36 -05:00
parent 30d37aefa1
commit fb67a08c08
2 changed files with 9 additions and 0 deletions

View file

@ -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();
}