From a2f8e8c72b8014cfcf94deffebb5bffc36940c23 Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Sun, 22 Mar 2020 23:22:28 +0100 Subject: [PATCH] Automatically reset speed to normal upon scenario completion. (#10998) --- distribution/changelog.txt | 1 + src/openrct2/Game.cpp | 6 ++++++ src/openrct2/Game.h | 1 + src/openrct2/scenario/Scenario.cpp | 1 + 4 files changed, 9 insertions(+) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 3b83fde7c7..665ebe8295 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -9,6 +9,7 @@ - Feature: [#10357] Added window for scenery scatter tool, allowing for area and density selection. - Feature: [#10637] Console command to remove all floating objects. - Change: [#1164] Use available translations for shortcut key bindings. +- Change: [#10997] Speed is automatically reset to normal upon scenario completion. - Fix: [#2485] Hide Vertical Faces not applied to the edges of water. - Fix: [#5249] No collision detection when building ride entrance at heights > 85.5m. - Fix: [#6766] Changelog window doesn't open on some platforms. diff --git a/src/openrct2/Game.cpp b/src/openrct2/Game.cpp index be26276479..843055f2f9 100644 --- a/src/openrct2/Game.cpp +++ b/src/openrct2/Game.cpp @@ -85,6 +85,12 @@ rct_string_id gGameCommandErrorText; using namespace OpenRCT2; +void game_reset_speed() +{ + gGameSpeed = 1; + window_invalidate_by_class(WC_TOP_TOOLBAR); +} + void game_increase_game_speed() { gGameSpeed = std::min(gConfigGeneral.debugging_tools ? 5 : 4, gGameSpeed + 1); diff --git a/src/openrct2/Game.h b/src/openrct2/Game.h index 6343c73ea0..b226f2594a 100644 --- a/src/openrct2/Game.h +++ b/src/openrct2/Game.h @@ -145,6 +145,7 @@ extern std::string gCurrentLoadedPath; extern bool gLoadKeepWindowsOpen; +void game_reset_speed(); void game_increase_game_speed(); void game_reduce_game_speed(); diff --git a/src/openrct2/scenario/Scenario.cpp b/src/openrct2/scenario/Scenario.cpp index f885144b23..fa9dd95a51 100644 --- a/src/openrct2/scenario/Scenario.cpp +++ b/src/openrct2/scenario/Scenario.cpp @@ -177,6 +177,7 @@ void scenario_begin() static void scenario_end() { + game_reset_speed(); window_close_by_class(WC_DROPDOWN); window_close_all_except_flags(WF_STICK_TO_BACK | WF_STICK_TO_FRONT); context_open_window_view(WV_PARK_OBJECTIVE);