mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-03 06:49:22 +00:00
Move mods to Depricated folder.
This commit is contained in:
parent
e61f119f32
commit
5d1cb2ebec
70 changed files with 44 additions and 119 deletions
30
.DepricatedMods/HeadBobbingFix/HarmonyPatches.cs
Normal file
30
.DepricatedMods/HeadBobbingFix/HarmonyPatches.cs
Normal file
|
@ -0,0 +1,30 @@
|
|||
using ABI_RC.Core.Player;
|
||||
using ABI_RC.Systems.MovementSystem;
|
||||
using HarmonyLib;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NAK.HeadBobbingFix.HarmonyPatches;
|
||||
|
||||
class PlayerSetupPatches
|
||||
{
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(PlayerSetup), nameof(PlayerSetup.HandleDesktopCameraPosition))]
|
||||
public static void Postfix_PlayerSetup_HandleDesktopCameraPosition(bool ignore, ref PlayerSetup __instance, ref MovementSystem ____movementSystem, ref int ___headBobbingLevel)
|
||||
{
|
||||
if (!HeadBobbingFix.EntryEnabled.Value)
|
||||
return;
|
||||
|
||||
// this would be much simplier if I bothered with transpilers
|
||||
if (____movementSystem.disableCameraControl && !ignore)
|
||||
return;
|
||||
|
||||
if (___headBobbingLevel != 2)
|
||||
return;
|
||||
|
||||
Transform viewpointTransform = __instance._viewPoint.pointer.transform;
|
||||
if (viewpointTransform != null)
|
||||
{
|
||||
__instance.desktopCamera.transform.position = viewpointTransform.position;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue