Merge
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package io.anuke.mindustry.ui;
|
||||
|
||||
import io.anuke.arc.Core;
|
||||
import io.anuke.arc.collection.Array;
|
||||
import io.anuke.arc.collection.OrderedMap;
|
||||
import io.anuke.arc.graphics.Color;
|
||||
import io.anuke.arc.scene.ui.layout.Table;
|
||||
@@ -45,7 +46,7 @@ public class ContentDisplay{
|
||||
BlockStats stats = block.stats;
|
||||
|
||||
for(StatCategory cat : stats.toMap().keys()){
|
||||
OrderedMap<BlockStat, StatValue> map = stats.toMap().get(cat);
|
||||
OrderedMap<BlockStat, Array<StatValue>> map = stats.toMap().get(cat);
|
||||
|
||||
if(map.size == 0) continue;
|
||||
|
||||
@@ -56,7 +57,13 @@ public class ContentDisplay{
|
||||
table.table(inset -> {
|
||||
inset.left();
|
||||
inset.add("[LIGHT_GRAY]" + stat.localized() + ":[] ");
|
||||
map.get(stat).display(inset);
|
||||
Array<StatValue> arr = map.get(stat);
|
||||
for(StatValue value : arr){
|
||||
value.display(inset);
|
||||
inset.add().size(10f);
|
||||
}
|
||||
|
||||
//map.get(stat).display(inset);
|
||||
}).fillX().padLeft(10);
|
||||
table.row();
|
||||
}
|
||||
@@ -201,7 +208,7 @@ public class ContentDisplay{
|
||||
|
||||
table.add(Core.bundle.format("unit.health", unit.health));
|
||||
table.row();
|
||||
table.add(Core.bundle.format("unit.speed", Strings.toFixed(unit.speed, 1)));
|
||||
table.add(Core.bundle.format("unit.speed", Strings.fixed(unit.speed, 1)));
|
||||
table.row();
|
||||
table.row();
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ public class ItemDisplay extends Table{
|
||||
}
|
||||
|
||||
public ItemDisplay(Item item, int amount){
|
||||
add(new ItemImage(new ItemStack(item, amount))).size(8*3);
|
||||
add(new ItemImage(new ItemStack(item, amount))).size(8*4);
|
||||
add(item.localizedName()).padLeft(4);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ public class ItemImage extends Stack{
|
||||
}
|
||||
|
||||
public ItemImage(ItemStack stack){
|
||||
add(new Image(stack.item.icon(Icon.medium)));
|
||||
add(new Image(stack.item.icon(Icon.large)));
|
||||
|
||||
if(stack.amount != 0){
|
||||
Table t = new Table().left().bottom();
|
||||
|
||||
@@ -1,14 +1,31 @@
|
||||
package io.anuke.mindustry.ui;
|
||||
|
||||
import io.anuke.mindustry.type.Liquid;
|
||||
import io.anuke.arc.graphics.Color;
|
||||
import io.anuke.arc.scene.ui.Image;
|
||||
import io.anuke.arc.scene.ui.layout.Stack;
|
||||
import io.anuke.arc.scene.ui.layout.Table;
|
||||
import io.anuke.arc.util.Strings;
|
||||
import io.anuke.mindustry.type.Liquid;
|
||||
import io.anuke.mindustry.world.meta.StatUnit;
|
||||
|
||||
/**An ItemDisplay, but for liquids.*/
|
||||
public class LiquidDisplay extends Table{
|
||||
|
||||
public LiquidDisplay(Liquid liquid){
|
||||
add(new Image(liquid.getContentIcon())).size(8*3);
|
||||
add(liquid.localizedName()).padLeft(3);
|
||||
public LiquidDisplay(Liquid liquid, float amount, boolean perSecond){
|
||||
add(new Stack(){{
|
||||
add(new Image(liquid.getContentIcon()));
|
||||
|
||||
if(amount != 0){
|
||||
Table t = new Table().left().bottom();
|
||||
t.add(Strings.autoFixed(amount, 1));
|
||||
add(t);
|
||||
}
|
||||
}}).size(8*4).padRight(3);
|
||||
|
||||
if(perSecond){
|
||||
add(StatUnit.perSecond.localized()).padLeft(2).padRight(5).color(Color.LIGHT_GRAY);
|
||||
}
|
||||
|
||||
add(liquid.localizedName());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -187,9 +187,9 @@ public class BlockInventoryFragment extends Fragment{
|
||||
private String round(float f){
|
||||
f = (int) f;
|
||||
if(f >= 1000000){
|
||||
return Strings.toFixed(f / 1000000f, 1) + "[gray]mil[]";
|
||||
return Strings.fixed(f / 1000000f, 1) + "[gray]mil[]";
|
||||
}else if(f >= 1000){
|
||||
return Strings.toFixed(f / 1000, 1) + "k";
|
||||
return Strings.fixed(f / 1000, 1) + "k";
|
||||
}else{
|
||||
return (int) f + "";
|
||||
}
|
||||
|
||||
@@ -192,7 +192,7 @@ public class PlacementFragment extends Fragment{
|
||||
topTable.table(header -> {
|
||||
header.left();
|
||||
header.add(new Image(lastDisplay.icon(Icon.medium))).size(8 * 4);
|
||||
header.labelWrap(() -> !unlocked(lastDisplay) ? Core.bundle.get("blocks.unknown") : lastDisplay.localizedName)
|
||||
header.labelWrap(() -> !unlocked(lastDisplay) ? Core.bundle.get("block.unknown") : lastDisplay.localizedName)
|
||||
.left().width(190f).padLeft(5);
|
||||
header.add().growX();
|
||||
if(unlocked(lastDisplay)){
|
||||
|
||||
Reference in New Issue
Block a user