Changed Item to class. This required way more modifications than Liquids.
This commit is contained in:
@@ -93,7 +93,7 @@ public class UpgradeDialog extends FloatingDialog{
|
||||
for(ItemStack s : req){
|
||||
|
||||
int amount = Math.min(Vars.control.getAmount(s.item), s.amount);
|
||||
reqtable.addImage(Draw.region("icon-" + s.item.name())).padRight(3).size(8*2);
|
||||
reqtable.addImage(Draw.region("icon-" + s.item.name)).padRight(3).size(8*2);
|
||||
reqtable.add(
|
||||
(amount >= s.amount ? "" : "[RED]")
|
||||
+ amount + " / " +s.amount, 0.5f).left();
|
||||
|
||||
@@ -261,7 +261,7 @@ public class BlocksFragment implements Fragment{
|
||||
|
||||
for(ItemStack stack : recipe.requirements){
|
||||
ItemStack fs = stack;
|
||||
requirements.addImage(Draw.region("icon-"+stack.item.name())).size(8*3);
|
||||
requirements.addImage(Draw.region("icon-"+stack.item.name)).size(8*3);
|
||||
Label reqlabel = new Label("");
|
||||
|
||||
reqlabel.update(()->{
|
||||
@@ -295,13 +295,11 @@ public class BlocksFragment implements Fragment{
|
||||
return;
|
||||
}
|
||||
|
||||
Item[] items = Item.values();
|
||||
|
||||
for(int i = 0; i < control.getItems().length; i ++){
|
||||
int amount = control.getItems()[i];
|
||||
if(amount == 0) continue;
|
||||
String formatted = amount > 99999999 ? "inf" : format(amount);
|
||||
Image image = new Image(Draw.region("icon-" + items[i].name()));
|
||||
Image image = new Image(Draw.region("icon-" + Item.items.get(i).name));
|
||||
Label label = new Label(formatted);
|
||||
label.setFontScale(fontscale*1.5f);
|
||||
itemtable.add(image).size(8*3);
|
||||
|
||||
Reference in New Issue
Block a user