v1.2.0: various small improvements to large UI elements
This commit is contained in:
parent
90b8ff9a66
commit
f8c67a0709
Binary file not shown.
Before Width: | Height: | Size: 1013 B After Width: | Height: | Size: 1008 B |
|
@ -300,6 +300,7 @@ public class CellSelector extends ScrollArea {
|
||||||
Dungeon.observe();
|
Dungeon.observe();
|
||||||
heldTurns++;
|
heldTurns++;
|
||||||
moveFromAction(heldAction);
|
moveFromAction(heldAction);
|
||||||
|
Dungeon.hero.ready = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,6 +37,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.bags.VelvetPouch;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.wands.Wand;
|
import com.shatteredpixel.shatteredpixeldungeon.items.wands.Wand;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.windows.WndBag;
|
import com.shatteredpixel.shatteredpixeldungeon.windows.WndBag;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.windows.WndUseItem;
|
import com.shatteredpixel.shatteredpixeldungeon.windows.WndUseItem;
|
||||||
import com.watabou.gltextures.TextureCache;
|
import com.watabou.gltextures.TextureCache;
|
||||||
|
@ -94,8 +95,6 @@ public class InventoryPane extends Component {
|
||||||
@Override
|
@Override
|
||||||
protected void createChildren() {
|
protected void createChildren() {
|
||||||
|
|
||||||
//TODO capture inputs tapped on BG
|
|
||||||
|
|
||||||
bg = Chrome.get(Chrome.Type.TOAST_TR);
|
bg = Chrome.get(Chrome.Type.TOAST_TR);
|
||||||
add(bg);
|
add(bg);
|
||||||
|
|
||||||
|
@ -156,6 +155,7 @@ public class InventoryPane extends Component {
|
||||||
add(btn);
|
add(btn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lastEnabled = true;
|
||||||
updateInventory();
|
updateInventory();
|
||||||
|
|
||||||
width = WIDTH;
|
width = WIDTH;
|
||||||
|
@ -274,6 +274,11 @@ public class InventoryPane extends Component {
|
||||||
b.enable(lastEnabled);
|
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();
|
layout();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -293,6 +298,11 @@ public class InventoryPane extends Component {
|
||||||
for (BagButton b : bags){
|
for (BagButton b : bags){
|
||||||
b.enable(lastEnabled);
|
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 );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,6 +65,7 @@ public class StatusPane extends Component {
|
||||||
private Image shieldedHP;
|
private Image shieldedHP;
|
||||||
private Image hp;
|
private Image hp;
|
||||||
private BitmapText hpText;
|
private BitmapText hpText;
|
||||||
|
private Button heroInfoOnBar;
|
||||||
|
|
||||||
private Image exp;
|
private Image exp;
|
||||||
private BitmapText expText;
|
private BitmapText expText;
|
||||||
|
@ -81,7 +82,6 @@ public class StatusPane extends Component {
|
||||||
|
|
||||||
private static String asset = Assets.Interfaces.STATUS;
|
private static String asset = Assets.Interfaces.STATUS;
|
||||||
|
|
||||||
//TODO improve large mode texturing
|
|
||||||
private boolean large;
|
private boolean large;
|
||||||
|
|
||||||
public StatusPane( boolean large ){
|
public StatusPane( boolean large ){
|
||||||
|
@ -132,6 +132,15 @@ public class StatusPane extends Component {
|
||||||
hpText.alpha(0.6f);
|
hpText.alpha(0.6f);
|
||||||
add(hpText);
|
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);
|
if (large) exp = new Image(asset, 0, 121, 128, 7);
|
||||||
else exp = new Image(asset, 0, 44, 16, 1);
|
else exp = new Image(asset, 0, 44, 16, 1);
|
||||||
add( exp );
|
add( exp );
|
||||||
|
@ -172,7 +181,7 @@ 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 );
|
heroInfo.setRect( x, y+(large ? 0 : 1), 30, large ? 40 : 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;
|
||||||
|
@ -193,6 +202,8 @@ public class StatusPane extends Component {
|
||||||
expText.y = exp.y;
|
expText.y = exp.y;
|
||||||
PixelScene.align(expText);
|
PixelScene.align(expText);
|
||||||
|
|
||||||
|
heroInfoOnBar.setRect(heroInfo.right(), y + 19, 130, 20);
|
||||||
|
|
||||||
buffs.setPos( x + 31, y );
|
buffs.setPos( x + 31, y );
|
||||||
|
|
||||||
busy.x = x + bg.width + 1;
|
busy.x = x + bg.width + 1;
|
||||||
|
@ -210,6 +221,8 @@ public class StatusPane extends Component {
|
||||||
hpText.y -= 0.001f; //prefer to be slightly higher
|
hpText.y -= 0.001f; //prefer to be slightly higher
|
||||||
PixelScene.align(hpText);
|
PixelScene.align(hpText);
|
||||||
|
|
||||||
|
heroInfoOnBar.setRect(heroInfo.right(), y, 50, 9);
|
||||||
|
|
||||||
buffs.setPos( x + 31, y + 9 );
|
buffs.setPos( x + 31, y + 9 );
|
||||||
|
|
||||||
busy.x = x + 1;
|
busy.x = x + 1;
|
||||||
|
@ -305,7 +318,7 @@ public class StatusPane extends Component {
|
||||||
public void showStarParticles(){
|
public void showStarParticles(){
|
||||||
Emitter emitter = (Emitter)recycle( Emitter.class );
|
Emitter emitter = (Emitter)recycle( Emitter.class );
|
||||||
emitter.revive();
|
emitter.revive();
|
||||||
emitter.pos( 27, 27 );
|
emitter.pos( avatar.center() );
|
||||||
emitter.burst( Speck.factory( Speck.STAR ), 12 );
|
emitter.burst( Speck.factory( Speck.STAR ), 12 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user