v0.2.3: improvements to the rankings page
This commit is contained in:
parent
0db40dbf87
commit
872199b43e
BIN
assets/icons.png
BIN
assets/icons.png
Binary file not shown.
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.9 KiB |
|
@ -43,6 +43,8 @@ public enum Rankings {
|
||||||
public ArrayList<Record> records;
|
public ArrayList<Record> records;
|
||||||
public int lastRecord;
|
public int lastRecord;
|
||||||
public int totalNumber;
|
public int totalNumber;
|
||||||
|
|
||||||
|
private boolean saveNeeded = false;
|
||||||
|
|
||||||
public void submit( boolean win ) {
|
public void submit( boolean win ) {
|
||||||
|
|
||||||
|
@ -54,6 +56,8 @@ public enum Rankings {
|
||||||
rec.win = win;
|
rec.win = win;
|
||||||
rec.heroClass = Dungeon.hero.heroClass;
|
rec.heroClass = Dungeon.hero.heroClass;
|
||||||
rec.armorTier = Dungeon.hero.tier();
|
rec.armorTier = Dungeon.hero.tier();
|
||||||
|
rec.herolevel = Dungeon.hero.lvl;
|
||||||
|
rec.depth = Dungeon.depth;
|
||||||
rec.score = score( win );
|
rec.score = score( win );
|
||||||
|
|
||||||
String gameFile = Utils.format( DETAILS_FILE, SystemTime.now );
|
String gameFile = Utils.format( DETAILS_FILE, SystemTime.now );
|
||||||
|
@ -138,7 +142,7 @@ public enum Rankings {
|
||||||
if (totalNumber == 0) {
|
if (totalNumber == 0) {
|
||||||
totalNumber = records.size();
|
totalNumber = records.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -149,6 +153,8 @@ public enum Rankings {
|
||||||
private static final String WIN = "win";
|
private static final String WIN = "win";
|
||||||
private static final String SCORE = "score";
|
private static final String SCORE = "score";
|
||||||
private static final String TIER = "tier";
|
private static final String TIER = "tier";
|
||||||
|
private static final String LEVEL = "level";
|
||||||
|
private static final String DEPTH = "depth";
|
||||||
private static final String GAME = "gameFile";
|
private static final String GAME = "gameFile";
|
||||||
|
|
||||||
public String info;
|
public String info;
|
||||||
|
@ -156,6 +162,8 @@ public enum Rankings {
|
||||||
|
|
||||||
public HeroClass heroClass;
|
public HeroClass heroClass;
|
||||||
public int armorTier;
|
public int armorTier;
|
||||||
|
public int herolevel; //not currently used, but I may want this here in the future.
|
||||||
|
public int depth;
|
||||||
|
|
||||||
public int score;
|
public int score;
|
||||||
|
|
||||||
|
@ -172,6 +180,25 @@ public enum Rankings {
|
||||||
armorTier = bundle.getInt( TIER );
|
armorTier = bundle.getInt( TIER );
|
||||||
|
|
||||||
gameFile = bundle.getString( GAME );
|
gameFile = bundle.getString( GAME );
|
||||||
|
|
||||||
|
//for pre 0.2.3 saves
|
||||||
|
if (!bundle.contains(LEVEL)){
|
||||||
|
try {
|
||||||
|
depth = Integer.parseInt(info.replaceAll("[\\D]", ""));
|
||||||
|
} catch (Exception e) {
|
||||||
|
depth = 0;
|
||||||
|
}
|
||||||
|
info = info.split("on level")[0].trim();
|
||||||
|
try {
|
||||||
|
Dungeon.loadGame(gameFile);
|
||||||
|
herolevel = Dungeon.hero.lvl;
|
||||||
|
} catch (Exception e){
|
||||||
|
herolevel = 0;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
depth = bundle.getInt( DEPTH );
|
||||||
|
herolevel = bundle.getInt( LEVEL );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -183,6 +210,8 @@ public enum Rankings {
|
||||||
|
|
||||||
heroClass.storeInBundle( bundle );
|
heroClass.storeInBundle( bundle );
|
||||||
bundle.put( TIER, armorTier );
|
bundle.put( TIER, armorTier );
|
||||||
|
bundle.put( LEVEL, herolevel );
|
||||||
|
bundle.put( DEPTH, depth );
|
||||||
|
|
||||||
bundle.put( GAME, gameFile );
|
bundle.put( GAME, gameFile );
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,25 +20,25 @@ package com.shatteredpixel.shatteredpixeldungeon;
|
||||||
public class ResultDescriptions {
|
public class ResultDescriptions {
|
||||||
|
|
||||||
// Mobs
|
// Mobs
|
||||||
public static final String MOB = "Killed by %s on level %d";
|
public static final String MOB = "Killed by %s";
|
||||||
public static final String UNIQUE = "Killed by the %s on level %d";
|
public static final String UNIQUE = "Killed by the %s";
|
||||||
public static final String NAMED = "Killed by %s on level %d";
|
public static final String NAMED = "Killed by %s";
|
||||||
|
|
||||||
// Items
|
// Items
|
||||||
public static final String ITEM = "Killed by your own %s on level %d";
|
public static final String ITEM = "Killed by your own %s";
|
||||||
public static final String GLYPH = "Killed by the %s on level %d";
|
public static final String GLYPH = "Killed by the %s";
|
||||||
|
|
||||||
// Dungeon features
|
// Dungeon features
|
||||||
public static final String TRAP = "Killed by a %s on level %d";
|
public static final String TRAP = "Killed by a %s";
|
||||||
|
|
||||||
// Debuffs & blobs
|
// Debuffs & blobs
|
||||||
public static final String BURNING = "Burned to death on level %d";
|
public static final String BURNING = "Burned to Ash";
|
||||||
public static final String HUNGER = "Starved to death on level %d";
|
public static final String HUNGER = "Starved to Death";
|
||||||
public static final String POISON = "Died from poison on level %d";
|
public static final String POISON = "Succumbed to Poison";
|
||||||
public static final String GAS = "Died from toxic gas on level %d";
|
public static final String GAS = "Asphyxiated";
|
||||||
public static final String BLEEDING = "Bled to death on level %d";
|
public static final String BLEEDING = "Bled to Death";
|
||||||
public static final String OOZE = "Corroded to death on level %d";
|
public static final String OOZE = "Melted Away";
|
||||||
public static final String FALL = "Fell to death on level %d";
|
public static final String FALL = "Died on Impact";
|
||||||
|
|
||||||
public static final String WIN = "Obtained the Amulet of Yendor";
|
public static final String WIN = "Obtained the Amulet of Yendor";
|
||||||
}
|
}
|
||||||
|
|
|
@ -159,12 +159,11 @@ public abstract class Char extends Actor {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if ( this instanceof Yog ) {
|
if ( this instanceof Yog ) {
|
||||||
Dungeon.fail( Utils.format( ResultDescriptions.NAMED, name, Dungeon.depth ) );
|
Dungeon.fail( Utils.format( ResultDescriptions.NAMED, name) );
|
||||||
} if (Bestiary.isUnique( this )) {
|
} if (Bestiary.isUnique( this )) {
|
||||||
Dungeon.fail( Utils.format( ResultDescriptions.UNIQUE, name, Dungeon.depth ) );
|
Dungeon.fail( Utils.format( ResultDescriptions.UNIQUE, name) );
|
||||||
} else {
|
} else {
|
||||||
Dungeon.fail( Utils.format( ResultDescriptions.MOB,
|
Dungeon.fail( Utils.format( ResultDescriptions.MOB, Utils.indefinite( name )) );
|
||||||
Utils.indefinite( name ), Dungeon.depth ) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GLog.n( TXT_KILL, name );
|
GLog.n( TXT_KILL, name );
|
||||||
|
|
|
@ -68,7 +68,7 @@ public class ToxicGas extends Blob implements Hero.Doom {
|
||||||
|
|
||||||
Badges.validateDeathFromGas();
|
Badges.validateDeathFromGas();
|
||||||
|
|
||||||
Dungeon.fail( Utils.format( ResultDescriptions.GAS, Dungeon.depth ) );
|
Dungeon.fail( ResultDescriptions.GAS );
|
||||||
GLog.n( "You died from a toxic gas.." );
|
GLog.n( "You died from a toxic gas.." );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,7 +73,7 @@ public class Bleeding extends Buff {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (target == Dungeon.hero && !target.isAlive()) {
|
if (target == Dungeon.hero && !target.isAlive()) {
|
||||||
Dungeon.fail( Utils.format( ResultDescriptions.BLEEDING, Dungeon.depth ) );
|
Dungeon.fail( ResultDescriptions.BLEEDING );
|
||||||
GLog.n( "You bled to death..." );
|
GLog.n( "You bled to death..." );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -148,7 +148,7 @@ public class Burning extends Buff implements Hero.Doom {
|
||||||
|
|
||||||
Badges.validateDeathFromFire();
|
Badges.validateDeathFromFire();
|
||||||
|
|
||||||
Dungeon.fail( Utils.format( ResultDescriptions.BURNING, Dungeon.depth ) );
|
Dungeon.fail( ResultDescriptions.BURNING );
|
||||||
GLog.n( TXT_BURNED_TO_DEATH );
|
GLog.n( TXT_BURNED_TO_DEATH );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -153,7 +153,7 @@ public class Hunger extends Buff implements Hero.Doom {
|
||||||
|
|
||||||
Badges.validateDeathFromHunger();
|
Badges.validateDeathFromHunger();
|
||||||
|
|
||||||
Dungeon.fail( Utils.format( ResultDescriptions.HUNGER, Dungeon.depth ) );
|
Dungeon.fail( ResultDescriptions.HUNGER );
|
||||||
GLog.n( TXT_DEATH );
|
GLog.n( TXT_DEATH );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@ public class Ooze extends Buff {
|
||||||
else if (Random.Int(2) == 0)
|
else if (Random.Int(2) == 0)
|
||||||
target.damage( 1, this );
|
target.damage( 1, this );
|
||||||
if (!target.isAlive() && target == Dungeon.hero) {
|
if (!target.isAlive() && target == Dungeon.hero) {
|
||||||
Dungeon.fail( Utils.format( ResultDescriptions.OOZE, Dungeon.depth ) );
|
Dungeon.fail( ResultDescriptions.OOZE );
|
||||||
GLog.n( TXT_HERO_KILLED, toString() );
|
GLog.n( TXT_HERO_KILLED, toString() );
|
||||||
}
|
}
|
||||||
spend( TICK );
|
spend( TICK );
|
||||||
|
|
|
@ -90,7 +90,7 @@ public class Poison extends Buff implements Hero.Doom {
|
||||||
public void onDeath() {
|
public void onDeath() {
|
||||||
Badges.validateDeathFromPoison();
|
Badges.validateDeathFromPoison();
|
||||||
|
|
||||||
Dungeon.fail( Utils.format( ResultDescriptions.POISON, Dungeon.depth ) );
|
Dungeon.fail( ResultDescriptions.POISON );
|
||||||
GLog.n( "You died from poison..." );
|
GLog.n( "You died from poison..." );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -132,7 +132,7 @@ public class Eye extends Mob {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ch.isAlive() && ch == Dungeon.hero) {
|
if (!ch.isAlive() && ch == Dungeon.hero) {
|
||||||
Dungeon.fail( Utils.format( ResultDescriptions.MOB, Utils.indefinite( name ), Dungeon.depth ) );
|
Dungeon.fail( Utils.format( ResultDescriptions.MOB, Utils.indefinite( name ) ) );
|
||||||
GLog.n( TXT_DEATHGAZE_KILLED, name );
|
GLog.n( TXT_DEATHGAZE_KILLED, name );
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -106,8 +106,7 @@ public class Shaman extends Mob implements Callback {
|
||||||
Camera.main.shake( 2, 0.3f );
|
Camera.main.shake( 2, 0.3f );
|
||||||
|
|
||||||
if (!enemy.isAlive()) {
|
if (!enemy.isAlive()) {
|
||||||
Dungeon.fail( Utils.format( ResultDescriptions.MOB,
|
Dungeon.fail( Utils.format( ResultDescriptions.MOB, Utils.indefinite( name ) ) );
|
||||||
Utils.indefinite( name ), Dungeon.depth ) );
|
|
||||||
GLog.n( TXT_LIGHTNING_KILLED, name );
|
GLog.n( TXT_LIGHTNING_KILLED, name );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,7 +78,7 @@ public class Skeleton extends Mob {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (heroKilled) {
|
if (heroKilled) {
|
||||||
Dungeon.fail( Utils.format( ResultDescriptions.MOB, Utils.indefinite( name ), Dungeon.depth ) );
|
Dungeon.fail( Utils.format( ResultDescriptions.MOB, Utils.indefinite( name ) ) );
|
||||||
GLog.n( TXT_HERO_KILLED );
|
GLog.n( TXT_HERO_KILLED );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -108,8 +108,7 @@ public class Warlock extends Mob implements Callback {
|
||||||
enemy.damage( dmg, this );
|
enemy.damage( dmg, this );
|
||||||
|
|
||||||
if (!enemy.isAlive() && enemy == Dungeon.hero) {
|
if (!enemy.isAlive() && enemy == Dungeon.hero) {
|
||||||
Dungeon.fail( Utils.format( ResultDescriptions.MOB,
|
Dungeon.fail( Utils.format( ResultDescriptions.MOB, Utils.indefinite( name ) ) );
|
||||||
Utils.indefinite( name ), Dungeon.depth ) );
|
|
||||||
GLog.n( TXT_SHADOWBOLT_KILLED, name );
|
GLog.n( TXT_SHADOWBOLT_KILLED, name );
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -335,7 +335,7 @@ public class Yog extends Mob {
|
||||||
enemy.sprite.flash();
|
enemy.sprite.flash();
|
||||||
|
|
||||||
if (!enemy.isAlive() && enemy == Dungeon.hero) {
|
if (!enemy.isAlive() && enemy == Dungeon.hero) {
|
||||||
Dungeon.fail( Utils.format( ResultDescriptions.UNIQUE, name, Dungeon.depth ) );
|
Dungeon.fail( Utils.format( ResultDescriptions.UNIQUE, name ) );
|
||||||
GLog.n( TXT_KILL, name );
|
GLog.n( TXT_KILL, name );
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -127,7 +127,7 @@ public class Viscosity extends Glyph {
|
||||||
if (target == Dungeon.hero && !target.isAlive()) {
|
if (target == Dungeon.hero && !target.isAlive()) {
|
||||||
// FIXME
|
// FIXME
|
||||||
Glyph glyph = new Viscosity();
|
Glyph glyph = new Viscosity();
|
||||||
Dungeon.fail( Utils.format( ResultDescriptions.GLYPH, glyph.name(), Dungeon.depth ) );
|
Dungeon.fail( Utils.format( ResultDescriptions.GLYPH, glyph.name() ) );
|
||||||
GLog.n( "%s killed you...", glyph.name() );
|
GLog.n( "%s killed you...", glyph.name() );
|
||||||
|
|
||||||
Badges.validateDeathFromGlyph();
|
Badges.validateDeathFromGlyph();
|
||||||
|
|
|
@ -107,7 +107,7 @@ public class ChaliceOfBlood extends Artifact {
|
||||||
hero.damage(damage, this);
|
hero.damage(damage, this);
|
||||||
|
|
||||||
if (!hero.isAlive()) {
|
if (!hero.isAlive()) {
|
||||||
Dungeon.fail(Utils.format(ResultDescriptions.ITEM, name, Dungeon.depth));
|
Dungeon.fail(Utils.format( ResultDescriptions.ITEM, name ));
|
||||||
GLog.n("The Chalice sucks your life essence dry...");
|
GLog.n("The Chalice sucks your life essence dry...");
|
||||||
} else {
|
} else {
|
||||||
upgrade();
|
upgrade();
|
||||||
|
|
|
@ -64,7 +64,7 @@ public class ScrollOfPsionicBlast extends Scroll {
|
||||||
curUser.spendAndNext( TIME_TO_READ );
|
curUser.spendAndNext( TIME_TO_READ );
|
||||||
|
|
||||||
if (!curUser.isAlive()) {
|
if (!curUser.isAlive()) {
|
||||||
Dungeon.fail(Utils.format(ResultDescriptions.ITEM, name, Dungeon.depth));
|
Dungeon.fail( Utils.format(ResultDescriptions.ITEM, name ));
|
||||||
GLog.n("The Psionic Blast tears your mind apart...");
|
GLog.n("The Psionic Blast tears your mind apart...");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,7 +81,7 @@ public class WandOfAvalanche extends Wand {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!curUser.isAlive()) {
|
if (!curUser.isAlive()) {
|
||||||
Dungeon.fail( Utils.format( ResultDescriptions.ITEM, name, Dungeon.depth ) );
|
Dungeon.fail( Utils.format( ResultDescriptions.ITEM, name ) );
|
||||||
GLog.n( "You killed yourself with your own Wand of Avalanche..." );
|
GLog.n( "You killed yourself with your own Wand of Avalanche..." );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,7 +66,7 @@ public class WandOfFirebolt extends Wand {
|
||||||
ch.sprite.emitter().burst( FlameParticle.FACTORY, 5 );
|
ch.sprite.emitter().burst( FlameParticle.FACTORY, 5 );
|
||||||
|
|
||||||
if (ch == curUser && !ch.isAlive()) {
|
if (ch == curUser && !ch.isAlive()) {
|
||||||
Dungeon.fail( Utils.format( ResultDescriptions.ITEM, name, Dungeon.depth ) );
|
Dungeon.fail( Utils.format( ResultDescriptions.ITEM, name ) );
|
||||||
GLog.n( "You killed yourself with your own Wand of Firebolt..." );
|
GLog.n( "You killed yourself with your own Wand of Firebolt..." );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,7 @@ public class WandOfLightning extends Wand {
|
||||||
protected void onZap( int cell ) {
|
protected void onZap( int cell ) {
|
||||||
|
|
||||||
if (!curUser.isAlive()) {
|
if (!curUser.isAlive()) {
|
||||||
Dungeon.fail( Utils.format( ResultDescriptions.ITEM, name, Dungeon.depth ) );
|
Dungeon.fail( Utils.format( ResultDescriptions.ITEM, name ) );
|
||||||
GLog.n( "You killed yourself with your own Wand of Lightning..." );
|
GLog.n( "You killed yourself with your own Wand of Lightning..." );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,7 +78,7 @@ public class WandOfMagicMissile extends Wand {
|
||||||
ch.sprite.burst( 0xFF99CCFF, level / 2 + 2 );
|
ch.sprite.burst( 0xFF99CCFF, level / 2 + 2 );
|
||||||
|
|
||||||
if (ch == curUser && !ch.isAlive()) {
|
if (ch == curUser && !ch.isAlive()) {
|
||||||
Dungeon.fail( Utils.format( ResultDescriptions.ITEM, name, Dungeon.depth ) );
|
Dungeon.fail( Utils.format( ResultDescriptions.ITEM, name ) );
|
||||||
GLog.n( "You killed yourself with your own Wand of Magic Missile..." );
|
GLog.n( "You killed yourself with your own Wand of Magic Missile..." );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -104,7 +104,7 @@ public class Chasm {
|
||||||
public void onDeath() {
|
public void onDeath() {
|
||||||
Badges.validateDeathFromFalling();
|
Badges.validateDeathFromFalling();
|
||||||
|
|
||||||
Dungeon.fail( Utils.format( ResultDescriptions.FALL, Dungeon.depth ) );
|
Dungeon.fail( ResultDescriptions.FALL );
|
||||||
GLog.n( "You fell to death..." );
|
GLog.n( "You fell to death..." );
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
|
|
@ -45,7 +45,7 @@ public class LightningTrap {
|
||||||
Camera.main.shake( 2, 0.3f );
|
Camera.main.shake( 2, 0.3f );
|
||||||
|
|
||||||
if (!ch.isAlive()) {
|
if (!ch.isAlive()) {
|
||||||
Dungeon.fail( Utils.format( ResultDescriptions.TRAP, name, Dungeon.depth ) );
|
Dungeon.fail( Utils.format( ResultDescriptions.TRAP, name ) );
|
||||||
GLog.n( "You were killed by a discharge of a lightning trap..." );
|
GLog.n( "You were killed by a discharge of a lightning trap..." );
|
||||||
} else {
|
} else {
|
||||||
((Hero)ch).belongings.charge( false );
|
((Hero)ch).belongings.charge( false );
|
||||||
|
|
|
@ -138,7 +138,10 @@ public class RankingsScene extends PixelScene {
|
||||||
private Flare flare;
|
private Flare flare;
|
||||||
private BitmapText position;
|
private BitmapText position;
|
||||||
private BitmapTextMultiline desc;
|
private BitmapTextMultiline desc;
|
||||||
|
private Image steps;
|
||||||
|
private BitmapText depth;
|
||||||
private Image classIcon;
|
private Image classIcon;
|
||||||
|
private BitmapText level;
|
||||||
|
|
||||||
public Record( int pos, boolean latest, Rankings.Record rec ) {
|
public Record( int pos, boolean latest, Rankings.Record rec ) {
|
||||||
super();
|
super();
|
||||||
|
@ -168,9 +171,29 @@ public class RankingsScene extends PixelScene {
|
||||||
shield.view( ItemSpriteSheet.AMULET, null );
|
shield.view( ItemSpriteSheet.AMULET, null );
|
||||||
position.hardlight( TEXT_WIN[odd] );
|
position.hardlight( TEXT_WIN[odd] );
|
||||||
desc.hardlight( TEXT_WIN[odd] );
|
desc.hardlight( TEXT_WIN[odd] );
|
||||||
|
depth.hardlight( TEXT_WIN[odd] );
|
||||||
|
level.hardlight( TEXT_WIN[odd] );
|
||||||
} else {
|
} else {
|
||||||
position.hardlight( TEXT_LOSE[odd] );
|
position.hardlight( TEXT_LOSE[odd] );
|
||||||
desc.hardlight( TEXT_LOSE[odd] );
|
desc.hardlight( TEXT_LOSE[odd] );
|
||||||
|
depth.hardlight( TEXT_LOSE[odd] );
|
||||||
|
level.hardlight( TEXT_LOSE[odd] );
|
||||||
|
|
||||||
|
if (rec.depth != 0){
|
||||||
|
depth.text( Integer.toString(rec.depth) );
|
||||||
|
depth.measure();
|
||||||
|
steps.copy(Icons.DEPTH_LG.get());
|
||||||
|
|
||||||
|
add(steps);
|
||||||
|
add(depth);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rec.herolevel != 0){
|
||||||
|
level.text( Integer.toString(rec.herolevel) );
|
||||||
|
level.measure();
|
||||||
|
add(level);
|
||||||
}
|
}
|
||||||
|
|
||||||
classIcon.copy( Icons.get( rec.heroClass ) );
|
classIcon.copy( Icons.get( rec.heroClass ) );
|
||||||
|
@ -185,13 +208,22 @@ public class RankingsScene extends PixelScene {
|
||||||
add( shield );
|
add( shield );
|
||||||
|
|
||||||
position = new BitmapText( PixelScene.font1x );
|
position = new BitmapText( PixelScene.font1x );
|
||||||
|
position.alpha(0.8f);
|
||||||
add( position );
|
add( position );
|
||||||
|
|
||||||
desc = createMultiline( 9 );
|
desc = createMultiline( 9 );
|
||||||
add( desc );
|
add( desc );
|
||||||
|
|
||||||
|
depth = new BitmapText( PixelScene.font1x );
|
||||||
|
depth.alpha(0.8f);
|
||||||
|
|
||||||
|
steps = new Image();
|
||||||
|
|
||||||
classIcon = new Image();
|
classIcon = new Image();
|
||||||
add( classIcon );
|
add( classIcon );
|
||||||
|
|
||||||
|
level = new BitmapText( PixelScene.font1x );
|
||||||
|
level.alpha(0.8f);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -208,12 +240,21 @@ public class RankingsScene extends PixelScene {
|
||||||
if (flare != null) {
|
if (flare != null) {
|
||||||
flare.point( shield.center() );
|
flare.point( shield.center() );
|
||||||
}
|
}
|
||||||
|
|
||||||
classIcon.x = align( x + width - classIcon.width );
|
classIcon.x = align(x + width - classIcon.width);
|
||||||
classIcon.y = shield.y;
|
classIcon.y = shield.y;
|
||||||
|
|
||||||
|
level.x = align( classIcon.x + (classIcon.width - level.width()) / 2 );
|
||||||
|
level.y = align( classIcon.y + (classIcon.height - level.height()) / 2 + 1 );
|
||||||
|
|
||||||
|
steps.x = align(x + width - steps.width - classIcon.width);
|
||||||
|
steps.y = shield.y;
|
||||||
|
|
||||||
|
depth.x = align( steps.x + (steps.width - depth.width()) / 2 );
|
||||||
|
depth.y = align( steps.y + (steps.height - depth.height()) / 2 + 1 );
|
||||||
|
|
||||||
desc.x = shield.x + shield.width + GAP;
|
desc.x = shield.x + shield.width + GAP;
|
||||||
desc.maxWidth = (int)(classIcon.x - desc.x);
|
desc.maxWidth = (int)(steps.x - desc.x);
|
||||||
desc.measure();
|
desc.measure();
|
||||||
desc.y = align( shield.y + (shield.height - desc.height()) / 2 + 1 );
|
desc.y = align( shield.y + (shield.height - desc.height()) / 2 + 1 );
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,6 +39,7 @@ public enum Icons {
|
||||||
HUNTRESS,
|
HUNTRESS,
|
||||||
CLOSE,
|
CLOSE,
|
||||||
DEPTH,
|
DEPTH,
|
||||||
|
DEPTH_LG,
|
||||||
SLEEP,
|
SLEEP,
|
||||||
ALERT,
|
ALERT,
|
||||||
BACKPACK,
|
BACKPACK,
|
||||||
|
@ -106,6 +107,9 @@ public enum Icons {
|
||||||
case DEPTH:
|
case DEPTH:
|
||||||
icon.frame( icon.texture.uvRect( 45, 12, 54, 20 ) );
|
icon.frame( icon.texture.uvRect( 45, 12, 54, 20 ) );
|
||||||
break;
|
break;
|
||||||
|
case DEPTH_LG:
|
||||||
|
icon.frame( icon.texture.uvRect( 34, 46, 50, 62 ) );
|
||||||
|
break;
|
||||||
case SLEEP:
|
case SLEEP:
|
||||||
icon.frame( icon.texture.uvRect( 13, 45, 22, 53 ) );
|
icon.frame( icon.texture.uvRect( 13, 45, 22, 53 ) );
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user