mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 14:29:25 +00:00
[ThirdPerson] Fix for game issue, reset player camera culling mask to default on world load.
This commit is contained in:
parent
afb44fc3a7
commit
53c369b950
4 changed files with 66 additions and 47 deletions
|
@ -13,11 +13,12 @@ internal static class Patches
|
|||
{
|
||||
harmony.Patch(
|
||||
typeof(CVRWorld).GetMethod(nameof(CVRWorld.SetDefaultCamValues), BindingFlags.NonPublic | BindingFlags.Instance),
|
||||
postfix: typeof(Patches).GetMethod(nameof(OnWorldStart), BindingFlags.NonPublic | BindingFlags.Static).ToNewHarmonyMethod()
|
||||
postfix: typeof(Patches).GetMethod(nameof(OnPostWorldStart), BindingFlags.NonPublic | BindingFlags.Static).ToNewHarmonyMethod()
|
||||
);
|
||||
harmony.Patch(
|
||||
typeof(CVRWorld).GetMethod(nameof(CVRWorld.CopyRefCamValues), BindingFlags.NonPublic | BindingFlags.Instance),
|
||||
postfix: typeof(Patches).GetMethod(nameof(OnWorldStart), BindingFlags.NonPublic | BindingFlags.Static).ToNewHarmonyMethod()
|
||||
prefix: typeof(Patches).GetMethod(nameof(OnPreWorldStart), BindingFlags.NonPublic | BindingFlags.Static).ToNewHarmonyMethod(),
|
||||
postfix: typeof(Patches).GetMethod(nameof(OnPostWorldStart), BindingFlags.NonPublic | BindingFlags.Static).ToNewHarmonyMethod()
|
||||
);
|
||||
harmony.Patch(
|
||||
typeof(PlayerSetup).GetMethod(nameof(PlayerSetup.SetupIKScaling), BindingFlags.NonPublic | BindingFlags.Instance),
|
||||
|
@ -30,7 +31,8 @@ internal static class Patches
|
|||
}
|
||||
|
||||
//Copy camera settings & postprocessing components
|
||||
private static void OnWorldStart() => CopyPlayerCamValues();
|
||||
private static void OnPreWorldStart() => ResetPlayerCamValues();
|
||||
private static void OnPostWorldStart() => 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