From 9fc8a0f09ad531520db8896e671d10393e7d2d39 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Fri, 21 Oct 2022 00:03:39 +0600 Subject: я не ебу почему для андроидов new File() вместо Gdx.files.external() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ilotterytea/maxoning/utils/serialization/GameDataSystem.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'core/src/com/ilotterytea') diff --git a/core/src/com/ilotterytea/maxoning/utils/serialization/GameDataSystem.java b/core/src/com/ilotterytea/maxoning/utils/serialization/GameDataSystem.java index eff6c75..157b0a5 100644 --- a/core/src/com/ilotterytea/maxoning/utils/serialization/GameDataSystem.java +++ b/core/src/com/ilotterytea/maxoning/utils/serialization/GameDataSystem.java @@ -96,16 +96,16 @@ public class GameDataSystem { } } - if ((OsUtils.isAndroid || OsUtils.isIos) && Gdx.files.local(Gdx.files.getExternalStoragePath() + "/" + file_name).exists()) { + if ((OsUtils.isAndroid || OsUtils.isIos) && new File(Gdx.files.getExternalStoragePath() + file_name).exists()) { try { - log.info(String.format("Trying to get the savegame at %s/%s...", Gdx.files.getExternalStoragePath(), file_name)); - FileInputStream fis = new FileInputStream(String.format("%s/%s", Gdx.files.getExternalStoragePath(), file_name)); + log.info(String.format("Trying to get the savegame at %s%s...", Gdx.files.getExternalStoragePath(), file_name)); + FileInputStream fis = new FileInputStream(String.format("%s%s", Gdx.files.getExternalStoragePath(), file_name)); ObjectInputStream oos = new ObjectInputStream(fis); sav = gson.fromJson(oos.readUTF(), MaxonSavegame.class); oos.close(); - log.info(String.format("Successfully loaded the savegame from %s/%s!", dir.getAbsolutePath(), file_name)); + log.info(String.format("Successfully loaded the savegame from %s%s!", Gdx.files.getExternalStoragePath(), file_name)); } catch (IOException e) { throw new RuntimeException(e); } -- cgit v1.2.3