diff options
author | Strangerke | 2013-10-07 07:15:54 +0200 |
---|---|---|
committer | Strangerke | 2013-10-07 07:15:54 +0200 |
commit | 31b01f0d11307b82d3eeedbda9d70fe651313058 (patch) | |
tree | 2950c5ffcb2134e2e64c422d3d872528c7adcf5f /engines/avalanche | |
parent | 8430288fef4f831f51261b32e4ad1640006fad72 (diff) | |
download | scummvm-rg350-31b01f0d11307b82d3eeedbda9d70fe651313058.tar.gz scummvm-rg350-31b01f0d11307b82d3eeedbda9d70fe651313058.tar.bz2 scummvm-rg350-31b01f0d11307b82d3eeedbda9d70fe651313058.zip |
AVALANCHE: Add save/load code
Diffstat (limited to 'engines/avalanche')
-rw-r--r-- | engines/avalanche/parser.cpp | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp index e3383c7785..6bca4765ec 100644 --- a/engines/avalanche/parser.cpp +++ b/engines/avalanche/parser.cpp @@ -28,6 +28,8 @@ #include "avalanche/avalanche.h" #include "avalanche/parser.h" +#include "gui/saveload.h" + namespace Avalanche { const char *Parser::kCopyright = "1995"; @@ -1789,9 +1791,28 @@ void Parser::doThat() { swallow(); break; - case kVerbCodeLoad: + case kVerbCodeLoad: { + GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser("Restore game:", "Restore", false); + int16 savegameId = dialog->runModalWithCurrentTarget(); + delete dialog; + + if (savegameId < 0) // dialog aborted + return; + + _vm->loadGame(savegameId); + } break; - case kVerbCodeSave: + case kVerbCodeSave: { + GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser("Save game:", "Save", true); + int16 savegameId = dialog->runModalWithCurrentTarget(); + Common::String savegameDescription = dialog->getResultString(); + delete dialog; + + if (savegameId < 0) // dialog aborted + return; + + _vm->saveGame(savegameId, savegameDescription); + } break; // We don't handle these two because we use ScummVM's save/load system. |