Search in sources :

Example 31 with ValueContainer

use of eidolons.libgdx.gui.generic.ValueContainer in project Eidolons by IDemiurge.

the class CostTableTooltip method updateAct.

@Override
public void updateAct(float delta) {
    super.updateAct(delta);
    final List<ValueContainer> sources = ((CostTableSource) getUserObject()).getCostsList();
    for (int i = 0; i < sources.size(); i++) {
        final ValueContainer valueContainer = sources.get(i);
        if (i > 0 && i % 2 == 0) {
            row();
        }
        add(valueContainer).expand(1, 0).fill(1, 0);
    }
}
Also used : ValueContainer(eidolons.libgdx.gui.generic.ValueContainer)

Example 32 with ValueContainer

use of eidolons.libgdx.gui.generic.ValueContainer in project Eidolons by IDemiurge.

the class StatsPanel method updateAct.

@Override
public void updateAct(float delta) {
    clear();
    List<List<ValueContainer>> valueContainers = (List<List<ValueContainer>>) getUserObject();
    for (int i = 0; i < valueContainers.size(); i++) {
        List<ValueContainer> valueContainerList = valueContainers.get(i);
        Iterator<ValueContainer> iter = valueContainerList.iterator();
        int rows = valueContainerList.size() / 2;
        if (valueContainerList.size() % 2 != 0) {
            rows++;
        }
        for (int y = 0; y < rows; y++) {
            for (int x = 0; x < 2; x++) {
                if (iter.hasNext()) {
                    ValueContainer next = iter.next();
                    next.setBorder(getOrCreateR("UI/components/infopanel/simple_value_border.png"), false);
                    next.cropName();
                    next.setNameAlignment(Align.left);
                    next.setValueAlignment(Align.right);
                    next.pad(0, 5, 0, 5);
                    addElement(next);
                }
            }
            row();
        }
        addElement(null).pad(0, 0, 10, 0);
        row();
    }
}
Also used : List(java.util.List) ValueContainer(eidolons.libgdx.gui.generic.ValueContainer)

Example 33 with ValueContainer

use of eidolons.libgdx.gui.generic.ValueContainer 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)

Example 34 with ValueContainer

use of eidolons.libgdx.gui.generic.ValueContainer in project Eidolons by IDemiurge.

the class MainParamPanel method addAttributeContainer.

private void addAttributeContainer(String sub) {
    ValueContainer container = new ValueContainer(getOrCreateR("UI/value icons/attributes/" + sub + ".png"), StringMaster.getWellFormattedString(sub), "");
    container.overrideImageSize(UiMaster.getSmallIconSize(), UiMaster.getSmallIconSize());
    containers.add(container);
    addElement(container);
}
Also used : ValueContainer(eidolons.libgdx.gui.generic.ValueContainer)

Example 35 with ValueContainer

use of eidolons.libgdx.gui.generic.ValueContainer in project Eidolons by IDemiurge.

the class MultiValueContainer method separate.

public List<ValueContainer> separate() {
    List<ValueContainer> result = new ArrayList<>();
    if (imageContainer.getActor() != null) {
        result.add(new ValueContainer(imageContainer.getActor().getContent()));
    } else {
        result.add(null);
    }
    result.add(new ValueContainer(nameContainer.getActor()));
    values.forEach(el -> result.add(new ValueContainer(el.getActor())));
    return result;
}
Also used : ArrayList(java.util.ArrayList) ValueContainer(eidolons.libgdx.gui.generic.ValueContainer)

Aggregations

ValueContainer (eidolons.libgdx.gui.generic.ValueContainer)38 ValueTooltip (eidolons.libgdx.gui.tooltips.ValueTooltip)12 ArrayList (java.util.ArrayList)12 TextureRegion (com.badlogic.gdx.graphics.g2d.TextureRegion)10 VerticalValueContainer (eidolons.libgdx.gui.generic.VerticalValueContainer)8 List (java.util.List)8 PARAMS (eidolons.content.PARAMS)7 DC_UnitAction (eidolons.entity.active.DC_UnitAction)5 TextureCache (eidolons.libgdx.texture.TextureCache)5 Arrays (java.util.Arrays)5 PARAMETER (main.content.values.parameters.PARAMETER)5 G_PROPS (main.content.values.properties.G_PROPS)5 Pair (org.apache.commons.lang3.tuple.Pair)5 ClickListener (com.badlogic.gdx.scenes.scene2d.utils.ClickListener)4 UNIT_INFO_PARAMS (eidolons.content.UNIT_INFO_PARAMS)4 DC_ArmorObj (eidolons.entity.item.DC_ArmorObj)4 Unit (eidolons.entity.obj.unit.Unit)4 TablePanel (eidolons.libgdx.gui.panels.TablePanel)4 ImmutablePair (org.apache.commons.lang3.tuple.ImmutablePair)4 InputEvent (com.badlogic.gdx.scenes.scene2d.InputEvent)3