v0.2.4: corrected order of bag tabs, size of tabs now scale based on space and bags owned.

This commit is contained in:
Evan Debenham 2015-02-06 11:40:30 -05:00
parent 68406db6fe
commit 92afe5977e

View File

@ -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 );
}
}