Skip to content

Commit

Permalink
Close debug console with Esc
Browse files Browse the repository at this point in the history
  • Loading branch information
Kalobi committed Oct 15, 2023
1 parent 52fe165 commit 4efe4d1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Celeste.Mod.mm/Patches/Monocle/Commands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ internal void UpdateClosed() {
TextInput.OnInput += HandleChar;
}
if (!printedInfoMessage) {
Log("Type in 'help' for a list of debug commands or 'q' to close the console. Confirm commands with Enter.");
Log("Use the 'help' command for a list of debug commands. Press Esc or use the 'q' command to close the console.");
printedInfoMessage = true;
}
}
Expand Down Expand Up @@ -209,6 +209,10 @@ internal void Render() {
[MonoModReplace] // don't create an orig_ method
private void HandleKey(Keys key) {
// this method handles all control characters, which go through the XNA Keys API
if (key == Keys.Escape) {
Open = canOpen = false;
return;
}
underscore = true;
underscoreCounter = 0f;
bool shift = currentState[Keys.LeftShift] == KeyState.Down || currentState[Keys.RightShift] == KeyState.Down;
Expand Down

0 comments on commit 4efe4d1

Please sign in to comment.