From 92afe5977e998f101bd8ff5e364bbb306aa8e398 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Fri, 6 Feb 2015 11:40:30 -0500 Subject: [PATCH] v0.2.4: corrected order of bag tabs, size of tabs now scale based on space and bags owned. --- .../shatteredpixeldungeon/windows/WndBag.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/windows/WndBag.java b/src/com/shatteredpixel/shatteredpixeldungeon/windows/WndBag.java index 71d59d323..f59d8c411 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/windows/WndBag.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/windows/WndBag.java @@ -77,8 +77,6 @@ public class WndBag extends WndTabbed { protected static final int SLOT_SIZE = 28; protected static final int SLOT_MARGIN = 1; - protected static final int TAB_WIDTH = 25; - protected static final int TITLE_HEIGHT = 12; private Listener listener; @@ -128,15 +126,18 @@ public class WndBag extends WndTabbed { stuff.backpack, stuff.getItem( SeedPouch.class ), stuff.getItem( ScrollHolder.class ), - stuff.getItem( WandHolster.class ), - stuff.getItem(PotionBandolier.class)}; - + stuff.getItem( PotionBandolier.class ), + stuff.getItem( WandHolster.class )}; + for (Bag b : bags) { if (b != null) { BagTab tab = new BagTab( b ); - tab.setSize( TAB_WIDTH, tabHeight() ); - add( tab ); - + int tab_width = (slotsWidth-((bags.length-1)*5))/bags.length; + tab.setSize( tab_width, tabHeight() ); + + //no point in showing tabs if there's just one bag + if (bags.length > 1) add( tab ); + tab.select( b == bag ); } }