MOHAWK: Stub off LB mini games

greeneggs can now continue to completion in 'play' mode
This commit is contained in:
Matthew Hoops 2011-03-26 11:08:07 -04:00
parent 153e67b37c
commit 5af474ec7c
2 changed files with 49 additions and 0 deletions

View File

@ -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

View File

@ -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;