From 679b590da576f75d068595b923dac163359320a0 Mon Sep 17 00:00:00 2001 From: Dav999-v Date: Mon, 16 Nov 2020 00:32:44 +0100 Subject: [PATCH] Restrict the ENTER menu to saving while in a cutscene PR #468 made it so you can use the menus while in a cutscene, in order to counteract softlocks. However, this has resulted in more unintentional behavior: - `gamemode(teleporter)` breaks when opening the ENTER menu (Misa mentioned this) - The player can now interrupt shakes and walks, and have their timers run out before resuming the cutscene - After completing the game, the player can warp to the ship while a dialogue is active, and prevent themselves from advancing text (plus it's always rude to just teleport away while someone's talking) - The player can peek at the map before hidecoordinates is run, and can also peek at what the game does with missing/rescued crewmates during cutscenes This commit fixes the latter two issues. While a script is running, only the SAVE tab is now available. Therefore the player can still get themselves out of softlocks as intended, but they do things like looking at the map or teleporting away during a cutscene. --- desktop_version/src/Input.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/desktop_version/src/Input.cpp b/desktop_version/src/Input.cpp index 1e3f276d..704f8c9c 100644 --- a/desktop_version/src/Input.cpp +++ b/desktop_version/src/Input.cpp @@ -2028,7 +2028,14 @@ void gameinput() game.gamesaved = false; game.gamesavefailed = false; graphics.resumegamemode = false; - game.menupage = 0; // The Map Page + if (script.running) + { + game.menupage = 3; // Only allow saving + } + else + { + game.menupage = 0; // The Map Page + } BlitSurfaceStandard(graphics.menubuffer,NULL,graphics.backBuffer, NULL); graphics.menuoffset = 240; //actually this should count the roomname graphics.oldmenuoffset = 240; @@ -2221,7 +2228,11 @@ void mapinput() game.jumpheld = true; } - if (game.press_left) + if (script.running && game.menupage == 3) + { + // Force the player to stay in the SAVE tab while in a cutscene + } + else if (game.press_left) { game.menupage--; }