From c815a427c029033d17d5487d7f20049d6b7d33fa Mon Sep 17 00:00:00 2001 From: spacek531 Date: Tue, 4 Jul 2017 19:11:28 -0700 Subject: [PATCH] Change Seconds (internal) to Milliseconds, en-GB too --- data/language/en-GB.txt | 4 ++-- src/openrct2/title/TitleSequence.cpp | 4 ++-- src/openrct2/title/TitleSequence.h | 2 +- src/openrct2/title/TitleSequencePlayer.cpp | 2 +- src/openrct2/windows/title_command_editor.c | 5 +++-- src/openrct2/windows/title_editor.c | 2 +- 6 files changed, 10 insertions(+), 9 deletions(-) diff --git a/data/language/en-GB.txt b/data/language/en-GB.txt index 2126236283..8a3c8f1e1a 100644 --- a/data/language/en-GB.txt +++ b/data/language/en-GB.txt @@ -1,4 +1,4 @@ -# STR_XXXX part is read and XXXX becomes the string id number. +# STR_XXXX part is read and XXXX becomes the string id number. # Everything after the colon and before the new line will be saved as the string. # Use # at the beginning of a line to leave a comment. STR_0000 : @@ -3768,7 +3768,7 @@ STR_5426 :End STR_5427 :Coordinates: STR_5428 :Anticlockwise rotations: STR_5429 :Zoom level: -STR_5430 :Seconds to wait: +STR_5430 :Milliseconds to wait: STR_5431 :Save to load: STR_5432 :Command: STR_5433 :Title Sequences diff --git a/src/openrct2/title/TitleSequence.cpp b/src/openrct2/title/TitleSequence.cpp index 30fb2e4136..191ca573a5 100644 --- a/src/openrct2/title/TitleSequence.cpp +++ b/src/openrct2/title/TitleSequence.cpp @@ -446,7 +446,7 @@ static std::vector LegacyScriptRead(utf8 * script, size_t scriptLe else if (_stricmp(token, "WAIT") == 0) { command.Type = TITLE_SCRIPT_WAIT; - command.Seconds = atoi(part1) & 0xFF; + command.Milliseconds = atoi(part1) & 0xFFFF; } else if (_stricmp(token, "RESTART") == 0) { @@ -595,7 +595,7 @@ static utf8 * LegacyScriptWrite(TitleSequence * seq) sb.Append(buffer); break; case TITLE_SCRIPT_WAIT: - String::Format(buffer, sizeof(buffer), "WAIT %u", command->Seconds); + String::Format(buffer, sizeof(buffer), "WAIT %u", command->Milliseconds); sb.Append(buffer); break; case TITLE_SCRIPT_RESTART: diff --git a/src/openrct2/title/TitleSequence.h b/src/openrct2/title/TitleSequence.h index b9c111ad8d..0772908afb 100644 --- a/src/openrct2/title/TitleSequence.h +++ b/src/openrct2/title/TitleSequence.h @@ -31,7 +31,7 @@ typedef struct TitleCommand uint8 Rotations; // ROTATE (counter-clockwise) uint8 Zoom; // ZOOM uint8 Speed; // SPEED - uint8 Seconds; // WAIT + uint16 Milliseconds; // WAIT }; } TitleCommand; diff --git a/src/openrct2/title/TitleSequencePlayer.cpp b/src/openrct2/title/TitleSequencePlayer.cpp index 8804999957..146c7c6dca 100644 --- a/src/openrct2/title/TitleSequencePlayer.cpp +++ b/src/openrct2/title/TitleSequencePlayer.cpp @@ -248,7 +248,7 @@ private: break; case TITLE_SCRIPT_WAIT: // The waitCounter is measured in 25-ms game ticks. Previously it was seconds * 40 ticks/second, now it is ms / 25 ms/tick - _waitCounter = Math::Min(1, command->Seconds / UPDATE_TIME_MS); + _waitCounter = Math::Min(1, command->Milliseconds / UPDATE_TIME_MS); break; case TITLE_SCRIPT_LOADMM: { diff --git a/src/openrct2/windows/title_command_editor.c b/src/openrct2/windows/title_command_editor.c index 3f1b9b392b..f0e2a03d34 100644 --- a/src/openrct2/windows/title_command_editor.c +++ b/src/openrct2/windows/title_command_editor.c @@ -42,6 +42,7 @@ TITLE_COMMAND_ORDER window_title_command_editor_orders[] = { { TITLE_SCRIPT_ZOOM, STR_TITLE_EDITOR_COMMAND_TYPE_ZOOM, STR_TITLE_EDITOR_ARGUMENT_ZOOM_LEVEL }, { TITLE_SCRIPT_SPEED, STR_TITLE_EDITOR_COMMAND_TYPE_SPEED, STR_TITLE_EDITOR_ARGUMENT_SPEED }, { TITLE_SCRIPT_WAIT, STR_TITLE_EDITOR_COMMAND_TYPE_WAIT, STR_TITLE_EDITOR_ARGUMENT_WAIT_SECONDS }, + { TITLE_SCRIPT_WAIT, STR_TITLE_EDITOR_COMMAND_TYPE_WAIT, STR_TITLE_EDITOR_ARGUMENT_WAIT_SECONDS }, { TITLE_SCRIPT_RESTART, STR_TITLE_EDITOR_RESTART, STR_NONE }, { TITLE_SCRIPT_END, STR_TITLE_EDITOR_END, STR_NONE }, }; @@ -402,8 +403,8 @@ static void window_title_command_editor_dropdown(rct_window *w, rct_widgetindex command.Speed = 1; break; case TITLE_SCRIPT_WAIT: - command.Seconds = 10; - snprintf(textbox1Buffer, BUF_SIZE, "%d", command.Seconds); + command.Milliseconds = 10000; + snprintf(textbox1Buffer, BUF_SIZE, "%d", command.Milliseconds); break; case TITLE_SCRIPT_LOAD: command.SaveIndex = 0; diff --git a/src/openrct2/windows/title_editor.c b/src/openrct2/windows/title_editor.c index 9431a6b4f9..7c349606ee 100644 --- a/src/openrct2/windows/title_editor.c +++ b/src/openrct2/windows/title_editor.c @@ -891,7 +891,7 @@ static void window_title_editor_scrollpaint_commands(rct_window *w, rct_drawpixe break; case TITLE_SCRIPT_WAIT: commandName = STR_TITLE_EDITOR_COMMAND_WAIT; - set_format_arg(0, uint16, command->Seconds); + set_format_arg(0, uint16, command->Milliseconds); break; case TITLE_SCRIPT_RESTART: commandName = STR_TITLE_EDITOR_RESTART;