From 0bcaba7a7ce6c4af1e948e443b31f45c7c67404d Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Wed, 4 Nov 2015 02:23:44 -0500 Subject: [PATCH] v0.3.2: implemented notification window for mastery book changes --- .../scenes/TitleScene.java | 54 +++++++++++++++---- 1 file changed, 43 insertions(+), 11 deletions(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/scenes/TitleScene.java b/src/com/shatteredpixel/shatteredpixeldungeon/scenes/TitleScene.java index 2efec2a87..e3a9ec103 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/scenes/TitleScene.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/scenes/TitleScene.java @@ -24,7 +24,11 @@ import javax.microedition.khronos.opengles.GL10; import android.opengl.GLES20; +import com.shatteredpixel.shatteredpixeldungeon.Badges; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.ui.ChangesButton; +import com.shatteredpixel.shatteredpixeldungeon.windows.WndHardNotification; import com.watabou.noosa.BitmapText; import com.watabou.noosa.Camera; import com.watabou.noosa.Game; @@ -53,17 +57,6 @@ public class TitleScene extends PixelScene { super.create(); - - int gameversion = ShatteredPixelDungeon.version(); - - if (gameversion != Game.versionCode) { - //new intro, make older players see it again. - if (gameversion < 9) - ShatteredPixelDungeon.intro(true); - Game.switchScene(WelcomeScene.class); - return; - } - Music.INSTANCE.play( Assets.THEME, true ); Music.INSTANCE.volume( ShatteredPixelDungeon.musicVol() / 10f ); @@ -169,6 +162,45 @@ public class TitleScene extends PixelScene { ExitButton btnExit = new ExitButton(); btnExit.setPos( w - btnExit.width(), 0 ); add( btnExit ); + + int gameversion = ShatteredPixelDungeon.version(); + + if (gameversion != Game.versionCode) { + if (gameversion < 65){ + //TODO special code for 0.3.2 update to notify people about mastery book changes. Remove when not needed + Badges.loadGlobal(); + + if (Badges.isUnlocked(Badges.Badge.MASTERY_WARRIOR) || + Badges.isUnlocked(Badges.Badge.MASTERY_ROGUE) || + Badges.isUnlocked(Badges.Badge.MASTERY_MAGE) || + Badges.isUnlocked(Badges.Badge.MASTERY_HUNTRESS) ){ + add(new WndHardNotification(new ItemSprite(ItemSpriteSheet.MASTERY, null), + "Mastery Book Changes", + "v0.3.2 brings new prison content and some big balance changes to subclasses:\n" + + "\n" + + "_The Book of Mastery is no longer given at floor 1, it is only dropped by Tengu._\n" + + "\n" + + "There have been balance tweaks to accommodate this, so the difficulty should be similar.\n" + + "\n" + + "This change is necessary to allow for more interesting subclasses in the future, " + + "apologies for any frustration.", + "See All Changes", 10){ + @Override + public void hide() { + super.hide(); + Game.switchScene(WelcomeScene.class); + } + } + ); + } else { + Game.switchScene(WelcomeScene.class); + return; + } + } else { + Game.switchScene(WelcomeScene.class); + return; + } + } fadeIn(); }