Filter the first 'a' button press after returning from a game when running in background.

This commit is contained in:
Leon Styhre 2021-12-09 18:56:25 +01:00
parent 045e56ae3f
commit 171679efa9

View file

@ -838,6 +838,10 @@ bool ViewController::input(InputConfig* config, Input input)
if (mWindow->getGameLaunchedState()) {
mWindow->setAllowTextScrolling(true);
mWindow->unsetLaunchedGame();
// Filter out the "a" button so the game is not restarted if there was such a button press
// queued when leaving the game.
if (config->isMappedTo("a", input) && input.value != 0)
return true;
}
// Open the main menu.