Search in sources :

Example 1 with InventoryTableDataSource

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

the class InventorySlotsPanel method afterUpdateAct.

@Override
public void afterUpdateAct(float delta) {
    if (getUserObject() == null)
        return;
    clear();
    super.afterUpdateAct(delta);
    final List<InventoryValueContainer> inventorySlots = ((InventoryTableDataSource) getUserObject()).getInventorySlots();
    for (int i = 0; i < SIZE; i++) {
        ValueContainer valueContainer = inventorySlots.get(i);
        if (valueContainer == null) {
            valueContainer = new ValueContainer(getOrCreateR("UI/empty_pack.jpg"));
        }
        add(valueContainer).expand(0, 0);
        if ((i + 1) % COLUMNS == 0) {
            row();
        }
    }
}
Also used : ValueContainer(eidolons.libgdx.gui.generic.ValueContainer) InventoryTableDataSource(eidolons.libgdx.gui.panels.dc.inventory.datasource.InventoryTableDataSource)

Aggregations

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