72 lines
2.0 KiB
C#
72 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;
|
|
}
|
|
}
|
|
|
|
|
|
} |