From b369751a75dddbacdb48acd5d673751d18273579 Mon Sep 17 00:00:00 2001 From: Anuken Date: Fri, 30 Aug 2019 13:56:33 -0400 Subject: [PATCH] Bugfixes --- .../mindustry/ui/dialogs/DeployDialog.java | 1 + .../mindustry/world/blocks/power/PowerNode.java | 17 ++--------------- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/core/src/io/anuke/mindustry/ui/dialogs/DeployDialog.java b/core/src/io/anuke/mindustry/ui/dialogs/DeployDialog.java index 2ef4dc9374..b1e8acca02 100644 --- a/core/src/io/anuke/mindustry/ui/dialogs/DeployDialog.java +++ b/core/src/io/anuke/mindustry/ui/dialogs/DeployDialog.java @@ -86,6 +86,7 @@ public class DeployDialog extends FloatingDialog{ Stack sub = new Stack(); 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())); } diff --git a/core/src/io/anuke/mindustry/world/blocks/power/PowerNode.java b/core/src/io/anuke/mindustry/world/blocks/power/PowerNode.java index 358fb27a43..194df6ca88 100644 --- a/core/src/io/anuke/mindustry/world/blocks/power/PowerNode.java +++ b/core/src/io/anuke/mindustry/world/blocks/power/PowerNode.java @@ -122,7 +122,7 @@ public class PowerNode extends PowerBlock{ private void getPotentialLinks(Tile tile, Consumer others){ Predicate 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) && - 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); tempTiles.clear(); @@ -222,20 +222,7 @@ public class PowerNode extends PowerBlock{ Draw.color(Pal.placing); Drawf.circles(x * tilesize + offset(), y * tilesize + offset(), laserRange * tilesize); - getPotentialLinks(tile, other -> { - 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); - } - } - }*/ + getPotentialLinks(tile, other -> Drawf.square(other.drawx(), other.drawy(), other.block().size * tilesize / 2f + 2f, Pal.place)); Draw.reset(); }