aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/access/amazon/amazon_game.cpp4
-rw-r--r--engines/access/amazon/amazon_game.h2
-rw-r--r--engines/access/amazon/amazon_resources.cpp4
-rw-r--r--engines/access/amazon/amazon_resources.h1
-rw-r--r--engines/access/amazon/amazon_scripts.cpp47
5 files changed, 53 insertions, 5 deletions
diff --git a/engines/access/amazon/amazon_game.cpp b/engines/access/amazon/amazon_game.cpp
index cdc7727244..f4cf83e150 100644
--- a/engines/access/amazon/amazon_game.cpp
+++ b/engines/access/amazon/amazon_game.cpp
@@ -726,7 +726,7 @@ void AmazonEngine::drawHelpText(const Common::String &msg) {
_events->showCursor();
}
-void AmazonEngine::drawHelp() {
+void AmazonEngine::drawHelp(const Common::String str) {
_events->hideCursor();
if (_useItem == 0) {
_buffer2.copyBuffer(_screen);
@@ -760,7 +760,7 @@ void AmazonEngine::drawHelp() {
_screen->fadeIn();
helpTitle();
- drawHelpText("TODO: WHICH BUFFER?");
+ drawHelpText(str);
}
void AmazonEngine::startChapter(int chapter) {
diff --git a/engines/access/amazon/amazon_game.h b/engines/access/amazon/amazon_game.h
index d67f0c2150..435e1722b2 100644
--- a/engines/access/amazon/amazon_game.h
+++ b/engines/access/amazon/amazon_game.h
@@ -197,7 +197,7 @@ public:
*/
void freeInactivePlayer();
- void drawHelp();
+ void drawHelp(const Common::String str);
virtual void establish(int esatabIndex, int sub);
diff --git a/engines/access/amazon/amazon_resources.cpp b/engines/access/amazon/amazon_resources.cpp
index 6148eeb8f1..05e234aefc 100644
--- a/engines/access/amazon/amazon_resources.cpp
+++ b/engines/access/amazon/amazon_resources.cpp
@@ -1772,6 +1772,10 @@ RiverStruct *RIVEROBJECTTBL[6] = {
ENDRIVER1, RIVER2OBJECTS, ENDRIVER2
};
+const int HELP1COORDS[2][4] = {
+ { 76, 129, 168, 183 }, { 187, 240, 168, 183 }
+};
+
} // End of namespace Amazon
} // End of namespace Access
diff --git a/engines/access/amazon/amazon_resources.h b/engines/access/amazon/amazon_resources.h
index cd1fc95f82..6d94e6a359 100644
--- a/engines/access/amazon/amazon_resources.h
+++ b/engines/access/amazon/amazon_resources.h
@@ -126,6 +126,7 @@ extern RiverStruct RIVER2OBJECTS[53];
extern RiverStruct ENDRIVER2[1];
extern RiverStruct *RIVEROBJECTTBL[6];
+extern const int HELP1COORDS[2][4];
} // End of namespace Amazon
diff --git a/engines/access/amazon/amazon_scripts.cpp b/engines/access/amazon/amazon_scripts.cpp
index ea7df7bcbd..cde1ff8324 100644
--- a/engines/access/amazon/amazon_scripts.cpp
+++ b/engines/access/amazon/amazon_scripts.cpp
@@ -1887,8 +1887,51 @@ void AmazonScripts::cmdHelp() {
if (level < _game->_helpLevel)
_game->_moreHelp = 0;
- _game->drawHelp();
- error("TODO: more cmdHelp");
+ _game->drawHelp(helpMessage);
+
+ 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() {