Search in sources :

Example 1 with QuickSlotDataSource

use of eidolons.libgdx.gui.panels.dc.inventory.datasource.QuickSlotDataSource in project Eidolons by IDemiurge.

the class InventoryQuickSlotPanel method afterUpdateAct.

@Override
public void afterUpdateAct(float delta) {
    if (getUserObject() == null)
        return;
    clear();
    super.afterUpdateAct(delta);
    final List<InventoryValueContainer> quickSlots = ((QuickSlotDataSource) getUserObject()).getQuickSlots();
    int maxLength = Math.min(8, quickSlots.size());
    for (int i = 0; i < maxLength; i++) {
        ValueContainer valueContainer = quickSlots.get(i);
        if (valueContainer == null) {
            valueContainer = new ValueContainer(TextureCache.getOrCreateR("UI/empty_pack.jpg"));
        }
        addElement(valueContainer).fill(0, 1).expand(0, 1).center();
    }
}
Also used : QuickSlotDataSource(eidolons.libgdx.gui.panels.dc.inventory.datasource.QuickSlotDataSource) ValueContainer(eidolons.libgdx.gui.generic.ValueContainer)

Aggregations

ValueContainer (eidolons.libgdx.gui.generic.ValueContainer)1 QuickSlotDataSource (eidolons.libgdx.gui.panels.dc.inventory.datasource.QuickSlotDataSource)1