v0.6.5: fixed issues with previous badge changes

This commit is contained in:
Evan Debenham 2018-04-26 01:14:55 -04:00 committed by Evan Debenham
parent cd5aabf49c
commit 9c1658abc1
2 changed files with 15 additions and 3 deletions

View File

@ -39,6 +39,7 @@ import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
@ -183,6 +184,12 @@ public class Badges {
"RARE_SENIOR", "RARE_ACIDIC", "RARE", "TUTORIAL_WARRIOR", "TUTORIAL_MAGE"));
}
private static final HashMap<String, String> renamedBadges = new HashMap<>();
static{
//0.6.5
renamedBadges.put("CHAMPION", "CHAMPION_1");
}
private static HashSet<Badge> restore( Bundle bundle ) {
HashSet<Badge> badges = new HashSet<Badge>();
if (bundle == null) return badges;
@ -190,6 +197,9 @@ public class Badges {
String[] names = bundle.getStringArray( BADGES );
for (int i=0; i < names.length; i++) {
try {
if (renamedBadges.containsKey(names[i])){
names[i] = renamedBadges.get(names[i]);
}
if (!removedBadges.contains(names[i])){
badges.add( Badge.valueOf( names[i] ) );
}

View File

@ -62,7 +62,9 @@ badges$badge.games_played_2=50 games played
badges$badge.games_played_3=250 games played
badges$badge.games_played_4=1000 games played
badges$badge.happy_end=Happy end
badges$badge.champion=Challenge won
badges$badge.champion_1=Won with a Challenge
badges$badge.champion_2=Won with 3 Challenges
badges$badge.champion_3=Won with 6 Challenges
challenges.no_food=On diet
challenges.no_food_desc=Food is scarce, so make every bite count!\n\n- Regular rations and pasties are replaced with small rations\n- Mystery meat and blandfruit are removed\n- Horn of Plenty is removed