Search in sources :

Example 6 with TablePanel

use of eidolons.libgdx.gui.panels.TablePanel in project Eidolons by IDemiurge.

the class WeaponTooltip method updateAct.

@Override
public void updateAct(float delta) {
    final WeaponToolTipDataSource source = (WeaponToolTipDataSource) getUserObject();
    addElement(initTableValues(source.getMainParams()));
    row();
    if (source.getBuffs().size() > 0) {
        TablePanel buffsTable = new TablePanel();
        source.getBuffs().forEach(el -> {
            el.overrideImageSize(32, 32);
            buffsTable.addElement(el);
        });
        addElement(buffsTable).padTop(5);
    }
}
Also used : TablePanel(eidolons.libgdx.gui.panels.TablePanel)

Example 7 with TablePanel

use of eidolons.libgdx.gui.panels.TablePanel in project Eidolons by IDemiurge.

the class ContainerPanel method initListeners.

private void initListeners() {
    clear();
    TextureRegion textureRegion = new TextureRegion(getOrCreateR("UI/components/inventory_background.png"));
    TextureRegionDrawable drawable = new TextureRegionDrawable(textureRegion);
    setBackground(drawable);
    inventorySlotsPanel = new InventorySlotsPanel();
    containerSlotsPanel = new InventorySlotsPanel();
    portrait = new Image();
    portrait.setSize(GridMaster.CELL_W, GridMaster.CELL_H);
    addElement(portrait).top().height(GridMaster.CELL_H).width(GridMaster.CELL_W);
    row();
    addElement(inventorySlotsPanel).height(340).pad(20, 20, 0, 20).top().expand(1, 0);
    row();
    addElement(containerSlotsPanel).height(340).pad(20, 30, 0, 20).top().expand(1, 0);
    // initListeners();
    final TablePanel<Actor> lower = new TablePanel<>();
    addElement(lower).pad(0, 30, 20, 20);
    takeAllButton = lower.addElement(new TextButton("Take All", StyleHolder.getDefaultTextButtonStyle())).fill(false).expand(0, 0).right().pad(20, 10, 20, 10).size(50, 50);
    GuiEventManager.bind(SHOW_LOOT_PANEL, (obj) -> {
        final Pair<InventoryDataSource, ContainerDataSource> param = (Pair<InventoryDataSource, ContainerDataSource>) obj.get();
        if (param == null) {
            close();
        } else {
            open();
            inventorySlotsPanel.setUserObject(param.getKey());
            containerSlotsPanel.setUserObject(param.getValue());
            if (containerSlotsPanel.getListeners().size > 0)
                inventorySlotsPanel.addListener(containerSlotsPanel.getListeners().first());
            TextButton button = (TextButton) takeAllButton.getActor();
            button.getListeners().clear();
            final ContainerDataSource source = param.getValue();
            button.addListener(new ClickListener() {

                @Override
                public void clicked(InputEvent event, float x, float y) {
                    source.getHandler().takeAllClicked();
                }
            });
            portrait.setDrawable(TextureCache.getOrCreateTextureRegionDrawable(StringMaster.getAppendedImageFile(source.getHandler().getContainer().getImagePath(), ContainerMaster.OPEN)));
        }
    });
    addListener(new InputListener() {

        @Override
        public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
            event.stop();
            return true;
        }

        @Override
        public boolean mouseMoved(InputEvent event, float x, float y) {
            event.stop();
            return true;
        }
    });
}
Also used : TextButton(com.badlogic.gdx.scenes.scene2d.ui.TextButton) TextureRegionDrawable(com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable) Image(com.badlogic.gdx.scenes.scene2d.ui.Image) TextureRegion(com.badlogic.gdx.graphics.g2d.TextureRegion) InventoryDataSource(eidolons.libgdx.gui.panels.dc.inventory.datasource.InventoryDataSource) InventorySlotsPanel(eidolons.libgdx.gui.panels.dc.inventory.InventorySlotsPanel) InputListener(com.badlogic.gdx.scenes.scene2d.InputListener) Actor(com.badlogic.gdx.scenes.scene2d.Actor) InputEvent(com.badlogic.gdx.scenes.scene2d.InputEvent) ClickListener(com.badlogic.gdx.scenes.scene2d.utils.ClickListener) TablePanel(eidolons.libgdx.gui.panels.TablePanel) Pair(org.apache.commons.lang3.tuple.Pair)

Example 8 with TablePanel

use of eidolons.libgdx.gui.panels.TablePanel in project Eidolons by IDemiurge.

the class UnitInfoPanel method initInnerPanels.

