From 8797b380db420b0f108332882f525f6cc478d07f Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Mon, 1 Feb 2016 17:27:47 -0500 Subject: [PATCH] v0.3.4: externalized changes and welcome scene strings --- .../messages/scenes/scenes.properties | 8 ++++- .../scenes/ChangesScene.java | 34 ++----------------- .../scenes/WelcomeScene.java | 23 +++++-------- 3 files changed, 17 insertions(+), 48 deletions(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/messages/scenes/scenes.properties b/src/com/shatteredpixel/shatteredpixeldungeon/messages/scenes/scenes.properties index 155be5e97..481d0a696 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/messages/scenes/scenes.properties +++ b/src/com/shatteredpixel/shatteredpixeldungeon/messages/scenes/scenes.properties @@ -6,6 +6,8 @@ scenes.amuletscene.text=You finally hold it in your hands, the Amulet of Yendor. scenes.badgesscene.title=Your Badges +scenes.changesscene.title=Recent Changes + scenes.gamescene.welcome=Welcome to the level %d of Pixel Dungeon! scenes.gamescene.welcome_back=Welcome back to the level %d of Pixel Dungeon! scenes.gamescene.chasm=Your steps echo across the dungeon. @@ -49,4 +51,8 @@ scenes.titlescene.rankings=Rankings scenes.titlescene.badges=Badges scenes.titlescene.about=About -#scenes.welcomescene.= +scenes.welcomescene.welcome_msg=Shattered Pixel Dungeon is a roguelike RPG, with randomly generated enemies, levels, items, and traps!\n\nEach run is a new challenging experience, but be careful, death is permanent!\n\nHappy Dungeoneering! +scenes.welcomescene.update_msg=Look at that, a brand new update page, pretty!\n\nAt this stage there are a few refinements left to be made to the language selection ui and then all the code support for translation will be done.\n\nWe are very close to first release! My goal is to have 0.3.4 released by the end of the week!\n\nWe can make further translation improvements/fixes through patches. +scenes.welcomescene.what_msg=It seems that your current saves are from a future version of Shattered Pixel Dungeon!\n\nTread with caution! Your saves may contain things which don't exist in this version, this could cause some very weird errors to occur. +scenes.welcomescene.continue=Continue +scenes.welcomescene.changelist=Changelist diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/scenes/ChangesScene.java b/src/com/shatteredpixel/shatteredpixeldungeon/scenes/ChangesScene.java index 80c37f75c..51f7e351f 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/scenes/ChangesScene.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/scenes/ChangesScene.java @@ -22,6 +22,7 @@ package com.shatteredpixel.shatteredpixeldungeon.scenes; import com.shatteredpixel.shatteredpixeldungeon.Chrome; import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; +import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.ui.Archs; import com.shatteredpixel.shatteredpixeldungeon.ui.ExitButton; import com.shatteredpixel.shatteredpixeldungeon.ui.ScrollPane; @@ -35,31 +36,6 @@ import com.watabou.noosa.ui.Component; //TODO: update this class with relevant info as new versions come out. public class ChangesScene extends PixelScene { - private static final String TTL_Welcome = "Welcome!"; - - private static final String TTL_Update = "v0.3.3: Google Play Games!"; - - private static final String TTL_Future = "Wait What?"; - - private static final String TXT_Welcome = - "Shattered Pixel Dungeon is a roguelike RPG, with randomly generated enemies, maps, items, and traps!\n" + - "\n" + - "Each run is a new challenging experience, but be careful, death is permanent!\n" + - "\n" + - "Shattered Pixel Dungeon is based on Watabou's Pixel Dungeon, if you're familiar with the original game, here is a list of major changes:\n" + - "- Mage class and wands totally reworked\n" + - "- Rings totally reworked, plus big changes to the rogue\n" + - "- A new category of item: Artifacts!\n" + - "- Enemy, boss, and quest changes to floors 1-10\n" + - "- Subclasses currently being reworked, and are only available after floor 10\n" + - "- Lots of balance changes, including removing degradation\n" + - "- Over 20 new trap types!\n" + - "- A redesigned UI with up to 4 quickslots\n" + - "- Updates with new and reworked content roughly once a month\n" + - "\n" + - "\n" + - "Happy Dungeoneering!"; - private static final String TXT_Update = "v0.3.3b:\n" + "- Fixed start-crash on android 2.2\n" + @@ -96,12 +72,6 @@ public class ChangesScene extends PixelScene { "\n" + "There's a lot of behind-the-scenes technical changes in this update, so let me know if you run into any issues!"; - private static final String TXT_Future = - "It seems that your current saves are from a future version of Shattered Pixel Dungeon!\n\n"+ - "Either you're messing around with older versions of the app, or something has gone buggy.\n\n"+ - "Regardless, tread with caution! Your saves may contain things which don't exist in this version, "+ - "this could cause some very weird errors to occur."; - @Override public void create() { super.create(); @@ -109,7 +79,7 @@ public class ChangesScene extends PixelScene { int w = Camera.main.width; int h = Camera.main.height; - RenderedText title = PixelScene.renderText( "Recent Changes", 9 ); + RenderedText title = PixelScene.renderText( Messages.get(this, "title"), 9 ); title.hardlight(Window.TITLE_COLOR); title.x = (w - title.width()) / 2 ; title.y = 4; diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/scenes/WelcomeScene.java b/src/com/shatteredpixel/shatteredpixeldungeon/scenes/WelcomeScene.java index 7f0f51940..ac0471013 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/scenes/WelcomeScene.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/scenes/WelcomeScene.java @@ -7,6 +7,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Rankings; import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; import com.shatteredpixel.shatteredpixeldungeon.effects.BannerSprites; import com.shatteredpixel.shatteredpixeldungeon.effects.Fireball; +import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton; import com.watabou.noosa.Camera; import com.watabou.noosa.Game; @@ -18,23 +19,13 @@ import javax.microedition.khronos.opengles.GL10; public class WelcomeScene extends PixelScene { - private static final String TXT_Welcome = - "Shattered Pixel Dungeon is a roguelike RPG, with randomly generated enemies, levels, items, and traps!\n" + - "\n" + - "Each run is a new challenging experience, but be careful, death is permanent!\n" + - "\n" + - "Happy Dungeoneering!"; - - private static final String TXT_Update = - "add something here on next update."; - @Override public void create() { super.create(); final int previousVersion = ShatteredPixelDungeon.version(); - if (ShatteredPixelDungeon.versionCode == previousVersion) { + if (ShatteredPixelDungeon.versionCode != previousVersion) { ShatteredPixelDungeon.switchNoFade(TitleScene.class); return; } @@ -75,7 +66,7 @@ public class WelcomeScene extends PixelScene { signs.y = title.y; add( signs ); - DarkRedButton okay = new DarkRedButton("Continue"){ + DarkRedButton okay = new DarkRedButton(Messages.get(this, "continue")){ @Override protected void onClick() { super.onClick(); @@ -85,7 +76,7 @@ public class WelcomeScene extends PixelScene { }; if (previousVersion != 0){ - DarkRedButton changes = new DarkRedButton("Changelist"){ + DarkRedButton changes = new DarkRedButton(Messages.get(this, "changelist")){ @Override protected void onClick() { super.onClick(); @@ -108,9 +99,11 @@ public class WelcomeScene extends PixelScene { RenderedTextMultiline text = PixelScene.renderMultiline(6); if (previousVersion == 0) { - text.text(TXT_Welcome, w - 20); + text.text(Messages.get(this, "welcome_msg"), w - 20); + } else if (previousVersion <= ShatteredPixelDungeon.versionCode) { + text.text(Messages.get(this, "update_msg"), w - 20); } else { - text.text(TXT_Update, w - 20); + text.text(Messages.get(this, "what_msg"), w - 20); } float textSpace = h - title.y - (title.height() - 10) - okay.height() - 2; text.setPos(10, title.y+(title.height() - 10) + ((textSpace - text.height()) / 2));