diff options
| -rw-r--r-- | engines/mohawk/livingbooks.cpp | 40 | ||||
| -rw-r--r-- | engines/mohawk/livingbooks.h | 9 | 
2 files changed, 49 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 diff --git a/engines/mohawk/livingbooks.h b/engines/mohawk/livingbooks.h index 186502d532..6c22187cf3 100644 --- a/engines/mohawk/livingbooks.h +++ b/engines/mohawk/livingbooks.h @@ -88,6 +88,7 @@ enum {  	kLBPaletteAItem = 0x44, // unused?  	kLBPaletteItem = 0x45,  	kLBProxyItem = 0x46, +	kLBMiniGameItem = 666, // EVIL!!!!  	kLBXDataFileItem = 0x3e9,  	kLBDiscDectectorItem = 0xfa1  }; @@ -537,6 +538,14 @@ public:  	bool togglePlaying(bool playing, bool restart);  }; +class LBMiniGameItem : public LBItem { +public: +	LBMiniGameItem(MohawkEngine_LivingBooks *_vm, Common::Rect rect); +	~LBMiniGameItem(); + +	bool togglePlaying(bool playing, bool restart); +}; +  struct NotifyEvent {  	NotifyEvent(uint t, uint p) : type(t), param(p) { }  	uint type;  | 
