UniformAim/TarkovUniformAim/UniformAimPatch.cs
notGreg c92693880c Code has been reorganized and cleaned up.
Removed HFOV toggle - it's the default way now.
Added FOV Range Override for compatibility with FOV-extension mods.
Some values should now be grabbed from the game.
2022-08-04 18:13:18 +02:00

71 lines
2.0 KiB
C#

using Aki.Reflection.Patching;
using EFT;
using System.Reflection;
namespace UniformAim
{
public class UpdateSensitivityPatch : ModulePatch
{
protected override MethodBase GetTargetMethod()
{
return typeof(Player.FirearmController).GetMethod("UpdateSensitivity");
}
[PatchPostfix]
public static void PatchPostfix(ref float ____aimingSens)
{
____aimingSens = Plugin.mySens;
}
}
public class get_AimingSensitivityPatch : ModulePatch
{
protected override MethodBase GetTargetMethod()
{
return typeof(Player.FirearmController).GetMethod("get_AimingSensitivity");
}
[PatchPostfix]
public static void PatchPostfix(ref float ____aimingSens)
{
____aimingSens = Plugin.mySens;
}
}
public class get_SelectedScopeIndexPatch : ModulePatch
{
protected override MethodBase GetTargetMethod()
{
return typeof(EFT.InventoryLogic.SightComponent).GetMethod("get_SelectedScopeIndex");
}
[PatchPostfix]
public static void PatchPostfix(ref int ___SelectedScope)
{
Plugin.SelectedScope = ___SelectedScope;
}
}
public class get_SelectedScopeModePatch : ModulePatch
{
protected override MethodBase GetTargetMethod()
{
return typeof(EFT.InventoryLogic.SightComponent).GetMethod("get_SelectedScopeMode");
}
[PatchPostfix]
public static void PatchPostfix(ref int[] ___ScopesSelectedModes)
{
Plugin.SelectedScopeMode = ___ScopesSelectedModes[Plugin.SelectedScope];
}
}
public class get_IsAimingPatch : ModulePatch
{
protected override MethodBase GetTargetMethod()
{
return typeof(Player.FirearmController).GetMethod("get_IsAiming");
}
[PatchPostfix]
public static void PatchPostfix(ref bool ____isAiming)
{
Plugin.isAiming = ____isAiming;
}
}
}