From 2b6770bfad474877fe726fb55504ffafb51006b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20=C4=8Cern=C3=A1=C4=8D?= Date: Wed, 18 May 2016 22:04:57 +0200 Subject: [PATCH] Fix redundat separator in ride's measurement & test data window tab (#3654) --- src/localisation/string_ids.h | 5 +++++ src/windows/ride.c | 20 ++++++++++++++------ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/localisation/string_ids.h b/src/localisation/string_ids.h index 03f7e95f15..a2057fc175 100644 --- a/src/localisation/string_ids.h +++ b/src/localisation/string_ids.h @@ -495,7 +495,12 @@ enum { STR_NO_TEST_RESULTS_YET = 1339, STR_MAX_SPEED = 1340, STR_RIDE_TIME = 1341, + STR_RIDE_TIME_ENTRY = 1342, + STR_RIDE_TIME_ENTRY_WITH_SEPARATOR = 1343, + STR_RIDE_LENGTH = 1344, + STR_RIDE_LENGTH_ENTRY = 1345, + STR_RIDE_LENGTH_ENTRY_WITH_SEPARATOR = 1346, STR_AVERAGE_SPEED = 1347, STR_MAX_POSITIVE_VERTICAL_G = 1348, STR_MAX_POSITIVE_VERTICAL_G_RED = 1349, diff --git a/src/windows/ride.c b/src/windows/ride.c index de4914a948..05d6704f6a 100644 --- a/src/windows/ride.c +++ b/src/windows/ride.c @@ -4967,17 +4967,21 @@ static void window_ride_measurements_paint(rct_window *w, rct_drawpixelinfo *dpi for (i = 0; i < ride->num_stations; i++) { time = ride->time[numTimes]; if (time != 0) { - set_format_arg(0 + (numTimes * 4), uint16, 1343); + set_format_arg(0 + (numTimes * 4), uint16, STR_RIDE_TIME_ENTRY_WITH_SEPARATOR); set_format_arg(2 + (numTimes * 4), uint16, time); numTimes++; } } if (numTimes == 0) { - set_format_arg(0, uint16, 1343); + set_format_arg(0, uint16, STR_RIDE_TIME_ENTRY); set_format_arg(2, uint16, 0); numTimes++; + } else { + //sadly, STR_RIDE_TIME_ENTRY_WITH_SEPARATOR are defined with the separator AFTER an entry + //therefore we set the last entry to use the no-separator format now, post-format + set_format_arg(0 + ((numTimes - 1) * 4), uint16, STR_RIDE_TIME_ENTRY); } - RCT2_GLOBAL(0x013CE94E + (numTimes * 4), uint16) = 1342; + RCT2_GLOBAL(0x013CE94E + (numTimes * 4), uint16) = STR_RIDE_TIME_ENTRY; set_format_arg(0 + (numTimes * 4), uint16, 0); set_format_arg(2 + (numTimes * 4), uint16, 0); set_format_arg(4 + (numTimes * 4), uint16, 0); @@ -4992,17 +4996,21 @@ static void window_ride_measurements_paint(rct_window *w, rct_drawpixelinfo *dpi length = ride->length[numLengths]; if (length != 0) { length >>= 16; - set_format_arg(0 + (numLengths * 4), uint16, 1346); + set_format_arg(0 + (numLengths * 4), uint16, STR_RIDE_LENGTH_ENTRY_WITH_SEPARATOR); set_format_arg(2 + (numLengths * 4), uint16, (length & 0xFFFF)); numLengths++; } } if (numLengths == 0) { - set_format_arg(0, uint16, 1346); + set_format_arg(0, uint16, STR_RIDE_LENGTH_ENTRY); set_format_arg(2, uint16, 0); numLengths++; + } else { + //sadly, STR_RIDE_LENGTH_ENTRY_WITH_SEPARATOR are defined with the separator AFTER an entry + //therefore we set the last entry to use the no-separator format now, post-format + set_format_arg(0 + ((numTimes - 1) * 4), uint16, STR_RIDE_LENGTH_ENTRY); } - RCT2_GLOBAL(0x013CE94E + (numLengths * 4), uint16) = 1345; + RCT2_GLOBAL(0x013CE94E + (numLengths * 4), uint16) = STR_RIDE_LENGTH_ENTRY; set_format_arg(0 + (numLengths * 4), uint16, 0); set_format_arg(2 + (numLengths * 4), uint16, 0); set_format_arg(4 + (numLengths * 4), uint16, 0);