From d52d9bec818384d1441306b14aca3f2638db8503 Mon Sep 17 00:00:00 2001 From: Anuken Date: Mon, 19 Feb 2018 20:44:14 -0500 Subject: [PATCH] Added warning message for upgrading users of the game --- core/assets/bundles/bundle.properties | 1 + core/assets/version.properties | 2 +- core/src/io/anuke/mindustry/core/Control.java | 23 +++++++++++++++++-- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index e41cf25858..eb860705bf 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -1,5 +1,6 @@ text.about=Created by [ROYAL]Anuken.[]\nOriginally an entry in the [orange]GDL[] MM Jam.\n\nCredits:\n- SFX made with [YELLOW]bfxr[]\n- Music made by [GREEN]RoccoW[] / found on [lime]FreeMusicArchive.org[]\n\nSpecial thanks to:\n- [coral]MitchellFJN[]: extensive playtesting and feedback\n- [sky]Luxray5474[]: wiki work, code contributions\n- All the beta testers on itch.io and Google Play\n text.discord=Join the mindustry discord! +text.changes=[SCARLET]Attention!\n[]Some important game mechanics have been changed.\n\n- [accent]Teleporters[] now use power.\n- [accent]Smelteries[] and [accent]crucibles[] now have a maximum item capacity.\n- [accent]Crucibles[] now require coal as fuel. text.gameover=The core was destroyed. text.highscore=[YELLOW]New highscore! text.lasted=You lasted until wave diff --git a/core/assets/version.properties b/core/assets/version.properties index 7dbcdf0698..2404c816db 100644 --- a/core/assets/version.properties +++ b/core/assets/version.properties @@ -1,5 +1,5 @@ #Autogenerated file. Do not modify. -#Mon Feb 19 20:13:04 EST 2018 +#Mon Feb 19 20:43:00 EST 2018 version=beta androidBuildCode=248 name=Mindustry diff --git a/core/src/io/anuke/mindustry/core/Control.java b/core/src/io/anuke/mindustry/core/Control.java index 0cffe6365d..7528e67520 100644 --- a/core/src/io/anuke/mindustry/core/Control.java +++ b/core/src/io/anuke/mindustry/core/Control.java @@ -119,7 +119,8 @@ public class Control extends Module{ "port", port+"", "name", android || gwt ? "player" : UCore.getProperty("user.name"), "servers", "", - "color", Color.rgba8888(playerColors[8]) + "color", Color.rgba8888(playerColors[8]), + "lastVersion", "3.2" ); KeyBinds.load(); @@ -245,6 +246,23 @@ public class Control extends Module{ return tutorial; } + private void checkOldUser(){ + boolean hasPlayed = false; + + for(Map map : world.maps().getAllMaps()){ + if(Settings.getInt("hiscore" + map.name) != 0){ + hasPlayed = true; + break; + } + } + + if(hasPlayed && Settings.getString("lastVersion").equals("3.2")){ + Timers.runTask(1f, () -> ui.showInfo("$text.changes")); + Settings.putString("lastVersion", "3.3"); + Settings.save(); + } + } + @Override public void dispose(){ Platform.instance.onGameExit(); @@ -269,10 +287,11 @@ public class Control extends Module{ Timers.run(1f, Musics::shuffleAll); Entities.initPhysics(); - Entities.collisions().setCollider(tilesize, world::solid); Platform.instance.updateRPC(); + + checkOldUser(); } @Override