1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 11:03:00 +01:00

Fix #3200: Close Construction window upon selecting vehicle page (#13022)

This commit is contained in:
Tulio Leao
2020-09-28 07:37:22 -03:00
committed by GitHub
parent 0297d0bef3
commit 8f5ee758ee
2 changed files with 13 additions and 0 deletions

View File

@@ -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)
------------------------------------------------------------------------

View File

@@ -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