diff options
Diffstat (limited to 'engines/mohawk')
-rw-r--r-- | engines/mohawk/dialogs.cpp | 18 | ||||
-rw-r--r-- | engines/mohawk/dialogs.h | 1 | ||||
-rw-r--r-- | engines/mohawk/myst.cpp | 6 | ||||
-rw-r--r-- | engines/mohawk/myst.h | 1 |
4 files changed, 25 insertions, 1 deletions
diff --git a/engines/mohawk/dialogs.cpp b/engines/mohawk/dialogs.cpp index 11e050aa72..2d1cc3bfa3 100644 --- a/engines/mohawk/dialogs.cpp +++ b/engines/mohawk/dialogs.cpp @@ -81,7 +81,8 @@ enum { kTransCmd = 'TRAN', kWaterCmd = 'WATR', kDropCmd = 'DROP', - kMapCmd = 'SMAP' + kMapCmd = 'SMAP', + kMenuCmd = 'MENU' }; #ifdef ENABLE_MYST @@ -97,6 +98,12 @@ MystOptionsDialog::MystOptionsDialog(MohawkEngine_Myst* vm) : GUI::OptionsDialog else _showMapButton = 0; + // Myst demo only has a menu + if (_vm->getFeatures() & GF_DEMO) + _returnToMenuButton = new GUI::ButtonWidget(this, 15, 95, 100, 25, _("~M~ain Menu"), 0, kMenuCmd); + else + _returnToMenuButton = 0; + new GUI::ButtonWidget(this, 95, 160, 120, 25, _("~O~K"), 0, GUI::kOKCmd); new GUI::ButtonWidget(this, 225, 160, 120, 25, _("~C~ancel"), 0, GUI::kCloseCmd); } @@ -113,6 +120,11 @@ void MystOptionsDialog::open() { _showMapButton->setEnabled(_vm->_scriptParser && _vm->_scriptParser->getMap()); + // Return to menu button is not enabled on the menu + if (_returnToMenuButton) + _returnToMenuButton->setEnabled(_vm->_scriptParser && + _vm->getCurStack() != kDemoStack); + // Zip mode is disabled in the demo if (_vm->getFeatures() & GF_DEMO) _zipModeCheckbox->setEnabled(false); @@ -137,6 +149,10 @@ void MystOptionsDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, ui _vm->_needsShowMap = true; close(); break; + case kMenuCmd: + _vm->_needsShowDemoMenu = true; + close(); + break; case GUI::kCloseCmd: close(); break; diff --git a/engines/mohawk/dialogs.h b/engines/mohawk/dialogs.h index 853ff30813..844c01ad26 100644 --- a/engines/mohawk/dialogs.h +++ b/engines/mohawk/dialogs.h @@ -83,6 +83,7 @@ private: GUI::CheckboxWidget *_transitionsCheckbox; GUI::ButtonWidget *_dropPageButton; GUI::ButtonWidget *_showMapButton; + GUI::ButtonWidget *_returnToMenuButton; }; #endif diff --git a/engines/mohawk/myst.cpp b/engines/mohawk/myst.cpp index 342fa4e78c..eeb4594f3c 100644 --- a/engines/mohawk/myst.cpp +++ b/engines/mohawk/myst.cpp @@ -343,6 +343,7 @@ Common::Error MohawkEngine_Myst::run() { case Common::KEYCODE_F5: _needsPageDrop = false; _needsShowMap = false; + _needsShowDemoMenu = false; runDialog(*_optionsDialog); @@ -355,6 +356,11 @@ Common::Error MohawkEngine_Myst::run() { _scriptParser->showMap(); _needsShowMap = false; } + + if (_needsShowDemoMenu) { + changeToStack(kDemoStack, 2002, 0, 0); + _needsShowDemoMenu = false; + } break; default: break; diff --git a/engines/mohawk/myst.h b/engines/mohawk/myst.h index ebcc3b445c..02f0a46e3f 100644 --- a/engines/mohawk/myst.h +++ b/engines/mohawk/myst.h @@ -167,6 +167,7 @@ public: bool _needsUpdate; bool _needsPageDrop; bool _needsShowMap; + bool _needsShowDemoMenu; MystView _view; MystGraphics *_gfx; |