From 1b877ceb5b207c4ad95b4323980eca5159656ff2 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 13 Feb 2010 11:45:54 +0000 Subject: Added command variation for dumping quotes and vocab svn-id: r48038 --- engines/m4/console.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'engines') diff --git a/engines/m4/console.cpp b/engines/m4/console.cpp index 25d568f8ac..e445b6e8d4 100644 --- a/engines/m4/console.cpp +++ b/engines/m4/console.cpp @@ -342,11 +342,23 @@ bool MadsConsole::cmdObject(int argc, const char **argv) { } bool MadsConsole::cmdMessage(int argc, const char **argv) { - VALIDATE_MADS; - - if (argc == 1) + if (argc == 1) { DebugPrintf("message 'objnum'\n"); - else { + } else if (!strcmp(argv[1], "list_quotes")) { + // Dump the quotes list + FILE *destFile = fopen("mads_quotes.txt", "wb"); + for (uint i = 0; i < _vm->globals()->getQuotesSize(); ++i) + fprintf(destFile, "%.3d - %s\n", i, _vm->globals()->getQuote(i)); + fclose(destFile); + + } else if (!strcmp(argv[1], "list_vocab")) { + // Dump the vocab list + FILE *destFile = fopen("mads_vocab.txt", "wb"); + for (uint i = 1; i <= _vm->globals()->getVocabSize(); ++i) + fprintf(destFile, "%.3d/%.3x - %s\n", i, i, _vm->globals()->getVocab(i)); + fclose(destFile); + + } else { int messageIdx = strToInt(argv[1]); if ((argc != 3) || (strcmp(argv[2], "idx") != 0)) -- cgit v1.2.3