From 6a9969ed25e485e393cd76fe486d3778b541d0c4 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sun, 18 Aug 2019 15:29:14 +0300 Subject: STARTREK: Fix loading of some texts, and add the "text" console command --- engines/startrek/console.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'engines/startrek/console.cpp') diff --git a/engines/startrek/console.cpp b/engines/startrek/console.cpp index 471294fe9c..d3f012d4d1 100644 --- a/engines/startrek/console.cpp +++ b/engines/startrek/console.cpp @@ -30,6 +30,7 @@ namespace StarTrek { Console::Console(StarTrekEngine *vm) : GUI::Debugger(), _vm(vm) { registerCmd("room", WRAP_METHOD(Console, Cmd_Room)); registerCmd("actions", WRAP_METHOD(Console, Cmd_Actions)); + registerCmd("text", WRAP_METHOD(Console, Cmd_Text)); } Console::~Console() { @@ -84,6 +85,30 @@ bool Console::Cmd_Actions(int argc, const char **argv) { return true; } +bool Console::Cmd_Text(int argc, const char **argv) { + typedef Common::HashMap::iterator MessageIterator; + + debugPrintf("\nLook messages\n"); + debugPrintf("-------------\n"); + for (MessageIterator i = _vm->_room->_lookMessages.begin(); i != _vm->_room->_lookMessages.end(); ++i) { + debugPrintf("%i: %s\n", i->_key, i->_value.c_str()); + } + + debugPrintf("\nLook with talker messages\n"); + debugPrintf("-------------------------\n"); + for (MessageIterator i = _vm->_room->_lookWithTalkerMessages.begin(); i != _vm->_room->_lookWithTalkerMessages.end(); ++i) { + debugPrintf("%i: %s\n", i->_key, i->_value.c_str()); + } + + debugPrintf("\nTalk messages\n"); + debugPrintf("-------------\n"); + for (MessageIterator i = _vm->_room->_talkMessages.begin(); i != _vm->_room->_talkMessages.end(); ++i) { + debugPrintf("%i: %s\n", i->_key, i->_value.c_str()); + } + + return true; +} + Common::String Console::EventToString(uint32 action) { const char *actions[] = { "Tick", -- cgit v1.2.3