v1.2.0: fixed hero info button not moving with status pane

This commit is contained in:
Evan Debenham
2022-01-21 13:59:32 -05:00
parent d2f477f656
commit 6bc0a50409
@@ -53,6 +53,7 @@ public class StatusPane extends Component {
private NinePatch bg; private NinePatch bg;
private Image avatar; private Image avatar;
private Button heroInfo;
public static float talentBlink; public static float talentBlink;
private float warning; private float warning;
@@ -92,7 +93,7 @@ public class StatusPane extends Component {
else bg = new NinePatch( asset, 0, 0, 128, 36, 85, 0, 45, 0 ); else bg = new NinePatch( asset, 0, 0, 128, 36, 85, 0, 45, 0 );
add( bg ); add( bg );
add( new Button(){ heroInfo = new Button(){
@Override @Override
protected void onClick () { protected void onClick () {
Camera.main.panTo( Dungeon.hero.sprite.center(), 5f ); Camera.main.panTo( Dungeon.hero.sprite.center(), 5f );
@@ -103,7 +104,8 @@ public class StatusPane extends Component {
public GameAction keyAction() { public GameAction keyAction() {
return SPDAction.HERO_INFO; return SPDAction.HERO_INFO;
} }
}.setRect( x, y+(large ? 0 : 1), 30, 30 )); };
add(heroInfo);
avatar = HeroSprite.avatar( Dungeon.hero.heroClass, lastTier ); avatar = HeroSprite.avatar( Dungeon.hero.heroClass, lastTier );
add( avatar ); add( avatar );
@@ -170,6 +172,8 @@ public class StatusPane extends Component {
avatar.y = bg.y - avatar.height / 2f + (large ? 15 : 16); avatar.y = bg.y - avatar.height / 2f + (large ? 15 : 16);
PixelScene.align(avatar); PixelScene.align(avatar);
heroInfo.setRect( x, y+(large ? 0 : 1), 30, 30 );
compass.x = avatar.x + avatar.width / 2f - compass.origin.x; compass.x = avatar.x + avatar.width / 2f - compass.origin.x;
compass.y = avatar.y + avatar.height / 2f - compass.origin.y; compass.y = avatar.y + avatar.height / 2f - compass.origin.y;
PixelScene.align(compass); PixelScene.align(compass);