CWX-mods/Live/CWX_DeSharpener/DeSharpener.cs

34 lines
712 B
C#
Raw Normal View History

2022-05-14 19:53:00 +01:00
using System;
using System.Reflection;
using Aki.Reflection.Patching;
using Aki.Reflection.Utils;
using System.Linq;
namespace DeSharpener
{
public class DeSharpener : ModulePatch
{
private static Type _targetType;
2022-05-14 19:53:00 +01:00
public DeSharpener()
{
_targetType = PatchConstants.EftTypes.Single(IsTargetType);
}
private bool IsTargetType(Type type)
{
return type.GetMethod("UpdateAmount") != null && type.GetMethod("ChangeDefaultSharpenValue") != null;
}
protected override MethodBase GetTargetMethod()
{
return _targetType.GetMethod("UpdateAmount");
}
[PatchPrefix]
private static bool PatchPrefix()
{
return false;
}
}
}