mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-22 04:01:23 +00:00
ACCESS: MM - Split cmdHelp for MM
This commit is contained in:
parent
b6b5a520d4
commit
ca0bef9595
@ -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) {
|
||||
|
@ -49,7 +49,7 @@ protected:
|
||||
void setInactive();
|
||||
void boatWalls(int param1, int param2);
|
||||
|
||||
void cmdHelp();
|
||||
void cmdHelp_v2();
|
||||
void cmdCycleBack();
|
||||
void cmdChapter();
|
||||
void cmdSetHelp();
|
||||
|
@ -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();
|
||||
|
@ -135,7 +135,8 @@ protected:
|
||||
void cmdDead();
|
||||
void cmdFadeOut();
|
||||
void cmdEndVideo();
|
||||
void cmdHelp();
|
||||
void cmdHelp_v1();
|
||||
void cmdHelp_v2();
|
||||
void cmdCycleBack();
|
||||
void cmdSetHelp();
|
||||
public:
|
||||
|
Loading…
x
Reference in New Issue
Block a user