ACCESS: Finish the implementation of cmdHelp (still a redraw issue)
This commit is contained in:
parent
3f44538441
commit
2735101179
5 changed files with 53 additions and 5 deletions
|
@ -726,7 +726,7 @@ void AmazonEngine::drawHelpText(const Common::String &msg) {
|
||||||
_events->showCursor();
|
_events->showCursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AmazonEngine::drawHelp() {
|
void AmazonEngine::drawHelp(const Common::String str) {
|
||||||
_events->hideCursor();
|
_events->hideCursor();
|
||||||
if (_useItem == 0) {
|
if (_useItem == 0) {
|
||||||
_buffer2.copyBuffer(_screen);
|
_buffer2.copyBuffer(_screen);
|
||||||
|
@ -760,7 +760,7 @@ void AmazonEngine::drawHelp() {
|
||||||
_screen->fadeIn();
|
_screen->fadeIn();
|
||||||
|
|
||||||
helpTitle();
|
helpTitle();
|
||||||
drawHelpText("TODO: WHICH BUFFER?");
|
drawHelpText(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AmazonEngine::startChapter(int chapter) {
|
void AmazonEngine::startChapter(int chapter) {
|
||||||
|
|
|
@ -197,7 +197,7 @@ public:
|
||||||
*/
|
*/
|
||||||
void freeInactivePlayer();
|
void freeInactivePlayer();
|
||||||
|
|
||||||
void drawHelp();
|
void drawHelp(const Common::String str);
|
||||||
|
|
||||||
virtual void establish(int esatabIndex, int sub);
|
virtual void establish(int esatabIndex, int sub);
|
||||||
|
|
||||||
|
|
|
@ -1772,6 +1772,10 @@ RiverStruct *RIVEROBJECTTBL[6] = {
|
||||||
ENDRIVER1, RIVER2OBJECTS, ENDRIVER2
|
ENDRIVER1, RIVER2OBJECTS, ENDRIVER2
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const int HELP1COORDS[2][4] = {
|
||||||
|
{ 76, 129, 168, 183 }, { 187, 240, 168, 183 }
|
||||||
|
};
|
||||||
|
|
||||||
} // End of namespace Amazon
|
} // End of namespace Amazon
|
||||||
|
|
||||||
} // End of namespace Access
|
} // End of namespace Access
|
||||||
|
|
|
@ -126,6 +126,7 @@ extern RiverStruct RIVER2OBJECTS[53];
|
||||||
extern RiverStruct ENDRIVER2[1];
|
extern RiverStruct ENDRIVER2[1];
|
||||||
|
|
||||||
extern RiverStruct *RIVEROBJECTTBL[6];
|
extern RiverStruct *RIVEROBJECTTBL[6];
|
||||||
|
extern const int HELP1COORDS[2][4];
|
||||||
|
|
||||||
} // End of namespace Amazon
|
} // End of namespace Amazon
|
||||||
|
|
||||||
|
|
|
@ -1887,8 +1887,51 @@ void AmazonScripts::cmdHelp() {
|
||||||
if (level < _game->_helpLevel)
|
if (level < _game->_helpLevel)
|
||||||
_game->_moreHelp = 0;
|
_game->_moreHelp = 0;
|
||||||
|
|
||||||
_game->drawHelp();
|
_game->drawHelp(helpMessage);
|
||||||
error("TODO: more cmdHelp");
|
|
||||||
|
while(true) {
|
||||||
|
while(!_vm->shouldQuit() && !_vm->_events->_leftButton)
|
||||||
|
_vm->_events->pollEventsAndWait();
|
||||||
|
|
||||||
|
_vm->_events->debounceLeft();
|
||||||
|
|
||||||
|
static const Common::Rect butn1 = Common::Rect(HELP1COORDS[0][0], HELP1COORDS[0][2], HELP1COORDS[0][1], HELP1COORDS[0][3]);
|
||||||
|
static const Common::Rect butn2 = Common::Rect(HELP1COORDS[1][0], HELP1COORDS[1][2], HELP1COORDS[1][1], HELP1COORDS[1][3]);
|
||||||
|
const Common::Point pt = _vm->_events->_mousePos;
|
||||||
|
|
||||||
|
int choice = -1;
|
||||||
|
if (butn1.contains(pt))
|
||||||
|
choice = 0;
|
||||||
|
else if (butn2.contains(pt))
|
||||||
|
choice = 1;
|
||||||
|
|
||||||
|
if (choice < 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (choice == 1) {
|
||||||
|
_game->_helpLevel = 0;
|
||||||
|
_game->_moreHelp = 1;
|
||||||
|
_game->_useItem = 0;
|
||||||
|
_vm->_events->hideCursor();
|
||||||
|
_vm->_screen->restoreScreen();
|
||||||
|
_vm->_screen->setPanel(0);
|
||||||
|
_vm->_buffer2.copyFrom(*_vm->_screen);
|
||||||
|
_vm->_screen->restorePalette();
|
||||||
|
_vm->_screen->setPalette();
|
||||||
|
_vm->_events->showCursor();
|
||||||
|
free(_vm->_objectsTable[45]);
|
||||||
|
_vm->_objectsTable[45] = nullptr;
|
||||||
|
_vm->_timers.restoreTimers();
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
if ((_game->_moreHelp == 0) || (choice != 0))
|
||||||
|
continue;
|
||||||
|
++_game->_helpLevel;
|
||||||
|
_game->_useItem = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
findNull();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AmazonScripts::cmdCycleBack() {
|
void AmazonScripts::cmdCycleBack() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue