forked from mirror/OpenTTD
(svn r2332) - Feature: Add 'clear' command and CTRL+L to empty the console window
- Fix: do not execute emtpy commands anymore
This commit is contained in:
@@ -268,7 +268,6 @@ DEF_CONSOLE_CMD(ConChangeDirectory)
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
DEF_CONSOLE_CMD(ConPrintWorkingDirectory)
|
||||
{
|
||||
const char *path;
|
||||
@@ -287,6 +286,18 @@ DEF_CONSOLE_CMD(ConPrintWorkingDirectory)
|
||||
return true;
|
||||
}
|
||||
|
||||
DEF_CONSOLE_CMD(ConClearBuffer)
|
||||
{
|
||||
if (argc == 0) {
|
||||
IConsoleHelp("Clear the console buffer. Usage: 'clear'");
|
||||
return true;
|
||||
}
|
||||
|
||||
IConsoleClearBuffer();
|
||||
InvalidateWindow(WC_CONSOLE, 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// ********************************* //
|
||||
// * Network Core Console Commands * //
|
||||
@@ -1217,6 +1228,7 @@ void IConsoleStdLibRegister(void)
|
||||
IConsoleCmdRegister("ls", ConListFiles);
|
||||
IConsoleCmdRegister("cd", ConChangeDirectory);
|
||||
IConsoleCmdRegister("pwd", ConPrintWorkingDirectory);
|
||||
IConsoleCmdRegister("clear", ConClearBuffer);
|
||||
|
||||
IConsoleAliasRegister("dir", "ls");
|
||||
IConsoleAliasRegister("newmap", "newgame");
|
||||
|
Reference in New Issue
Block a user