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

Close #22476: Add time since last inspection to Rides List window (#24080)

* Add time since last inspection to ride window

* Changelog

* Add missing entry to ride_info_type_money_mapping
Make dropdown wider

* Consistent formatting

* Update distribution/changelog.txt

---------

Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
This commit is contained in:
Andrew
2025-05-18 05:56:44 -04:00
committed by GitHub
parent 208480f005
commit 736d9448af
4 changed files with 38 additions and 2 deletions

View File

@@ -3818,3 +3818,7 @@ STR_6770 :Frame rate limit:
STR_6771 :Internal speed (default)
STR_6772 :Vertical sync
STR_6773 :Unrestricted
STR_6774 :Time since last inspection
STR_6775 :{COMMA16} minute
STR_6776 :{COMMA16} minutes
STR_6777 :more than 4 hours

View File

@@ -1,6 +1,7 @@
0.4.23 (in development)
------------------------------------------------------------------------
- Feature: [#24313] [Plugin] Add API for setting a ride vehicles sprite to a smoke plume.
- Feature: [#22476] “Time since last inspection” statistic is available in the rides window.
- Feature: [#24313] [Plugin] Add API for setting a ride vehicles 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.
- Change: [#24342] g2.dat is now split into g2.dat and fonts.dat.

View File

@@ -1734,6 +1734,10 @@ namespace OpenRCT2
STR_CLOSE_ALL = 1011,
STR_DOWN_TIME = 1833,
STR_DOWN_TIME_LABEL = 1840,
STR_LAST_INSPECTION = 6774,
STR_LAST_INSPECTION_LABEL_MINUTE = 6775,
STR_LAST_INSPECTION_LABEL_MINUTES = 6776,
STR_LAST_INSPECTION_LABEL_MORE_THAN_FOUR_HOURS = 6777,
STR_EXCITEMENT_LABEL = 6463,
STR_GUESTS_FAVOURITE = 1834,
STR_GUESTS_FAVOURITE_LABEL = 1842,

View File

@@ -97,6 +97,7 @@ namespace OpenRCT2::Ui::Windows
INFORMATION_TYPE_QUEUE_TIME,
INFORMATION_TYPE_RELIABILITY,
INFORMATION_TYPE_DOWN_TIME,
INFORMATION_TYPE_LAST_INSPECTION,
INFORMATION_TYPE_GUESTS_FAVOURITE,
INFORMATION_TYPE_EXCITEMENT,
INFORMATION_TYPE_INTENSITY,
@@ -119,6 +120,7 @@ namespace OpenRCT2::Ui::Windows
STR_QUEUE_TIME,
STR_RELIABILITY,
STR_DOWN_TIME,
STR_LAST_INSPECTION,
STR_GUESTS_FAVOURITE,
STR_RIDE_LIST_EXCITEMENT,
STR_RIDE_LIST_INTENSITY,
@@ -146,6 +148,7 @@ namespace OpenRCT2::Ui::Windows
false, // Queue time
false, // Reliability
false, // Down time
false, // Last inspection
false, // Guests favourite
false, // Excitement
false, // Intensity
@@ -211,7 +214,7 @@ namespace OpenRCT2::Ui::Windows
widgets[WIDX_SORT].right = width - 60 + 54;
auto dropdownStart = widgets[WIDX_CURRENT_INFORMATION_TYPE].top;
ResizeDropdown(WIDX_CURRENT_INFORMATION_TYPE, { 150, dropdownStart }, { width - 216, kDropdownHeight });
ResizeDropdown(WIDX_CURRENT_INFORMATION_TYPE, { 100, dropdownStart }, { width - 166, kDropdownHeight });
// Refreshing the list can be a very intensive operation
// owing to its use of ride_has_any_track_elements().
@@ -704,6 +707,25 @@ namespace OpenRCT2::Ui::Windows
ft.Add<uint16_t>(ridePtr->downtime);
formatSecondary = STR_DOWN_TIME_LABEL;
break;
case INFORMATION_TYPE_LAST_INSPECTION:
{
const auto lastInspection = ridePtr->lastInspection;
ft.Add<uint16_t>(lastInspection);
if (lastInspection <= 1)
{
formatSecondary = STR_LAST_INSPECTION_LABEL_MINUTE;
}
else if (lastInspection <= 240)
{
formatSecondary = STR_LAST_INSPECTION_LABEL_MINUTES;
}
else
{
formatSecondary = STR_LAST_INSPECTION_LABEL_MORE_THAN_FOUR_HOURS;
}
break;
}
case INFORMATION_TYPE_GUESTS_FAVOURITE:
formatSecondary = 0;
if (ridePtr->isRide())
@@ -907,6 +929,11 @@ namespace OpenRCT2::Ui::Windows
return thisRide.downtime <= otherRide.downtime;
});
break;
case INFORMATION_TYPE_LAST_INSPECTION:
SortListByPredicate([](const Ride& thisRide, const Ride& otherRide) -> bool {
return thisRide.lastInspection <= otherRide.lastInspection;
});
break;
case INFORMATION_TYPE_GUESTS_FAVOURITE:
SortListByPredicate([](const Ride& thisRide, const Ride& otherRide) -> bool {
return thisRide.guestsFavourite <= otherRide.guestsFavourite;