CGE: Use Engine save/load dialog methods

This commit is contained in:
Paul Gilbert 2020-02-02 16:46:35 -08:00 committed by Paul Gilbert
parent 6850c92617
commit cc689fd16a
2 changed files with 2 additions and 21 deletions

View File

@ -1,3 +0,0 @@
engines/cge/detection.cpp
engines/cge/events.cpp

View File

@ -28,7 +28,6 @@
#include "gui/saveload.h"
#include "common/config-manager.h"
#include "common/events.h"
#include "common/translation.h"
#include "engines/advancedDetector.h"
#include "cge/events.h"
#include "cge/events.h"
@ -68,25 +67,10 @@ bool Keyboard::getKey(Common::Event &event) {
_vm->_commandHandler->addCommand(kCmdInf, 1, kShowScummVMVersion + i, NULL);
return false;
case Common::KEYCODE_F5:
if (_vm->canSaveGameStateCurrently()) {
GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser(_("Save game:"), _("Save"), true);
int16 savegameId = dialog->runModalWithCurrentTarget();
Common::String savegameDescription = dialog->getResultString();
delete dialog;
if (savegameId != -1)
_vm->saveGameState(savegameId, savegameDescription);
}
_vm->saveGameDialog();
return false;
case Common::KEYCODE_F7:
if (_vm->canLoadGameStateCurrently()) {
GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser(_("Restore game:"), _("Restore"), false);
int16 savegameId = dialog->runModalWithCurrentTarget();
delete dialog;
if (savegameId != -1)
_vm->loadGameState(savegameId);
}
_vm->loadGameDialog();
return false;
case Common::KEYCODE_d:
if (event.kbd.flags & Common::KBD_CTRL) {