diff options
author | Darkvater <Darkvater@openttd.org> | 2005-05-16 13:46:26 +0000 |
---|---|---|
committer | Darkvater <Darkvater@openttd.org> | 2005-05-16 13:46:26 +0000 |
commit | ee89f5ab77860ce319e62bab507820660a11d707 (patch) | |
tree | 2c210f6d84e74e19b38b5217dd6dd779b7615b7d /console_cmds.c | |
parent | 2dc7d2b14e4d9ac744630759e94cb80df46f0cda (diff) | |
download | openttd-ee89f5ab77860ce319e62bab507820660a11d707.tar.xz |
(svn r2332) - Feature: Add 'clear' command and CTRL+L to empty the console window
- Fix: do not execute emtpy commands anymore
Diffstat (limited to 'console_cmds.c')
-rw-r--r-- | console_cmds.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/console_cmds.c b/console_cmds.c index 502bc1048..3b2159142 100644 --- a/console_cmds.c +++ b/console_cmds.c @@ -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"); |