2024-05-21 19:10:17 +01:00
|
|
|
|
using SPT.Reflection.Patching;
|
2024-03-19 09:43:17 +00:00
|
|
|
|
using Comfort.Common;
|
|
|
|
|
using EFT;
|
|
|
|
|
using EFT.Console.Core;
|
|
|
|
|
using EFT.UI;
|
|
|
|
|
using HarmonyLib;
|
|
|
|
|
using System.Reflection;
|
|
|
|
|
|
2024-05-21 19:10:17 +01:00
|
|
|
|
namespace SPT.Debugging.Patches
|
2024-03-19 09:43:17 +00:00
|
|
|
|
{
|
|
|
|
|
public class ReloadClientPatch : ModulePatch
|
|
|
|
|
{
|
|
|
|
|
protected override MethodBase GetTargetMethod()
|
|
|
|
|
{
|
|
|
|
|
return AccessTools.Method(typeof(PreloaderUI), nameof(PreloaderUI.Awake));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[PatchPostfix]
|
2024-08-02 16:57:59 +01:00
|
|
|
|
public static void PatchPostfix()
|
2024-03-19 09:43:17 +00:00
|
|
|
|
{
|
|
|
|
|
ConsoleScreen.Processor.RegisterCommandGroup<ReloadClientPatch>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[ConsoleCommand("reload", "", null, "Reloads currently loaded profile.\nOnly use while in Main Menu" +
|
2024-03-19 12:54:17 +00:00
|
|
|
|
"\nRunning command while in hideout will cause graphical glitches and NRE to do with Nightvision. Pretty sure wont cause anything bad" +
|
|
|
|
|
"\nMay Cause Unexpected Behaviors inraid")]
|
2024-03-19 09:43:17 +00:00
|
|
|
|
public static void Reload()
|
|
|
|
|
{
|
2024-08-20 19:00:11 +01:00
|
|
|
|
Reflection.Utils.ClientAppUtils.GetMainApp().method_51().HandleExceptions();
|
2024-03-19 09:43:17 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|