forked from SamSWAT/FOV
24 lines
617 B
C#
24 lines
617 B
C#
using SPT.Reflection.Patching;
|
|
using SPT.Reflection.Utils;
|
|
using System;
|
|
using System.Linq;
|
|
using System.Reflection;
|
|
using UnityEngine;
|
|
|
|
namespace SamSWAT.FOV
|
|
{
|
|
public class SettingsApplierPatch : ModulePatch
|
|
{
|
|
protected override MethodBase GetTargetMethod()
|
|
{
|
|
return typeof(GClass960.Class1578).GetMethod("method_0", BindingFlags.Instance | BindingFlags.Public);
|
|
}
|
|
|
|
[PatchPostfix]
|
|
public static void PatchPostfix(int x, ref int __result)
|
|
{
|
|
__result = Mathf.Clamp(x, FovPlugin.MinFov.Value, FovPlugin.MaxFov.Value);
|
|
}
|
|
}
|
|
}
|