v0.3.4 externalized challenge strings

This commit is contained in:
Evan Debenham 2015-12-30 23:30:13 -05:00 committed by Evan Debenham
parent 82e4a5b9d8
commit c1d55bcd77
3 changed files with 20 additions and 11 deletions

View File

@ -30,14 +30,14 @@ public class Challenges {
public static final int DARKNESS = 32; public static final int DARKNESS = 32;
public static final int NO_SCROLLS = 64; public static final int NO_SCROLLS = 64;
public static final String[] NAMES = { public static final String[] NAME_IDS = {
"On diet", "no_food",
"Faith is my armor", "no_armor",
"Pharmacophobia", "no_healing",
"Barren land", "no_herbalism",
"Swarm intelligence", "swarm_intelligence",
"Into darkness", "darkness",
"Forbidden runes" "no_scrolls"
}; };
public static final int[] MASKS = { public static final int[] MASKS = {

View File

@ -698,3 +698,11 @@ badges$badge.games_played_4=2000 games played
badges$badge.happy_end=Happy end badges$badge.happy_end=Happy end
badges$badge.champion=Challenge won badges$badge.champion=Challenge won
badges$badge.supporter=Thanks for your support! badges$badge.supporter=Thanks for your support!
challenges.no_food=On diet
challenges.no_armor=Faith is my armor
challenges.no_healing=Pharmacophobia
challenges.no_herbalism=Barren land
challenges.swarm_intelligence=Swarm intelligence
challenges.darkness=Into darkness
challenges.no_scrolls=Forbidden runes

View File

@ -22,6 +22,7 @@ package com.shatteredpixel.shatteredpixeldungeon.windows;
import java.util.ArrayList; import java.util.ArrayList;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.watabou.noosa.BitmapText; import com.watabou.noosa.BitmapText;
import com.shatteredpixel.shatteredpixeldungeon.Challenges; import com.shatteredpixel.shatteredpixeldungeon.Challenges;
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
@ -57,9 +58,9 @@ public class WndChallenges extends Window {
boxes = new ArrayList<CheckBox>(); boxes = new ArrayList<CheckBox>();
float pos = TTL_HEIGHT; float pos = TTL_HEIGHT;
for (int i=0; i < Challenges.NAMES.length; i++) { for (int i=0; i < Challenges.NAME_IDS.length; i++) {
CheckBox cb = new CheckBox( Challenges.NAMES[i] ); CheckBox cb = new CheckBox( Messages.get(Challenges.class, Challenges.NAME_IDS[i]) );
cb.checked( (checked & Challenges.MASKS[i]) != 0 ); cb.checked( (checked & Challenges.MASKS[i]) != 0 );
cb.active = editable; cb.active = editable;