diff --git a/core/src/mindustry/graphics/Drawf.java b/core/src/mindustry/graphics/Drawf.java index f1d45bebc3..166b7e9e5c 100644 --- a/core/src/mindustry/graphics/Drawf.java +++ b/core/src/mindustry/graphics/Drawf.java @@ -136,16 +136,24 @@ public class Drawf{ Draw.reset(); } - public static void square(float x, float y, float radius, Color color){ + public static void square(float x, float y, float radius, float rotation, Color color){ Lines.stroke(3f, Pal.gray); - Lines.square(x, y, radius + 1f, 45); + Lines.square(x, y, radius + 1f, rotation); Lines.stroke(1f, color); - Lines.square(x, y, radius + 1f, 45); + Lines.square(x, y, radius + 1f, rotation); Draw.reset(); } + public static void square(float x, float y, float radius, float rotation){ + square(x, y, radius, rotation, Pal.accent); + } + + public static void square(float x, float y, float radius, Color color){ + square(x, y, radius, 45, color); + } + public static void square(float x, float y, float radius){ - square(x, y, radius, Pal.accent); + square(x, y, radius, 45); } public static void arrow(float x, float y, float x2, float y2, float length, float radius){ diff --git a/core/src/mindustry/world/blocks/logic/LogicBlock.java b/core/src/mindustry/world/blocks/logic/LogicBlock.java index e06468984b..8ccc558299 100644 --- a/core/src/mindustry/world/blocks/logic/LogicBlock.java +++ b/core/src/mindustry/world/blocks/logic/LogicBlock.java @@ -8,6 +8,7 @@ import arc.struct.*; import arc.util.*; import arc.util.io.*; import mindustry.*; +import mindustry.ai.types.*; import mindustry.core.*; import mindustry.gen.*; import mindustry.graphics.*; @@ -431,6 +432,13 @@ public class LogicBlock extends Block{ } } + @Override + public void drawSelect() { + Groups.unit.each(u -> u.controller() instanceof LogicAI ai && ai.controller == this, unit -> { + Drawf.square(unit.x, unit.y, unit.hitSize, unit.rotation + 45); + }); + } + public boolean validLink(Building other){ return other != null && other.isValid() && other.team == team && other.within(this, range + other.block.size*tilesize/2f) && !(other instanceof ConstructBuild); }