From f8c67a070919ff985b9803bc10db50740b7ef265 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Thu, 27 Jan 2022 18:19:41 -0500 Subject: [PATCH] v1.2.0: various small improvements to large UI elements --- .../main/assets/interfaces/status_pane.png | Bin 1013 -> 1008 bytes .../scenes/CellSelector.java | 1 + .../ui/InventoryPane.java | 14 +++++++++++-- .../shatteredpixeldungeon/ui/StatusPane.java | 19 +++++++++++++++--- 4 files changed, 29 insertions(+), 5 deletions(-) diff --git a/core/src/main/assets/interfaces/status_pane.png b/core/src/main/assets/interfaces/status_pane.png index 18fa4b94df5f13295b0372b13429b198f479e5aa..30eb2b239ba222e7e5ee70d2b66a7e0c5312038a 100644 GIT binary patch delta 734 zcmV<40wMkN2k-~59|3=@LNt&oFMTC2X&)?M9Vx=X!kwL+goK1^YinO$U-I6W^3{m) z%yaU_Y4X5a^0q|ss~tPz;imuq010$bPE-H?|NsC0{~7>rMt{2i00M1EL_t(|0qxm` zYE(fKfZ_j~ncZ9vGw79FTHjYtw!W{RXnkKn+4{ckjCw#1=m9-o zSO8>O9sz&z09gun1O#>g;Aom$0=RJo05`w51Q;9K_5li@jsd|lz}Vn64lp*jjn?-$ zpv49^ukUR~@cA|X%v!JSvw37jHV@PxDqPNlD&j`Ch3!*J`7R&ph;Zi&+uh@o@6L}^ zNAZAVspPwStQR0ESX3GfqL37ehE{_ptgwVugD6%H8^f&CAe#NxgNR|z)xa}ndg@HK zo%I*!FQA9w>M(MGujkJ6#F_3m>o3q>Ko7*#K}7KN!kLOQ|9~E_FRu3g0IBOMQHM!^ Qe=APXGV_ delta 739 zcmV<90v!GD2lWTA9|3>PVob+cL#;wIkSi~JB{1>v@#W>^%gf8YzP_!kt(%*hjg5`} z=b8WFj{n_*|JZx~(r}(FlTZKv010$bPE-H?|NsC0{~7>rMt{2i00MGJL_t(|0qofU zhgCro!14b%bMD(qRBhj*RaGCLswzN1pf9+~$kB8rk1Eh?oX8VILmFcb1jqXmjYTbNM7 zpp)<9oEswD4@#Vs(*MUm4=#}N^Grm~QzDlBe+n=q#}tVxN*tO%c|fP+bjor;5fh+1 zK$RR-0!9g8nVB0#Cm6jGs9U6XaOyt1+;(` z&;nY32ua=swHZU;Br#B(5m55tEK)_m`kpEZ*7tQ3tnaHRSl`!Cu)c3QqZZHtT0jfv z7p!e~1RQ?^5@Nt3Ah4C@-C1-A;PO$LuY7a~$ZT+@570FF1q9!K^#<1~p#BCoyS`6U zr`X`8^?lwhe7Kgz`PA$CLQx|*B24}BUe3-o$0WpXZp>VUUa77tOfW7Y=3pNZS?qh>Z~2Y7NCE&?8ShBWdLi7 Vk5Ft&2(bVF002ovPDHLkV1i8CW)uJb diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/CellSelector.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/CellSelector.java index 467b5fb9c..d0e4e0bb6 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/CellSelector.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/CellSelector.java @@ -300,6 +300,7 @@ public class CellSelector extends ScrollArea { Dungeon.observe(); heldTurns++; moveFromAction(heldAction); + Dungeon.hero.ready = false; } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/InventoryPane.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/InventoryPane.java index 68478b0d7..f50b5e244 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/InventoryPane.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/InventoryPane.java @@ -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 ); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/StatusPane.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/StatusPane.java index c0766bd12..6ec12db96 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/StatusPane.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/StatusPane.java @@ -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 ); }