diff options
Diffstat (limited to 'engines/zvision/scripting')
-rw-r--r-- | engines/zvision/scripting/controls/save_control.cpp | 2 | ||||
-rw-r--r-- | engines/zvision/scripting/script_manager.cpp | 23 |
2 files changed, 25 insertions, 0 deletions
diff --git a/engines/zvision/scripting/controls/save_control.cpp b/engines/zvision/scripting/controls/save_control.cpp index ad01257e6b..d773b5fc6f 100644 --- a/engines/zvision/scripting/controls/save_control.cpp +++ b/engines/zvision/scripting/controls/save_control.cpp @@ -101,6 +101,8 @@ bool SaveControl::process(uint32 deltaTimeInMillis) { toSave = false; if (toSave) { + // FIXME: At this point, the screen shows the save control, so the save game thumbnails will always + // show the save control _engine->getSaveManager()->saveGameBuffered(iter->saveId, inp->getText()); _engine->delayedMessage(_engine->getStringManager()->getTextLine(StringManager::ZVISION_STR_SAVED), 2000); _engine->getScriptManager()->changeLocation(_engine->getScriptManager()->getLastMenuLocation()); diff --git a/engines/zvision/scripting/script_manager.cpp b/engines/zvision/scripting/script_manager.cpp index 7904817156..c532a2b15d 100644 --- a/engines/zvision/scripting/script_manager.cpp +++ b/engines/zvision/scripting/script_manager.cpp @@ -36,6 +36,7 @@ #include "common/hashmap.h" #include "common/debug.h" #include "common/stream.h" +#include "common/config-manager.h" namespace ZVision { @@ -521,6 +522,28 @@ void ScriptManager::ChangeLocationReal() { assert(_nextLocation.world != 0); debug(1, "Changing location to: %c %c %c %c %u", _nextLocation.world, _nextLocation.room, _nextLocation.node, _nextLocation.view, _nextLocation.offset); + if (_nextLocation.world == 'g' && _nextLocation.room == 'j' && !ConfMan.getBool("originalsaveload")) { + if ((_nextLocation.node == 's' || _nextLocation.node == 'r') && _nextLocation.view == 'e') { + // Hook up the ScummVM save/restore dialog + bool isSave = (_nextLocation.node == 's'); + bool gameSavedOrLoaded = _engine->getSaveManager()->scummVMSaveLoadDialog(isSave); + if (!gameSavedOrLoaded || isSave) { + // Reload the current room + _nextLocation.world = _currentLocation.world; + _nextLocation.room = _currentLocation.room; + _nextLocation.node = _currentLocation.node; + _nextLocation.view = _currentLocation.view; + _nextLocation.offset = _currentLocation.offset; + _currentLocation.world = '0'; + _currentLocation.room = '0'; + _currentLocation.node = '0'; + _currentLocation.view = '0'; + _currentLocation.offset = 0; + } else + return; + } + } + _engine->setRenderDelay(2); if (getStateValue(StateKey_World) != 'g' || getStateValue(StateKey_Room) != 'j') { |