Search in sources :

Example 6 with ValueContainer

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

the class UnitDataSource method getCounterPoints.

@Override
public ValueContainer getCounterPoints() {
    int c = unit.getIntParam(PARAMS.C_N_OF_COUNTERS);
    int m = unit.getIntParam(PARAMS.N_OF_COUNTERS);
    final String value = c + "/" + m;
    VerticalValueContainer container = new VerticalValueContainer(getOrCreateR(ImageManager.getValueIconPath(PARAMS.N_OF_COUNTERS)), value);
    ValueTooltip toolTip = new ValueTooltip();
    toolTip.setUserObject(Arrays.asList(new ValueContainer(PARAMS.N_OF_COUNTERS.getName(), value)));
    container.addListener(toolTip.getController());
    return container;
}
Also used : ValueTooltip(eidolons.libgdx.gui.tooltips.ValueTooltip) VerticalValueContainer(eidolons.libgdx.gui.generic.VerticalValueContainer) VerticalValueContainer(eidolons.libgdx.gui.generic.VerticalValueContainer) ValueContainer(eidolons.libgdx.gui.generic.ValueContainer)

Example 7 with ValueContainer

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

the class UnitDataSource method getActionPoints.

@Override
public ValueContainer getActionPoints() {
    int c = unit.getIntParam(PARAMS.C_N_OF_ACTIONS);
    int m = unit.getIntParam(PARAMS.N_OF_ACTIONS);
    final String value = c + "/" + m;
    VerticalValueContainer container = getValueContainer(PARAMS.N_OF_ACTIONS, value);
    ValueTooltip toolTip = new ValueTooltip();
    toolTip.setUserObject(Arrays.asList(new ValueContainer(PARAMS.N_OF_ACTIONS.getName(), value)));
    container.addListener(toolTip.getController());
    return container;
}
Also used : ValueTooltip(eidolons.libgdx.gui.tooltips.ValueTooltip) VerticalValueContainer(eidolons.libgdx.gui.generic.VerticalValueContainer) VerticalValueContainer(eidolons.libgdx.gui.generic.VerticalValueContainer) ValueContainer(eidolons.libgdx.gui.generic.ValueContainer)

Example 8 with ValueContainer

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

the class UnitDataSource method getStatsValueContainers.

private List<List<ValueContainer>> getStatsValueContainers(PARAMS[][] unitInfoParamsGeneral) {
    List<List<ValueContainer>> values = new ArrayList<>();
    Arrays.stream(unitInfoParamsGeneral).forEach(ps -> values.add(Arrays.stream(ps).map(p -> {
        String value = unit.getStrParam(p);
        String name = p.getName();
        ValueContainer valueContainer = new ValueContainer(name, value);
        ValueTooltip valueTooltip = new ValueTooltip();
        valueTooltip.setUserObject(Arrays.asList(new ValueContainer(name, value)));
        valueContainer.addListener(valueTooltip.getController());
        return valueContainer;
    }).collect(Collectors.toList())));
    return values;
}
Also used : DC_WeaponObj(eidolons.entity.item.DC_WeaponObj) WeaponTooltip(eidolons.libgdx.gui.panels.dc.unitinfo.tooltips.WeaponTooltip) UNIT_INFO_PARAMS(eidolons.content.UNIT_INFO_PARAMS) Arrays(java.util.Arrays) AttackTooltipFactory(eidolons.libgdx.gui.panels.dc.unitinfo.tooltips.AttackTooltipFactory) UiMaster(eidolons.libgdx.gui.UiMaster) PARAMS(eidolons.content.PARAMS) VerticalValueContainer(eidolons.libgdx.gui.generic.VerticalValueContainer) StringUtils(org.apache.commons.lang3.StringUtils) ArrayList(java.util.ArrayList) WeaponToolTipDataSource(eidolons.libgdx.gui.panels.dc.unitinfo.tooltips.WeaponToolTipDataSource) TextureCache.getOrCreateR(eidolons.libgdx.texture.TextureCache.getOrCreateR) Pair(org.apache.commons.lang3.tuple.Pair) TextureRegion(com.badlogic.gdx.graphics.g2d.TextureRegion) Tooltip(eidolons.libgdx.gui.tooltips.Tooltip) G_PROPS(main.content.values.properties.G_PROPS) DC_UnitAction(eidolons.entity.active.DC_UnitAction) ValueContainer(eidolons.libgdx.gui.generic.ValueContainer) CELL_TYPE(eidolons.libgdx.gui.panels.dc.inventory.InventoryClickHandler.CELL_TYPE) AttackTooltip(eidolons.libgdx.gui.panels.dc.unitinfo.tooltips.AttackTooltip) Collectors(java.util.stream.Collectors) ImmutablePair(org.apache.commons.lang3.tuple.ImmutablePair) PARAMETER(main.content.values.parameters.PARAMETER) ImageManager(main.system.images.ImageManager) List(java.util.List) TextureCache(eidolons.libgdx.texture.TextureCache) ValuePages(eidolons.content.ValuePages) ValueTooltip(eidolons.libgdx.gui.tooltips.ValueTooltip) DC_ArmorObj(eidolons.entity.item.DC_ArmorObj) Unit(eidolons.entity.obj.unit.Unit) ValueTooltip(eidolons.libgdx.gui.tooltips.ValueTooltip) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) VerticalValueContainer(eidolons.libgdx.gui.generic.VerticalValueContainer) ValueContainer(eidolons.libgdx.gui.generic.ValueContainer)

Example 9 with ValueContainer

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

the class UnitDataSource method getParamValues.

@Override
public List<ValueContainer> getParamValues() {
    final DC_ArmorObj armor = unit.getArmor();
    List<ValueContainer> values = new ArrayList<>();
    if (armor != null) {
        final String cd = armor.getStrParam(PARAMS.C_DURABILITY);
        final String d = armor.getStrParam(PARAMS.DURABILITY);
        values.add(new ValueContainer(PARAMS.DURABILITY.getName(), cd + "/" + d));
        final String cover = armor.getStrParam(PARAMS.COVER_PERCENTAGE);
        values.add(new ValueContainer(PARAMS.COVER_PERCENTAGE.getName(), cover));
    }
    return values;
}
Also used : ArrayList(java.util.ArrayList) DC_ArmorObj(eidolons.entity.item.DC_ArmorObj) VerticalValueContainer(eidolons.libgdx.gui.generic.VerticalValueContainer) ValueContainer(eidolons.libgdx.gui.generic.ValueContainer)

Example 10 with ValueContainer

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

the class UnitDataSource method getValueContainer.

private VerticalValueContainer getValueContainer(String valueIconPath, String param, String paramName) {
    final VerticalValueContainer container = new VerticalValueContainer(getOrCreateR(valueIconPath), param);
    container.overrideImageSize(UiMaster.getSmallIconSize(), UiMaster.getSmallIconSize());
    ValueTooltip tooltip = new ValueTooltip();
    tooltip.setUserObject(Arrays.asList(new ValueContainer(paramName, param)));
    container.addListener(tooltip.getController());
    return container;
}
Also used : ValueTooltip(eidolons.libgdx.gui.tooltips.ValueTooltip) VerticalValueContainer(eidolons.libgdx.gui.generic.VerticalValueContainer) VerticalValueContainer(eidolons.libgdx.gui.generic.VerticalValueContainer) 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