Search in sources :

Example 11 with TablePanel

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

the class ActionCostTooltip method getDescriptionAction.

private Action getDescriptionAction() {
    DelayAction addAfter = new DelayAction();
    Action add = new Action() {

        @Override
        public boolean act(float delta) {
            if (getActor() instanceof Group) {
                ((TablePanel) getActor()).row();
                ((TablePanel) getActor()).addElement(getDescription());
            }
            return true;
        }
    };
    // TODO add move up action!
    add.setActor(this);
    addAfter.setAction(add);
    addAfter.setDuration(0.7f);
    addAfter.setTarget(this);
    return addAfter;
}
Also used : Group(com.badlogic.gdx.scenes.scene2d.Group) Action(com.badlogic.gdx.scenes.scene2d.Action) DelayAction(com.badlogic.gdx.scenes.scene2d.actions.DelayAction) DelayAction(com.badlogic.gdx.scenes.scene2d.actions.DelayAction) TablePanel(eidolons.libgdx.gui.panels.TablePanel)

Example 12 with TablePanel

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

the class ScenarioInfoPanel method initHeader.

@Override
protected void initHeader(TablePanel<Actor> header) {
    header.addNormalSize(preview).left().padLeft(20).padTop(45);
    header.addElement(title).left();
    header.row();
    TablePanel<Actor> infoTable = new TablePanel<>();
    header.addNoGrow(infoTable);
    infoTable.padLeft(50).padTop(50);
    missionsInfo = new Label("", StyleHolder.getSizedLabelStyle(FONT.MAGIC, 18));
    missionsInfo.setText("Missions: N/A");
    infoTable.addNoGrow(missionsInfo);
    infoTable.row();
    partyInfo = new Label("", StyleHolder.getSizedLabelStyle(FONT.MAGIC, 18));
    partyInfo.setText("Party: N/A");
    infoTable.addNoGrow(partyInfo);
    infoTable.row();
    mainInfo = new Label("", StyleHolder.getSizedLabelStyle(FONT.MAGIC, 18));
    mainInfo.setText("Difficulty: Unknown");
    infoTable.addNoGrow(mainInfo);
}
Also used : Actor(com.badlogic.gdx.scenes.scene2d.Actor) Label(com.badlogic.gdx.scenes.scene2d.ui.Label) TablePanel(eidolons.libgdx.gui.panels.TablePanel)

Example 13 with TablePanel

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

the class AttackTooltip method updateAct.

@Override
public void updateAct(float delta) {
    clear();
    TablePanel left = new TablePanel();
    final ActionTooltipSource source = (ActionTooltipSource) getUserObject();
    final MultiValueContainer valueContainer = source.getHead();
    final List<Container<Label>> values = valueContainer.getValues();
    final TextureRegion leftImage = getOrCreateR(values.get(0).getActor().getText().toString());
    final TextureRegion rightImage = getOrCreateR(values.get(1).getActor().getText().toString());
    baseTable = new TablePanel();
    baseTable.addElement(null).expand(0, 0).fill(false);
    baseTable.addElement(new ValueContainer(valueContainer.getName(), ""));
    baseTable.addElement(new ValueContainer(leftImage));
    baseTable.addElement(new ValueContainer(rightImage));
    baseTable.row();
    ValueContainer precalcRow = source.getPrecalcRow();
    if (precalcRow != null) {
        Label label = new Label("Est.", StyleHolder.getDefaultLabelStyle());
        baseTable.addElement(label);
        baseTable.addElement(precalcRow);
        baseTable.row();
    }
    List<MultiValueContainer> list = source.getBase();
    for (Object o : list) {
        MultiValueContainer container = (MultiValueContainer) o;
        final List<ValueContainer> separated = container.separate();
        separated.forEach(el -> {
            baseTable.addElement(el);
        });
        baseTable.row();
    }
    rangeTable = new TablePanel();
    list = source.getRange();
    for (Object o : list) {
        MultiValueContainer container = (MultiValueContainer) o;
        final List<ValueContainer> separated = container.separate();
        separated.forEach(el -> {
            rangeTable.addElement(el);
        });
        rangeTable.row();
    }
    List<List<ValueContainer>> listText = source.getText();
    for (List<ValueContainer> valueContainers : listText) {
        TablePanel panel = new TablePanel();
        textTables.add(panel);
        for (ValueContainer container : valueContainers) {
            // container.wrapNames();
            panel.addElement(container);
            panel.row();
        }
    }
    left.addElement(baseTable).width(282).pad(0, 0, 3, 0);
    left.row();
    left.addElement(rangeTable).width(282).pad(0, 0, 3, 0);
    left.row();
    textTables.forEach(el -> {
        left.addElement(el).width(282).pad(0, 0, 3, 0);
        left.row();
    });
    addElement(left);
    CostsPanel costsPanel = new CostsPanel();
    costsPanel.setUserObject(source.getCostsSource());
    addElement(costsPanel);
}
Also used : Label(com.badlogic.gdx.scenes.scene2d.ui.Label) MultiValueContainer(eidolons.libgdx.gui.panels.dc.unitinfo.MultiValueContainer) TextureRegion(com.badlogic.gdx.graphics.g2d.TextureRegion) ValueContainer(eidolons.libgdx.gui.generic.ValueContainer) MultiValueContainer(eidolons.libgdx.gui.panels.dc.unitinfo.MultiValueContainer) Container(com.badlogic.gdx.scenes.scene2d.ui.Container) ArrayList(java.util.ArrayList) List(java.util.List) ValueContainer(eidolons.libgdx.gui.generic.ValueContainer) MultiValueContainer(eidolons.libgdx.gui.panels.dc.unitinfo.MultiValueContainer) TablePanel(eidolons.libgdx.gui.panels.TablePanel)

Example 14 with TablePanel

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

the class WeaponPanel method addWeapons.

protected void addWeapons(ValueContainer mainWeapon, List<ValueContainer> list, String tabName) {
    final TablePanel panel = new TablePanel();
    Cell<ValueContainer> lastCell = panel.add(mainWeapon).left().bottom();
    for (ValueContainer valueContainer : list) {
        lastCell = panel.addElement(valueContainer).expand(0, 0).fill(false).left().bottom().padLeft(5);
    }
    if (lastCell != null) {
        lastCell.expand();
    }
    addTab(panel, tabName);
}
Also used : ValueContainer(eidolons.libgdx.gui.generic.ValueContainer) 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