File tree Expand file tree Collapse file tree 2 files changed +10
-9
lines changed
engine/src/main/java/org/destinationsol Expand file tree Collapse file tree 2 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -188,10 +188,16 @@ public static boolean resourceExists(String fileName) {
188188 }
189189
190190 /**
191- * Tests is the game has a previous ship (a game to continue)
191+ * Tests if the game has a compatible previous ship (a game to continue)
192192 */
193- public static boolean hasPrevShip (String fileName ) {
194- return resourceExists (fileName );
193+ public static boolean hasPreviousCompatibleShip () {
194+ if (!resourceExists (Const .SAVE_FILE_NAME )) {
195+ return false ;
196+ }
197+ IniReader reader = new IniReader (Const .SAVE_FILE_NAME , null );
198+ String saveMajorVersion = reader .getString ("version" , "" ).split ("\\ ." )[0 ];
199+ String gameMajorVersion = Const .VERSION .split ("\\ ." )[0 ];
200+ return saveMajorVersion .equals (gameMajorVersion );
195201 }
196202
197203 /**
Original file line number Diff line number Diff line change 1818
1919import com .badlogic .gdx .graphics .Texture ;
2020import com .badlogic .gdx .graphics .g2d .TextureAtlas ;
21- import org .destinationsol .Const ;
2221import org .destinationsol .GameOptions ;
23- import org .destinationsol .IniReader ;
2422import org .destinationsol .SolApplication ;
2523import org .destinationsol .assets .Assets ;
2624import org .destinationsol .common .SolColor ;
@@ -60,10 +58,7 @@ public class NewGameScreen extends SolUiBaseScreen {
6058
6159 @ Override
6260 public void onAdd (SolApplication solApplication ) {
63- IniReader reader = new IniReader (Const .SAVE_FILE_NAME , null );
64- String saveMajorVersion = reader .getString ("version" , "" ).split ("\\ ." )[0 ];
65- String gameMajorVersion = Const .VERSION .split ("\\ ." )[0 ];
66- continueControl .setEnabled (SaveManager .hasPrevShip ("prevShip.ini" ) && saveMajorVersion .equals (gameMajorVersion ));
61+ continueControl .setEnabled (SaveManager .hasPreviousCompatibleShip ());
6762 }
6863
6964 @ Override
You can’t perform that action at this time.
0 commit comments