MOHAWK: Add a return to menu button to the dialog for the demo
This commit is contained in:
parent
ef1f5d48fa
commit
72a9f06f93
4 changed files with 25 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue