diff options
| author | Filippos Karapetis | 2014-05-20 14:31:10 +0300 | 
|---|---|---|
| committer | Filippos Karapetis | 2014-05-20 14:31:10 +0300 | 
| commit | eb7d018b4acc4c0d0614ed185b632c618636d727 (patch) | |
| tree | 781d5a5ea3419af3d35c2e87d7fd6603dc43ae8e /engines/mads/debugger.cpp | |
| parent | 1b34888b26d460cd7f36b6a5b280f931f97e6464 (diff) | |
| download | scummvm-rg350-eb7d018b4acc4c0d0614ed185b632c618636d727.tar.gz scummvm-rg350-eb7d018b4acc4c0d0614ed185b632c618636d727.tar.bz2 scummvm-rg350-eb7d018b4acc4c0d0614ed185b632c618636d727.zip | |
MADS: Add a debug command to show messages
Diffstat (limited to 'engines/mads/debugger.cpp')
| -rw-r--r-- | engines/mads/debugger.cpp | 16 | 
1 files changed, 16 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; | 
