Fixed more wide water / Unit command JSON support
This commit is contained in:
@@ -16,6 +16,7 @@ import arc.util.serialization.*;
|
|||||||
import arc.util.serialization.Json.*;
|
import arc.util.serialization.Json.*;
|
||||||
import arc.util.serialization.Jval.*;
|
import arc.util.serialization.Jval.*;
|
||||||
import mindustry.*;
|
import mindustry.*;
|
||||||
|
import mindustry.ai.*;
|
||||||
import mindustry.ai.types.*;
|
import mindustry.ai.types.*;
|
||||||
import mindustry.content.*;
|
import mindustry.content.*;
|
||||||
import mindustry.content.TechTree.*;
|
import mindustry.content.TechTree.*;
|
||||||
@@ -104,6 +105,18 @@ public class ContentParser{
|
|||||||
readFields(effect, data);
|
readFields(effect, data);
|
||||||
return effect;
|
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) -> {
|
put(BulletType.class, (type, data) -> {
|
||||||
if(data.isString()){
|
if(data.isString()){
|
||||||
return field(Bullets.class, data);
|
return field(Bullets.class, data);
|
||||||
|
|||||||
@@ -658,7 +658,7 @@ public class Tile implements Position, QuadTreeObject, Displayable{
|
|||||||
|
|
||||||
table.table(t -> {
|
table.table(t -> {
|
||||||
t.left();
|
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);
|
t.labelWrap(toDisplay.getDisplayName(this)).left().width(190f).padLeft(5);
|
||||||
}).growX().left();
|
}).growX().left();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user