From c5a5589ce53986064a3a9661e6d8de66532edd4f Mon Sep 17 00:00:00 2001 From: Misa Date: Mon, 22 Jun 2020 21:36:50 -0700 Subject: [PATCH] Allow pressing Esc to close Esc menu Another thing that's annoyed me a lot is being unable to simply press Esc to close the pause menu. You'd have to hover over the "return to game" or "keep playing" option. This would be even more annoying with more options on the menu, so allowing to press Esc is a nice quality-of-life thing. --- desktop_version/src/Game.cpp | 1 + desktop_version/src/Input.cpp | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/desktop_version/src/Game.cpp b/desktop_version/src/Game.cpp index b2e25066..993e54ad 100644 --- a/desktop_version/src/Game.cpp +++ b/desktop_version/src/Game.cpp @@ -7763,4 +7763,5 @@ void Game::returntopausemenu() gamestate = MAPMODE; map.kludge_to_bg(); map.tdrawback = true; + game.mapheld = true; } diff --git a/desktop_version/src/Input.cpp b/desktop_version/src/Input.cpp index 64659488..5806972e 100644 --- a/desktop_version/src/Input.cpp +++ b/desktop_version/src/Input.cpp @@ -1958,20 +1958,24 @@ void mapinput() { game.press_action = true; } - if (game.menupage < 12) + if (game.menupage < 12 || (game.menupage >= 30 && game.menupage <= 33)) { if (key.isDown(KEYBOARD_ENTER) || key.isDown(game.controllerButton_map) ) game.press_map = true; - if (key.isDown(27)) + if (key.isDown(27) && !game.mapheld) { game.mapheld = true; if (game.menupage < 9) { game.menupage = 30; } - else + else if (game.menupage < 12) { game.menupage = 31; } + else + { + graphics.resumegamemode = true; + } } } else