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.
This commit is contained in:
Misa authored and Ethan Lee committed 2020-06-23 15:23:57 -04:00
1 parent f6d73c62ec
commit c5a5589ce5
2 files changed
+8 -3

No files matched your search

+1
View File
@@ -7763,4 +7763,5 @@ void Game::returntopausemenu()
gamestate = MAPMODE;
map.kludge_to_bg();
map.tdrawback = true;
game.mapheld = true;
}
+7 -3
View File
@@ -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