Disable switching to dummy RTDs

This commit is contained in:
Gymnasiast committed 2026-02-04 19:58:28 +01:00
1 parent 8368340b7d
commit 1f11caeb3a
5 files changed
+17 -5

No files matched your search

+11 -1
View File
@@ -626,6 +626,7 @@ namespace OpenRCT2::Ui::Windows
ride_type_t RideTypeId;
StringId LabelId;
u8string LabelString;
bool isDummy;
};
// Used for sorting the vehicle type dropdown.
@@ -1898,10 +1899,11 @@ namespace OpenRCT2::Ui::Windows
// Will return the actual name for most rides, but a special string "Unknown Ride ({INT32})" for unknown ones.
// The placeholder will then be filled with the ID.
auto name = GetRideTypeNameForDropdown(i);
bool isDummy = GetRideTypeDescriptor(i).flags.has(RtdFlag::isDummyType);
auto ft = Formatter();
ft.Add<int32_t>(i);
auto label = FormatStringIDLegacy(name, ft.Data());
_rideDropdownData.push_back({ i, name, label });
_rideDropdownData.push_back({ i, name, label, isDummy });
}
std::sort(_rideDropdownData.begin(), _rideDropdownData.end(), [](auto& a, auto& b) {
@@ -1919,9 +1921,13 @@ namespace OpenRCT2::Ui::Windows
PopulateRideTypeDropdown();
std::vector<size_t> indicesToDisable{};
for (size_t i = 0; i < _rideDropdownData.size(); i++)
{
gDropdown.items[i] = Dropdown::MenuLabel(_rideDropdownData[i].LabelString);
if (_rideDropdownData[i].isDummy)
indicesToDisable.push_back(i);
}
Widget* dropdownWidget = widget - 1;
@@ -1943,6 +1949,10 @@ namespace OpenRCT2::Ui::Windows
gDropdown.highlightedIndex = pos;
gDropdown.defaultIndex = pos;
gDropdown.items[pos].setChecked(true);
for (auto i : indicesToDisable)
{
gDropdown.items[i].setDisabled(true);
}
}
void ShowLocateDropdown(Widget* widget)
+3 -1
View File
@@ -445,6 +445,8 @@ enum class RtdFlag : uint8_t
runningSpeedAffectsReliability,
poweredLaunchAffectsReliability,
reverseInclineLaunchAffectsReliability,
isDummyType,
};
using RtdFlags = FlagHolder<uint64_t, RtdFlag>;
@@ -635,7 +637,7 @@ constexpr RideTypeDescriptor kDummyRTD =
.StartTrackPiece = OpenRCT2::TrackElemType::endStation,
.TrackPaintFunctions = {},
.InvertedTrackPaintFunctions = {},
.flags = {},
.flags = { RtdFlag::isDummyType },
.RideModes = EnumsToFlags(RideMode::continuousCircuit),
.DefaultMode = RideMode::continuousCircuit,
.OperatingSettings = {},
@@ -111,7 +111,7 @@ constexpr RideTypeDescriptor FlyingRollerCoasterAltRTD =
.extraTrackGroups = { },
}),
.flags = kRtdFlagsHasThreeColours | kRtdFlagsCommonCoaster |
RtdFlags(RtdFlag::hasLeaveWhenAnotherVehicleArrivesAtStation, RtdFlag::startConstructionInverted),
RtdFlags(RtdFlag::hasLeaveWhenAnotherVehicleArrivesAtStation, RtdFlag::startConstructionInverted, RtdFlag::isDummyType),
.RideModes = EnumsToFlags(RideMode::continuousCircuit, RideMode::continuousCircuitBlockSectioned),
.DefaultMode = RideMode::continuousCircuit,
.OperatingSettings = { 10, 27 },
@@ -110,7 +110,7 @@ constexpr RideTypeDescriptor LayDownRollerCoasterAltRTD =
.extraTrackGroups = { },
}),
.flags = kRtdFlagsHasThreeColours | kRtdFlagsCommonCoaster |
RtdFlags(RtdFlag::hasLeaveWhenAnotherVehicleArrivesAtStation),
RtdFlags(RtdFlag::hasLeaveWhenAnotherVehicleArrivesAtStation, RtdFlag::isDummyType),
.RideModes = EnumsToFlags(RideMode::continuousCircuit, RideMode::continuousCircuitBlockSectioned),
.DefaultMode = RideMode::continuousCircuit,
.OperatingSettings = { 10, 27 },
@@ -110,7 +110,7 @@ constexpr RideTypeDescriptor MultiDimensionRollerCoasterAltRTD =
.extraTrackGroups = { },
}),
.flags = kRtdFlagsHasThreeColours | kRtdFlagsCommonCoaster |
RtdFlags(RtdFlag::hasLeaveWhenAnotherVehicleArrivesAtStation, RtdFlag::hasSeatRotation),
RtdFlags(RtdFlag::hasLeaveWhenAnotherVehicleArrivesAtStation, RtdFlag::hasSeatRotation, RtdFlag::isDummyType),
.RideModes = EnumsToFlags(RideMode::continuousCircuit, RideMode::continuousCircuitBlockSectioned),
.DefaultMode = RideMode::continuousCircuit,
.OperatingSettings = { 10, 27 },