2014-10-06 14:50:05 +02:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
|
|
|
*
|
2021-12-26 18:47:58 +01:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
2014-10-06 14:50:05 +02:00
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2021-12-26 18:47:58 +01:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2014-10-06 14:50:05 +02:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This code is based on Labyrinth of Time code with assistance of
|
|
|
|
*
|
|
|
|
* Copyright (c) 1993 Terra Nova Development
|
|
|
|
* Copyright (c) 2004 The Wyrmkeep Entertainment Co.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2015-12-12 03:28:06 +02:00
|
|
|
#include "common/savefile.h"
|
2015-12-09 06:17:16 +01:00
|
|
|
#include "common/translation.h"
|
|
|
|
|
|
|
|
#include "gui/message.h"
|
|
|
|
#include "gui/saveload.h"
|
|
|
|
|
2015-02-19 15:41:15 +02:00
|
|
|
#include "graphics/thumbnail.h"
|
2015-12-08 21:10:54 +01:00
|
|
|
#include "engines/savestate.h"
|
2015-02-19 15:41:15 +02:00
|
|
|
|
2014-12-25 19:13:52 +01:00
|
|
|
#include "lab/lab.h"
|
2015-12-08 21:19:41 +01:00
|
|
|
#include "lab/dispman.h"
|
2015-12-14 13:19:21 +01:00
|
|
|
#include "lab/eventman.h"
|
2015-12-08 21:00:50 +01:00
|
|
|
#include "lab/labsets.h"
|
2015-12-09 06:17:16 +01:00
|
|
|
#include "lab/music.h"
|
|
|
|
#include "lab/processroom.h"
|
2015-12-27 01:42:20 +02:00
|
|
|
#include "lab/speciallocks.h"
|
2014-10-06 14:50:05 +02:00
|
|
|
|
|
|
|
namespace Lab {
|
2015-12-09 06:17:16 +01:00
|
|
|
|
2015-02-19 15:41:15 +02:00
|
|
|
#define SAVEGAME_ID MKTAG('L', 'O', 'T', 'S')
|
|
|
|
#define SAVEGAME_VERSION 1
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-12-13 23:22:34 +01:00
|
|
|
void LabEngine::writeSaveGameHeader(Common::OutSaveFile *out, const Common::String &saveName) {
|
2015-02-19 15:41:15 +02:00
|
|
|
out->writeUint32BE(SAVEGAME_ID);
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-02-19 15:41:15 +02:00
|
|
|
// Write version
|
|
|
|
out->writeByte(SAVEGAME_VERSION);
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-02-19 15:41:15 +02:00
|
|
|
// Write savegame name
|
|
|
|
out->writeString(saveName);
|
|
|
|
out->writeByte(0);
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-02-19 15:41:15 +02:00
|
|
|
// Save the game thumbnail
|
|
|
|
Graphics::saveThumbnail(*out);
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-02-19 15:41:15 +02:00
|
|
|
// Creation date/time
|
|
|
|
TimeDate curTime;
|
2015-12-23 18:56:35 +01:00
|
|
|
_system->getTimeAndDate(curTime);
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-02-19 15:41:15 +02:00
|
|
|
uint32 saveDate = ((curTime.tm_mday & 0xFF) << 24) | (((curTime.tm_mon + 1) & 0xFF) << 16) | ((curTime.tm_year + 1900) & 0xFFFF);
|
|
|
|
uint16 saveTime = ((curTime.tm_hour & 0xFF) << 8) | ((curTime.tm_min) & 0xFF);
|
2015-12-24 01:21:40 +01:00
|
|
|
uint32 playTime = getTotalPlayTime() / 1000;
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-02-19 15:41:15 +02:00
|
|
|
out->writeUint32BE(saveDate);
|
|
|
|
out->writeUint16BE(saveTime);
|
|
|
|
out->writeUint32BE(playTime);
|
2014-10-06 14:50:05 +02:00
|
|
|
}
|
|
|
|
|
ALL: Load savegame thumbnail only when necessary
This commit introduces the following changes:
1. Graphics::loadThumbnail()
Now returns a boolean and takes a new argument skipThumbnail which
defaults to false. In case of true, loadThumbnail() reads past the
thumbnail data in the input stream instead of actually loading the
thumbnail. This simplifies savegame handling where, up until now,
many engines always read the whole savegame metadata (including
the thumbnail) and then threw away the thumbnail when not needed
(which is in almost all cases, the most common exception being
MetaEngine::querySaveMetaInfos() which is responsible for loading
savegame metadata for displaying it in the GUI launcher.
2. readSavegameHeader()
Engines which already implement such a method (name varies) now take
a new argument skipThumbnail (default: true) which is passed
through to loadThumbnail(). This means that the default case for
readSavegameHeader() is now _not_ loading the thumbnail from a
savegame and just reading past it. In those cases, e.g.
querySaveMetaInfos(), where we actually are interested in loading
the thumbnail readSavegameHeader() needs to explicitely be called
with skipThumbnail == false.
Engines whose readSavegameHeader() (name varies) already takes an
argument loadThumbnail have been adapted to have a similar
prototype and semantics.
I.e. readSaveHeader(in, loadThumbnail, header) now is
readSaveHeader(in, header, skipThumbnail).
3. Error handling
Engines which previously did not check the return value of
readSavegameHeader() (name varies) now do so ensuring that possibly
broken savegames (be it a broken thumbnail or something else) don't
make it into the GUI launcher list in the first place.
2018-04-06 00:06:38 +02:00
|
|
|
WARN_UNUSED_RESULT bool readSaveGameHeader(Common::InSaveFile *in, SaveGameHeader &header, bool skipThumbnail) {
|
2015-02-19 15:41:15 +02:00
|
|
|
uint32 id = in->readUint32BE();
|
2015-12-03 11:01:50 +01:00
|
|
|
|
2015-02-19 15:41:15 +02:00
|
|
|
// Check if it's a valid ScummVM savegame
|
|
|
|
if (id != SAVEGAME_ID)
|
|
|
|
return false;
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-02-19 15:41:15 +02:00
|
|
|
// Read in the version
|
2015-12-03 01:06:04 +01:00
|
|
|
header._version = in->readByte();
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-02-19 15:41:15 +02:00
|
|
|
// Check that the save version isn't newer than this binary
|
2015-12-03 01:06:04 +01:00
|
|
|
if (header._version > SAVEGAME_VERSION)
|
2015-02-19 15:41:15 +02:00
|
|
|
return false;
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-02-19 15:41:15 +02:00
|
|
|
// Read in the save name
|
|
|
|
Common::String saveName;
|
|
|
|
char ch;
|
|
|
|
while ((ch = (char)in->readByte()) != '\0')
|
|
|
|
saveName += ch;
|
2015-12-03 01:06:04 +01:00
|
|
|
header._descr.setDescription(saveName);
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-02-19 15:41:15 +02:00
|
|
|
// Get the thumbnail
|
2018-07-12 15:43:05 -07:00
|
|
|
Graphics::Surface *thumbnail = nullptr;
|
ALL: Load savegame thumbnail only when necessary
This commit introduces the following changes:
1. Graphics::loadThumbnail()
Now returns a boolean and takes a new argument skipThumbnail which
defaults to false. In case of true, loadThumbnail() reads past the
thumbnail data in the input stream instead of actually loading the
thumbnail. This simplifies savegame handling where, up until now,
many engines always read the whole savegame metadata (including
the thumbnail) and then threw away the thumbnail when not needed
(which is in almost all cases, the most common exception being
MetaEngine::querySaveMetaInfos() which is responsible for loading
savegame metadata for displaying it in the GUI launcher.
2. readSavegameHeader()
Engines which already implement such a method (name varies) now take
a new argument skipThumbnail (default: true) which is passed
through to loadThumbnail(). This means that the default case for
readSavegameHeader() is now _not_ loading the thumbnail from a
savegame and just reading past it. In those cases, e.g.
querySaveMetaInfos(), where we actually are interested in loading
the thumbnail readSavegameHeader() needs to explicitely be called
with skipThumbnail == false.
Engines whose readSavegameHeader() (name varies) already takes an
argument loadThumbnail have been adapted to have a similar
prototype and semantics.
I.e. readSaveHeader(in, loadThumbnail, header) now is
readSaveHeader(in, header, skipThumbnail).
3. Error handling
Engines which previously did not check the return value of
readSavegameHeader() (name varies) now do so ensuring that possibly
broken savegames (be it a broken thumbnail or something else) don't
make it into the GUI launcher list in the first place.
2018-04-06 00:06:38 +02:00
|
|
|
if (!Graphics::loadThumbnail(*in, thumbnail, skipThumbnail)) {
|
|
|
|
return false;
|
|
|
|
}
|
2018-07-12 15:43:05 -07:00
|
|
|
|
ALL: Load savegame thumbnail only when necessary
This commit introduces the following changes:
1. Graphics::loadThumbnail()
Now returns a boolean and takes a new argument skipThumbnail which
defaults to false. In case of true, loadThumbnail() reads past the
thumbnail data in the input stream instead of actually loading the
thumbnail. This simplifies savegame handling where, up until now,
many engines always read the whole savegame metadata (including
the thumbnail) and then threw away the thumbnail when not needed
(which is in almost all cases, the most common exception being
MetaEngine::querySaveMetaInfos() which is responsible for loading
savegame metadata for displaying it in the GUI launcher.
2. readSavegameHeader()
Engines which already implement such a method (name varies) now take
a new argument skipThumbnail (default: true) which is passed
through to loadThumbnail(). This means that the default case for
readSavegameHeader() is now _not_ loading the thumbnail from a
savegame and just reading past it. In those cases, e.g.
querySaveMetaInfos(), where we actually are interested in loading
the thumbnail readSavegameHeader() needs to explicitely be called
with skipThumbnail == false.
Engines whose readSavegameHeader() (name varies) already takes an
argument loadThumbnail have been adapted to have a similar
prototype and semantics.
I.e. readSaveHeader(in, loadThumbnail, header) now is
readSaveHeader(in, header, skipThumbnail).
3. Error handling
Engines which previously did not check the return value of
readSavegameHeader() (name varies) now do so ensuring that possibly
broken savegames (be it a broken thumbnail or something else) don't
make it into the GUI launcher list in the first place.
2018-04-06 00:06:38 +02:00
|
|
|
header._descr.setThumbnail(thumbnail);
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-02-19 15:41:15 +02:00
|
|
|
uint32 saveDate = in->readUint32BE();
|
|
|
|
uint16 saveTime = in->readUint16BE();
|
|
|
|
uint32 playTime = in->readUint32BE();
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-02-19 15:41:15 +02:00
|
|
|
int day = (saveDate >> 24) & 0xFF;
|
|
|
|
int month = (saveDate >> 16) & 0xFF;
|
|
|
|
int year = saveDate & 0xFFFF;
|
2015-12-03 01:06:04 +01:00
|
|
|
header._descr.setSaveDate(year, month, day);
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-02-19 15:41:15 +02:00
|
|
|
int hour = (saveTime >> 8) & 0xFF;
|
|
|
|
int minutes = saveTime & 0xFF;
|
2015-12-03 01:06:04 +01:00
|
|
|
header._descr.setSaveTime(hour, minutes);
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-12-03 01:06:04 +01:00
|
|
|
header._descr.setPlayTime(playTime * 1000);
|
2015-12-27 23:07:41 +02:00
|
|
|
if (g_engine)
|
|
|
|
g_engine->setTotalPlayTime(playTime * 1000);
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-02-19 15:41:15 +02:00
|
|
|
return true;
|
|
|
|
}
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-12-20 17:21:55 +01:00
|
|
|
bool LabEngine::saveGame(int slot, const Common::String desc) {
|
2020-02-06 21:54:41 -08:00
|
|
|
Common::String fileName = getSaveStateName(slot);
|
2015-12-23 18:56:35 +01:00
|
|
|
Common::SaveFileManager *saveFileManager = _system->getSavefileManager();
|
2015-02-19 15:41:15 +02:00
|
|
|
Common::OutSaveFile *file = saveFileManager->openForSaving(fileName);
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-02-19 15:41:15 +02:00
|
|
|
if (!file)
|
|
|
|
return false;
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-02-19 15:41:15 +02:00
|
|
|
// Load scene pic
|
2015-12-26 14:18:44 +01:00
|
|
|
_graphics->readPict(getPictName(false));
|
|
|
|
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-02-19 15:41:15 +02:00
|
|
|
writeSaveGameHeader(file, desc);
|
2015-12-13 23:22:34 +01:00
|
|
|
file->writeUint16LE(_roomNum);
|
|
|
|
file->writeUint16LE(getDirection());
|
|
|
|
file->writeUint16LE(getQuarters());
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-02-19 15:41:15 +02:00
|
|
|
// Conditions
|
2015-12-14 13:19:21 +01:00
|
|
|
for (int i = 0; i < _conditions->_lastElement / (8 * 2); i++)
|
2015-12-13 23:22:34 +01:00
|
|
|
file->writeUint16LE(_conditions->_array[i]);
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-02-19 15:41:15 +02:00
|
|
|
// Rooms found
|
2015-12-14 13:19:21 +01:00
|
|
|
for (int i = 0; i < _roomsFound->_lastElement / (8 * 2); i++)
|
2015-12-13 23:22:34 +01:00
|
|
|
file->writeUint16LE(_roomsFound->_array[i]);
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-12-27 01:42:20 +02:00
|
|
|
_specialLocks->save(file);
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-02-19 15:41:15 +02:00
|
|
|
// Breadcrumbs
|
2015-12-25 02:18:07 +01:00
|
|
|
for (uint i = 0; i < MAX_CRUMBS; i++) {
|
2016-01-14 00:46:06 +02:00
|
|
|
file->writeUint16LE(_breadCrumbs[i]._crumbRoomNum);
|
|
|
|
file->writeUint16LE(_breadCrumbs[i]._crumbDirection);
|
2014-10-06 14:50:05 +02:00
|
|
|
}
|
|
|
|
|
2015-02-19 15:41:15 +02:00
|
|
|
file->flush();
|
|
|
|
file->finalize();
|
|
|
|
delete file;
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2016-02-08 00:16:38 +02:00
|
|
|
_mainDisplay = true;
|
|
|
|
_alternate = false;
|
|
|
|
_event->simulateEvent();
|
|
|
|
_graphics->screenUpdate();
|
|
|
|
|
2014-10-06 14:50:05 +02:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2015-12-13 23:22:34 +01:00
|
|
|
bool LabEngine::loadGame(int slot) {
|
2020-02-06 21:54:41 -08:00
|
|
|
Common::String fileName = getSaveStateName(slot);
|
2015-12-23 18:56:35 +01:00
|
|
|
Common::SaveFileManager *saveFileManager = _system->getSavefileManager();
|
2015-02-19 15:41:15 +02:00
|
|
|
Common::InSaveFile *file = saveFileManager->openForLoading(fileName);
|
2015-12-03 11:01:50 +01:00
|
|
|
|
2015-02-19 15:41:15 +02:00
|
|
|
if (!file)
|
2014-10-06 14:50:05 +02:00
|
|
|
return false;
|
|
|
|
|
2015-02-19 15:41:15 +02:00
|
|
|
SaveGameHeader header;
|
ALL: Load savegame thumbnail only when necessary
This commit introduces the following changes:
1. Graphics::loadThumbnail()
Now returns a boolean and takes a new argument skipThumbnail which
defaults to false. In case of true, loadThumbnail() reads past the
thumbnail data in the input stream instead of actually loading the
thumbnail. This simplifies savegame handling where, up until now,
many engines always read the whole savegame metadata (including
the thumbnail) and then threw away the thumbnail when not needed
(which is in almost all cases, the most common exception being
MetaEngine::querySaveMetaInfos() which is responsible for loading
savegame metadata for displaying it in the GUI launcher.
2. readSavegameHeader()
Engines which already implement such a method (name varies) now take
a new argument skipThumbnail (default: true) which is passed
through to loadThumbnail(). This means that the default case for
readSavegameHeader() is now _not_ loading the thumbnail from a
savegame and just reading past it. In those cases, e.g.
querySaveMetaInfos(), where we actually are interested in loading
the thumbnail readSavegameHeader() needs to explicitely be called
with skipThumbnail == false.
Engines whose readSavegameHeader() (name varies) already takes an
argument loadThumbnail have been adapted to have a similar
prototype and semantics.
I.e. readSaveHeader(in, loadThumbnail, header) now is
readSaveHeader(in, header, skipThumbnail).
3. Error handling
Engines which previously did not check the return value of
readSavegameHeader() (name varies) now do so ensuring that possibly
broken savegames (be it a broken thumbnail or something else) don't
make it into the GUI launcher list in the first place.
2018-04-06 00:06:38 +02:00
|
|
|
if (!readSaveGameHeader(file, header)) {
|
|
|
|
delete file;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2015-12-13 23:22:34 +01:00
|
|
|
_roomNum = file->readUint16LE();
|
2016-01-14 02:06:10 +02:00
|
|
|
_music->checkRoomMusic(1, _roomNum);
|
2016-01-14 00:47:58 +02:00
|
|
|
_direction = file->readUint16LE();
|
2015-12-13 23:22:34 +01:00
|
|
|
setQuarters(file->readUint16LE());
|
2015-02-19 15:41:15 +02:00
|
|
|
|
|
|
|
// Conditions
|
2015-12-23 21:44:48 +02:00
|
|
|
for (int i = 0; i < _conditions->_lastElement / (8 * 2); i++)
|
2015-12-13 23:22:34 +01:00
|
|
|
_conditions->_array[i] = file->readUint16LE();
|
2015-02-19 15:41:15 +02:00
|
|
|
|
|
|
|
// Rooms found
|
2015-12-23 21:44:48 +02:00
|
|
|
for (int i = 0; i < _roomsFound->_lastElement / (8 * 2); i++)
|
2015-12-13 23:22:34 +01:00
|
|
|
_roomsFound->_array[i] = file->readUint16LE();
|
2015-02-19 15:41:15 +02:00
|
|
|
|
2015-12-27 01:42:20 +02:00
|
|
|
_specialLocks->load(file);
|
2015-02-19 15:41:15 +02:00
|
|
|
|
|
|
|
// Breadcrumbs
|
2015-12-25 02:18:07 +01:00
|
|
|
for (int i = 0; i < MAX_CRUMBS; i++) {
|
2016-01-14 00:46:06 +02:00
|
|
|
_breadCrumbs[i]._crumbRoomNum = file->readUint16LE();
|
|
|
|
_breadCrumbs[i]._crumbDirection = file->readUint16LE();
|
2015-02-19 15:41:15 +02:00
|
|
|
}
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2016-01-14 00:46:06 +02:00
|
|
|
_droppingCrumbs = (_breadCrumbs[0]._crumbRoomNum != 0);
|
2015-12-13 23:22:34 +01:00
|
|
|
_followingCrumbs = false;
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-12-25 02:18:07 +01:00
|
|
|
for (int i = 0; i < MAX_CRUMBS; i++) {
|
2016-01-14 00:46:06 +02:00
|
|
|
if (_breadCrumbs[i]._crumbRoomNum == 0)
|
2015-02-19 15:41:15 +02:00
|
|
|
break;
|
2015-12-13 23:22:34 +01:00
|
|
|
_numCrumbs = i;
|
2015-02-19 15:41:15 +02:00
|
|
|
}
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2015-02-19 15:41:15 +02:00
|
|
|
delete file;
|
2014-10-06 14:50:05 +02:00
|
|
|
|
2016-02-08 00:16:38 +02:00
|
|
|
_curFileName = " ";
|
|
|
|
_closeDataPtr = nullptr;
|
|
|
|
_followingCrumbs = false;
|
|
|
|
_graphics->_longWinInFront = false;
|
|
|
|
_event->initMouse();
|
|
|
|
|
|
|
|
_mainDisplay = true;
|
|
|
|
_alternate = false;
|
|
|
|
_event->simulateEvent();
|
|
|
|
_graphics->screenUpdate();
|
|
|
|
|
2014-10-06 14:50:05 +02:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2015-12-09 06:17:16 +01:00
|
|
|
bool LabEngine::saveRestoreGame() {
|
|
|
|
bool isOK = false;
|
|
|
|
|
|
|
|
// The original had one screen for saving/loading. We have two.
|
|
|
|
// Ask the user which screen to use.
|
|
|
|
GUI::MessageDialog saveOrLoad(_("Would you like to save or restore a game?"), _("Save"), _("Restore"));
|
|
|
|
|
|
|
|
int choice = saveOrLoad.runModal();
|
|
|
|
if (choice == GUI::kMessageOK) {
|
|
|
|
// Save
|
|
|
|
GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser(_("Save game:"), _("Save"), true);
|
|
|
|
int slot = dialog->runModalWithCurrentTarget();
|
|
|
|
if (slot >= 0) {
|
|
|
|
Common::String desc = dialog->getResultString();
|
|
|
|
|
|
|
|
if (desc.empty()) {
|
|
|
|
// create our own description for the saved game, the user didn't enter it
|
|
|
|
desc = dialog->createDefaultSaveDescription(slot);
|
|
|
|
}
|
|
|
|
|
2015-12-12 19:11:30 +02:00
|
|
|
isOK = saveGame(slot, desc);
|
2015-12-09 06:17:16 +01:00
|
|
|
}
|
2015-12-18 07:28:07 +01:00
|
|
|
delete dialog;
|
2015-12-09 06:17:16 +01:00
|
|
|
} else {
|
|
|
|
// Restore
|
|
|
|
GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser(_("Restore game:"), _("Restore"), false);
|
|
|
|
int slot = dialog->runModalWithCurrentTarget();
|
|
|
|
if (slot >= 0) {
|
2015-12-12 19:11:30 +02:00
|
|
|
isOK = loadGame(slot);
|
2015-12-09 06:17:16 +01:00
|
|
|
}
|
2015-12-18 07:28:07 +01:00
|
|
|
delete dialog;
|
2015-12-09 06:17:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return isOK;
|
|
|
|
}
|
2015-02-19 15:41:15 +02:00
|
|
|
|
2014-10-06 14:50:05 +02:00
|
|
|
} // End of namespace Lab
|