From 31b65ddb84338c2b7a8f7216dca9e364d72f18a8 Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Mon, 31 Mar 2025 16:43:26 +0200 Subject: [PATCH] TrackList window: make 'select other ride' button available in track manager --- distribution/changelog.txt | 1 + src/openrct2-ui/windows/TrackList.cpp | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 224dd7ef64..7e81bfc641 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -5,6 +5,7 @@ - Feature: [#23876] New park save files now contain a preview image, shown in the load/save window. - Change: [#23932] The land rights window now checks “Land Owned” by default. - Change: [#23936] The ‘guests prefer less/more intense rides’ settings have been turned into a dropdown. +- Change: [#24059] The ‘select other ride’ button is now available in the track manager. - Change: [#24067] [Plugin] Registered menu items are now listed alphabetically. - Change: [#24070] Footpath selection menus now show object names on hover using a tooltip. - Change: [#24101] Frozen peeps are no longer removed when using the 'remove all guests' cheat. diff --git a/src/openrct2-ui/windows/TrackList.cpp b/src/openrct2-ui/windows/TrackList.cpp index dc7d4fc700..73aa327eea 100644 --- a/src/openrct2-ui/windows/TrackList.cpp +++ b/src/openrct2-ui/windows/TrackList.cpp @@ -221,15 +221,6 @@ namespace OpenRCT2::Ui::Windows LoadDesignsList(_window_track_list_item); - if (gLegacyScene == LegacyScene::trackDesignsManager) - { - widgets[WIDX_BACK].type = WindowWidgetType::Empty; - } - else - { - widgets[WIDX_BACK].type = WindowWidgetType::TableHeader; - } - WindowInitScrollWidgets(*this); _selectedItemIsBeingUpdated = false; _reloadTrackDesigns = false; @@ -248,6 +239,14 @@ namespace OpenRCT2::Ui::Windows _loadedTrackDesignIndex = TRACK_DESIGN_INDEX_UNLOADED; } + void ReopenTrackManager() + { + auto* windowMgr = Ui::GetWindowManager(); + windowMgr->CloseByNumber(WindowClass::ManageTrackDesign, number); + windowMgr->CloseByNumber(WindowClass::TrackDeletePrompt, number); + Editor::LoadTrackManager(); + } + void OnClose() override { // Dispose track design and preview @@ -265,10 +264,7 @@ namespace OpenRCT2::Ui::Windows // try to load the track manager again, and an infinite loop will result. if ((gLegacyScene == LegacyScene::trackDesignsManager) && gScreenAge != 0) { - auto* windowMgr = Ui::GetWindowManager(); - windowMgr->CloseByNumber(WindowClass::ManageTrackDesign, number); - windowMgr->CloseByNumber(WindowClass::TrackDeletePrompt, number); - Editor::LoadTrackManager(); + ReopenTrackManager(); } } @@ -295,6 +291,10 @@ namespace OpenRCT2::Ui::Windows { ContextOpenWindow(WindowClass::ConstructRide); } + else + { + ReopenTrackManager(); + } break; case WIDX_FILTER_STRING: WindowStartTextbox(*this, widgetIndex, _filterString, sizeof(_filterString));