diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/scumm/dialogs.cpp | 4 | ||||
-rw-r--r-- | engines/scumm/input.cpp | 22 | ||||
-rw-r--r-- | engines/scumm/saveload.cpp | 9 |
3 files changed, 24 insertions, 11 deletions
diff --git a/engines/scumm/dialogs.cpp b/engines/scumm/dialogs.cpp index bef267f6f2..42e49afcc1 100644 --- a/engines/scumm/dialogs.cpp +++ b/engines/scumm/dialogs.cpp @@ -472,9 +472,7 @@ ScummMenuDialog::~ScummMenuDialog() { } void ScummMenuDialog::reflowLayout() { - // For v4+ games do not allow to save in room 0 just as original did. - // It is not possible to load such saves - if ((_vm->_game.version >= 4) && (_vm->_currentRoom == 0)) + if (!_vm->canSaveGameStateCurrently()) _saveButton->setEnabled(false); Dialog::reflowLayout(); diff --git a/engines/scumm/input.cpp b/engines/scumm/input.cpp index 61b714a3e2..4eadda8485 100644 --- a/engines/scumm/input.cpp +++ b/engines/scumm/input.cpp @@ -111,8 +111,8 @@ void ScummEngine::parseEvent(Common::Event event) { switch (event.type) { case Common::EVENT_KEYDOWN: if (event.kbd.keycode >= '0' && event.kbd.keycode <= '9' - && (event.kbd.flags == Common::KBD_ALT || - event.kbd.flags == Common::KBD_CTRL)) { + && event.kbd.flags == Common::KBD_CTRL && + canLoadGameStateCurrently()) { _saveLoadSlot = event.kbd.keycode - '0'; // don't overwrite autosave (slot 0) @@ -120,8 +120,24 @@ void ScummEngine::parseEvent(Common::Event event) { _saveLoadSlot = 10; sprintf(_saveLoadName, "Quicksave %d", _saveLoadSlot); - _saveLoadFlag = (event.kbd.flags == Common::KBD_ALT) ? 1 : 2; + _saveLoadFlag = 2; _saveTemporaryState = false; + } else if (event.kbd.keycode >= '0' && event.kbd.keycode <= '9' + && event.kbd.flags == Common::KBD_ALT && + canSaveGameStateCurrently()) { + _saveLoadSlot = event.kbd.keycode - '0'; + + // don't overwrite autosave (slot 0) + if (_saveLoadSlot == 0) + _saveLoadSlot = 10; + + sprintf(_saveLoadName, "Quicksave %d", _saveLoadSlot); + _saveLoadFlag = 1; + _saveTemporaryState = false; + } else if (event.kbd.flags == Common::KBD_CTRL && event.kbd.keycode == 'f') { + + + } else if (event.kbd.flags == Common::KBD_CTRL && event.kbd.keycode == 'f') { _fastMode ^= 1; } else if (event.kbd.flags == Common::KBD_CTRL && event.kbd.keycode == 'g') { diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp index 4d131b41be..0311b50e18 100644 --- a/engines/scumm/saveload.cpp +++ b/engines/scumm/saveload.cpp @@ -95,15 +95,14 @@ Common::Error ScummEngine::saveGameState(int slot, const char *desc) { } bool ScummEngine::canSaveGameStateCurrently() { - // For v4+ games do not allow to save in room 0 - if (_game.version >= 4) - return (_currentRoom != 0); - // FIXME: For now always allow loading in V0-V3 games // TODO: Should we disallow saving in some more places, // e.g. when a SAN movie is playing? Not sure whether the // original EXE allowed this. - return (VAR_MAINMENU_KEY == 0xFF || VAR(VAR_MAINMENU_KEY) != 0); + + // SCUMM v4+ doesn't allow saving in room 0 or if + // VAR(VAR_MAINMENU_KEY) to set to zero. + return (VAR_MAINMENU_KEY == 0xFF || (VAR(VAR_MAINMENU_KEY) != 0 && _currentRoom != 0)); } |