v0.2.4: tweaked bag window, now auto-opens containers of all types

This commit is contained in:
Evan Debenham
2015-02-18 14:35:38 -05:00
parent f0500e8eea
commit 5e9cdf87d5
2 changed files with 21 additions and 9 deletions
@@ -153,12 +153,12 @@ public class WndBag extends WndTabbed {
}
}
public static WndBag seedPouch( Listener listener, Mode mode, String title ) {
SeedPouch pouch = Dungeon.hero.belongings.getItem( SeedPouch.class );
return pouch != null ?
new WndBag( pouch, listener, mode, title ) :
new WndBag( Dungeon.hero.belongings.backpack, listener, mode, title );
public static WndBag getBag( Class<? extends Bag> bagClass, Listener listener, Mode mode, String title ) {
Bag bag = Dungeon.hero.belongings.getItem( bagClass );
return bag != null ?
new WndBag( bag, listener, mode, title ) :
lastBag( listener, mode, title );
}
protected void placeItems( Bag container ) {