mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-12 18:42:36 +01:00
Close #24400: Sort rides with preservation order alphabetically
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
- Feature: [#24313] [Plugin] Add API for setting a ride vehicle’s sprite to a smoke plume.
|
||||
- Improved: [#24364] Improve the fallback vehicle sprites for Zero G Rolls, and allow small ones to be built without cheats if the fallbacks are available.
|
||||
- Improved: [#24368] Clicking the in-game update notication now leads to a more user-friendly download page.
|
||||
- Improved: [#24400] Ride list in preservation window is now sorted alphabetically.
|
||||
- Improved: [#24409] Steam installs of RCT Classic are now detected automatically.
|
||||
- Improved: [#24413] Better performance when moving the viewport on Windows and Linux platforms.
|
||||
- Improved: [#24417] Improve the fallback vehicle sprites for Dive Loops.
|
||||
|
||||
@@ -2185,6 +2185,14 @@ namespace OpenRCT2::Ui::Windows
|
||||
WindowSetResize(*this, kSizeRides, kSizeRides);
|
||||
}
|
||||
|
||||
static std::string GetRideString(RideId rideId)
|
||||
{
|
||||
const auto* ride = GetRide(rideId);
|
||||
if (ride == nullptr)
|
||||
return "";
|
||||
return ride->getName();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x00672544
|
||||
@@ -2206,6 +2214,11 @@ namespace OpenRCT2::Ui::Windows
|
||||
}
|
||||
}
|
||||
|
||||
// Sort the rides alphabetically
|
||||
std::stable_sort(_rideableRides.begin(), _rideableRides.end(), [](const RideId& a, const RideId& b) {
|
||||
return String::compare(GetRideString(a), GetRideString(b), false) < 0;
|
||||
});
|
||||
|
||||
if (oldSize != _rideableRides.size())
|
||||
{
|
||||
Invalidate();
|
||||
|
||||
Reference in New Issue
Block a user