0
0
mirror of https://github.com/sp-tarkov/modules.git synced 2025-02-13 09:50:43 -05:00
modules/project/SPT.Debugging/Patches/ReloadClientPatch.cs

33 lines
917 B
C#
Raw Normal View History

2024-05-21 19:10:17 +01:00
using SPT.Reflection.Patching;
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
{
public class ReloadClientPatch : ModulePatch
{
protected override MethodBase GetTargetMethod()
{
return AccessTools.Method(typeof(PreloaderUI), nameof(PreloaderUI.Awake));
}
[PatchPostfix]
private static void PatchPostfix()
{
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")]
public static void Reload()
{
2024-07-05 17:46:55 +01:00
Reflection.Utils.ClientAppUtils.GetMainApp().method_52().HandleExceptions();
}
}
}