v1.2.0: various small improvements to large UI elements

This commit is contained in:
Evan Debenham 2022-01-27 18:19:41 -05:00
parent 90b8ff9a66
commit f8c67a0709
4 changed files with 29 additions and 5 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1013 B

After

Width:  |  Height:  |  Size: 1008 B

View File

@ -300,6 +300,7 @@ public class CellSelector extends ScrollArea {
Dungeon.observe();
heldTurns++;
moveFromAction(heldAction);
Dungeon.hero.ready = false;
}
}

View File

@ -37,6 +37,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.bags.VelvetPouch;
import com.shatteredpixel.shatteredpixeldungeon.items.wands.Wand;
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.shatteredpixel.shatteredpixeldungeon.windows.WndBag;
import com.shatteredpixel.shatteredpixeldungeon.windows.WndUseItem;
import com.watabou.gltextures.TextureCache;
@ -94,8 +95,6 @@ public class InventoryPane extends Component {
@Override
protected void createChildren() {
//TODO capture inputs tapped on BG
bg = Chrome.get(Chrome.Type.TOAST_TR);
add(bg);
@ -156,6 +155,7 @@ public class InventoryPane extends Component {
add(btn);
}
lastEnabled = true;
updateInventory();
width = WIDTH;
@ -274,6 +274,11 @@ public class InventoryPane extends Component {
b.enable(lastEnabled);
}
goldTxt.alpha( lastEnabled ? 1f : 0.3f );
gold.alpha( lastEnabled ? 1f : 0.3f );
energyTxt.alpha( lastEnabled ? 1f : 0.3f );
energy.alpha( lastEnabled ? 1f : 0.3f );
layout();
}
@ -293,6 +298,11 @@ public class InventoryPane extends Component {
for (BagButton b : bags){
b.enable(lastEnabled);
}
goldTxt.alpha( lastEnabled ? 1f : 0.3f );
gold.alpha( lastEnabled ? 1f : 0.3f );
energyTxt.alpha( lastEnabled ? 1f : 0.3f );
energy.alpha( lastEnabled ? 1f : 0.3f );
}
}

View File

@ -65,6 +65,7 @@ public class StatusPane extends Component {
private Image shieldedHP;
private Image hp;
private BitmapText hpText;
private Button heroInfoOnBar;
private Image exp;
private BitmapText expText;
@ -81,7 +82,6 @@ public class StatusPane extends Component {
private static String asset = Assets.Interfaces.STATUS;
//TODO improve large mode texturing
private boolean large;
public StatusPane( boolean large ){
@ -132,6 +132,15 @@ public class StatusPane extends Component {
hpText.alpha(0.6f);
add(hpText);
heroInfoOnBar = new Button(){
@Override
protected void onClick () {
Camera.main.panTo( Dungeon.hero.sprite.center(), 5f );
GameScene.show( new WndHero() );
}
};
add(heroInfoOnBar);
if (large) exp = new Image(asset, 0, 121, 128, 7);
else exp = new Image(asset, 0, 44, 16, 1);
add( exp );
@ -172,7 +181,7 @@ public class StatusPane extends Component {
avatar.y = bg.y - avatar.height / 2f + (large ? 15 : 16);
PixelScene.align(avatar);
heroInfo.setRect( x, y+(large ? 0 : 1), 30, 30 );
heroInfo.setRect( x, y+(large ? 0 : 1), 30, large ? 40 : 30 );
compass.x = avatar.x + avatar.width / 2f - compass.origin.x;
compass.y = avatar.y + avatar.height / 2f - compass.origin.y;
@ -193,6 +202,8 @@ public class StatusPane extends Component {
expText.y = exp.y;
PixelScene.align(expText);
heroInfoOnBar.setRect(heroInfo.right(), y + 19, 130, 20);
buffs.setPos( x + 31, y );
busy.x = x + bg.width + 1;
@ -210,6 +221,8 @@ public class StatusPane extends Component {
hpText.y -= 0.001f; //prefer to be slightly higher
PixelScene.align(hpText);
heroInfoOnBar.setRect(heroInfo.right(), y, 50, 9);
buffs.setPos( x + 31, y + 9 );
busy.x = x + 1;
@ -305,7 +318,7 @@ public class StatusPane extends Component {
public void showStarParticles(){
Emitter emitter = (Emitter)recycle( Emitter.class );
emitter.revive();
emitter.pos( 27, 27 );
emitter.pos( avatar.center() );
emitter.burst( Speck.factory( Speck.STAR ), 12 );
}