BURIED: Display a message when trying to load non-apartment saves in the trial

This commit is contained in:
Matthew Hoops 2015-03-29 16:28:36 -04:00 committed by Eugene Sandulenko
parent 18a7b010be
commit 57920ae92d
2 changed files with 21 additions and 1 deletions

View File

@ -135,6 +135,11 @@ Common::Error BuriedEngine::run() {
if (ConfMan.hasKey("save_slot")) {
uint32 gameToLoad = ConfMan.getInt("save_slot");
doIntro = (loadGameState(gameToLoad).getCode() != Common::kNoError);
// If the trial version tries to load a game without a time
// zone that's part of the trial version, force the intro.
if (isTrial() && !((FrameWindow *)_mainWindow)->getMainChildWindow())
doIntro = true;
}
// Play the intro only if we're starting from scratch

View File

@ -30,6 +30,7 @@
#include "common/serializer.h"
#include "common/system.h"
#include "common/translation.h"
#include "gui/message.h"
#include "gui/saveload.h"
#include "buried/buried.h"
@ -70,8 +71,22 @@ Common::Error BuriedEngine::loadGameState(int slot) {
return Common::kUnknownError;
}
((FrameWindow *)_mainWindow)->loadFromState(location, flags, inventoryItems);
// Done with the file
delete loadFile;
if (isTrial() && location.timeZone != 4) {
// Display a message preventing the user from loading a non-apartment
// saved game in the trial version
GUI::MessageDialog dialog("ERROR: The location in this saved game is not included in this version of Buried in Time");
dialog.runModal();
// Don't return an error. It's an "error" that we can't load,
// but we're still in a valid state. The message above will
// be displayed instead of the usual GUI load error.
return Common::kNoError;
}
((FrameWindow *)_mainWindow)->loadFromState(location, flags, inventoryItems);
return Common::kNoError;
}