mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-24 00:03:11 +01:00
Provide more warnings for RideSetColourSchemeAction (#18590)
Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
This commit is contained in:
@@ -3630,6 +3630,8 @@ STR_6524 :Increase the priority of the selected asset pack.
|
|||||||
STR_6525 :Reload all assets in the game with the enabled asset packs.
|
STR_6525 :Reload all assets in the game with the enabled asset packs.
|
||||||
STR_6526 :(base graphics, music and sound effects)
|
STR_6526 :(base graphics, music and sound effects)
|
||||||
STR_6527 :Competitions
|
STR_6527 :Competitions
|
||||||
|
STR_6528 :Invalid track parameters!
|
||||||
|
STR_6529 :Invalid colour scheme parameter!
|
||||||
|
|
||||||
#############
|
#############
|
||||||
# Scenarios #
|
# Scenarios #
|
||||||
|
|||||||
@@ -54,6 +54,22 @@ GameActions::Result RideSetColourSchemeAction::Query() const
|
|||||||
return GameActions::Result(
|
return GameActions::Result(
|
||||||
GameActions::Status::InvalidParameters, STR_CANT_SET_COLOUR_SCHEME, STR_LAND_NOT_OWNED_BY_PARK);
|
GameActions::Status::InvalidParameters, STR_CANT_SET_COLOUR_SCHEME, STR_LAND_NOT_OWNED_BY_PARK);
|
||||||
}
|
}
|
||||||
|
// Find the relevant track piece, prefer sequence 0 (logic copied from GetTrackElementOriginAndApplyChanges)
|
||||||
|
auto trackElement = MapGetTrackElementAtOfTypeSeq(_loc, _trackType, 0);
|
||||||
|
if (trackElement == nullptr)
|
||||||
|
{
|
||||||
|
trackElement = MapGetTrackElementAtOfType(_loc, _trackType);
|
||||||
|
if (trackElement == nullptr)
|
||||||
|
{
|
||||||
|
return GameActions::Result(
|
||||||
|
GameActions::Status::InvalidParameters, STR_CANT_SET_COLOUR_SCHEME, STR_INVALID_TRACK_PARAMETERS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (_newColourScheme >= OpenRCT2::Limits::NumColourSchemes)
|
||||||
|
{
|
||||||
|
return GameActions::Result(
|
||||||
|
GameActions::Status::InvalidParameters, STR_CANT_SET_COLOUR_SCHEME, STR_INVALID_COLOUR_SCHEME_PARAMETER);
|
||||||
|
}
|
||||||
return GameActions::Result();
|
return GameActions::Result();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3915,6 +3915,8 @@ enum : uint16_t
|
|||||||
|
|
||||||
STR_COMPETITIONS = 6527,
|
STR_COMPETITIONS = 6527,
|
||||||
|
|
||||||
|
STR_INVALID_TRACK_PARAMETERS = 6528,
|
||||||
|
STR_INVALID_COLOUR_SCHEME_PARAMETER = 6529,
|
||||||
// Have to include resource strings (from scenarios and objects) for the time being now that language is partially working
|
// 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
|
/* MAX_STR_COUNT = 32768 */ // MAX_STR_COUNT - upper limit for number of strings, not the current count strings
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user