diff --git a/distribution/changelog.txt b/distribution/changelog.txt index e843422d4f..a6813853e9 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -1,6 +1,7 @@ 0.3.1+ (in development) ------------------------------------------------------------------------ - Feature: [#13000] objective_options command for console +- Fix: [#3200] Close Construction window upon selecting vehicle page 0.3.1 (2020-09-27) ------------------------------------------------------------------------ diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index d5a7f88c90..9820ead41d 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -1685,6 +1685,18 @@ static void window_ride_set_page(rct_window* w, int32_t page) if (w->classification == gCurrentToolWidget.window_classification && w->number == gCurrentToolWidget.window_number) tool_cancel(); + if (page == WINDOW_RIDE_PAGE_VEHICLE) + { + auto constructionWindow = window_find_by_class(WC_RIDE_CONSTRUCTION); + if (constructionWindow && constructionWindow->number == w->number) + { + window_close_by_class(WC_RIDE_CONSTRUCTION); + // Closing the construction window sets the tab to the first page, which we don't want here, + // as user just clicked the Vehicle page + window_ride_set_page(w, WINDOW_RIDE_PAGE_VEHICLE); + } + } + // Set listen only to viewport listen = 0; if (page == WINDOW_RIDE_PAGE_MAIN && w->page == WINDOW_RIDE_PAGE_MAIN && w->viewport != nullptr