diff --git a/CelesteTAS-EverestInterop/Source/EverestInterop/ConsoleEnhancements.cs b/CelesteTAS-EverestInterop/Source/EverestInterop/ConsoleEnhancements.cs index 24d17e6c..47e1157d 100644 --- a/CelesteTAS-EverestInterop/Source/EverestInterop/ConsoleEnhancements.cs +++ b/CelesteTAS-EverestInterop/Source/EverestInterop/ConsoleEnhancements.cs @@ -52,13 +52,18 @@ internal static void UpdateMeta() { return; } + justClosed = false; if (Engine.Commands.Open) { Engine.Commands.UpdateOpen(); + if (!Engine.Commands.Open) { + justClosed = true; + } } else if (Engine.Commands.Enabled) { Engine.Commands.UpdateClosed(); } } + private static bool justClosed = false; internal static void OpenConsole() { if (!Manager.Running) { return; // Only allow inside a TAS, since outside it's already handled @@ -66,6 +71,14 @@ internal static void OpenConsole() { if (Engine.Commands.Open) { return; } + if (justClosed) { + // when commands open, hotkeys are not updated (in Hotkeys.UpdateMeta(), updateKey = false) + // so if without this extra check: + // Gameloop 1: Commands open + // Gameloop 2: CoreModule.(Toggle)DebugConsole gets pressed (note this is not our OpenConsole hotkey), and Commands get closed + // Gameloop 3: Hotkeys find Commands are closed and decide to update, and find that OpenConsole gets pressed, so it Opens Console again! + return; + } // Copied from Commands.UpdateClosed Engine.Commands.Open = true; diff --git a/CelesteTAS-EverestInterop/Source/EverestInterop/Hitboxes/HitboxSimplified.cs b/CelesteTAS-EverestInterop/Source/EverestInterop/Hitboxes/HitboxSimplified.cs index 9d1122fb..287a17c5 100644 --- a/CelesteTAS-EverestInterop/Source/EverestInterop/Hitboxes/HitboxSimplified.cs +++ b/CelesteTAS-EverestInterop/Source/EverestInterop/Hitboxes/HitboxSimplified.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Reflection; using Celeste; +using JetBrains.Annotations; using Microsoft.Xna.Framework; using Mono.Cecil.Cil; using Monocle; @@ -84,7 +85,8 @@ private static void Unload() { On.Celeste.Level.End -= LevelOnEnd; } - private static bool HideHitbox(Entity entity) { + [PublicAPI] + public static bool HideHitbox(Entity entity) { if (!TasSettings.ShowHitboxes || InfoWatchEntity.CurrentlyWatchedEntities.Contains(entity)) { return false; } diff --git a/CelesteTAS-EverestInterop/Source/EverestInterop/Hotkeys.cs b/CelesteTAS-EverestInterop/Source/EverestInterop/Hotkeys.cs index b88dec55..76010564 100644 --- a/CelesteTAS-EverestInterop/Source/EverestInterop/Hotkeys.cs +++ b/CelesteTAS-EverestInterop/Source/EverestInterop/Hotkeys.cs @@ -146,12 +146,7 @@ private static GamePadState GetGamePadState() { // No controller connected return default; } - - [Obsolete("Use UpdateMeta")] - public static void Update() => UpdateMeta(); - - // Used by TAS Helper - public static void UpdateMeta() { + internal static void UpdateMeta() { // Determined which inputs are already used for something else bool updateKey = true; bool updateButton = true;