Closes #9664
This commit is contained in:
@@ -460,14 +460,21 @@ public class StatValues{
|
||||
}
|
||||
|
||||
public static StatValue itemEffMultiplier(Floatf<Item> efficiency, float timePeriod, Boolf<Item> filter){
|
||||
return itemEffMultiplier(efficiency, timePeriod, filter, null);
|
||||
}
|
||||
|
||||
public static StatValue itemEffMultiplier(Floatf<Item> efficiency, float timePeriod, Boolf<Item> filter, @Nullable ObjectFloatMap<Item> itemDurationMultipliers){
|
||||
return table -> {
|
||||
table.getCells().peek().growX(); //Expand the spacer on the row above to push everything to the left
|
||||
table.row();
|
||||
table.table(c -> {
|
||||
for(Item item : content.items().select(i -> filter.get(i) && i.unlockedNow() && !i.isHidden())){
|
||||
float timeMultiplier = itemDurationMultipliers == null ? 1f : itemDurationMultipliers.get(item, 1f);
|
||||
float time = 1f / (timePeriod * timeMultiplier / 60f);
|
||||
|
||||
c.table(Styles.grayPanel, b -> {
|
||||
b.image(item.uiIcon).size(40).pad(10f).left().scaling(Scaling.fit);
|
||||
b.add(item.localizedName + (timePeriod > 0 ? "\n[lightgray]" + Strings.autoFixed(1f / (timePeriod / 60f), 2) + StatUnit.perSecond.localized() : "")).left().grow();
|
||||
b.add(item.localizedName + (timePeriod > 0 ? "\n[lightgray]" + (time < 0.01f ? Strings.fixed(time, 3) : Strings.autoFixed(time, 2)) + StatUnit.perSecond.localized() : "")).left().grow();
|
||||
b.add(Core.bundle.format("stat.efficiency", fixValue(efficiency.get(item) * 100f))).right().pad(10f).padRight(15f);
|
||||
}).growX().pad(5).row();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user