diff --git a/assets/icons.png b/assets/icons.png index 7865e0d71..3ec50e766 100644 Binary files a/assets/icons.png and b/assets/icons.png differ diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/ui/ResumeIndicator.java b/src/com/shatteredpixel/shatteredpixeldungeon/ui/ResumeIndicator.java new file mode 100644 index 000000000..77831e413 --- /dev/null +++ b/src/com/shatteredpixel/shatteredpixeldungeon/ui/ResumeIndicator.java @@ -0,0 +1,51 @@ +package com.shatteredpixel.shatteredpixeldungeon.ui; + +import com.shatteredpixel.shatteredpixeldungeon.Dungeon; +import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene; +import com.watabou.noosa.Image; + +/** + * Created by Evan on 21/01/2015. + */ +public class ResumeIndicator extends Tag { + + private Image icon; + + public ResumeIndicator() { + super(0xCDD5C0); + + setSize( 24, 22 ); + + visible = false; + + } + + @Override + protected void createChildren() { + super.createChildren(); + icon = Icons.get(Icons.RESUME); + add(icon); + } + + @Override + protected void layout() { + super.layout(); + icon.x = x + (width - icon.width()) / 2; + icon.y = y + (height - icon.height()) / 2; + } + + @Override + protected void onClick() { + Dungeon.hero.resume(); + } + + @Override + public void update() { + if (visible != (Dungeon.hero.lastAction != null)){ + visible = Dungeon.hero.lastAction != null; + if (visible) + flash(); + } + super.update(); + } +} diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/ui/StatusPane.java b/src/com/shatteredpixel/shatteredpixeldungeon/ui/StatusPane.java index 241d0d71e..7f8da7852 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/ui/StatusPane.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/ui/StatusPane.java @@ -57,6 +57,7 @@ public class StatusPane extends Component { private BitmapText keys; private DangerIndicator danger; + private ResumeIndicator resume; private LootIndicator loot; private BuffIndicator buffs; private Compass compass; @@ -119,6 +120,9 @@ public class StatusPane extends Component { danger = new DangerIndicator(); add( danger ); + resume = new ResumeIndicator(); + add ( resume ); + loot = new LootIndicator(); add( loot ); @@ -151,6 +155,8 @@ public class StatusPane extends Component { loot.setPos( width - loot.width(), danger.bottom() + 2 ); + resume.setPos( width - resume.width(), (loot.visible ? loot.bottom() : danger.bottom()) + 2 ); + buffs.setPos( 32, 11 ); btnMenu.setPos( width - btnMenu.width(), 1 ); @@ -205,6 +211,8 @@ public class StatusPane extends Component { lastTier = tier; avatar.copy( HeroSprite.avatar( Dungeon.hero.heroClass, tier ) ); } + + resume.setPos( width - resume.width(), (loot.visible ? loot.bottom() : danger.bottom()) + 2 ); } private static class MenuButton extends Button {