Search in sources :

Example 1 with WndJournal

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

the class StatusPane method createChildren.

@Override
protected void createChildren() {
    bg = new NinePatch(Assets.STATUS, 0, 0, 128, 36, 85, 0, 45, 0);
    add(bg);
    add(new TouchArea<GameAction>(0, 1, 31, 31) {

        @Override
        protected void onClick(NoosaInputProcessor.Touch touch) {
            Image sprite = Dungeon.hero.sprite;
            if (!sprite.isVisible()) {
                Camera.main.focusOn(sprite);
            }
            GameScene.show(new WndHero());
        }

        @Override
        public boolean onKeyUp(NoosaInputProcessor.Key<GameAction> key) {
            boolean handled = true;
            switch(key.action) {
                case HERO_INFO:
                    onClick(null);
                    break;
                case JOURNAL:
                    GameScene.show(new WndJournal());
                    break;
                default:
                    handled = false;
                    break;
            }
            return handled;
        }
    });
    btnJournal = new JournalButton();
    add(btnJournal);
    btnMenu = new MenuButton();
    add(btnMenu);
    avatar = HeroSprite.avatar(Dungeon.hero.heroClass, lastTier);
    add(avatar);
    compass = new Compass(Statistics.amuletObtained ? Dungeon.level.entrance : Dungeon.level.exit);
    add(compass);
    rawShielding = new Image(Assets.SHLD_BAR);
    rawShielding.alpha(0.5f);
    add(rawShielding);
    shieldedHP = new Image(Assets.SHLD_BAR);
    add(shieldedHP);
    hp = new Image(Assets.HP_BAR);
    add(hp);
    exp = new Image(Assets.XP_BAR);
    add(exp);
    bossHP = new BossHealthBar();
    add(bossHP);
    level = new BitmapText(PixelScene.pixelFont);
    level.hardlight(0xFFEBA4);
    add(level);
    depth = new BitmapText(Integer.toString(Dungeon.depth), PixelScene.pixelFont);
    depth.hardlight(0xCACFC2);
    depth.measure();
    add(depth);
    danger = new DangerIndicator();
    add(danger);
    buffs = new BuffIndicator(Dungeon.hero);
    add(buffs);
    add(pickedUp = new Toolbar.PickedUpItem());
}
Also used : WndJournal(com.shatteredpixel.shatteredpixeldungeon.windows.WndJournal) NinePatch(com.watabou.noosa.NinePatch) Image(com.watabou.noosa.Image) WndHero(com.shatteredpixel.shatteredpixeldungeon.windows.WndHero) BitmapText(com.watabou.noosa.BitmapText) NoosaInputProcessor(com.watabou.input.NoosaInputProcessor) GameAction(com.shatteredpixel.shatteredpixeldungeon.input.GameAction)

Example 2 with WndJournal

use of com.shatteredpixel.shatteredpixeldungeon.windows.WndJournal 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

WndJournal (com.shatteredpixel.shatteredpixeldungeon.windows.WndJournal)2 GameAction (com.shatteredpixel.shatteredpixeldungeon.input.GameAction)1 WndBag (com.shatteredpixel.shatteredpixeldungeon.windows.WndBag)1 WndHero (com.shatteredpixel.shatteredpixeldungeon.windows.WndHero)1 NoosaInputProcessor (com.watabou.input.NoosaInputProcessor)1 BitmapText (com.watabou.noosa.BitmapText)1 Image (com.watabou.noosa.Image)1 NinePatch (com.watabou.noosa.NinePatch)1