From c16ae2ac0bf5e8fca9b812b491b698c03b03e81c Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Thu, 31 Dec 2015 00:13:13 -0500 Subject: [PATCH] v0.3.4 externalized journal strings --- .../shatteredpixeldungeon/Journal.java | 31 +++++++++---------- .../messages/messages.properties | 13 +++++++- .../windows/WndJournal.java | 2 +- 3 files changed, 28 insertions(+), 18 deletions(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/Journal.java b/src/com/shatteredpixel/shatteredpixeldungeon/Journal.java index c9392ef8f..fb480f7d6 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/Journal.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/Journal.java @@ -22,28 +22,27 @@ package com.shatteredpixel.shatteredpixeldungeon; import java.util.ArrayList; +import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.watabou.utils.Bundlable; import com.watabou.utils.Bundle; public class Journal { - public static enum Feature { - WELL_OF_HEALTH ( "Well of Health" ), - WELL_OF_AWARENESS ( "Well of Awareness" ), - WELL_OF_TRANSMUTATION ( "Well of Transmutation" ), - ALCHEMY ( "Alchemy pot" ), - GARDEN ( "Garden" ), - STATUE ( "Animated statue" ), + public enum Feature { + WELL_OF_HEALTH, + WELL_OF_AWARENESS, + WELL_OF_TRANSMUTATION, + ALCHEMY, + GARDEN, + STATUE, - GHOST ( "Sad ghost" ), - WANDMAKER ( "Old wandmaker" ), - TROLL ( "Troll blacksmith" ), - IMP ( "Ambitious imp" ); - - public String desc; - - private Feature( String desc ) { - this.desc = desc; + GHOST, + WANDMAKER, + TROLL, + IMP; + + public String desc() { + return Messages.get(this, name()); } }; diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/messages/messages.properties b/src/com/shatteredpixel/shatteredpixeldungeon/messages/messages.properties index a26680910..77f233808 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/messages/messages.properties +++ b/src/com/shatteredpixel/shatteredpixeldungeon/messages/messages.properties @@ -705,4 +705,15 @@ challenges.no_healing=Pharmacophobia challenges.no_herbalism=Barren land challenges.swarm_intelligence=Swarm intelligence challenges.darkness=Into darkness -challenges.no_scrolls=Forbidden runes \ No newline at end of file +challenges.no_scrolls=Forbidden runes + +journal$feature.well_of_health=Well of Health +journal$feature.well_of_awareness=Well of Awareness +journal$feature.well_of_transmutation=Well of Transmutation +journal$feature.alchemy=Alchemy pot +journal$feature.garden=Garden +journal$feature.statue=Animated statue +journal$feature.ghost=Sad ghost +journal$feature.wandmaker=Old wandmaker +journal$feature.troll=Troll blacksmith +journal$feature.imp=Ambitious imp \ No newline at end of file diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/windows/WndJournal.java b/src/com/shatteredpixel/shatteredpixeldungeon/windows/WndJournal.java index d8d3058ee..54d79add9 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/windows/WndJournal.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/windows/WndJournal.java @@ -88,7 +88,7 @@ public class WndJournal extends Window { public ListItem( Journal.Feature f, int d ) { super(); - feature.text( f.desc ); + feature.text( f.desc() ); feature.measure(); depth.text( Integer.toString( d ) );