Search in sources :

Example 16 with ValueContainer

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

the class EffectAndAbilitiesPanel method updateAct.

@Override
public void updateAct(float delta) {
    clear();
    EffectsAndAbilitiesSource source = (EffectsAndAbilitiesSource) getUserObject();
    final int h = 3;
    final int w = 4;
    List<ValueContainer> effects = source.getBuffs();
    IconGrid effectsGrid = new IconGrid(effects, w, h);
    addElement(effectsGrid).size(32 * w, 32 * h);
    List<ValueContainer> abils = source.getAbilities();
    IconGrid abilsGrid = new IconGrid(abils, w, h);
    addElement(abilsGrid).size(32 * w, 32 * h);
}
Also used : EffectsAndAbilitiesSource(eidolons.libgdx.gui.panels.dc.unitinfo.datasource.EffectsAndAbilitiesSource) ValueContainer(eidolons.libgdx.gui.generic.ValueContainer)

Example 17 with ValueContainer

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

the class HeroScreenDataSourceImpl method getUnlockedMasteries.

@Override
public List<ValueContainer> getUnlockedMasteries() {
    List<ValueContainer> list = new ArrayList<>();
    for (PARAMS params : DC_ContentManager.getMasteryParams()) {
        Integer v = hero.getIntParam(params);
        if (v > 0) {
            TextureRegion texture = TextureCache.getOrCreateR(ImageManager.getValueIconPath(params));
            list.add(new ValueContainer(texture, params.getName(), String.valueOf(v)));
        }
    }
    return null;
}
Also used : TextureRegion(com.badlogic.gdx.graphics.g2d.TextureRegion) ArrayList(java.util.ArrayList) ValueContainer(eidolons.libgdx.gui.generic.ValueContainer) PARAMS(eidolons.content.PARAMS)

Example 18 with ValueContainer

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

the class InitiativePanel method init.

private void init() {
    queue = new QueueViewContainer[maxSize];
    queueGroup = new WidgetGroup();
    queueGroup.setBounds(0, 0, imageSize * visualSize + (offset - 1) * visualSize, imageSize);
    container = new Container<>(queueGroup);
    container.setBounds(imageSize - offset, queueOffsetY, imageSize * visualSize + (offset - 1) * visualSize, imageSize);
    container.left().bottom();
    if (ExplorationMaster.isExplorationOn()) {
        container.setY(imageSize);
        container.setVisible(false);
    }
    addActor(container);
    final TextureRegion textureRegion = getOrCreateR(StrPathBuilder.build("UI", "components", "2017", "panels", "initiativepanel", "initiativePanel plain.png"));
    panelImage = new ValueContainer(textureRegion);
    // 
    panelImage.setPosition(50, 25 + queueOffsetY);
    // image.align(Align.bottomLeft);
    // image.overrideImageSize(imageSize, imageSize);
    // image.setSize(imageSize, imageSize);
    ValueTooltip tooltip = new ValueTooltip();
    tooltip.setUserObject(Arrays.asList(new ValueContainer("Good time to die!", "")));
    panelImage.addListener(tooltip.getController());
    addActor(panelImage);
    // panelImage.setPosition(0, -textureRegion.getRegionHeight());
    setBounds(0, 0, imageSize * visualSize + (offset - 1) * visualSize, // textureRegion.getRegionHeight()
    imageSize + queueOffsetY);
    light = new SuperContainer(new Image(TextureCache.getOrCreateR(SHADE_LIGHT.LIGHT_EMITTER.getTexturePath())), true);
    clock = animatedClock ? createAnimatedClock() : new SuperContainer(new Image(TextureCache.getOrCreateR(StrPathBuilder.build("UI", "components", "2017", "panels", "initiativepanel", "clock.png"))), true) {

        @Override
        protected float getAlphaFluctuationMin() {
            return 0.6f;
        }

        @Override
        protected float getAlphaFluctuationPerDelta() {
            return super.getAlphaFluctuationPerDelta() / 3;
        }
    };
    clock.addListener(getClockListener());
    addActor(light);
    light.setPosition(-15, -14);
    addActor(clock);
    clock.setPosition(-23, -31);
    timeLabel = new Label("Time", StyleHolder.getSizedLabelStyle(FONT.NYALA, 22));
    addActor(timeLabel);
    timeLabel.setPosition(15, 100);
}
Also used : ValueTooltip(eidolons.libgdx.gui.tooltips.ValueTooltip) TextureRegion(com.badlogic.gdx.graphics.g2d.TextureRegion) SuperContainer(eidolons.libgdx.bf.generic.SuperContainer) Label(com.badlogic.gdx.scenes.scene2d.ui.Label) WidgetGroup(com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup) ValueContainer(eidolons.libgdx.gui.generic.ValueContainer) Image(com.badlogic.gdx.scenes.scene2d.ui.Image)

Example 19 with ValueContainer

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

the class BaseSlotPanel method addValueContainer.

protected void addValueContainer(TablePanel page, ValueContainer valueContainer, TextureRegion emptySlotTexture) {
    if (valueContainer == null) {
        valueContainer = new ValueContainer(emptySlotTexture);
    }
    if (imageSize > 0) {
        valueContainer.overrideImageSize(imageSize, imageSize);
        float scale = imageSize / valueContainer.getImageContainer().getActor().getWidth();
        valueContainer.setScale(scale, scale);
    }
    page.add(valueContainer).left().bottom().size(imageSize);
}
Also used : ValueContainer(eidolons.libgdx.gui.generic.ValueContainer)

Example 20 with ValueContainer

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

the class OrbsPanel method addTooltip.

public static void addTooltip(OrbElement el, String name, String val) {
    ValueTooltip tooltip = new ValueTooltip();
    tooltip.setUserObject(Arrays.asList(new ValueContainer(el.getIconRegion(), name, val)));
    el.addListener(tooltip.getController());
}
Also used : ValueTooltip(eidolons.libgdx.gui.tooltips.ValueTooltip) 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