aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk/livingbooks.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/mohawk/livingbooks.cpp')
-rw-r--r--engines/mohawk/livingbooks.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/engines/mohawk/livingbooks.cpp b/engines/mohawk/livingbooks.cpp
index 482aade99d..b25a1a7d8f 100644
--- a/engines/mohawk/livingbooks.cpp
+++ b/engines/mohawk/livingbooks.cpp
@@ -36,6 +36,8 @@
#include "engines/util.h"
+#include "gui/message.h"
+
namespace Mohawk {
// read a null-terminated string from a stream
@@ -595,6 +597,9 @@ void MohawkEngine_LivingBooks::loadBITL(uint16 resourceId) {
case kLBMovieItem:
res = new LBMovieItem(this, rect);
break;
+ case kLBMiniGameItem:
+ res = new LBMiniGameItem(this, rect);
+ break;
default:
warning("Unknown item type %04x", type);
case 3: // often used for buttons
@@ -3470,4 +3475,39 @@ bool LBMovieItem::togglePlaying(bool playing, bool restart) {
return LBItem::togglePlaying(playing, restart);
}
+LBMiniGameItem::LBMiniGameItem(MohawkEngine_LivingBooks *vm, Common::Rect rect) : LBItem(vm, rect) {
+ debug(3, "new LBMiniGameItem");
+}
+
+LBMiniGameItem::~LBMiniGameItem() {
+}
+
+bool LBMiniGameItem::togglePlaying(bool playing, bool restart) {
+ // HACK: Since we don't support any of these hardcoded mini games yet,
+ // just skip to the most logical page. For optional minigames, this
+ // will return the player to the previous page. For mandatory minigames,
+ // this will send the player to the next page.
+ // TODO: Document mini games from Arthur's Reading Race
+
+ uint16 destPage;
+
+ // Figure out what minigame we have and bring us back to a page where
+ // the player can continue
+ if (_desc == "Kitch") // Green Eggs and Ham: Kitchen minigame
+ destPage = 4;
+ else if (_desc == "Eggs") // Green Eggs and Ham: Eggs minigame
+ destPage = 5;
+ else if (_desc == "Fall") // Green Eggs and Ham: Fall minigame
+ destPage = 13;
+ else
+ error("Unknown minigame '%s'", _desc.c_str());
+
+ GUI::MessageDialog dialog(Common::String::format("The '%s' minigame is not supported yet.", _desc.c_str()));
+ dialog.runModal();
+
+ _vm->addNotifyEvent(NotifyEvent(kLBNotifyChangePage, destPage));
+
+ return false;
+}
+
} // End of namespace Mohawk