Changeset - r25668:a808c425ce60
[Not reviewed]
master
0 2 0
rubidium42 - 3 years ago 2021-06-13 12:55:11
rubidium@openttd.org
Codechange: improve style/writing of IConsolePrint strings
2 files changed with 15 insertions and 15 deletions:
0 comments (0 inline, 0 general)
src/console_cmds.cpp
Show inline comments
 
@@ -270,26 +270,26 @@ DEF_CONSOLE_CMD(ConScrollToTile)
 
			return true;
 

	
 
		case 2: {
 
			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);
 
				return true;
 
			}
 
			break;
 
		}
 

	
 
		case 3: {
 
			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));
 
				return true;
 
			}
 
			break;
 
@@ -590,26 +590,26 @@ DEF_CONSOLE_CMD(ConUnBan)
 

	
 
	if (index < _network_ban_list.size()) {
 
		IConsolePrint(CC_DEFAULT, "Unbanned {}.", _network_ban_list[index]);
 
		_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;
 
}
 

	
 
DEF_CONSOLE_CMD(ConBanList)
 
{
 
	if (argc == 0) {
 
		IConsolePrint(CC_HELP, "List the IP's of banned clients: Usage 'banlist'.");
 
		return true;
 
	}
 

	
 
	IConsolePrint(CC_DEFAULT, "Banlist: ");
 
	IConsolePrint(CC_DEFAULT, "Banlist:");
 

	
 
	uint i = 1;
 
	for (const auto &entry : _network_ban_list) {
 
		IConsolePrint(CC_DEFAULT, "  {}) {}", i, entry);
 
		i++;
 
	}
 
@@ -1015,13 +1015,13 @@ DEF_CONSOLE_CMD(ConScript)
 
		if (argc < 2) return false;
 

	
 
		_iconsole_output_file = fopen(argv[1], "ab");
 
		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]);
 
		}
 
	}
 

	
 
	return true;
 
}
 

	
 
@@ -1578,24 +1578,24 @@ DEF_CONSOLE_CMD(ConHelp)
 
				return true;
 
			}
 
			IConsolePrint(CC_ERROR, "Alias is of special type, please see its execution-line: '{}'.", alias->cmdline);
 
			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 '<command> <arg2> <arg3>...'");
 
	IConsolePrint(CC_DEFAULT, " - to assign strings, or use them as arguments, enclose it within quotes");
 
	IConsolePrint(CC_DEFAULT, " like this: '<command> \"string argument with spaces\"'");
 
	IConsolePrint(CC_DEFAULT, " - use 'help <command>' 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: '<command> \"string argument with spaces\"'.");
 
	IConsolePrint(CC_DEFAULT, " - use 'help <command>' 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;
 
}
 

	
 
DEF_CONSOLE_CMD(ConListCommands)
 
{
 
@@ -2067,13 +2067,13 @@ DEF_CONSOLE_CMD(ConNewGRFProfile)
 
				char grfidstr[12]{ 0 };
 
				seprintf(grfidstr, lastof(grfidstr), "[%08X]", BSWAP32(pr.grffile->grfid));
 
				grfids += grfidstr;
 
			}
 
		}
 
		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;
 

	
 
				char datestrbuf[32]{ 0 };
 
				SetDParam(0, _newgrf_profile_end_date);
 
@@ -2141,13 +2141,13 @@ DEF_CONSOLE_CMD(ConFramerateWindow)
 
	if (argc == 0) {
 
		IConsolePrint(CC_HELP, "Open the frame rate window.");
 
		return true;
 
	}
 

	
 
	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;
 
	}
 

	
 
	ShowFramerateWindow();
 
	return true;
 
}
src/console_gui.cpp
Show inline comments
 
@@ -398,13 +398,13 @@ void IConsoleGUIInit()
 

	
 
	IConsoleLine::Reset();
 
	memset(_iconsole_history, 0, sizeof(_iconsole_history));
 

	
 
	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();
 
}
 

	
 
void IConsoleClearBuffer()
 
{
0 comments (0 inline, 0 general)