From a0291f5c3927babd0188f449c583e1cffff8a16c Mon Sep 17 00:00:00 2001 From: NotZer0Two Date: Sun, 8 Dec 2024 13:48:29 +0100 Subject: [PATCH] DebugUI --- .../Patches/Fixes/DebugUIHandlerPatch.cs | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 ContentAPI/Patches/Fixes/DebugUIHandlerPatch.cs diff --git a/ContentAPI/Patches/Fixes/DebugUIHandlerPatch.cs b/ContentAPI/Patches/Fixes/DebugUIHandlerPatch.cs new file mode 100644 index 0000000..5d5197d --- /dev/null +++ b/ContentAPI/Patches/Fixes/DebugUIHandlerPatch.cs @@ -0,0 +1,26 @@ +namespace ContentAPI.Patches.Fixes +{ +#pragma warning disable SA1313 +#pragma warning disable SA1402 + using HarmonyLib; + using UnityEngine; + using Zorro.Core.CLI; + + /// + /// Patch for adding back the debug ui. + /// + [HarmonyPatch(typeof(DebugUIHandler), "Update")] + internal class DebugUIHandlerPatch + { + private static void Postfix(DebugUIHandler __instance) + { + if (Input.GetKeyDown(KeyCode.F1)) + { + if (__instance.IsOpen) + __instance.Hide(); + else + __instance.Show(); + } + } + } +} \ No newline at end of file