aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra/debugger.cpp
diff options
context:
space:
mode:
authorathrxx2012-01-15 01:13:03 +0100
committerathrxx2012-01-15 13:36:50 +0100
commitd355c536c4d3dea4ff61288d8ac85ab071451825 (patch)
treeb9abfc0c50583fd395d0712513f52e9f47b7c8a5 /engines/kyra/debugger.cpp
parente73984631083a29c072c3bc2191eefbc0d36b9cd (diff)
downloadscummvm-rg350-d355c536c4d3dea4ff61288d8ac85ab071451825.tar.gz
scummvm-rg350-d355c536c4d3dea4ff61288d8ac85ab071451825.tar.bz2
scummvm-rg350-d355c536c4d3dea4ff61288d8ac85ab071451825.zip
KYRA: (EOB) - add support for original save game files
The engine will try to import original save game files once per target (especially the "Quick Start Party"). Afterwards the user can manually import save files with the debug console.
Diffstat (limited to 'engines/kyra/debugger.cpp')
-rw-r--r--engines/kyra/debugger.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/engines/kyra/debugger.cpp b/engines/kyra/debugger.cpp
index 6514984b93..2c9f9f2eea 100644
--- a/engines/kyra/debugger.cpp
+++ b/engines/kyra/debugger.cpp
@@ -29,6 +29,9 @@
#include "kyra/eobcommon.h"
#include "common/system.h"
+#include "common/config-manager.h"
+
+#include "gui/message.h"
namespace Kyra {
@@ -477,6 +480,34 @@ Debugger_LoL::Debugger_LoL(LoLEngine *vm) : Debugger(vm), _vm(vm) {
#ifdef ENABLE_EOB
Debugger_EoB::Debugger_EoB(EoBCoreEngine *vm) : Debugger(vm), _vm(vm) {
}
+
+void Debugger_EoB::initialize() {
+ DCmd_Register("import_savefile", WRAP_METHOD(Debugger_EoB, cmd_importSaveFile));
+}
+
+bool Debugger_EoB::cmd_importSaveFile(int argc, const char **argv) {
+ if (argc == 3) {
+ int slot = atoi(argv[1]);
+ if (slot < -1 || slot > 989) {
+ DebugPrintf("slot must be between (including) -1 and 989 \n");
+ return true;
+ }
+
+ ::GUI::MessageDialog dialog("Your current game (if any) will be lost if you continue. Make sure to save your game first.\n\n", "Continue", "Cancel");
+ if (!dialog.runModal()) {
+ DebugPrintf("Cancelled.\n");
+ return true;
+ }
+
+ DebugPrintf(_vm->importOriginalSaveFile(slot, argv[2]) ? "Success.\n" : "Failure.\n");
+ _vm->loadItemDefs();
+ } else {
+ DebugPrintf("Syntax: import_savefile <dest slot> <source file>\n (Imports source save game file to dest slot.)\n import_savefile -1\n (Imports all original save game files found and pushs them to the top of the save game list.)\n\n");
+ }
+
+ return true;
+}
+
#endif // ENABLE_EOB
} // End of namespace Kyra