v0.9.0: fixed errors with trap names and switching languages
This commit is contained in:
parent
35ea6504b7
commit
c273f30f72
|
@ -945,7 +945,7 @@ public abstract class Level implements Bundlable {
|
||||||
case Terrain.SECRET_TRAP:
|
case Terrain.SECRET_TRAP:
|
||||||
if (hard) {
|
if (hard) {
|
||||||
trap = traps.get( cell );
|
trap = traps.get( cell );
|
||||||
GLog.i(Messages.get(Level.class, "hidden_trap", trap.name));
|
GLog.i(Messages.get(Level.class, "hidden_trap", trap.name()));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -689,7 +689,7 @@ public class NewPrisonBossLevel extends Level {
|
||||||
public String name(int tileX, int tileY) {
|
public String name(int tileX, int tileY) {
|
||||||
int cell = (this.tileX+tileX) + Dungeon.level.width()*(this.tileY+tileY);
|
int cell = (this.tileX+tileX) + Dungeon.level.width()*(this.tileY+tileY);
|
||||||
if (Dungeon.level.traps.get(cell) != null){
|
if (Dungeon.level.traps.get(cell) != null){
|
||||||
return Messages.titleCase(Dungeon.level.traps.get(cell).name);
|
return Messages.titleCase(Dungeon.level.traps.get(cell).name());
|
||||||
}
|
}
|
||||||
return super.name(tileX, tileY);
|
return super.name(tileX, tileY);
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,8 +51,6 @@ public abstract class Trap implements Bundlable {
|
||||||
public static final int CROSSHAIR = 5;
|
public static final int CROSSHAIR = 5;
|
||||||
public static final int LARGE_DOT = 6;
|
public static final int LARGE_DOT = 6;
|
||||||
|
|
||||||
public String name = Messages.get(this, "name");
|
|
||||||
|
|
||||||
public int color;
|
public int color;
|
||||||
public int shape;
|
public int shape;
|
||||||
|
|
||||||
|
@ -103,6 +101,14 @@ public abstract class Trap implements Bundlable {
|
||||||
Dungeon.level.disarmTrap(pos);
|
Dungeon.level.disarmTrap(pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String name(){
|
||||||
|
return Messages.get(this, "name");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String desc() {
|
||||||
|
return Messages.get(this, "desc");
|
||||||
|
}
|
||||||
|
|
||||||
private static final String POS = "pos";
|
private static final String POS = "pos";
|
||||||
private static final String VISIBLE = "visible";
|
private static final String VISIBLE = "visible";
|
||||||
private static final String ACTIVE = "active";
|
private static final String ACTIVE = "active";
|
||||||
|
@ -122,8 +128,4 @@ public abstract class Trap implements Bundlable {
|
||||||
bundle.put( VISIBLE, visible );
|
bundle.put( VISIBLE, visible );
|
||||||
bundle.put( ACTIVE, active );
|
bundle.put( ACTIVE, active );
|
||||||
}
|
}
|
||||||
|
|
||||||
public String desc() {
|
|
||||||
return Messages.get(this, "desc");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1091,7 +1091,7 @@ public class GameScene extends PixelScene {
|
||||||
Trap trap = Dungeon.level.traps.get( cell );
|
Trap trap = Dungeon.level.traps.get( cell );
|
||||||
if (trap != null && trap.visible) {
|
if (trap != null && trap.visible) {
|
||||||
objects.add(trap);
|
objects.add(trap);
|
||||||
names.add(Messages.titleCase( trap.name ));
|
names.add(Messages.titleCase( trap.name() ));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (objects.isEmpty()) {
|
if (objects.isEmpty()) {
|
||||||
|
|
|
@ -31,7 +31,7 @@ public class WndInfoTrap extends WndTitledMessage {
|
||||||
public WndInfoTrap(Trap trap) {
|
public WndInfoTrap(Trap trap) {
|
||||||
|
|
||||||
super(TerrainFeaturesTilemap.tile( trap.pos, Dungeon.level.map[trap.pos]),
|
super(TerrainFeaturesTilemap.tile( trap.pos, Dungeon.level.map[trap.pos]),
|
||||||
Messages.titleCase(trap.name),
|
Messages.titleCase(trap.name()),
|
||||||
(!trap.active ? Messages.get(WndInfoTrap.class, "inactive") + "\n\n" : "") + trap.desc());
|
(!trap.active ? Messages.get(WndInfoTrap.class, "inactive") + "\n\n" : "") + trap.desc());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user