v1.2.0: redesigned depth indicator, added a challenge indicator

This commit is contained in:
Evan Debenham 2022-03-10 16:10:21 -05:00
parent dba3773ec3
commit adb7df68a6
14 changed files with 169 additions and 34 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 265 B

After

Width:  |  Height:  |  Size: 152 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1008 B

After

Width:  |  Height:  |  Size: 976 B

View File

@ -362,7 +362,7 @@ public class GameScene extends PixelScene {
menu = new MenuPane();
menu.camera = uiCamera;
menu.setPos( uiCamera.width-50, uiSize > 0 ? 0 : 1);
menu.setPos( uiCamera.width-MenuPane.WIDTH, uiSize > 0 ? 0 : 1);
add(menu);
status = new StatusPane( SPDSettings.interfaceSize() > 0 );

View File

@ -204,7 +204,7 @@ public class RankingsScene extends PixelScene {
if (rec.depth != 0){
depth.text( Integer.toString(rec.depth) );
depth.measure();
steps.copy(Icons.DEPTH.get());
steps.copy(Icons.STAIRS.get());
add(steps);
add(depth);

View File

@ -172,7 +172,7 @@ public class StartScene extends PixelScene {
hero = new Image(info.heroClass.spritesheet(), 0, 15*info.armorTier, 12, 15);
add(hero);
steps = new Image(Icons.get(Icons.DEPTH));
steps = new Image(Icons.get(Icons.STAIRS));
add(steps);
depth = new BitmapText(PixelScene.pixelFont);
add(depth);

View File

@ -23,6 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.ui;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass;
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
import com.watabou.noosa.Image;
@ -39,7 +40,7 @@ public enum Icons {
SHPX,
//rankings and hero select icons, spacing for 16x16
DEPTH,
STAIRS,
WARRIOR,
MAGE,
ROGUE,
@ -89,6 +90,15 @@ public enum Icons {
SLEEP,
ALERT,
LOST,
DEPTH,
DEPTH_CHASM,
DEPTH_WATER,
DEPTH_GRASS,
DEPTH_DARK,
DEPTH_LARGE,
DEPTH_TRAPS,
DEPTH_SECRETS,
CHAL_COUNT,
//icons that appear in the about screen, variable spacing
LIBGDX,
@ -133,7 +143,7 @@ public enum Icons {
icon.frame( icon.texture.uvRectBySize( 119, 0, 16, 16 ) );
break;
case DEPTH:
case STAIRS:
icon.frame( icon.texture.uvRectBySize( 0, 16, 13, 16 ) );
break;
case WARRIOR:
@ -270,7 +280,34 @@ public enum Icons {
icon.frame( icon.texture.uvRectBySize( 32, 72, 8, 8 ) );
break;
case LOST:
icon.frame( icon.texture.uvRectBySize( 32, 72, 8, 8 ) );
icon.frame( icon.texture.uvRectBySize( 40, 72, 8, 8 ) );
break;
case DEPTH:
icon.frame( icon.texture.uvRectBySize( 48, 64, 6, 7 ) );
break;
case DEPTH_CHASM:
icon.frame( icon.texture.uvRectBySize( 56, 64, 7, 7 ) );
break;
case DEPTH_WATER:
icon.frame( icon.texture.uvRectBySize( 64, 64, 7, 7 ) );
break;
case DEPTH_GRASS:
icon.frame( icon.texture.uvRectBySize( 72, 64, 7, 7 ) );
break;
case DEPTH_DARK:
icon.frame( icon.texture.uvRectBySize( 80, 64, 7, 7 ) );
break;
case DEPTH_LARGE:
icon.frame( icon.texture.uvRectBySize( 88, 64, 7, 7 ) );
break;
case DEPTH_TRAPS:
icon.frame( icon.texture.uvRectBySize( 96, 64, 7, 7 ) );
break;
case DEPTH_SECRETS:
icon.frame( icon.texture.uvRectBySize( 104, 64, 7, 7 ) );
break;
case CHAL_COUNT:
icon.frame( icon.texture.uvRectBySize( 48, 72, 7, 7 ) );
break;
case LIBGDX:
@ -323,4 +360,25 @@ public enum Icons {
return null;
}
}
public static Image get(Level.Feeling feeling){
switch (feeling){
case NONE: default:
return get(DEPTH);
case CHASM:
return get(DEPTH_CHASM);
case WATER:
return get(DEPTH_WATER);
case GRASS:
return get(DEPTH_GRASS);
case DARK:
return get(DEPTH_DARK);
case LARGE:
return get(DEPTH_LARGE);
case TRAPS:
return get(DEPTH_TRAPS);
case SECRETS:
return get(DEPTH_SECRETS);
}
}
}

View File

@ -22,6 +22,7 @@
package com.shatteredpixel.shatteredpixeldungeon.ui;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Challenges;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.SPDAction;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
@ -29,6 +30,8 @@ import com.shatteredpixel.shatteredpixeldungeon.journal.Document;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.shatteredpixel.shatteredpixeldungeon.windows.WndChallenges;
import com.shatteredpixel.shatteredpixeldungeon.windows.WndGame;
import com.shatteredpixel.shatteredpixeldungeon.windows.WndJournal;
import com.shatteredpixel.shatteredpixeldungeon.windows.WndKeyBindings;
@ -44,7 +47,14 @@ public class MenuPane extends Component {
private Image bg;
private BitmapText depth;
private Image depthIcon;
private BitmapText depthText;
private Button depthButton;
private Image challengeIcon;
private BitmapText challengeText;
private Button challengeButton;
private JournalButton btnJournal;
private MenuButton btnMenu;
@ -54,7 +64,7 @@ public class MenuPane extends Component {
private DangerIndicator danger;
public static final int WIDTH = 50;
public static final int WIDTH = 32;
@Override
protected void createChildren() {
@ -63,10 +73,60 @@ public class MenuPane extends Component {
bg = new Image(Assets.Interfaces.MENU);
add(bg);
depth = new BitmapText( Integer.toString( Dungeon.depth ), PixelScene.pixelFont);
depth.hardlight( 0xCACFC2 );
depth.measure();
add( depth );
depthIcon = Icons.get(Dungeon.level.feeling);
add(depthIcon);
depthText = new BitmapText( Integer.toString( Dungeon.depth ), PixelScene.pixelFont);
depthText.hardlight( 0xCACFC2 );
depthText.measure();
add( depthText );
depthButton = new Button(){
@Override
protected String hoverText() {
switch (Dungeon.level.feeling) {
case CHASM: return Messages.get(GameScene.class, "chasm");
case WATER: return Messages.get(GameScene.class, "water");
case GRASS: return Messages.get(GameScene.class, "grass");
case DARK: return Messages.get(GameScene.class, "dark");
case LARGE: return Messages.get(GameScene.class, "large");
case TRAPS: return Messages.get(GameScene.class, "traps");
case SECRETS: return Messages.get(GameScene.class, "secrets");
}
return null;
}
@Override
protected void onClick() {
super.onClick();
//just open journal for now, maybe have it open landmarks after expanding that page?
GameScene.show( new WndJournal() );
}
};
add(depthButton);
if (Challenges.activeChallenges() > 0){
challengeIcon = Icons.get(Icons.CHAL_COUNT);
add(challengeIcon);
challengeText = new BitmapText( Integer.toString( Challenges.activeChallenges() ), PixelScene.pixelFont);
challengeText.hardlight( 0xCACFC2 );
challengeText.measure();
add( challengeText );
challengeButton = new Button(){
@Override
protected void onClick() {
GameScene.show(new WndChallenges(Dungeon.challenges, false));
}
@Override
protected String hoverText() {
return Messages.get(WndChallenges.class, "title");
}
};
add(challengeButton);
}
btnJournal = new JournalButton();
add( btnJournal );
@ -91,14 +151,34 @@ public class MenuPane extends Component {
bg.x = x;
bg.y = y;
depth.x = x + 14.5f - depth.width() / 2f;
depth.y = y + 7f - depth.baseLine() / 2f;
PixelScene.align(depth);
btnJournal.setPos( x + WIDTH - 42, y );
btnMenu.setPos( x + WIDTH - btnMenu.width(), y );
btnJournal.setPos( btnMenu.left() - btnJournal.width() + 2, y );
depthIcon.x = btnJournal.left() - 7 + (7 - depthIcon.width())/2f - 0.1f;
depthIcon.y = y + 2;
PixelScene.align(depthIcon);
depthText.scale.set(PixelScene.align(0.5f));
depthText.x = depthIcon.x + (depthIcon.width() - depthText.width())/2f;
depthText.y = depthIcon.y + depthIcon.height();
PixelScene.align(depthText);
depthButton.setRect(depthIcon.x, depthIcon.y, depthIcon.width(), depthIcon.height() + depthText.height());
if (challengeIcon != null){
challengeIcon.x = btnJournal.left() - 14 + (7 - challengeIcon.width())/2f - 0.1f;
challengeIcon.y = y + 2;
PixelScene.align(challengeIcon);
challengeText.scale.set(PixelScene.align(0.5f));
challengeText.x = challengeIcon.x + (challengeIcon.width() - challengeText.width())/2f;
challengeText.y = challengeIcon.y + challengeIcon.height();
PixelScene.align(challengeText);
challengeButton.setRect(challengeIcon.x, challengeIcon.y, challengeIcon.width(), challengeIcon.height() + challengeText.height());
}
version.scale.set(PixelScene.align(0.5f));
version.measure();
version.x = x + WIDTH - version.width();
@ -134,7 +214,7 @@ public class MenuPane extends Component {
public JournalButton() {
super();
width = bg.width + 13; //includes the depth display to the left
width = bg.width + 4;
height = bg.height + 4;
}
@ -162,7 +242,7 @@ public class MenuPane extends Component {
protected void layout() {
super.layout();
bg.x = x + 13;
bg.x = x + 2;
bg.y = y + 2;
journalIcon.x = bg.x + (bg.width() - journalIcon.width())/2f;

View File

@ -52,7 +52,7 @@ public class v0_5_X_Changes {
"\n" +
"v0.5.0 was also Shattered's longest-developed update yet. While I don't think there was much I could do about this for v0.5.0 and v0.6.0, it started an unfortunate trend of major updates taking up to half a year! I eventually broke this trend in v0.9.0 by splitting these larger updates into smaller parts."));
changes.addButton( new ChangeButton( Icons.get(Icons.DEPTH), "New Dungeon Visual Style!",
changes.addButton( new ChangeButton( Icons.get(Icons.STAIRS), "New Dungeon Visual Style!",
"_-_ Walls and some terrain now have depth\n" +
"_-_ Characters & items are raised & cast shadows\n" +
"_-_ Added a visible tile grid in the settings menu"));

View File

@ -513,7 +513,7 @@ public class v0_6_X_Changes {
"\n" +
"Lastly, v0.6.2 (and v0.6.1) included some important AI changes that made character behaviour much more consistent when allies are concerned. This paved the way for ally additions in future updates."));
changes.addButton( new ChangeButton( Icons.get(Icons.DEPTH), "Dungeon Secrets!",
changes.addButton( new ChangeButton( Icons.get(Icons.STAIRS), "Dungeon Secrets!",
"The secrets of the dungeon have been totally redesigned!\n\n" +
"_-_ Regular rooms can no longer be totally hidden\n\n" +
"_-_ 12 new secret rooms added, which are always hidden\n\n" +
@ -711,7 +711,7 @@ public class v0_6_X_Changes {
"_-_ Reduced the numbers of games needed for the 'games played' badges from 10/100/500/2000 to 10/50/250/1000\n\n" +
"_-_ Blank badges shown in the badges menu are now accurate to how many badges you have left to unlock."));
changes.addButton( new ChangeButton( Icons.get(Icons.DEPTH), "Dungeon Changes",
changes.addButton( new ChangeButton( Icons.get(Icons.STAIRS), "Dungeon Changes",
"_-_ Added 5 new regional rooms\n" +
"_-_ Added two new uncommon room types\n" +
"_-_ Added a new type of tunnel room\n\n" +
@ -869,7 +869,7 @@ public class v0_6_X_Changes {
"\n" +
"I feel v0.6.0 also represents the start of another era in Shattered's development. While Shattered was still missing some big updates (most notably v0.8.0), after v0.6.0 Shattered started to resemble its current incarnation more than the original Pixel Dungeon."));
changes.addButton( new ChangeButton( Icons.get(Icons.DEPTH), "Levelgen Overhaul!",
changes.addButton( new ChangeButton( Icons.get(Icons.STAIRS), "Levelgen Overhaul!",
"Level creation algorithm overhauled!\n\n" +
"_-_ Levels are now much less box-shaped\n" +
"_-_ Sewers are now smaller, caves+ are now larger\n" +

View File

@ -27,11 +27,9 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Spinner;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.ChaliceOfBlood;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.CloakOfShadows;
import com.shatteredpixel.shatteredpixeldungeon.items.bombs.WoollyBomb;
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfEnergy;
import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfFrost;
import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfTransfusion;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MagesStaff;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.scenes.ChangesScene;
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
@ -40,7 +38,6 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.GolemSprite;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.shatteredpixel.shatteredpixeldungeon.sprites.SpawnerSprite;
import com.shatteredpixel.shatteredpixeldungeon.sprites.SpectralNecromancerSprite;
import com.shatteredpixel.shatteredpixeldungeon.sprites.SpinnerSprite;
import com.shatteredpixel.shatteredpixeldungeon.ui.Icons;
import com.shatteredpixel.shatteredpixeldungeon.ui.TalentIcon;
@ -92,7 +89,7 @@ public class v0_9_X_Changes {
changes.hardlight(CharSprite.WARNING);
changeInfos.add(changes);
changes.addButton(new ChangeButton(Icons.get(Icons.DEPTH), "Dungeon Changes",
changes.addButton(new ChangeButton(Icons.get(Icons.STAIRS), "Dungeon Changes",
"I'm making some slight tweaks to level sizes and layouts, to make the game overall a little shorter, and to put a bit more emphasis on the final region:\n\n" +
"_-_ Standard room count down by roughly 10/20/15/15/5%, for each region\n" +
"_-_ Connection room frequency down by ~25%\n\n" +
@ -399,7 +396,7 @@ public class v0_9_X_Changes {
"The second talent tier is similar to the first, but talent powers are much less focused on the early game. Expect effects that are useful all game long.\n\n" +
"Look forward to tier 3 of the talent system coming in v0.9.2, which will span levels 13-20."));
changes.addButton(new ChangeButton(Icons.get(Icons.DEPTH), "Levelgen Improvements!",
changes.addButton(new ChangeButton(Icons.get(Icons.STAIRS), "Levelgen Improvements!",
"_The game's level generation system has received a number of improvements!:_\n\n" +
"_-_ A new region specific room has been added to each dungeon region, 5 in total.\n" +
"_-_ Three new level feelings have been added: large, secrets, and traps.\n" +

View File

@ -173,7 +173,7 @@ public class WndHeroInfo extends WndTabbed {
break;
case ROGUE:
icons = new Image[]{ new ItemSprite(ItemSpriteSheet.ARTIFACT_CLOAK),
Icons.get(Icons.DEPTH),
Icons.get(Icons.STAIRS),
new ItemSprite(ItemSpriteSheet.DAGGER),
new ItemSprite(ItemSpriteSheet.SCROLL_ISAZ)};
break;

View File

@ -110,7 +110,7 @@ public class WndJournal extends WndTabbed {
if (value) last_index = 1;
}
},
new IconTab( Icons.get(Icons.DEPTH) ) {
new IconTab( Icons.get(Icons.STAIRS) ) {
protected void select( boolean value ) {
super.select( value );
notesTab.active = notesTab.visible = value;
@ -550,7 +550,7 @@ public class WndJournal extends WndTabbed {
pos += Math.max(ITEM_HEIGHT, title.height());
}
for(Notes.Record rec : keys){
ListItem item = new ListItem( Icons.get(Icons.DEPTH),
ListItem item = new ListItem( Icons.get(Icons.STAIRS),
Messages.titleCase(rec.desc()), rec.depth() );
item.setRect( 0, pos, width(), ITEM_HEIGHT );
content.add( item );
@ -575,7 +575,7 @@ public class WndJournal extends WndTabbed {
pos += Math.max(ITEM_HEIGHT, title.height());
}
for (Notes.Record rec : landmarks) {
ListItem item = new ListItem( Icons.get(Icons.DEPTH),
ListItem item = new ListItem( Icons.get(Icons.STAIRS),
Messages.titleCase(rec.desc()), rec.depth() );
item.setRect( 0, pos, width(), ITEM_HEIGHT );
content.add( item );

View File

@ -325,7 +325,7 @@ public class WndStartGame extends Window {
case ROGUE:
heroItem.icon(new ItemSprite(ItemSpriteSheet.ARTIFACT_CLOAK, null));
heroLoadout.icon(new ItemSprite(ItemSpriteSheet.DAGGER, null));
heroMisc.icon(Icons.get(Icons.DEPTH));
heroMisc.icon(Icons.get(Icons.STAIRS));
break;
case HUNTRESS:
heroItem.icon(new ItemSprite(ItemSpriteSheet.SPIRIT_BOW, null));