Search in sources :

Example 1 with WndBag

use of com.shatteredpixel.shatteredpixeldungeon.windows.WndBag in project shattered-pixel-dungeon-gdx by 00-Evan.

the class GameScene method selectItem.

public static WndBag selectItem(WndBag.Listener listener, WndBag.Mode mode, String title) {
    cancelCellSelector();
    WndBag wnd = mode == Mode.SEED ? WndBag.getBag(VelvetPouch.class, listener, mode, title) : mode == Mode.SCROLL ? WndBag.getBag(ScrollHolder.class, listener, mode, title) : mode == Mode.POTION ? WndBag.getBag(PotionBandolier.class, listener, mode, title) : mode == Mode.WAND ? WndBag.getBag(MagicalHolster.class, listener, mode, title) : WndBag.lastBag(listener, mode, title);
    if (scene != null)
        scene.addToFront(wnd);
    return wnd;
}
Also used : PotionBandolier(com.shatteredpixel.shatteredpixeldungeon.items.bags.PotionBandolier) WndBag(com.shatteredpixel.shatteredpixeldungeon.windows.WndBag) VelvetPouch(com.shatteredpixel.shatteredpixeldungeon.items.bags.VelvetPouch)

Example 2 with WndBag

use of com.shatteredpixel.shatteredpixeldungeon.windows.WndBag in project shattered-pixel-dungeon-gdx by 00-Evan.

the class Toolbar method createChildren.

@Override
protected void createChildren() {
    add(btnWait = new Tool(24, 0, 20, 26, GameAction.REST) {

        @Override
        protected void onClick() {
            examining = false;
            Dungeon.hero.rest(false);
        }

        protected boolean onLongClick() {
            examining = false;
            Dungeon.hero.rest(true);
            return true;
        }
    });
    add(btnSearch = new Tool(44, 0, 20, 26, GameAction.SEARCH) {

        @Override
        protected void onClick() {
            if (!examining) {
                GameScene.selectCell(informer);
                examining = true;
            } else {
                informer.onSelect(null);
                Dungeon.hero.search(true);
            }
        }

        @Override
        protected boolean onLongClick() {
            Dungeon.hero.search(true);
            return true;
        }
    });
    btnQuick = new QuickslotTool[4];
    add(btnQuick[3] = new QuickslotTool(64, 0, 22, 24, 3, GameAction.QUICKSLOT_4));
    add(btnQuick[2] = new QuickslotTool(64, 0, 22, 24, 2, GameAction.QUICKSLOT_3));
    add(btnQuick[1] = new QuickslotTool(64, 0, 22, 24, 1, GameAction.QUICKSLOT_2));
    add(btnQuick[0] = new QuickslotTool(64, 0, 22, 24, 0, GameAction.QUICKSLOT_1));
    add(btnInventory = new Tool(0, 0, 24, 26, GameAction.BACKPACK) {

        private GoldIndicator gold;

        @Override
        protected void onClick() {
            GameScene.show(new WndBag(Dungeon.hero.belongings.backpack, null, WndBag.Mode.ALL, null));
        }

        @Override
        protected boolean onLongClick() {
            // catalog page
            WndJournal.last_index = 2;
            GameScene.show(new WndJournal());
            return true;
        }

        @Override
        protected void createChildren() {
            super.createChildren();
            gold = new GoldIndicator();
            add(gold);
        }

        @Override
        protected void layout() {
            super.layout();
            gold.fill(this);
        }
    });
    add(pickedUp = new PickedUpItem());
}
Also used : WndJournal(com.shatteredpixel.shatteredpixeldungeon.windows.WndJournal) WndBag(com.shatteredpixel.shatteredpixeldungeon.windows.WndBag)

Aggregations

WndBag (com.shatteredpixel.shatteredpixeldungeon.windows.WndBag)2 PotionBandolier (com.shatteredpixel.shatteredpixeldungeon.items.bags.PotionBandolier)1 VelvetPouch (com.shatteredpixel.shatteredpixeldungeon.items.bags.VelvetPouch)1 WndJournal (com.shatteredpixel.shatteredpixeldungeon.windows.WndJournal)1