diff --git a/project/Aki.Debugging/AkiDebuggingPlugin.cs b/project/Aki.Debugging/AkiDebuggingPlugin.cs index f4c9876..dcb8bd0 100644 --- a/project/Aki.Debugging/AkiDebuggingPlugin.cs +++ b/project/Aki.Debugging/AkiDebuggingPlugin.cs @@ -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(); diff --git a/project/Aki.Debugging/Patches/DebugLogoPatch.cs b/project/Aki.Debugging/Patches/DebugLogoPatch.cs new file mode 100644 index 0000000..0bd4273 --- /dev/null +++ b/project/Aki.Debugging/Patches/DebugLogoPatch.cs @@ -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.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(json).Version; + + ____label.text = $"SPT BLEEDINGEDGE \n ${result} \n {___profile_0.Nickname} \n {GClass1296.Now.ToString("HH:mm:ss")}"; + } + } +}