Separator output display
This commit is contained in:
@@ -38,7 +38,14 @@ public class Separator extends Block{
|
||||
stats.timePeriod = craftTime;
|
||||
super.setStats();
|
||||
|
||||
stats.add(Stat.output, StatValues.items(item -> Structs.contains(results, i -> i.item == item)));
|
||||
int[] sum = {0};
|
||||
for(var r : results) sum[0] += r.amount;
|
||||
|
||||
stats.add(Stat.output, table -> {
|
||||
for(ItemStack stack : results){
|
||||
table.add(StatValues.displayItemPercent(stack.item, (int)((float)stack.amount / sum[0] * 100), true)).padRight(5);
|
||||
}
|
||||
});
|
||||
stats.add(Stat.productionTime, craftTime / 60f, StatUnit.seconds);
|
||||
}
|
||||
|
||||
|
||||
@@ -137,7 +137,7 @@ public class UnitFactory extends UnitBlock{
|
||||
}
|
||||
|
||||
ItemStack stack = plan.requirements[i];
|
||||
req.add(new ItemDisplay(stack.item, stack.amount, plan.time, true)).pad(5);
|
||||
req.add(StatValues.displayItem(stack.item, stack.amount, plan.time, true)).pad(5);
|
||||
}
|
||||
}).right().grow().pad(10f);
|
||||
}else{
|
||||
|
||||
Reference in New Issue
Block a user