0
0
mirror of https://github.com/sp-tarkov/modules.git synced 2025-02-13 08:10:45 -05:00
modules/project/Aki.Debugging/Patches/DebugLogoPatch.cs

49 lines
1.4 KiB
C#
Raw Normal View History

2024-03-05 20:21:31 +00:00
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
{
2024-03-05 20:28:51 +00:00
private static string sptVersion;
2024-03-05 20:21:31 +00:00
protected override MethodBase GetTargetMethod()
{
return AccessTools.Method(typeof(ClientWatermark), nameof(ClientWatermark.method_0));
}
[PatchPostfix]
private static void patchPostfix(ref TextMeshProUGUI ____label, Profile ___profile_0)
{
2024-03-05 20:28:51 +00:00
if (sptVersion is null)
{
var json = RequestHandler.GetJson("/singleplayer/settings/version");
sptVersion = Json.Deserialize<VersionResponse>(json).Version;
}
2024-03-05 20:21:31 +00:00
2024-03-05 22:09:38 +00:00
____label.text = $"{sptVersion} \n {___profile_0.Nickname} \n {GClass1296.Now.ToString("HH:mm:ss")}";
2024-03-05 20:21:31 +00:00
}
}
}