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.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.Artifact; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.Artifact;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.MissileWeapon; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.MissileWeapon;
import com.shatteredpixel.shatteredpixeldungeon.ui.QuickSlotButton;
import com.watabou.noosa.Game; import com.watabou.noosa.Game;
import com.watabou.utils.Bundle; import com.watabou.utils.Bundle;
import com.watabou.utils.Random; import com.watabou.utils.Random;
@ -182,7 +181,7 @@ public class Bones {
} }
} }
item.syncVisuals(); item.sync();
return item; return item;
} else { } 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 ); Dungeon.level.drop( detachAll( hero.belongings.backpack ), hero.pos ).sprite.drop( hero.pos );
} }
public void syncVisuals(){ //'syncs' an item to be consistent between two separate game instances.
//do nothing by default, as most items need no visual syncing. public void sync(){
//resets the name incase the language has changed.
name = Messages.get(this, "name");
} }
public void doThrow( Hero hero ) { public void doThrow( Hero hero ) {

View File

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

View File

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

View File

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