This commit is contained in:
Anuken
2019-09-05 21:44:49 -04:00
parent 5d04f93a88
commit b492c7ae27
9 changed files with 25 additions and 10 deletions

View File

@@ -13,11 +13,15 @@ public class ItemDisplay extends Table{
this(item, 0);
}
public ItemDisplay(Item item, int amount){
add(new ItemImage(new ItemStack(item, amount))).size(8 * 4);
add(item.localizedName()).padLeft(4);
public ItemDisplay(Item item, int amount, boolean showName){
add(new ItemImage(new ItemStack(item, amount))).size(8 * 4).padRight(amount > 99 ? 12 : 0);
if(showName) add(item.localizedName()).padLeft(4 + amount > 99 ? 4 : 0);
this.item = item;
this.amount = amount;
}
public ItemDisplay(Item item, int amount){
this(item, amount, true);
}
}

View File

@@ -27,7 +27,7 @@ public class LiquidDisplay extends Table{
t.add(Strings.autoFixed(amount, 1));
add(t);
}
}}).size(8 * 4).padRight(3);
}}).size(8 * 4).padRight(3 + (amount != 0 && Strings.autoFixed(amount, 1).length() > 2 ? 8 : 0));
if(perSecond){
add(StatUnit.perSecond.localized()).padLeft(2).padRight(5).color(Color.LIGHT_GRAY);