diff --git a/project/Aki.Debugging/AkiDebuggingPlugin.cs b/project/Aki.Debugging/AkiDebuggingPlugin.cs index dcb8bd0..2e98638 100644 --- a/project/Aki.Debugging/AkiDebuggingPlugin.cs +++ b/project/Aki.Debugging/AkiDebuggingPlugin.cs @@ -19,6 +19,7 @@ namespace Aki.Debugging // new StaticLootDumper().Enable(); new DebugLogoPatch().Enable(); new DebugLogoPatch2().Enable(); + new DebugLogoPatch3().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 index f4a32e8..c638b2d 100644 --- a/project/Aki.Debugging/Patches/DebugLogoPatch.cs +++ b/project/Aki.Debugging/Patches/DebugLogoPatch.cs @@ -7,6 +7,7 @@ using EFT.UI; using HarmonyLib; using System.Reflection; using TMPro; +using UnityEngine; namespace Aki.Debugging.Patches { @@ -34,7 +35,7 @@ namespace Aki.Debugging.Patches } [PatchPostfix] - private static void patchPostfix(ref TextMeshProUGUI ____label, Profile ___profile_0) + private static void PatchPostfix(ref TextMeshProUGUI ____label, Profile ___profile_0) { if (sptVersion is null) { @@ -45,4 +46,27 @@ namespace Aki.Debugging.Patches ____label.text = $"{sptVersion} \n {___profile_0.Nickname} \n {GClass1296.Now.ToString("HH:mm:ss")}"; } } + + 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; + } + } }