diff --git a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/AndorsTrailApplication.java b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/AndorsTrailApplication.java index 9c5402798..5ac54f632 100644 --- a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/AndorsTrailApplication.java +++ b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/AndorsTrailApplication.java @@ -28,7 +28,8 @@ public final class AndorsTrailApplication extends Application { public static final boolean DEVELOPMENT_VALIDATEDATA = true; public static final boolean DEVELOPMENT_DEBUGMESSAGES = true; public static final boolean DEVELOPMENT_INCOMPATIBLE_SAVEGAMES = DEVELOPMENT_DEBUGRESOURCES || DEVELOPMENT_DEBUGBUTTONS || DEVELOPMENT_FASTSPEED; - public static final int CURRENT_VERSION = DEVELOPMENT_INCOMPATIBLE_SAVEGAMES ? 999 : 48; + public static final int DEVELOPMENT_INCOMPATIBLE_SAVEGAME_VERSION = 999; + public static final int CURRENT_VERSION = DEVELOPMENT_INCOMPATIBLE_SAVEGAMES ? DEVELOPMENT_INCOMPATIBLE_SAVEGAME_VERSION : 48; public static final String CURRENT_VERSION_DISPLAY = "0.7.7"; public static final boolean IS_RELEASE_VERSION = !CURRENT_VERSION_DISPLAY.matches(".*[a-d].*"); diff --git a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/activity/LoadSaveActivity.java b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/activity/LoadSaveActivity.java index 9145aba92..00563a990 100644 --- a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/activity/LoadSaveActivity.java +++ b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/activity/LoadSaveActivity.java @@ -175,6 +175,22 @@ public final class LoadSaveActivity extends Activity implements OnClickListener public void onClick(View view) { final int slot = (Integer) view.getTag(); + if (!isLoading && slot != SLOT_NUMBER_CREATE_NEW_SLOT && AndorsTrailApplication.CURRENT_VERSION == AndorsTrailApplication.DEVELOPMENT_INCOMPATIBLE_SAVEGAME_VERSION) { + final FileHeader header = Savegames.quickload(this, slot); + if (header != null && header.fileversion != AndorsTrailApplication.DEVELOPMENT_INCOMPATIBLE_SAVEGAME_VERSION) { + final Dialog d = CustomDialogFactory.createDialog(this, + "Overwriting not allowed", + getResources().getDrawable(android.R.drawable.ic_dialog_alert), + "You are currently using a development version of Andor's trail. Overwriting a regular savegame is not allowed in development mode.", + null, + true); + CustomDialogFactory.addDismissButton(d, android.R.string.ok); + CustomDialogFactory.show(d); + return; + } + } + + if (isLoading) { if(!Savegames.getSlotFile(slot).exists()) { showErrorLoadingEmptySlot(); diff --git a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/savegames/Savegames.java b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/savegames/Savegames.java index 6111f66b9..cb0b13cd0 100644 --- a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/savegames/Savegames.java +++ b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/savegames/Savegames.java @@ -319,7 +319,7 @@ public final class Savegames { public final long savedVersion; public String describe() { - return playerName + ", " + displayInfo; + return (fileversion == AndorsTrailApplication.DEVELOPMENT_INCOMPATIBLE_SAVEGAME_VERSION ? "(D) " : "") + playerName + ", " + displayInfo; }