use of eidolons.libgdx.gui.generic.ValueContainer in project Eidolons by IDemiurge.
the class ResistPanel method addContainer.
void addContainer(Pair<TextureRegion, DAMAGE_TYPE> pair) {
ValueContainer valueContainer = new ValueContainer(pair.getLeft(), "n/a");
valueContainer.setSize(32, 32);
map.put(pair.getRight(), valueContainer);
addElement(valueContainer);
}
use of eidolons.libgdx.gui.generic.ValueContainer in project Eidolons by IDemiurge.
the class ResistPanel method updateAct.
@Override
public void updateAct(float delta) {
List<Pair<PARAMETER, String>> source = (List<Pair<PARAMETER, String>>) getUserObject();
source.forEach(pair -> {
PARAMS param = (PARAMS) pair.getLeft();
DAMAGE_TYPE damageType = getFromParams(param);
if (map.containsKey(damageType)) {
final ValueContainer container = map.get(damageType);
ValueTooltip valueTooltip = new ValueTooltip();
valueTooltip.setUserObject((Supplier) () -> Arrays.asList(new ValueContainer(param.getName(), "")));
container.addListener(valueTooltip.getController());
container.updateValue(pair.getRight() + "%");
}
});
}
use of eidolons.libgdx.gui.generic.ValueContainer in project Eidolons by IDemiurge.
the class UnitDataSource method getArmorObj.
@Override
public ValueContainer getArmorObj() {
final DC_ArmorObj armor = unit.getArmor();
final ValueContainer container;
if (armor != null) {
container = new ValueContainer(getOrCreateR(armor.getImagePath()));
WeaponTooltip tooltip = new WeaponTooltip();
tooltip.setUserObject(new WeaponToolTipDataSource() {
@Override
public List<ValueContainer> getMainParams() {
return Arrays.stream(ARMOR_TOOLTIP).map(el -> new ValueContainer(el.getName(), armor.getStrParam(el)).pad(10)).collect(Collectors.toList());
}
@Override
public List<ValueContainer> getBuffs() {
return armor.getBuffs().stream().filter(obj -> StringUtils.isNoneEmpty(obj.getType().getProperty(G_PROPS.IMAGE))).map(AttackTooltipFactory.getObjValueContainerMapper()).collect(Collectors.toList());
}
});
container.addListener(tooltip.getController());
} else {
container = new ValueContainer(getOrCreateR(CELL_TYPE.ARMOR.getSlotImagePath()));
}
return container;
}
Aggregations