This commit is contained in:
Anuken
2020-12-27 10:16:34 -05:00
parent c02d603a7a
commit 16778ea16c
4 changed files with 14 additions and 8 deletions

View File

@@ -43,10 +43,12 @@ public class ConsumeItemDynamic extends Consume{
private void rebuild(Building tile, Table table){
table.clear();
int i = 0;
for(ItemStack stack : items.get(tile)){
table.add(new ReqImage(new ItemImage(stack.item.icon(Cicon.medium), stack.amount),
() -> tile.items != null && tile.items.has(stack.item, stack.amount))).padRight(8);
() -> tile.items != null && tile.items.has(stack.item, stack.amount))).padRight(8).left();
if(++i % 4 == 0) table.row();
}
}

View File

@@ -34,10 +34,14 @@ public class ConsumeItems extends Consume{
@Override
public void build(Building tile, Table table){
for(ItemStack stack : items){
table.add(new ReqImage(new ItemImage(stack.item.icon(Cicon.medium), stack.amount),
table.table(c -> {
int i = 0;
for(ItemStack stack : items){
c.add(new ReqImage(new ItemImage(stack.item.icon(Cicon.medium), stack.amount),
() -> tile.items != null && tile.items.has(stack.item, stack.amount))).padRight(8);
}
if(++i % 4 == 0) table.row();
}
}).left();
}
@Override