Show controlled units on processor hover

This commit is contained in:
summetdev 2020-10-27 20:30:41 +03:00
parent 8cffab46e0
commit 76124c1b19

View File

@ -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);
}