summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2022-10-06 17:21:58 +0600
committerilotterytea <iltsu@alright.party>2022-10-06 17:21:58 +0600
commitf706eab45127213e8a26e0a732cc5467784d01f6 (patch)
treec1ee875042551258237c8e473ad2e647cfd94554 /core
parente8ab2aff11aa1da59968c9f06f96194e2f5e501e (diff)
set game screen after loading assets (only for android)
Diffstat (limited to 'core')
-rw-r--r--core/src/com/ilotterytea/maxoning/screens/SplashScreen.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/core/src/com/ilotterytea/maxoning/screens/SplashScreen.java b/core/src/com/ilotterytea/maxoning/screens/SplashScreen.java
index 31a1023..2817948 100644
--- a/core/src/com/ilotterytea/maxoning/screens/SplashScreen.java
+++ b/core/src/com/ilotterytea/maxoning/screens/SplashScreen.java
@@ -14,8 +14,11 @@ import com.badlogic.gdx.utils.Timer;
import com.badlogic.gdx.utils.viewport.FillViewport;
import com.ilotterytea.maxoning.MaxonGame;
import com.ilotterytea.maxoning.utils.AssetLoading;
+import com.ilotterytea.maxoning.utils.OsUtils;
import com.ilotterytea.maxoning.utils.math.Math;
+import com.ilotterytea.maxoning.utils.serialization.GameDataSystem;
+import java.io.IOException;
import java.util.ArrayList;
public class SplashScreen implements Screen {
@@ -97,7 +100,15 @@ public class SplashScreen implements Screen {
private void update() {
if (game.assetManager.update()) {
AssetLoading.registerItems(game.assetManager, game.locale);
- game.setScreen(new MenuScreen(game));
+ if (OsUtils.isAndroid || OsUtils.isIos) {
+ try {
+ game.setScreen(new GameScreen(game, GameDataSystem.load("latest.sav")));
+ } catch (IOException | ClassNotFoundException e) {
+ throw new RuntimeException(e);
+ }
+ } else {
+ game.setScreen(new MenuScreen(game));
+ }
dispose();
}
}