0
0
mirror of https://github.com/sp-tarkov/modules.git synced 2025-02-13 09:10:44 -05:00
modules/project/Aki.Custom/Patches/CoreDifficultyPatch.cs
2023-03-03 18:52:31 +00:00

28 lines
741 B
C#

using Aki.Reflection.Patching;
using Aki.Reflection.Utils;
using Aki.Common.Http;
using System.Linq;
using System.Reflection;
namespace Aki.Custom.Patches
{
public class CoreDifficultyPatch : ModulePatch
{
protected override MethodBase GetTargetMethod()
{
var methodName = "LoadCoreByString";
var flags = BindingFlags.Public | BindingFlags.Static;
return PatchConstants.EftTypes.Single(x => x.GetMethod(methodName, flags) != null)
.GetMethod(methodName, flags);
}
[PatchPrefix]
private static bool PatchPrefix(ref string __result)
{
__result = RequestHandler.GetJson("/singleplayer/settings/bot/difficulty/core/core");
return string.IsNullOrWhiteSpace(__result);
}
}
}