Skip to content

Commit

Permalink
fix: Hotkeys being re-initialized when starting a TAS
Browse files Browse the repository at this point in the history
  • Loading branch information
psyGamer committed Jan 2, 2025
1 parent b5bc582 commit 27f1534
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions CelesteTAS-EverestInterop/Source/EverestInterop/Hotkeys.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,8 @@ private static bool CelesteNetChatting {

internal static bool Initialized { get; private set; } = false;

[Load]
private static void Load() {
Everest.Events.Input.OnInitialize += InputInitialize;
}
[Unload]
private static void Unload() {
Everest.Events.Input.OnInitialize -= InputInitialize;
}

private static void InputInitialize() {
[Initialize]
private static void Initialize() {
AllHotkeys.Clear();
AllHotkeys[HotkeyID.Start] = StartStop = BindingToHotkey(TasSettings.KeyStart);
AllHotkeys[HotkeyID.Restart] = Restart = BindingToHotkey(TasSettings.KeyRestart);
Expand Down Expand Up @@ -252,7 +244,7 @@ public class Hotkey(List<InputKeys> keys, List<InputButtons> buttons, bool keyCo
public bool DoublePressed { get; private set; }
public bool Repeated { get; private set; }

private bool LastCheck { get; set; }
public bool LastCheck { get; set; }

private const double DoublePressTimeoutMS = 200.0;
private const double RepeatTimeoutMS = 500.0;
Expand Down

0 comments on commit 27f1534

Please sign in to comment.