diff options
author | Strangerke | 2015-01-25 22:05:10 +0100 |
---|---|---|
committer | Strangerke | 2015-01-25 22:05:10 +0100 |
commit | ca0bef9595f60d6478b0da89cdd330254ee8a2ef (patch) | |
tree | 07b3c7e3bccfedb7141e567f20f6fc838ec414f4 /engines | |
parent | b6b5a520d4f899c5317140dbaf8d5d7b8381908b (diff) | |
download | scummvm-rg350-ca0bef9595f60d6478b0da89cdd330254ee8a2ef.tar.gz scummvm-rg350-ca0bef9595f60d6478b0da89cdd330254ee8a2ef.tar.bz2 scummvm-rg350-ca0bef9595f60d6478b0da89cdd330254ee8a2ef.zip |
ACCESS: MM - Split cmdHelp for MM
Diffstat (limited to 'engines')
-rw-r--r-- | engines/access/amazon/amazon_scripts.cpp | 4 | ||||
-rw-r--r-- | engines/access/amazon/amazon_scripts.h | 2 | ||||
-rw-r--r-- | engines/access/scripts.cpp | 41 | ||||
-rw-r--r-- | engines/access/scripts.h | 3 |
4 files changed, 41 insertions, 9 deletions
diff --git a/engines/access/amazon/amazon_scripts.cpp b/engines/access/amazon/amazon_scripts.cpp index d7ca408eca..19777541e4 100644 --- a/engines/access/amazon/amazon_scripts.cpp +++ b/engines/access/amazon/amazon_scripts.cpp @@ -381,7 +381,7 @@ typedef void(AmazonScripts::*AmazonScriptMethodPtr)(); void AmazonScripts::executeCommand(int commandIndex) { static const AmazonScriptMethodPtr COMMAND_LIST[] = { - &AmazonScripts::cmdHelp, &AmazonScripts::cmdCycleBack, + &AmazonScripts::cmdHelp_v2, &AmazonScripts::cmdCycleBack, &AmazonScripts::cmdChapter, &AmazonScripts::cmdSetHelp, &AmazonScripts::cmdCenterPanel, &AmazonScripts::cmdMainPanel, &AmazonScripts::CMDRETFLASH @@ -393,7 +393,7 @@ void AmazonScripts::executeCommand(int commandIndex) { Scripts::executeCommand(commandIndex); } -void AmazonScripts::cmdHelp() { +void AmazonScripts::cmdHelp_v2() { Common::String helpMessage = readString(); if (_game->_helpLevel == 0) { diff --git a/engines/access/amazon/amazon_scripts.h b/engines/access/amazon/amazon_scripts.h index e10eefb4f5..6d992667f5 100644 --- a/engines/access/amazon/amazon_scripts.h +++ b/engines/access/amazon/amazon_scripts.h @@ -49,7 +49,7 @@ protected: void setInactive(); void boatWalls(int param1, int param2); - void cmdHelp(); + void cmdHelp_v2(); void cmdCycleBack(); void cmdChapter(); void cmdSetHelp(); diff --git a/engines/access/scripts.cpp b/engines/access/scripts.cpp index ecf3cf7422..d15f293163 100644 --- a/engines/access/scripts.cpp +++ b/engines/access/scripts.cpp @@ -118,6 +118,7 @@ void Scripts::setOpcodes() { COMMAND_LIST[70] = &Scripts::cmdDead; COMMAND_LIST[71] = &Scripts::cmdFadeOut; COMMAND_LIST[72] = &Scripts::cmdEndVideo; + COMMAND_LIST[73] = &Scripts::cmdHelp_v1; } void Scripts::setOpcodes_v2() { @@ -318,11 +319,13 @@ void Scripts::cmdPrint_v1() { } void Scripts::printString(const Common::String &msg) { - _vm->_screen->_printOrg = Common::Point(20, 42); - _vm->_screen->_printStart = Common::Point(20, 42); - _vm->_timers[PRINT_TIMER]._timer = 50; - _vm->_timers[PRINT_TIMER]._initTm = 50; - ++_vm->_timers[PRINT_TIMER]._flag; + if (_vm->getGameID() != GType_MartianMemorandum) { + _vm->_screen->_printOrg = Common::Point(20, 42); + _vm->_screen->_printStart = Common::Point(20, 42); + _vm->_timers[PRINT_TIMER]._timer = 50; + _vm->_timers[PRINT_TIMER]._initTm = 50; + ++_vm->_timers[PRINT_TIMER]._flag; + } // Display the text in a bubble, and wait for a keypress or mouse click _vm->_bubbleBox->placeBubble(msg); @@ -706,6 +709,34 @@ void Scripts::cmdDoTravel() { } } +void Scripts::cmdHelp_v1() { + int idx = 0; + for (int i = 0; i < 40; i++) { + byte c = _data->readByte(); + if (c != 0xFF) { + Common::String tmpStr = c + readString(); + if (Martian::HELP[i]) { + _vm->_helpBox->_tempList[idx] = tmpStr; + _vm->_helpBox->_tempListIdx[idx] = i; + ++idx; + } + } else + break; + } + _vm->_helpBox->_tempList[idx] = ""; + + int btnSelected = 0; + int boxX = _vm->_helpBox->doBox_v1(0, 0, btnSelected); + + if (boxX == -1) + btnSelected = 2; + + if (btnSelected != 2) + _vm->_useItem = _vm->_helpBox->_tempListIdx[boxX]; + else + _vm->_useItem = -1; +} + void Scripts::cmdCheckAbout() { int idx = _data->readSint16LE(); int val = _data->readSint16LE(); diff --git a/engines/access/scripts.h b/engines/access/scripts.h index b1a4120fc3..a035087d48 100644 --- a/engines/access/scripts.h +++ b/engines/access/scripts.h @@ -135,7 +135,8 @@ protected: void cmdDead(); void cmdFadeOut(); void cmdEndVideo(); - void cmdHelp(); + void cmdHelp_v1(); + void cmdHelp_v2(); void cmdCycleBack(); void cmdSetHelp(); public: |