Merge branches 'master' and 'save-preview' of https://github.com/Anuken/Mindustry into save-preview
This commit is contained in:
@@ -86,6 +86,7 @@ public class DeployDialog extends FloatingDialog{
|
|||||||
Stack sub = new Stack();
|
Stack sub = new Stack();
|
||||||
|
|
||||||
if(control.saves.getZoneSlot().getZone() != null){
|
if(control.saves.getZoneSlot().getZone() != null){
|
||||||
|
sub.add(new Table(f -> f.margin(4f).add(new Image("whiteui")).color(Color.fromGray(0.1f)).grow()));
|
||||||
sub.add(new Table(f -> f.margin(4f).add(new Image(control.saves.getZoneSlot().getZone().preview).setScaling(Scaling.fit)).color(Color.DARK_GRAY).grow()));
|
sub.add(new Table(f -> f.margin(4f).add(new Image(control.saves.getZoneSlot().getZone().preview).setScaling(Scaling.fit)).color(Color.DARK_GRAY).grow()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ public class PowerNode extends PowerBlock{
|
|||||||
private void getPotentialLinks(Tile tile, Consumer<Tile> others){
|
private void getPotentialLinks(Tile tile, Consumer<Tile> others){
|
||||||
Predicate<Tile> valid = other -> other != null && other != tile && other.entity != null && other.entity.power != null &&
|
Predicate<Tile> valid = other -> other != null && other != tile && other.entity != null && other.entity.power != null &&
|
||||||
((!other.block().outputsPower && other.block().consumesPower) || (other.block().outputsPower && !other.block().consumesPower) || other.block() instanceof PowerNode) &&
|
((!other.block().outputsPower && other.block().consumesPower) || (other.block().outputsPower && !other.block().consumesPower) || other.block() instanceof PowerNode) &&
|
||||||
overlaps(tile.x * tilesize + offset(), tile.y *tilesize + offset(), other, laserRange * tilesize)
|
overlaps(tile.x * tilesize + offset(), tile.y *tilesize + offset(), other, laserRange * tilesize) && other.getTeam() == player.getTeam()
|
||||||
&& !other.entity.proximity().contains(tile) && !graphs.contains(other.entity.power.graph);
|
&& !other.entity.proximity().contains(tile) && !graphs.contains(other.entity.power.graph);
|
||||||
|
|
||||||
tempTiles.clear();
|
tempTiles.clear();
|
||||||
@@ -222,20 +222,7 @@ public class PowerNode extends PowerBlock{
|
|||||||
Draw.color(Pal.placing);
|
Draw.color(Pal.placing);
|
||||||
Drawf.circles(x * tilesize + offset(), y * tilesize + offset(), laserRange * tilesize);
|
Drawf.circles(x * tilesize + offset(), y * tilesize + offset(), laserRange * tilesize);
|
||||||
|
|
||||||
getPotentialLinks(tile, other -> {
|
getPotentialLinks(tile, other -> Drawf.square(other.drawx(), other.drawy(), other.block().size * tilesize / 2f + 2f, Pal.place));
|
||||||
Drawf.square(other.drawx(), other.drawy(), other.block().size * tilesize / 2f + 2f, Pal.place);
|
|
||||||
});
|
|
||||||
|
|
||||||
/*
|
|
||||||
for(int cx = (int)(x - laserRange - 1); cx <= x + laserRange + 1; cx++){
|
|
||||||
for(int cy = (int)(y - laserRange - 1); cy <= y + laserRange + 1; cy++){
|
|
||||||
Tile link = world.ltile(cx, cy);
|
|
||||||
|
|
||||||
if(link != null && !(link.x == x && link.y == y) && link.block().hasPower && overlaps(x * tilesize + offset(), y *tilesize + offset(), link, laserRange * tilesize)){
|
|
||||||
Drawf.square(link.drawx(), link.drawy(), link.block().size * tilesize / 2f + 2f, link.pos() == lastPlaced ? Pal.place : Pal.accent);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user