Fixed more wide water / Unit command JSON support

This commit is contained in:
Anuken 2022-07-30 21:59:36 -04:00
parent 5fa301e242
commit 0debdee40b
2 changed files with 14 additions and 1 deletions

View File

@ -16,6 +16,7 @@ import arc.util.serialization.*;
import arc.util.serialization.Json.*;
import arc.util.serialization.Jval.*;
import mindustry.*;
import mindustry.ai.*;
import mindustry.ai.types.*;
import mindustry.content.*;
import mindustry.content.TechTree.*;
@ -104,6 +105,18 @@ public class ContentParser{
readFields(effect, data);
return effect;
});
put(UnitCommand.class, (type, data) -> {
if(data.isString()){
var cmd = UnitCommand.all.find(u -> u.name.equals(data.asString()));
if(cmd != null){
return cmd;
}else{
throw new IllegalArgumentException("Unknown unit command name: " + data.asString());
}
}else{
throw new IllegalArgumentException("Unit commands must be strings.");
}
});
put(BulletType.class, (type, data) -> {
if(data.isString()){
return field(Bullets.class, data);

View File

@ -658,7 +658,7 @@ public class Tile implements Position, QuadTreeObject, Displayable{
table.table(t -> {
t.left();
t.add(new Image(toDisplay.getDisplayIcon(this))).size(8 * 4);
t.add(new Image(toDisplay.getDisplayIcon(this))).scaling(Scaling.fit).size(8 * 4);
t.labelWrap(toDisplay.getDisplayName(this)).left().width(190f).padLeft(5);
}).growX().left();
}