diff options
author | Paul Gilbert | 2015-09-06 22:18:47 -0400 |
---|---|---|
committer | Paul Gilbert | 2015-09-06 22:18:47 -0400 |
commit | 1f5afe5c845829464230e73ec392b52bb64fc84f (patch) | |
tree | f5702cb95ae75864bbd6558bf92e07b0968eb618 /engines/sherlock/scalpel | |
parent | 8b3dd18aca839c87790c4fabec33178bc6d1bf16 (diff) | |
download | scummvm-rg350-1f5afe5c845829464230e73ec392b52bb64fc84f.tar.gz scummvm-rg350-1f5afe5c845829464230e73ec392b52bb64fc84f.tar.bz2 scummvm-rg350-1f5afe5c845829464230e73ec392b52bb64fc84f.zip |
SHERLOCK: 3DO: Hook up Save/Load buttons to ScummVM's dialogs
Diffstat (limited to 'engines/sherlock/scalpel')
-rw-r--r-- | engines/sherlock/scalpel/scalpel.cpp | 23 | ||||
-rw-r--r-- | engines/sherlock/scalpel/scalpel.h | 10 | ||||
-rw-r--r-- | engines/sherlock/scalpel/scalpel_user_interface.cpp | 41 |
3 files changed, 59 insertions, 15 deletions
diff --git a/engines/sherlock/scalpel/scalpel.cpp b/engines/sherlock/scalpel/scalpel.cpp index e698ac6ae2..73ee33b9e1 100644 --- a/engines/sherlock/scalpel/scalpel.cpp +++ b/engines/sherlock/scalpel/scalpel.cpp @@ -21,6 +21,8 @@ */ #include "engines/util.h" +#include "gui/saveload.h" +#include "common/translation.h" #include "sherlock/scalpel/scalpel.h" #include "sherlock/scalpel/scalpel_fixed_text.h" #include "sherlock/scalpel/scalpel_map.h" @@ -1218,6 +1220,27 @@ void ScalpelEngine::flushBrumwellMirror() { _screen->slamArea(137, 18, 47, 56); } + +void ScalpelEngine::showScummVMSaveDialog() { + GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser(_("Save game:"), _("Save"), true); + + int slot = dialog->runModalWithCurrentTarget(); + if (slot >= 0) { + Common::String desc = dialog->getResultString(); + + saveGameState(slot, desc); + } +} + +void ScalpelEngine::showScummVMRestoreDialog() { + GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser(_("Restore game:"), _("Restore"), false); + + int slot = dialog->runModalWithCurrentTarget(); + if (slot >= 0) { + loadGameState(slot); + } +} + } // End of namespace Scalpel } // End of namespace Sherlock diff --git a/engines/sherlock/scalpel/scalpel.h b/engines/sherlock/scalpel/scalpel.h index 6ae8563e61..5c46b16973 100644 --- a/engines/sherlock/scalpel/scalpel.h +++ b/engines/sherlock/scalpel/scalpel.h @@ -128,6 +128,16 @@ public: * This clears the mirror in scene 12 (mansion drawing room) in case anything messed draw over it */ void flushBrumwellMirror(); + + /** + * Show the ScummVM restore savegame dialog + */ + void showScummVMSaveDialog(); + + /** + * Show the ScummVM restore savegame dialog + */ + void showScummVMRestoreDialog(); }; } // End of namespace Scalpel diff --git a/engines/sherlock/scalpel/scalpel_user_interface.cpp b/engines/sherlock/scalpel/scalpel_user_interface.cpp index f384af0324..aed7df8440 100644 --- a/engines/sherlock/scalpel/scalpel_user_interface.cpp +++ b/engines/sherlock/scalpel/scalpel_user_interface.cpp @@ -1273,6 +1273,7 @@ void ScalpelUserInterface::doLookControl() { } void ScalpelUserInterface::doMainControl() { + ScalpelEngine &vm = *(ScalpelEngine *)_vm; Events &events = *_vm->_events; ScalpelInventory &inv = *(ScalpelInventory *)_vm->_inventory; ScalpelSaveManager &saves = *(ScalpelSaveManager *)_vm->_saves; @@ -1382,24 +1383,34 @@ void ScalpelUserInterface::doMainControl() { journalControl(); break; case 'F': - pushButton(10); + if (IS_3DO) { + if (_temp == 10) { + pushButton(10); + vm.showScummVMRestoreDialog(); + } else if (_temp == 11) { + pushButton(11); + vm.showScummVMSaveDialog(); + } + } else { + pushButton(10); - // Create a thumbnail of the current screen before the files dialog is shown, in case - // the user saves the game - saves.createThumbnail(); + // Create a thumbnail of the current screen before the files dialog is shown, in case + // the user saves the game + saves.createThumbnail(); - _selector = _oldSelector = -1; + _selector = _oldSelector = -1; - if (_vm->_showOriginalSavesDialog) { - // Show the original dialog - _menuMode = FILES_MODE; - saves.drawInterface(); - _windowOpen = true; - } else { - // Show the ScummVM GMM instead - _vm->_canLoadSave = true; - _vm->openMainMenuDialog(); - _vm->_canLoadSave = false; + if (_vm->_showOriginalSavesDialog) { + // Show the original dialog + _menuMode = FILES_MODE; + saves.drawInterface(); + _windowOpen = true; + } else { + // Show the ScummVM GMM instead + _vm->_canLoadSave = true; + _vm->openMainMenuDialog(); + _vm->_canLoadSave = false; + } } break; case 'S': |