Warn user if unsupported vehicle or element used

This commit is contained in:
spacek531 2022-07-04 12:06:59 -07:00 committed by GitHub
parent b499a0517f
commit 312ad3e3ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 16 additions and 2 deletions

View File

@ -3604,6 +3604,8 @@ STR_6495 :Group rides by ride types instead of showing each vehicle separatel
STR_6496 :{WINDOW_COLOUR_2}{STRINGID}
STR_6497 :Click on a tile to show its tile elements.{NEWLINE}Ctrl + click a tile element to select it directly.
STR_6498 :Enable to maintain square map shape.
STR_6499 :Vehicle type not supported by track design format
STR_6500 :Track elements not supported by track design format
#############
# Scenarios #

View File

@ -1,4 +1,6 @@
0.4.2 (in development)
------------------------------------------------------------------------
- Change: [#17499] Update error text when using vehicle incompatible with TD6 and add error when using incompatible track elements.
0.4.1 (2022-07-04)
------------------------------------------------------------------------

View File

@ -3877,6 +3877,9 @@ enum : uint16_t
STR_MAINTAIN_SQUARE_MAP_TOOLTIP = 6498,
STR_VEHICLE_UNSUPPORTED_TD6 = 6499,
STR_TRACK_ELEM_UNSUPPORTED_TD6 = 6500,
// Have to include resource strings (from scenarios and objects) for the time being now that language is partially working
/* MAX_STR_COUNT = 32768 */ // MAX_STR_COUNT - upper limit for number of strings, not the current count strings
};

View File

@ -526,6 +526,7 @@ namespace TrackElemType
constexpr track_type_t FlatTrack1x1B_Alias = 121;
constexpr track_type_t FlatTrack1x4C_Alias = 122;
constexpr track_type_t FlatTrack3x3_Alias = 123;
constexpr track_type_t HighestAlias = 266;
}; // namespace TrackElemType
enum

View File

@ -87,10 +87,10 @@ rct_string_id TrackDesign::CreateTrackDesign(TrackDesignState& tds, const Ride&
if (object != nullptr)
{
auto entry = object->GetObjectEntry();
// Remove this check for new track design format
if (entry.IsEmpty())
{
// TODO create a new error message for `JSON objects are unsupported`
return STR_UNKNOWN_OBJECT_TYPE;
return STR_VEHICLE_UNSUPPORTED_TD6;
}
vehicle_object = ObjectEntryDescriptor(entry);
}
@ -199,6 +199,12 @@ rct_string_id TrackDesign::CreateTrackDesignTrack(TrackDesignState& tds, const R
do
{
// Remove this check for new track design format
if (trackElement.element->AsTrack()->GetTrackType() > TrackElemType::HighestAlias)
{
return STR_TRACK_ELEM_UNSUPPORTED_TD6;
}
TrackDesignTrackElement track{};
track.type = trackElement.element->AsTrack()->GetTrackType();