diff options
Diffstat (limited to 'engines/mohawk/dialogs.cpp')
-rw-r--r-- | engines/mohawk/dialogs.cpp | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/engines/mohawk/dialogs.cpp b/engines/mohawk/dialogs.cpp index 029867f6a6..5700a4641b 100644 --- a/engines/mohawk/dialogs.cpp +++ b/engines/mohawk/dialogs.cpp @@ -180,22 +180,22 @@ void MohawkOptionsDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, MystOptionsDialog::MystOptionsDialog(MohawkEngine_Myst* vm) : MohawkOptionsDialog(vm), _vm(vm) { // I18N: Option for fast scene switching - _zipModeCheckbox = new GUI::CheckboxWidget(this, 15, 10, 220, 15, _("~Z~ip Mode Activated"), 0, kZipCmd); - _transitionsCheckbox = new GUI::CheckboxWidget(this, 15, 30, 220, 15, _("~T~ransitions Enabled"), 0, kTransCmd); + _zipModeCheckbox = new GUI::CheckboxWidget(this, 15, 10, 220, 15, _("~Z~ip Mode Activated"), nullptr, kZipCmd); + _transitionsCheckbox = new GUI::CheckboxWidget(this, 15, 30, 220, 15, _("~T~ransitions Enabled"), nullptr, kTransCmd); // I18N: Drop book page - _dropPageButton = new GUI::ButtonWidget(this, 15, 60, 100, 25, _("~D~rop Page"), 0, kDropCmd); + _dropPageButton = new GUI::ButtonWidget(this, 15, 60, 100, 25, _("~D~rop Page"), nullptr, kDropCmd); // Myst ME only has maps if (_vm->getFeatures() & GF_ME) - _showMapButton = new GUI::ButtonWidget(this, 15, 95, 100, 25, _("Show ~M~ap"), 0, kMapCmd); + _showMapButton = new GUI::ButtonWidget(this, 15, 95, 100, 25, _("Show ~M~ap"), nullptr, kMapCmd); else - _showMapButton = 0; + _showMapButton = nullptr; // Myst demo only has a menu if (_vm->getFeatures() & GF_DEMO) - _returnToMenuButton = new GUI::ButtonWidget(this, 15, 95, 100, 25, _("Main Men~u~"), 0, kMenuCmd); + _returnToMenuButton = new GUI::ButtonWidget(this, 15, 95, 100, 25, _("Main Men~u~"), nullptr, kMenuCmd); else - _returnToMenuButton = 0; + _returnToMenuButton = nullptr; } MystOptionsDialog::~MystOptionsDialog() { @@ -204,16 +204,19 @@ MystOptionsDialog::~MystOptionsDialog() { void MystOptionsDialog::open() { MohawkOptionsDialog::open(); - _dropPageButton->setEnabled(_vm->_gameState->_globals.heldPage != 0); + bool canDropPage = _vm->isInteractive() && _vm->_gameState->_globals.heldPage != kNoPage; + _dropPageButton->setEnabled(canDropPage); - if (_showMapButton) - _showMapButton->setEnabled(_vm->_scriptParser && - _vm->_scriptParser->getMap()); + if (_showMapButton) { + bool canShowMap = _vm->isInteractive() && _vm->_scriptParser->getMap(); + _showMapButton->setEnabled(canShowMap); + } - // Return to menu button is not enabled on the menu - if (_returnToMenuButton) - _returnToMenuButton->setEnabled(_vm->_scriptParser && - _vm->getCurStack() != kDemoStack); + if (_returnToMenuButton) { + // Return to menu button is not enabled on the menu + bool canReturnToMenu = _vm->isInteractive() && _vm->getCurStack() != kDemoStack; + _returnToMenuButton->setEnabled(canReturnToMenu); + } // Zip mode is disabled in the demo if (_vm->getFeatures() & GF_DEMO) @@ -266,8 +269,8 @@ void MystOptionsDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, ui RivenOptionsDialog::RivenOptionsDialog(MohawkEngine_Riven* vm) : MohawkOptionsDialog(vm), _vm(vm) { - _zipModeCheckbox = new GUI::CheckboxWidget(this, 15, 10, 220, 15, _("~Z~ip Mode Activated"), 0, kZipCmd); - _waterEffectCheckbox = new GUI::CheckboxWidget(this, 15, 30, 220, 15, _("~W~ater Effect Enabled"), 0, kWaterCmd); + _zipModeCheckbox = new GUI::CheckboxWidget(this, 15, 10, 220, 15, _("~Z~ip Mode Activated"), nullptr, kZipCmd); + _waterEffectCheckbox = new GUI::CheckboxWidget(this, 15, 30, 220, 15, _("~W~ater Effect Enabled"), nullptr, kWaterCmd); _transitionModeCaption = new GUI::StaticTextWidget(this, 15, 50, 90, 20, _("Transitions:"), Graphics::kTextAlignRight); _transitionModePopUp = new GUI::PopUpWidget(this, 115, 50, 120, 20); |