0
0
mirror of https://github.com/sp-tarkov/modules.git synced 2025-02-13 09:50:43 -05:00

Add additional debug patch

This commit is contained in:
Dev 2024-03-05 20:21:31 +00:00
parent 2b3bf8864a
commit f781071bf2
2 changed files with 45 additions and 0 deletions

View File

@ -17,6 +17,8 @@ namespace Aki.Debugging
new EndRaidDebug().Enable();
// new CoordinatesPatch().Enable();
// new StaticLootDumper().Enable();
new DebugLogoPatch().Enable();
new DebugLogoPatch2().Enable();
// BTR debug command patches, can be disabled later
//new BTRDebugCommandPatch().Enable();

View File

@ -0,0 +1,43 @@
using Aki.Common.Http;
using Aki.Common.Utils;
using Aki.Custom.Models;
using Aki.Reflection.Patching;
using EFT;
using EFT.UI;
using HarmonyLib;
using System.Reflection;
using TMPro;
namespace Aki.Debugging.Patches
{
public class DebugLogoPatch : ModulePatch
{
protected override MethodBase GetTargetMethod()
{
return AccessTools.Method(typeof(TarkovApplication), nameof(TarkovApplication.method_27));
}
[PatchPrefix]
private static void PatchPrefix(Profile profile)
{
MonoBehaviourSingleton<PreloaderUI>.Instance.SetWatermarkStatus(profile, true);
}
}
public class DebugLogoPatch2 : ModulePatch
{
protected override MethodBase GetTargetMethod()
{
return AccessTools.Method(typeof(ClientWatermark), nameof(ClientWatermark.method_0));
}
[PatchPostfix]
private static void patchPostfix(ref TextMeshProUGUI ____label, Profile ___profile_0)
{
var json = RequestHandler.GetJson("/singleplayer/settings/version");
var result = Json.Deserialize<VersionResponse>(json).Version;
____label.text = $"SPT BLEEDINGEDGE \n ${result} \n {___profile_0.Nickname} \n {GClass1296.Now.ToString("HH:mm:ss")}";
}
}
}