private void initInnerPanels() {
    TablePanel left = new TablePanel();
    MainWeaponPanel mainWeaponPanel = new MainWeaponPanel();
    left.addElement(mainWeaponPanel).height(184);
    left.row();
    ResourcePanel resourcePanel = new ResourcePanel();
    left.addElement(resourcePanel).minHeight(210);
    left.row();
    MainParamPanel mainParamPanel = new MainParamPanel();
    left.addElement(mainParamPanel).minHeight(214);
    left.row();
    EffectAndAbilitiesPanel effectAndAbilitiesPanel = new EffectAndAbilitiesPanel();
    left.addElement(effectAndAbilitiesPanel);
    left.row();
    addElement(left).maxWidth(360);
    TablePanel mid = new TablePanel();
    AvatarPanel avatarPanel = new AvatarPanel();
    mid.addElement(avatarPanel);
    mid.row();
    CounterAndActionPointsPanel pointsPanel = new CounterAndActionPointsPanel();
    mid.addElement(pointsPanel);
    mid.row();
    mid.addElement(getPanelSeparator()).expand().center();
    mid.row();
    MainAttributesPanel attributesPanel = new MainAttributesPanel();
    mid.addElement(attributesPanel).expand().center();
    mid.row();
    ArmorPanel armorPanel = new ArmorPanel();
    mid.addElement(armorPanel);
    mid.row();
    mid.addElement(getPanelSeparator()).expand().center();
    mid.row();
    ResistInfoTabsPanel resistTabs = new ResistInfoTabsPanel();
    mid.addElement(resistTabs);
    mid.row();
    addElement(mid);
    TablePanel right = new TablePanel();
    OffWeaponPanel offWeaponPanel = new OffWeaponPanel();
    right.add(offWeaponPanel).height(184).top();
    right.row();
    StatsTabsPanel statsTabsPanel = new StatsTabsPanel();
    right.addElement(statsTabsPanel).grow().fill(1, 0).top();
    right.row();
    right.addElement(null);
    addElement(right).maxWidth(360);
}
Also used : TablePanel(eidolons.libgdx.gui.panels.TablePanel)

Example 9 with TablePanel

use of eidolons.libgdx.gui.panels.TablePanel in project Eidolons by IDemiurge.

the class QuickSlotPanel method initPage.

@Override
protected TablePanel initPage(List<ActionValueContainer> sources, String emptyImagePath) {
    TablePanel page = new TablePanel();
    for (int i = 0; i < getPageSize(); i++) {
        ActionValueContainer valueContainer = null;
        if (sources.size() > i) {
            valueContainer = sources.get(i);
            if (page == null)
                emptyImagePath = ("UI/empty_pack.jpg");
        }
        addValueContainer(page, valueContainer, getOrCreateR(emptyImagePath));
    }
    return page;
}
Also used : TablePanel(eidolons.libgdx.gui.panels.TablePanel)

Example 10 with TablePanel

use of eidolons.libgdx.gui.panels.TablePanel in project Eidolons by IDemiurge.

the class BaseSlotPanel method initPage.

protected TablePanel initPage(List<ActionValueContainer> sources, String emptyImagePath) {
    TablePanel page = new TablePanel();
    for (int i = 0; i < getPageSize(); i++) {
        ActionValueContainer valueContainer = null;
        if (sources.size() > i)
            valueContainer = sources.get(i);
        addValueContainer(page, valueContainer, getOrCreateR(emptyImagePath));
    }
    return page;
}
Also used : TablePanel(eidolons.libgdx.gui.panels.TablePanel)

Aggregations

TablePanel (eidolons.libgdx.gui.panels.TablePanel)14 ValueContainer (eidolons.libgdx.gui.generic.ValueContainer)4 TextureRegion (com.badlogic.gdx.graphics.g2d.TextureRegion)3 Actor (com.badlogic.gdx.scenes.scene2d.Actor)3 InputEvent (com.badlogic.gdx.scenes.scene2d.InputEvent)2 Label (com.badlogic.gdx.scenes.scene2d.ui.Label)2 ClickListener (com.badlogic.gdx.scenes.scene2d.utils.ClickListener)2 Action (com.badlogic.gdx.scenes.scene2d.Action)1 Group (com.badlogic.gdx.scenes.scene2d.Group)1 InputListener (com.badlogic.gdx.scenes.scene2d.InputListener)1 DelayAction (com.badlogic.gdx.scenes.scene2d.actions.DelayAction)1 Container (com.badlogic.gdx.scenes.scene2d.ui.Container)1 Image (com.badlogic.gdx.scenes.scene2d.ui.Image)1 TextButton (com.badlogic.gdx.scenes.scene2d.ui.TextButton)1 NinePatchDrawable (com.badlogic.gdx.scenes.scene2d.utils.NinePatchDrawable)1 TextureRegionDrawable (com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable)1 Unit (eidolons.entity.obj.unit.Unit)1 Route (eidolons.game.module.adventure.map.Route)1 InventorySlotsPanel (eidolons.libgdx.gui.panels.dc.inventory.InventorySlotsPanel)1 InventoryDataSource (eidolons.libgdx.gui.panels.dc.inventory.datasource.InventoryDataSource)1