mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-01-10 15:19:24 +07:00
Fixed more wide water / Unit command JSON support
This commit is contained in:
parent
5fa301e242
commit
0debdee40b
@ -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);
|
||||
|
@ -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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user