summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2010-08-03 12:54:19 +0000
committeryexo <yexo@openttd.org>2010-08-03 12:54:19 +0000
commite2d706cd21c4ded88694d58dc656d88de813a7e8 (patch)
tree6337abbc5706aaaa282e130c7bd65c1bede77b3d /src
parent0664955db72d2e721baa874d6eefe6dc7447e48e (diff)
downloadopenttd-e2d706cd21c4ded88694d58dc656d88de813a7e8.tar.xz
(svn r20344) -Feature: add rescan_newgrf console command
Diffstat (limited to 'src')
-rw-r--r--src/console_cmds.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/console_cmds.cpp b/src/console_cmds.cpp
index c0cfcdf0b..fd08ab99c 100644
--- a/src/console_cmds.cpp
+++ b/src/console_cmds.cpp
@@ -1163,6 +1163,19 @@ DEF_CONSOLE_CMD(ConRescanAI)
}
#endif /* ENABLE_AI */
+DEF_CONSOLE_CMD(ConRescanNewGRF)
+{
+ if (argc == 0) {
+ IConsoleHelp("Rescan the data dir for NewGRFs. Usage: 'rescan_newgrf'");
+ return true;
+ }
+
+ ScanNewGRFFiles();
+ InvalidateWindowData(WC_GAME_OPTIONS, 0, 1);
+
+ return true;
+}
+
DEF_CONSOLE_CMD(ConGetSeed)
{
if (argc == 0) {
@@ -1744,6 +1757,7 @@ void IConsoleStdLibRegister()
IConsoleCmdRegister("setting_newgame", ConSettingNewgame);
IConsoleCmdRegister("list_settings",ConListSettings);
IConsoleCmdRegister("gamelog", ConGamelogPrint);
+ IConsoleCmdRegister("rescan_newgrf", ConRescanNewGRF);
IConsoleAliasRegister("dir", "ls");
IConsoleAliasRegister("del", "rm %+");