ACCESS: MM - Split cmdHelp for MM

This commit is contained in:
Strangerke 2015-01-25 22:05:10 +01:00
parent b6b5a520d4
commit ca0bef9595
4 changed files with 41 additions and 9 deletions

View File

@ -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) {

View File

@ -49,7 +49,7 @@ protected:
void setInactive();
void boatWalls(int param1, int param2);
void cmdHelp();
void cmdHelp_v2();
void cmdCycleBack();
void cmdChapter();
void cmdSetHelp();

View File

@ -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();

View File

@ -135,7 +135,8 @@ protected:
void cmdDead();
void cmdFadeOut();
void cmdEndVideo();
void cmdHelp();
void cmdHelp_v1();
void cmdHelp_v2();
void cmdCycleBack();
void cmdSetHelp();
public: