mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 14:29:25 +00:00
added scale modifier
ThirdPerson distance now uses avatar height as modifier, so you keep the same distance across avatars & while scaling.
This commit is contained in:
parent
5c0e8a2ff4
commit
0dae699932
2 changed files with 16 additions and 8 deletions
|
@ -1,4 +1,5 @@
|
|||
using ABI.CCK.Components;
|
||||
using ABI_RC.Core.Player;
|
||||
using MelonLoader;
|
||||
using System.Reflection;
|
||||
using static NAK.ThirdPerson.CameraLogic;
|
||||
|
@ -10,15 +11,20 @@ internal static class Patches
|
|||
internal static void Apply(HarmonyLib.Harmony harmony)
|
||||
{
|
||||
harmony.Patch(
|
||||
typeof(CVRWorld).GetMethod("SetDefaultCamValues", BindingFlags.NonPublic | BindingFlags.Instance),
|
||||
typeof(CVRWorld).GetMethod(nameof(CVRWorld.SetDefaultCamValues), BindingFlags.NonPublic | BindingFlags.Instance),
|
||||
postfix: typeof(Patches).GetMethod(nameof(OnWorldStart), BindingFlags.NonPublic | BindingFlags.Static).ToNewHarmonyMethod()
|
||||
);
|
||||
harmony.Patch(
|
||||
typeof(CVRWorld).GetMethod("CopyRefCamValues", BindingFlags.NonPublic | BindingFlags.Instance),
|
||||
typeof(CVRWorld).GetMethod(nameof(CVRWorld.CopyRefCamValues), BindingFlags.NonPublic | BindingFlags.Instance),
|
||||
postfix: typeof(Patches).GetMethod(nameof(OnWorldStart), BindingFlags.NonPublic | BindingFlags.Static).ToNewHarmonyMethod()
|
||||
);
|
||||
harmony.Patch(
|
||||
typeof(PlayerSetup).GetMethod(nameof(PlayerSetup.SetupIKScaling), BindingFlags.NonPublic | BindingFlags.Instance),
|
||||
postfix: typeof(Patches).GetMethod(nameof(OnScaleAdjusted), BindingFlags.NonPublic | BindingFlags.Static).ToNewHarmonyMethod()
|
||||
);
|
||||
}
|
||||
|
||||
//Copy camera settings & postprocessing components
|
||||
private static void OnWorldStart() => CopyFromPlayerCam();
|
||||
private static void OnWorldStart() => CopyPlayerCamValues();
|
||||
private static void OnScaleAdjusted(float height) => AdjustScale(height);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue