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);
}
}
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();
}
}
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);
}
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);
}
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;
}
Aggregations