From fc63432a11e405bb54ecd8013fcb1e1c497389c8 Mon Sep 17 00:00:00 2001 From: rubidium42 Date: Sun, 13 Jun 2021 14:55:11 +0200 Subject: [PATCH] Codechange: improve style/writing of IConsolePrint strings --- src/console_cmds.cpp | 28 ++++++++++++++-------------- src/console_gui.cpp | 2 +- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/console_cmds.cpp b/src/console_cmds.cpp index 09b1db4af9..9d03f3deba 100644 --- a/src/console_cmds.cpp +++ b/src/console_cmds.cpp @@ -273,7 +273,7 @@ DEF_CONSOLE_CMD(ConScrollToTile) uint32 result; if (GetArgumentInteger(&result, argv[1])) { if (result >= MapSize()) { - IConsolePrint(CC_ERROR, "Tile does not exist"); + IConsolePrint(CC_ERROR, "Tile does not exist."); return true; } ScrollMainWindowToTile((TileIndex)result); @@ -286,7 +286,7 @@ DEF_CONSOLE_CMD(ConScrollToTile) uint32 x, y; if (GetArgumentInteger(&x, argv[1]) && GetArgumentInteger(&y, argv[2])) { if (x >= MapSizeX() || y >= MapSizeY()) { - IConsolePrint(CC_ERROR, "Tile does not exist"); + IConsolePrint(CC_ERROR, "Tile does not exist."); return true; } ScrollMainWindowToTile(TileXY(x, y)); @@ -593,7 +593,7 @@ DEF_CONSOLE_CMD(ConUnBan) _network_ban_list.erase(_network_ban_list.begin() + index); } else { IConsolePrint(CC_DEFAULT, "Invalid list index or IP not in ban-list."); - IConsolePrint(CC_DEFAULT, "For a list of banned IP's, see the command 'banlist'"); + IConsolePrint(CC_DEFAULT, "For a list of banned IP's, see the command 'banlist'."); } return true; @@ -606,7 +606,7 @@ DEF_CONSOLE_CMD(ConBanList) return true; } - IConsolePrint(CC_DEFAULT, "Banlist: "); + IConsolePrint(CC_DEFAULT, "Banlist:"); uint i = 1; for (const auto &entry : _network_ban_list) { @@ -1018,7 +1018,7 @@ DEF_CONSOLE_CMD(ConScript) if (_iconsole_output_file == nullptr) { IConsolePrint(CC_ERROR, "Could not open console log file '{}'.", argv[1]); } else { - IConsolePrint(CC_INFO, "Console log output started to: '{}'", argv[1]); + IConsolePrint(CC_INFO, "Console log output started to '{}'.", argv[1]); } } @@ -1581,18 +1581,18 @@ DEF_CONSOLE_CMD(ConHelp) return true; } - IConsolePrint(CC_ERROR, "Command not found"); + IConsolePrint(CC_ERROR, "Command not found."); return true; } IConsolePrint(TC_LIGHT_BLUE, " ---- OpenTTD Console Help ---- "); - IConsolePrint(CC_DEFAULT, " - commands: [command to list all commands: list_cmds]"); + IConsolePrint(CC_DEFAULT, " - commands: the command to list all commands is 'list_cmds'."); IConsolePrint(CC_DEFAULT, " call commands with ' ...'"); - IConsolePrint(CC_DEFAULT, " - to assign strings, or use them as arguments, enclose it within quotes"); - IConsolePrint(CC_DEFAULT, " like this: ' \"string argument with spaces\"'"); - IConsolePrint(CC_DEFAULT, " - use 'help ' to get specific information"); - IConsolePrint(CC_DEFAULT, " - scroll console output with shift + (up | down | pageup | pagedown)"); - IConsolePrint(CC_DEFAULT, " - scroll console input history with the up or down arrows"); + IConsolePrint(CC_DEFAULT, " - to assign strings, or use them as arguments, enclose it within quotes."); + IConsolePrint(CC_DEFAULT, " like this: ' \"string argument with spaces\"'."); + IConsolePrint(CC_DEFAULT, " - use 'help ' to get specific information."); + IConsolePrint(CC_DEFAULT, " - scroll console output with shift + (up | down | pageup | pagedown)."); + IConsolePrint(CC_DEFAULT, " - scroll console input history with the up or down arrows."); IConsolePrint(CC_DEFAULT, ""); return true; } @@ -2070,7 +2070,7 @@ DEF_CONSOLE_CMD(ConNewGRFProfile) } } if (started > 0) { - IConsolePrint(CC_DEBUG, "Started profiling for GRFID{} {}", (started > 1) ? "s" : "", grfids); + IConsolePrint(CC_DEBUG, "Started profiling for GRFID{} {}.", (started > 1) ? "s" : "", grfids); if (argc >= 3) { int days = std::max(atoi(argv[2]), 1); _newgrf_profile_end_date = _date + days; @@ -2144,7 +2144,7 @@ DEF_CONSOLE_CMD(ConFramerateWindow) } if (_network_dedicated) { - IConsolePrint(CC_ERROR, "Can not open frame rate window on a dedicated server"); + IConsolePrint(CC_ERROR, "Can not open frame rate window on a dedicated server."); return false; } diff --git a/src/console_gui.cpp b/src/console_gui.cpp index a225673e89..81978f08a2 100644 --- a/src/console_gui.cpp +++ b/src/console_gui.cpp @@ -401,7 +401,7 @@ void IConsoleGUIInit() IConsolePrint(TC_LIGHT_BLUE, "OpenTTD Game Console Revision 7 - {}", _openttd_revision); IConsolePrint(CC_WHITE, "------------------------------------"); - IConsolePrint(CC_WHITE, "use \"help\" for more information"); + IConsolePrint(CC_WHITE, "use \"help\" for more information."); IConsolePrint(CC_WHITE, ""); IConsoleClearCommand(); }