Changeset - r6890:9062c22b27d8
[Not reviewed]
master
0 1 0
rubidium - 17 years ago 2007-06-13 14:52:41
rubidium@openttd.org
(svn r10137) -Add: console command to get the current game date.
1 file changed with 15 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/console_cmds.cpp
Show inline comments
 
@@ -941,6 +941,20 @@ DEF_CONSOLE_CMD(ConGetSeed)
 
	return true;
 
}
 

	
 
DEF_CONSOLE_CMD(ConGetDate)
 
{
 
	if (argc == 0) {
 
		IConsoleHelp("Returns the current date (day-month-year) of the game. Usage: 'getdate'");
 
		return true;
 
	}
 

	
 
	YearMonthDay ymd;
 
	ConvertDateToYMD(_date, &ymd);
 
	IConsolePrintF(_icolour_def, "Date: %d-%d-%d", ymd.day, ymd.month + 1, ymd.year);
 
	return true;
 
}
 

	
 

	
 
DEF_CONSOLE_CMD(ConAlias)
 
{
 
	IConsoleAlias *alias;
 
@@ -1496,6 +1510,7 @@ void IConsoleStdLibRegister()
 
	IConsoleCmdRegister("newgame",      ConNewGame);
 
	IConsoleCmdRegister("restart",      ConRestart);
 
	IConsoleCmdRegister("getseed",      ConGetSeed);
 
	IConsoleCmdRegister("getdate",      ConGetDate);
 
	IConsoleCmdRegister("quit",         ConExit);
 
	IConsoleCmdRegister("resetengines", ConResetEngines);
 
	IConsoleCmdRegister("return",       ConReturn);
0 comments (0 inline, 0 general)