Search in sources :

Example 1 with ActionCostSourceImpl

use of eidolons.libgdx.gui.panels.dc.actionpanel.datasource.ActionCostSourceImpl in project Eidolons by IDemiurge.

the class RadialManager method addCostTooltip.

public static void addCostTooltip(DC_ActiveObj el, ValueContainer valueContainer) {
    ActionCostTooltip tooltip = new ActionCostTooltip(el);
    tooltip.setRadial(true);
    tooltip.setUserObject(new ActionCostSourceImpl(el));
    valueContainer.addListener(tooltip.getController());
}
Also used : ActionCostTooltip(eidolons.libgdx.gui.panels.dc.actionpanel.tooltips.ActionCostTooltip) ActionCostSourceImpl(eidolons.libgdx.gui.panels.dc.actionpanel.datasource.ActionCostSourceImpl)

Example 2 with ActionCostSourceImpl

use of eidolons.libgdx.gui.panels.dc.actionpanel.datasource.ActionCostSourceImpl in project Eidolons by IDemiurge.

the class SpellRadialManager method createNodeBranch.

private static RadialValueContainer createNodeBranch(RADIAL_ITEM object, Unit source, DC_Obj target) {
    RadialValueContainer valueContainer;
    if (object instanceof EntityNode) {
        final DC_ActiveObj action = (DC_ActiveObj) object.getContents();
        valueContainer = RadialManager.configureActionNode(target, action);
        ActionCostTooltip tooltip = new ActionCostTooltip(action);
        tooltip.setRadial(true);
        tooltip.setUserObject(new ActionCostSourceImpl(action));
        valueContainer.addListener(tooltip.getController());
    } else {
        valueContainer = new SpellRadialContainer(TextureCache.getOrCreateSizedRegion(UiMaster.getIconSize(), object.getTexturePath()), null);
        valueContainer.setChildNodes(object.getItems(source).stream().map(el -> createNodeBranch(el, source, target)).collect(Collectors.toList()));
        String tooltip = StringMaster.getWellFormattedString(object.getContents().toString());
        addSimpleTooltip(valueContainer, tooltip);
    }
    return valueContainer;
}
Also used : ActionCostTooltip(eidolons.libgdx.gui.panels.dc.actionpanel.tooltips.ActionCostTooltip) DC_ActiveObj(eidolons.entity.active.DC_ActiveObj) ActionCostSourceImpl(eidolons.libgdx.gui.panels.dc.actionpanel.datasource.ActionCostSourceImpl)

Aggregations

ActionCostSourceImpl (eidolons.libgdx.gui.panels.dc.actionpanel.datasource.ActionCostSourceImpl)2 ActionCostTooltip (eidolons.libgdx.gui.panels.dc.actionpanel.tooltips.ActionCostTooltip)2 DC_ActiveObj (eidolons.entity.active.DC_ActiveObj)1