diff options
-rw-r--r-- | engines/mads/debugger.cpp | 16 | ||||
-rw-r--r-- | engines/mads/debugger.h | 1 |
2 files changed, 17 insertions, 0 deletions
diff --git a/engines/mads/debugger.cpp b/engines/mads/debugger.cpp index 0b69ee81fb..9f5735f318 100644 --- a/engines/mads/debugger.cpp +++ b/engines/mads/debugger.cpp @@ -41,6 +41,7 @@ Debugger::Debugger(MADSEngine *vm) : GUI::Debugger(), _vm(vm) { DCmd_Register("show_quote", WRAP_METHOD(Debugger, Cmd_ShowQuote)); DCmd_Register("show_vocab", WRAP_METHOD(Debugger, Cmd_ShowVocab)); DCmd_Register("dump_vocab", WRAP_METHOD(Debugger, Cmd_DumpVocab)); + DCmd_Register("show_message", WRAP_METHOD(Debugger, Cmd_ShowMessage)); DCmd_Register("show_item", WRAP_METHOD(Debugger, Cmd_ShowItem)); DCmd_Register("dump_items", WRAP_METHOD(Debugger, Cmd_DumpItems)); DCmd_Register("item", WRAP_METHOD(Debugger, Cmd_Item)); @@ -244,6 +245,21 @@ bool Debugger::Cmd_DumpVocab(int argc, const char **argv) { return true; } +bool Debugger::Cmd_ShowMessage(int argc, const char **argv) { + if (argc != 2) { + DebugPrintf("Usage: %s <message number>\n", argv[0]); + } else { + int messageId = strToInt(argv[1]); + Common::StringArray msg = _vm->_game->getMessage(messageId); + for (uint idx = 0; idx < msg.size(); ++idx) { + Common::String srcLine = msg[idx]; + DebugPrintf("%s\n", srcLine.c_str()); + } + } + + return true; +} + bool Debugger::Cmd_ShowItem(int argc, const char **argv) { InventoryObjects &objects = _vm->_game->_objects; diff --git a/engines/mads/debugger.h b/engines/mads/debugger.h index 9059f3fc39..351eb13615 100644 --- a/engines/mads/debugger.h +++ b/engines/mads/debugger.h @@ -45,6 +45,7 @@ protected: bool Cmd_ShowQuote(int argc, const char **argv); bool Cmd_ShowVocab(int argc, const char **argv); bool Cmd_DumpVocab(int argc, const char **argv); + bool Cmd_ShowMessage(int argc, const char **argv); bool Cmd_ShowItem(int argc, const char **argv); bool Cmd_DumpItems(int argc, const char **argv); bool Cmd_Item(int argc, const char **argv); |