Search in sources :

Example 1 with ValueTooltip

use of eidolons.libgdx.gui.tooltips.ValueTooltip in project Eidolons by IDemiurge.

the class RadialManager method addSimpleTooltip.

public static void addSimpleTooltip(RadialValueContainer el, String name) {
    ValueTooltip tooltip = new ValueTooltip();
    tooltip.setUserObject(Arrays.asList(new ValueContainer(name, "")));
    for (com.badlogic.gdx.scenes.scene2d.EventListener sub : el.getListeners()) {
        if (!(sub instanceof ClickListener))
            el.removeListener(sub);
    }
    el.addListener(tooltip.getController());
}
Also used : ValueTooltip(eidolons.libgdx.gui.tooltips.ValueTooltip) ValueContainer(eidolons.libgdx.gui.generic.ValueContainer) ClickListener(com.badlogic.gdx.scenes.scene2d.utils.ClickListener)

Example 2 with ValueTooltip

use of eidolons.libgdx.gui.tooltips.ValueTooltip 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 3 with ValueTooltip

use of eidolons.libgdx.gui.tooltips.ValueTooltip 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 4 with ValueTooltip

use of eidolons.libgdx.gui.tooltips.ValueTooltip 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 5 with ValueTooltip

use of eidolons.libgdx.gui.tooltips.ValueTooltip 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

ValueTooltip (eidolons.libgdx.gui.tooltips.ValueTooltip)10 ValueContainer (eidolons.libgdx.gui.generic.ValueContainer)9 VerticalValueContainer (eidolons.libgdx.gui.generic.VerticalValueContainer)4 TextureRegion (com.badlogic.gdx.graphics.g2d.TextureRegion)3 ClickListener (com.badlogic.gdx.scenes.scene2d.utils.ClickListener)3 InputEvent (com.badlogic.gdx.scenes.scene2d.InputEvent)2 PARAMS (eidolons.content.PARAMS)2 ArrayList (java.util.ArrayList)2 PARAMETER (main.content.values.parameters.PARAMETER)2 ImmutablePair (org.apache.commons.lang3.tuple.ImmutablePair)2 Pair (org.apache.commons.lang3.tuple.Pair)2 Actor (com.badlogic.gdx.scenes.scene2d.Actor)1 Image (com.badlogic.gdx.scenes.scene2d.ui.Image)1 Label (com.badlogic.gdx.scenes.scene2d.ui.Label)1 WidgetGroup (com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup)1 NinePatchDrawable (com.badlogic.gdx.scenes.scene2d.utils.NinePatchDrawable)1 UNIT_INFO_PARAMS (eidolons.content.UNIT_INFO_PARAMS)1 ValuePages (eidolons.content.ValuePages)1 DC_UnitAction (eidolons.entity.active.DC_UnitAction)1 DC_ArmorObj (eidolons.entity.item.DC_ArmorObj)1