v0.2.4: corrected order of bag tabs, size of tabs now scale based on space and bags owned.
This commit is contained in:
@@ -77,8 +77,6 @@ public class WndBag extends WndTabbed {
|
|||||||
protected static final int SLOT_SIZE = 28;
|
protected static final int SLOT_SIZE = 28;
|
||||||
protected static final int SLOT_MARGIN = 1;
|
protected static final int SLOT_MARGIN = 1;
|
||||||
|
|
||||||
protected static final int TAB_WIDTH = 25;
|
|
||||||
|
|
||||||
protected static final int TITLE_HEIGHT = 12;
|
protected static final int TITLE_HEIGHT = 12;
|
||||||
|
|
||||||
private Listener listener;
|
private Listener listener;
|
||||||
@@ -128,14 +126,17 @@ public class WndBag extends WndTabbed {
|
|||||||
stuff.backpack,
|
stuff.backpack,
|
||||||
stuff.getItem( SeedPouch.class ),
|
stuff.getItem( SeedPouch.class ),
|
||||||
stuff.getItem( ScrollHolder.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) {
|
for (Bag b : bags) {
|
||||||
if (b != null) {
|
if (b != null) {
|
||||||
BagTab tab = new BagTab( b );
|
BagTab tab = new BagTab( b );
|
||||||
tab.setSize( TAB_WIDTH, tabHeight() );
|
int tab_width = (slotsWidth-((bags.length-1)*5))/bags.length;
|
||||||
add( tab );
|
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 );
|
tab.select( b == bag );
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user