From ad2a77bfa586721169afd858544a37b16c6958cc Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Wed, 27 Oct 2021 11:30:55 +0200 Subject: [PATCH] Fix #12981: New vehicles do not appear in vehicle type dropdown --- distribution/changelog.txt | 1 + src/openrct2-ui/windows/Ride.cpp | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index b596fa8697..e0fe669b15 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -10,6 +10,7 @@ - Feature: [#15194] [Plugin] Add guest properties, ride downtime and park casualty penalty. - Feature: [#15195] Added a bug-report item in file dropdown menu. - Feature: [#15294] New vehicle animation type: flying animal. +- Fix: [#12981] New vehicles do not appear in vehicle type dropdown. - Fix: [#13465] Creating a scenario based on a won save game results in a scenario that’s instantly won. - Fix: [#13912] “Dome park” no longer renders dome correctly. - Fix: [#14316] Closing the Track Designs Manager window causes broken state. diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index 8131b436e9..a293dc3fbc 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -65,6 +65,8 @@ static constexpr const rct_string_id WINDOW_TITLE = STR_RIDE_WINDOW_TITLE; static constexpr const int32_t WH = 207; static constexpr const int32_t WW = 316; +static void populate_vehicle_type_dropdown(Ride* ride, bool forceRefresh = false); + enum { WINDOW_RIDE_PAGE_MAIN, @@ -1249,6 +1251,8 @@ static rct_window* window_ride_open(Ride* ride) window_ride_update_overall_view(ride); + populate_vehicle_type_dropdown(ride, true); + return w; } @@ -2066,7 +2070,7 @@ static void window_ride_main_follow_ride(rct_window* w) } } -static void populate_vehicle_type_dropdown(Ride* ride) +static void populate_vehicle_type_dropdown(Ride* ride, bool forceRefresh) { auto& objManager = GetContext()->GetObjectManager(); rct_ride_entry* rideEntry = ride->GetRideEntry(); @@ -2091,7 +2095,7 @@ static void populate_vehicle_type_dropdown(Ride* ride) // Don't repopulate the list if we just did. auto& ls = OpenRCT2::GetContext()->GetLocalisationService(); - if (VehicleDropdownExpanded == selectionShouldBeExpanded && VehicleDropdownRideType == rideEntry + if (!forceRefresh && VehicleDropdownExpanded == selectionShouldBeExpanded && VehicleDropdownRideType == rideEntry && VehicleDropdownDataLanguage == ls.GetCurrentLanguage()) return;