v0.3.4: fixed item names being in different languages in bones

This commit is contained in:
Evan Debenham 2016-01-19 01:16:11 -05:00 committed by Evan Debenham
parent 4b6ae663f7
commit b070cb0c6a
5 changed files with 15 additions and 11 deletions

View File

@ -26,7 +26,6 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Gold;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.Artifact;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.MissileWeapon;
import com.shatteredpixel.shatteredpixeldungeon.ui.QuickSlotButton;
import com.watabou.noosa.Game;
import com.watabou.utils.Bundle;
import com.watabou.utils.Random;
@ -43,7 +42,7 @@ public class Bones {
private static final String LEVEL = "level";
private static final String ITEM = "item";
private static int depth = -1;
private static Item item;
@ -182,7 +181,7 @@ public class Bones {
}
}
item.syncVisuals();
item.sync();
return item;
} else {

View File

@ -118,8 +118,10 @@ public class Item implements Bundlable {
Dungeon.level.drop( detachAll( hero.belongings.backpack ), hero.pos ).sprite.drop( hero.pos );
}
public void syncVisuals(){
//do nothing by default, as most items need no visual syncing.
//'syncs' an item to be consistent between two separate game instances.
public void sync(){
//resets the name incase the language has changed.
name = Messages.get(this, "name");
}
public void doThrow( Hero hero ) {

View File

@ -112,11 +112,12 @@ public class Potion extends Item {
public Potion() {
super();
syncVisuals();
sync();
}
@Override
public void syncVisuals(){
public void sync(){
super.sync();
image = handler.image( this );
color = handler.label( this );
};

View File

@ -99,10 +99,11 @@ public class Ring extends KindofMisc {
public Ring() {
super();
syncVisuals();
sync();
}
public void syncVisuals() {
public void sync() {
super.sync();
image = handler.image( this );
gem = handler.label( this );
}

View File

@ -100,11 +100,12 @@ public abstract class Scroll extends Item {
public Scroll() {
super();
syncVisuals();
sync();
}
@Override
public void syncVisuals(){
public void sync(){
super.sync();
image = handler.image( this );
rune = handler.label( this );
};