mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-13 11:02:47 +01:00
Hide speed and length statistics for flat ride TD6 files (#7563)
This hides the speed and length statistics in the track design list when viewing designs for non-tracked rides. Fixes #7507.
This commit is contained in:
committed by
Hielke Morsink
parent
a2f39079a7
commit
8a724c3983
@@ -593,81 +593,96 @@ static void window_track_list_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||||||
gfx_draw_string_left(dpi, STR_TRACK_LIST_NAUSEA_RATING, &rating, COLOUR_BLACK, x, y);
|
gfx_draw_string_left(dpi, STR_TRACK_LIST_NAUSEA_RATING, &rating, COLOUR_BLACK, x, y);
|
||||||
y += LIST_ROW_HEIGHT + 4;
|
y += LIST_ROW_HEIGHT + 4;
|
||||||
|
|
||||||
if (td6->type != RIDE_TYPE_MAZE) {
|
// Information for tracked rides.
|
||||||
if (td6->type == RIDE_TYPE_MINI_GOLF) {
|
if (ride_type_has_flag(td6->type, RIDE_TYPE_FLAG_HAS_TRACK))
|
||||||
// Holes
|
{
|
||||||
uint16 holes = td6->holes & 0x1F;
|
if (td6->type != RIDE_TYPE_MAZE)
|
||||||
gfx_draw_string_left(dpi, STR_HOLES, &holes, COLOUR_BLACK, x, y);
|
{
|
||||||
y += LIST_ROW_HEIGHT;
|
if (td6->type == RIDE_TYPE_MINI_GOLF)
|
||||||
} else {
|
{
|
||||||
// Maximum speed
|
// Holes
|
||||||
uint16 speed = ((td6->max_speed << 16) * 9) >> 18;
|
uint16 holes = td6->holes & 0x1F;
|
||||||
gfx_draw_string_left(dpi, STR_MAX_SPEED, &speed, COLOUR_BLACK, x, y);
|
gfx_draw_string_left(dpi, STR_HOLES, &holes, COLOUR_BLACK, x, y);
|
||||||
y += LIST_ROW_HEIGHT;
|
y += LIST_ROW_HEIGHT;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Maximum speed
|
||||||
|
uint16 speed = ((td6->max_speed << 16) * 9) >> 18;
|
||||||
|
gfx_draw_string_left(dpi, STR_MAX_SPEED, &speed, COLOUR_BLACK, x, y);
|
||||||
|
y += LIST_ROW_HEIGHT;
|
||||||
|
|
||||||
// Average speed
|
// Average speed
|
||||||
speed = ((td6->average_speed << 16) * 9) >> 18;
|
speed = ((td6->average_speed << 16) * 9) >> 18;
|
||||||
gfx_draw_string_left(dpi, STR_AVERAGE_SPEED, &speed, COLOUR_BLACK, x, y);
|
gfx_draw_string_left(dpi, STR_AVERAGE_SPEED, &speed, COLOUR_BLACK, x, y);
|
||||||
|
y += LIST_ROW_HEIGHT;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Ride length
|
||||||
|
set_format_arg(0, rct_string_id, STR_RIDE_LENGTH_ENTRY);
|
||||||
|
set_format_arg(2, uint16, td6->ride_length);
|
||||||
|
gfx_draw_string_left_clipped(dpi, STR_TRACK_LIST_RIDE_LENGTH, gCommonFormatArgs, COLOUR_BLACK, x, y, 214);
|
||||||
y += LIST_ROW_HEIGHT;
|
y += LIST_ROW_HEIGHT;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ride length
|
if (ride_type_has_flag(td6->type, RIDE_TYPE_FLAG_HAS_G_FORCES))
|
||||||
set_format_arg(0, rct_string_id, STR_RIDE_LENGTH_ENTRY);
|
{
|
||||||
set_format_arg(2, uint16, td6->ride_length);
|
// Maximum positive vertical Gs
|
||||||
gfx_draw_string_left_clipped(dpi, STR_TRACK_LIST_RIDE_LENGTH, gCommonFormatArgs, COLOUR_BLACK, x, y, 214);
|
sint32 gForces = td6->max_positive_vertical_g * 32;
|
||||||
y += LIST_ROW_HEIGHT;
|
gfx_draw_string_left(dpi, STR_MAX_POSITIVE_VERTICAL_G, &gForces, COLOUR_BLACK, x, y);
|
||||||
}
|
y += LIST_ROW_HEIGHT;
|
||||||
|
|
||||||
if (ride_type_has_flag(td6->type, RIDE_TYPE_FLAG_HAS_G_FORCES)) {
|
// Maximum negative vertical Gs
|
||||||
// Maximum positive vertical Gs
|
gForces = td6->max_negative_vertical_g * 32;
|
||||||
sint32 gForces = td6->max_positive_vertical_g * 32;
|
gfx_draw_string_left(dpi, STR_MAX_NEGATIVE_VERTICAL_G, &gForces, COLOUR_BLACK, x, y);
|
||||||
gfx_draw_string_left(dpi, STR_MAX_POSITIVE_VERTICAL_G, &gForces, COLOUR_BLACK, x, y);
|
y += LIST_ROW_HEIGHT;
|
||||||
y += LIST_ROW_HEIGHT;
|
|
||||||
|
|
||||||
// Maximum negative vertical Gs
|
// Maximum lateral Gs
|
||||||
gForces = td6->max_negative_vertical_g * 32;
|
gForces = td6->max_lateral_g * 32;
|
||||||
gfx_draw_string_left(dpi, STR_MAX_NEGATIVE_VERTICAL_G, &gForces, COLOUR_BLACK, x, y);
|
gfx_draw_string_left(dpi, STR_MAX_LATERAL_G, &gForces, COLOUR_BLACK, x, y);
|
||||||
y += LIST_ROW_HEIGHT;
|
y += LIST_ROW_HEIGHT;
|
||||||
|
|
||||||
// Maximum lateral Gs
|
// If .TD6
|
||||||
gForces = td6->max_lateral_g * 32;
|
if (td6->version_and_colour_scheme / 4 >= 2)
|
||||||
gfx_draw_string_left(dpi, STR_MAX_LATERAL_G, &gForces, COLOUR_BLACK, x, y);
|
{
|
||||||
y += LIST_ROW_HEIGHT;
|
if (td6->total_air_time != 0)
|
||||||
|
{
|
||||||
|
// Total air time
|
||||||
|
sint32 airTime = td6->total_air_time * 25;
|
||||||
|
gfx_draw_string_left(dpi, STR_TOTAL_AIR_TIME, &airTime, COLOUR_BLACK, x, y);
|
||||||
|
y += LIST_ROW_HEIGHT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// If .TD6
|
if (ride_type_has_flag(td6->type, RIDE_TYPE_FLAG_HAS_DROPS))
|
||||||
if (td6->version_and_colour_scheme / 4 >= 2) {
|
{
|
||||||
if (td6->total_air_time != 0) {
|
// Drops
|
||||||
// Total air time
|
uint16 drops = td6->drops & 0x3F;
|
||||||
sint32 airTime = td6->total_air_time * 25;
|
gfx_draw_string_left(dpi, STR_DROPS, &drops, COLOUR_BLACK, x, y);
|
||||||
gfx_draw_string_left(dpi, STR_TOTAL_AIR_TIME, &airTime, COLOUR_BLACK, x, y);
|
y += LIST_ROW_HEIGHT;
|
||||||
|
|
||||||
|
// Drop height is multiplied by 0.75
|
||||||
|
uint16 highestDropHeight = (td6->highest_drop_height * 3) / 4;
|
||||||
|
gfx_draw_string_left(dpi, STR_HIGHEST_DROP_HEIGHT, &highestDropHeight, COLOUR_BLACK, x, y);
|
||||||
|
y += LIST_ROW_HEIGHT;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (td6->type != RIDE_TYPE_MINI_GOLF)
|
||||||
|
{
|
||||||
|
uint16 inversions = td6->inversions & 0x1F;
|
||||||
|
if (inversions != 0)
|
||||||
|
{
|
||||||
|
// Inversions
|
||||||
|
gfx_draw_string_left(dpi, STR_INVERSIONS, &inversions, COLOUR_BLACK, x, y);
|
||||||
y += LIST_ROW_HEIGHT;
|
y += LIST_ROW_HEIGHT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
y += 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ride_type_has_flag(td6->type, RIDE_TYPE_FLAG_HAS_DROPS)) {
|
if (td6->space_required_x != 0xFF)
|
||||||
// Drops
|
{
|
||||||
uint16 drops = td6->drops & 0x3F;
|
|
||||||
gfx_draw_string_left(dpi, STR_DROPS, &drops, COLOUR_BLACK, x, y);
|
|
||||||
y += LIST_ROW_HEIGHT;
|
|
||||||
|
|
||||||
// Drop height is multiplied by 0.75
|
|
||||||
uint16 highestDropHeight = (td6->highest_drop_height * 3) / 4;
|
|
||||||
gfx_draw_string_left(dpi, STR_HIGHEST_DROP_HEIGHT, &highestDropHeight, COLOUR_BLACK, x, y);
|
|
||||||
y += LIST_ROW_HEIGHT;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (td6->type != RIDE_TYPE_MINI_GOLF) {
|
|
||||||
uint16 inversions = td6->inversions & 0x1F;
|
|
||||||
if (inversions != 0) {
|
|
||||||
// Inversions
|
|
||||||
gfx_draw_string_left(dpi, STR_INVERSIONS, &inversions, COLOUR_BLACK, x, y);
|
|
||||||
y += LIST_ROW_HEIGHT;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
y += 4;
|
|
||||||
|
|
||||||
if (td6->space_required_x != 0xFF) {
|
|
||||||
// Space required
|
// Space required
|
||||||
set_format_arg(0, uint16, td6->space_required_x);
|
set_format_arg(0, uint16, td6->space_required_x);
|
||||||
set_format_arg(2, uint16, td6->space_required_y);
|
set_format_arg(2, uint16, td6->space_required_y);
|
||||||
@@ -675,7 +690,8 @@ static void window_track_list_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
|||||||
y += LIST_ROW_HEIGHT;
|
y += LIST_ROW_HEIGHT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (td6->cost != 0) {
|
if (td6->cost != 0)
|
||||||
|
{
|
||||||
gfx_draw_string_left(dpi, STR_TRACK_LIST_COST_AROUND, &td6->cost, COLOUR_BLACK, x, y);
|
gfx_draw_string_left(dpi, STR_TRACK_LIST_COST_AROUND, &td6->cost, COLOUR_BLACK, x, y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user