2024-03-06 22:58:57 +00:00
|
|
|
|
using Aki.Reflection.Patching;
|
2024-03-05 20:21:31 +00:00
|
|
|
|
using EFT;
|
|
|
|
|
using EFT.UI;
|
|
|
|
|
using HarmonyLib;
|
|
|
|
|
using System.Reflection;
|
|
|
|
|
using TMPro;
|
2024-03-06 08:49:49 +00:00
|
|
|
|
using UnityEngine;
|
2024-03-05 20:21:31 +00:00
|
|
|
|
|
|
|
|
|
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]
|
2024-03-06 08:49:49 +00:00
|
|
|
|
private static void PatchPostfix(ref TextMeshProUGUI ____label, Profile ___profile_0)
|
2024-03-05 20:21:31 +00:00
|
|
|
|
{
|
2024-03-07 13:44:20 +00:00
|
|
|
|
____label.text = $"{AkiDebuggingPlugin.commitHash}";
|
2024-03-05 20:21:31 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2024-03-06 08:49:49 +00:00
|
|
|
|
|
|
|
|
|
public class DebugLogoPatch3 : ModulePatch
|
|
|
|
|
{
|
|
|
|
|
protected override MethodBase GetTargetMethod()
|
|
|
|
|
{
|
|
|
|
|
return AccessTools.Method(typeof(ClientWatermark), nameof(ClientWatermark.smethod_0));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Prefix so the logic isnt being duplicated.
|
|
|
|
|
[PatchPrefix]
|
|
|
|
|
private static bool PatchPrefix(int screenHeight, int screenWidth, int rectHeight, int rectWidth, ref Vector2 __result)
|
|
|
|
|
{
|
|
|
|
|
System.Random random = new System.Random();
|
|
|
|
|
|
|
|
|
|
int maxX = (screenWidth / 4) - (rectWidth / 2);
|
|
|
|
|
int maxY = (screenHeight / 4) - (rectHeight / 2);
|
|
|
|
|
int newX = random.Next(-maxX, maxX);
|
|
|
|
|
int newY = random.Next(-maxY, maxY);
|
|
|
|
|
|
|
|
|
|
__result = new Vector2(newX, newY);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-03-05 20:21:31 +00:00
|
|
|
|
}
|