2024-08-02 14:10:29 +01:00
|
|
|
|
using SPT.Reflection.Patching;
|
|
|
|
|
using SPT.Reflection.Utils;
|
2022-07-29 17:28:54 +03:00
|
|
|
|
using System;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Reflection;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
namespace SamSWAT.FOV
|
|
|
|
|
{
|
|
|
|
|
public class SettingsApplierPatch : ModulePatch
|
|
|
|
|
{
|
|
|
|
|
protected override MethodBase GetTargetMethod()
|
|
|
|
|
{
|
2024-08-02 14:10:29 +01:00
|
|
|
|
return typeof(GClass960.Class1578).GetMethod("method_0", BindingFlags.Instance | BindingFlags.Public);
|
2022-07-29 17:28:54 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[PatchPostfix]
|
|
|
|
|
public static void PatchPostfix(int x, ref int __result)
|
|
|
|
|
{
|
|
|
|
|
__result = Mathf.Clamp(x, FovPlugin.MinFov.Value, FovPlugin.MaxFov.Value);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|