aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk/dialogs.cpp
diff options
context:
space:
mode:
authorBastien Bouclet2017-12-20 17:51:57 +0100
committerBastien Bouclet2017-12-20 19:16:07 +0100
commita33548c0d2085f6f5ea0e66be2d4f22ef1192047 (patch)
tree5e0f28a58cecd80fce7fe6d7ea0c309ca9e05844 /engines/mohawk/dialogs.cpp
parentf4bc714677fd778015053fac532c4dc2a9dfccd7 (diff)
downloadscummvm-rg350-a33548c0d2085f6f5ea0e66be2d4f22ef1192047.tar.gz
scummvm-rg350-a33548c0d2085f6f5ea0e66be2d4f22ef1192047.tar.bz2
scummvm-rg350-a33548c0d2085f6f5ea0e66be2d4f22ef1192047.zip
MOHAWK: RIVEN: Add keyboard shortcuts for loading and saving
Those shortcuts are documented in the original game manual.
Diffstat (limited to 'engines/mohawk/dialogs.cpp')
-rw-r--r--engines/mohawk/dialogs.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/engines/mohawk/dialogs.cpp b/engines/mohawk/dialogs.cpp
index df832c9a2c..029867f6a6 100644
--- a/engines/mohawk/dialogs.cpp
+++ b/engines/mohawk/dialogs.cpp
@@ -94,13 +94,13 @@ enum {
MohawkOptionsDialog::MohawkOptionsDialog(MohawkEngine *vm) :
GUI::Dialog(0, 0, 360, 200),
- _vm(vm), _loadSlot(-1) {
- _loadButton = new GUI::ButtonWidget(this, 245, 25, 100, 25, _("~L~oad"), 0, kLoadCmd);
- _saveButton = new GUI::ButtonWidget(this, 245, 60, 100, 25, _("~S~ave"), 0, kSaveCmd);
- new GUI::ButtonWidget(this, 245, 95, 100, 25, _("~Q~uit"), 0, kQuitCmd);
+ _vm(vm), _loadSlot(-1), _saveSlot(-1) {
+ _loadButton = new GUI::ButtonWidget(this, 245, 25, 100, 25, _("~L~oad"), nullptr, kLoadCmd);
+ _saveButton = new GUI::ButtonWidget(this, 245, 60, 100, 25, _("~S~ave"), nullptr, kSaveCmd);
+ new GUI::ButtonWidget(this, 245, 95, 100, 25, _("~Q~uit"), nullptr, kQuitCmd);
- 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);
+ new GUI::ButtonWidget(this, 95, 160, 120, 25, _("~O~K"), nullptr, GUI::kOKCmd);
+ new GUI::ButtonWidget(this, 225, 160, 120, 25, _("~C~ancel"), nullptr, GUI::kCloseCmd);
_loadDialog = new GUI::SaveLoadChooser(_("Load game:"), _("Load"), false);
_saveDialog = new GUI::SaveLoadChooser(_("Save game:"), _("Save"), true);
@@ -115,22 +115,22 @@ void MohawkOptionsDialog::open() {
GUI::Dialog::open();
_loadSlot = -1;
+ _saveSlot = -1;
_loadButton->setEnabled(_vm->canLoadGameStateCurrently());
_saveButton->setEnabled(_vm->canSaveGameStateCurrently());
}
void MohawkOptionsDialog::save() {
- int slot = _saveDialog->runModalWithCurrentTarget();
+ _saveSlot = _saveDialog->runModalWithCurrentTarget();
- if (slot >= 0) {
- Common::String result(_saveDialog->getResultString());
- if (result.empty()) {
+ if (_saveSlot >= 0) {
+ _saveDescription = _saveDialog->getResultString();
+ if (_saveDescription.empty()) {
// If the user was lazy and entered no save name, come up with a default name.
- result = _saveDialog->createDefaultSaveDescription(slot);
+ _saveDescription = _saveDialog->createDefaultSaveDescription(_saveSlot);
}
- _vm->saveGameState(slot, result);
close();
}
}