diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 258b74c48d..6048d6f368 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -11,6 +11,7 @@ - Improved: [#21981] The map window now defaults to showing as much of the map as fits the screen. - Improved: [#21983] Taking a screenshot now shows a message again, closing when taking another. - Improved: [#22026] The options window now stays centred when window scaling is changed. +- Improved: [#22084] The game now temporarily pauses while the load/save window is open. - Change: [#7248] Small mini-maps are now centred in the map window. - Change: [#20240] Heavy snow and blizzards now make guests buy and use umbrellas. - Change: [#21214] Wacky Worlds and Time Twister’s scenario names now match their park names. diff --git a/src/openrct2-ui/windows/LoadSave.cpp b/src/openrct2-ui/windows/LoadSave.cpp index b846b238bb..a00bf2648c 100644 --- a/src/openrct2-ui/windows/LoadSave.cpp +++ b/src/openrct2-ui/windows/LoadSave.cpp @@ -17,7 +17,9 @@ #include #include #include +#include #include +#include #include #include #include @@ -26,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -676,6 +679,13 @@ static Widget window_loadsave_widgets[] = const bool isSave = (type & 0x01) == LOADSAVETYPE_SAVE; const auto path = GetDir(type); + // Pause the game if not on title scene, nor in network play. + if (!(gScreenFlags & SCREEN_FLAGS_TITLE_DEMO) && NetworkGetMode() == NETWORK_MODE_NONE) + { + gGamePaused |= GAME_PAUSED_MODAL; + Audio::StopAll(); + } + const char* pattern = GetFilterPatternByType(type, isSave); PopulateList(isSave, path, pattern); no_list_items = static_cast(_listItems.size()); @@ -693,6 +703,13 @@ static Widget window_loadsave_widgets[] = { _listItems.clear(); WindowCloseByClass(WindowClass::LoadsaveOverwritePrompt); + + // Unpause the game if not on title scene, nor in network play. + if (!(gScreenFlags & SCREEN_FLAGS_TITLE_DEMO) && NetworkGetMode() == NETWORK_MODE_NONE) + { + gGamePaused &= ~GAME_PAUSED_MODAL; + Audio::Resume(); + } } void OnResize() override