Mercurial > hg > openttd
changeset 15679:7d5a8cb093f1 draft
(svn r20344) -Feature: add rescan_newgrf console command
author | yexo <yexo@openttd.org> |
---|---|
date | Tue, 03 Aug 2010 12:54:19 +0000 |
parents | fc72f8feb746 |
children | ebc49007986b |
files | src/console_cmds.cpp |
diffstat | 1 files changed, 14 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/console_cmds.cpp +++ b/src/console_cmds.cpp @@ -1163,6 +1163,19 @@ } #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 @@ IConsoleCmdRegister("setting_newgame", ConSettingNewgame); IConsoleCmdRegister("list_settings",ConListSettings); IConsoleCmdRegister("gamelog", ConGamelogPrint); + IConsoleCmdRegister("rescan_newgrf", ConRescanNewGRF); IConsoleAliasRegister("dir", "ls"); IConsoleAliasRegister("del", "rm %+");