V0.2.1 : Added alternate title text to appropriate locations for Sub-Reddit modding distinctions. Standardized alternate text color int global variable. Added hero icon to hero display. make about scene flare less flashy.

This commit is contained in:
Evan Debenham 2014-10-12 00:03:23 -04:00
parent 12e2f13808
commit ad32c4d984
5 changed files with 30 additions and 28 deletions

View File

@ -60,12 +60,12 @@ public class AboutScene extends PixelScene {
shpx.y = align( 30 ); shpx.y = align( 30 );
add( shpx ); add( shpx );
new Flare( 7, 64 ).color( 0x57b300, true ).show( shpx, 0 ).angularSpeed = +20; new Flare( 7, 64 ).color( 0x225511, true ).show( shpx, 0 ).angularSpeed = +20;
BitmapTextMultiline shpxtitle = createMultiline( TTL_SHPX, 8 ); BitmapTextMultiline shpxtitle = createMultiline( TTL_SHPX, 8 );
shpxtitle.maxWidth = Math.min( Camera.main.width, 120 ); shpxtitle.maxWidth = Math.min( Camera.main.width, 120 );
shpxtitle.measure(); shpxtitle.measure();
shpxtitle.hardlight( 0x50a500 ); shpxtitle.hardlight( Window.SHPX_COLOR );
add( shpxtitle ); add( shpxtitle );
shpxtitle.x = align( (Camera.main.width - shpxtitle.width()) / 2 ); shpxtitle.x = align( (Camera.main.width - shpxtitle.width()) / 2 );
@ -82,7 +82,7 @@ public class AboutScene extends PixelScene {
BitmapTextMultiline shpxlink = createMultiline( LNK_SHPX, 8 ); BitmapTextMultiline shpxlink = createMultiline( LNK_SHPX, 8 );
shpxlink.maxWidth = Math.min( Camera.main.width, 120 ); shpxlink.maxWidth = Math.min( Camera.main.width, 120 );
shpxlink.measure(); shpxlink.measure();
shpxlink.hardlight( 0x57b300 ); shpxlink.hardlight( Window.SHPX_COLOR );
add( shpxlink ); add( shpxlink );
shpxlink.x = shpxtext.x; shpxlink.x = shpxtext.x;

View File

@ -38,7 +38,7 @@ import com.shatteredpixel.shatteredpixeldungeon.windows.WndRanking;
public class RankingsScene extends PixelScene { public class RankingsScene extends PixelScene {
private static final String TXT_TITLE = "Top Rankings (SHATTERED)"; private static final String TXT_TITLE = "Top Rankings";
private static final String TXT_TOTAL = "Total games played: %d"; private static final String TXT_TOTAL = "Total games played: %d";
private static final String TXT_NO_GAMES = "No games have been played yet."; private static final String TXT_NO_GAMES = "No games have been played yet.";
@ -74,7 +74,7 @@ public class RankingsScene extends PixelScene {
float top = align( (h - ROW_HEIGHT * Rankings.INSTANCE.records.size()) / 2 ); float top = align( (h - ROW_HEIGHT * Rankings.INSTANCE.records.size()) / 2 );
BitmapText title = PixelScene.createText( TXT_TITLE, 9 ); BitmapText title = PixelScene.createText( TXT_TITLE, 9 );
title.hardlight( Window.TITLE_COLOR ); title.hardlight( Window.SHPX_COLOR );
title.measure(); title.measure();
title.x = align( (w - title.width()) / 2 ); title.x = align( (w - title.width()) / 2 );
title.y = align( top - title.height() - GAP ); title.y = align( top - title.height() - GAP );

View File

@ -41,6 +41,7 @@ public class Window extends Group implements Signal.Listener<Key> {
protected NinePatch chrome; protected NinePatch chrome;
public static final int TITLE_COLOR = 0xFFFF44; public static final int TITLE_COLOR = 0xFFFF44;
public static final int SHPX_COLOR = 0x33BB33;
public Window() { public Window() {
this( 0, 0, Chrome.get( Chrome.Type.WINDOW ) ); this( 0, 0, Chrome.get( Chrome.Type.WINDOW ) );

View File

@ -19,6 +19,8 @@ package com.shatteredpixel.shatteredpixeldungeon.windows;
import java.util.Locale; import java.util.Locale;
import com.shatteredpixel.shatteredpixeldungeon.sprites.HeroSprite;
import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
import com.watabou.gltextures.SmartTexture; import com.watabou.gltextures.SmartTexture;
import com.watabou.gltextures.TextureCache; import com.watabou.gltextures.TextureCache;
import com.watabou.noosa.BitmapText; import com.watabou.noosa.BitmapText;
@ -102,14 +104,15 @@ public class WndHero extends WndTabbed {
public StatsTab() { public StatsTab() {
Hero hero = Dungeon.hero; Hero hero = Dungeon.hero;
IconTitle title = new IconTitle();
title.icon( HeroSprite.avatar(hero.heroClass, hero.tier()) );
title.label(Utils.format( TXT_TITLE, hero.lvl, hero.className() ).toUpperCase( Locale.ENGLISH ), 9);
title.color(Window.SHPX_COLOR);
title.setRect( 0, 0, WIDTH, 0 );
add(title);
BitmapText title = PixelScene.createText(
Utils.format( TXT_TITLE, hero.lvl, hero.className() ).toUpperCase( Locale.ENGLISH ), 9 );
title.hardlight( TITLE_COLOR );
title.measure();
add( title );
RedButton btnCatalogus = new RedButton( TXT_CATALOGUS ) { RedButton btnCatalogus = new RedButton( TXT_CATALOGUS ) {
@Override @Override
protected void onClick() { protected void onClick() {
@ -117,9 +120,9 @@ public class WndHero extends WndTabbed {
GameScene.show( new WndCatalogus() ); GameScene.show( new WndCatalogus() );
} }
}; };
btnCatalogus.setRect( 0, title.y + title.height(), btnCatalogus.reqWidth() + 2, btnCatalogus.reqHeight() + 2 ); btnCatalogus.setRect( 0, title.height(), btnCatalogus.reqWidth() + 2, btnCatalogus.reqHeight() + 2 );
add( btnCatalogus ); add( btnCatalogus );
RedButton btnJournal = new RedButton( TXT_JOURNAL ) { RedButton btnJournal = new RedButton( TXT_JOURNAL ) {
@Override @Override
protected void onClick() { protected void onClick() {
@ -127,31 +130,31 @@ public class WndHero extends WndTabbed {
GameScene.show( new WndJournal() ); GameScene.show( new WndJournal() );
} }
}; };
btnJournal.setRect( btnJournal.setRect(
btnCatalogus.right() + 1, btnCatalogus.top(), btnCatalogus.right() + 1, btnCatalogus.top(),
btnJournal.reqWidth() + 2, btnJournal.reqHeight() + 2 ); btnJournal.reqWidth() + 2, btnJournal.reqHeight() + 2 );
add( btnJournal ); add( btnJournal );
pos = btnCatalogus.bottom() + GAP; pos = btnCatalogus.bottom() + GAP;
statSlot( TXT_STR, hero.STR() ); statSlot( TXT_STR, hero.STR() );
statSlot( TXT_HEALTH, hero.HP + "/" + hero.HT ); statSlot( TXT_HEALTH, hero.HP + "/" + hero.HT );
statSlot( TXT_EXP, hero.exp + "/" + hero.maxExp() ); statSlot( TXT_EXP, hero.exp + "/" + hero.maxExp() );
pos += GAP; pos += GAP;
statSlot( TXT_GOLD, Statistics.goldCollected ); statSlot( TXT_GOLD, Statistics.goldCollected );
statSlot( TXT_DEPTH, Statistics.deepestFloor ); statSlot( TXT_DEPTH, Statistics.deepestFloor );
pos += GAP; pos += GAP;
} }
private void statSlot( String label, String value ) { private void statSlot( String label, String value ) {
BitmapText txt = PixelScene.createText( label, 8 ); BitmapText txt = PixelScene.createText( label, 8 );
txt.y = pos; txt.y = pos;
add( txt ); add( txt );
txt = PixelScene.createText( value, 8 ); txt = PixelScene.createText( value, 8 );
txt.measure(); txt.measure();
txt.x = PixelScene.align( WIDTH * 0.65f ); txt.x = PixelScene.align( WIDTH * 0.65f );

View File

@ -19,6 +19,7 @@ package com.shatteredpixel.shatteredpixeldungeon.windows;
import java.util.Locale; import java.util.Locale;
import com.shatteredpixel.shatteredpixeldungeon.ui.*;
import com.watabou.noosa.BitmapText; import com.watabou.noosa.BitmapText;
import com.watabou.noosa.ColorBlock; import com.watabou.noosa.ColorBlock;
import com.watabou.noosa.Game; import com.watabou.noosa.Game;
@ -34,10 +35,6 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Belongings;
import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene; import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
import com.shatteredpixel.shatteredpixeldungeon.sprites.HeroSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.HeroSprite;
import com.shatteredpixel.shatteredpixeldungeon.ui.BadgesList;
import com.shatteredpixel.shatteredpixeldungeon.ui.Icons;
import com.shatteredpixel.shatteredpixeldungeon.ui.ItemSlot;
import com.shatteredpixel.shatteredpixeldungeon.ui.ScrollPane;
import com.shatteredpixel.shatteredpixeldungeon.utils.Utils; import com.shatteredpixel.shatteredpixeldungeon.utils.Utils;
public class WndRanking extends WndTabbed { public class WndRanking extends WndTabbed {
@ -141,7 +138,7 @@ public class WndRanking extends WndTabbed {
private static final int GAP = 4; private static final int GAP = 4;
private static final String TXT_TITLE = "(SH)Level %d %s"; private static final String TXT_TITLE = "Level %d %s";
private static final String TXT_HEALTH = "Health"; private static final String TXT_HEALTH = "Health";
private static final String TXT_STR = "Strength"; private static final String TXT_STR = "Strength";
@ -164,6 +161,7 @@ public class WndRanking extends WndTabbed {
IconTitle title = new IconTitle(); IconTitle title = new IconTitle();
title.icon( HeroSprite.avatar( Dungeon.hero.heroClass, Dungeon.hero.tier() ) ); title.icon( HeroSprite.avatar( Dungeon.hero.heroClass, Dungeon.hero.tier() ) );
title.label( Utils.format( TXT_TITLE, Dungeon.hero.lvl, heroClass ).toUpperCase( Locale.ENGLISH ) ); title.label( Utils.format( TXT_TITLE, Dungeon.hero.lvl, heroClass ).toUpperCase( Locale.ENGLISH ) );
title.color(Window.SHPX_COLOR);
title.setRect( 0, 0, WIDTH, 0 ); title.setRect( 0, 0, WIDTH, 0 );
add( title ); add( title );