Closes Anuken/Mindustry-Suggestions/issues/5967
This commit is contained in:
@@ -1172,6 +1172,24 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
||||
Draw.draw(Layer.groundUnit - 1, () -> {
|
||||
drawCommanded(false);
|
||||
});
|
||||
|
||||
Draw.draw(Layer.overlayUI, () -> {
|
||||
drawCommandedTargets();
|
||||
});
|
||||
}
|
||||
|
||||
public void drawCommandedTargets(){
|
||||
if(commandMode){
|
||||
for(Unit unit : selectedUnits){
|
||||
if(unit.controller() instanceof CommandAI ai){
|
||||
var cmd = ai.currentCommand();
|
||||
|
||||
if(ai.attackTarget != null && cmd.drawTarget){
|
||||
Drawf.target(ai.attackTarget.getX(), ai.attackTarget.getY(), 6f, Pal.remove);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void drawCommanded(boolean flying){
|
||||
@@ -1183,7 +1201,6 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
||||
//happens sometimes
|
||||
selectedUnits.removeAll(u -> !u.allowCommand());
|
||||
|
||||
//draw command overlay UI
|
||||
for(Unit unit : selectedUnits){
|
||||
|
||||
Color color = unit.controller() instanceof LogicAI ? Team.malis.color : Pal.accent;
|
||||
@@ -1194,10 +1211,6 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
||||
var cmd = ai.currentCommand();
|
||||
lastPos = ai.attackTarget != null ? ai.attackTarget : ai.targetPos;
|
||||
|
||||
if(flying && ai.attackTarget != null && cmd.drawTarget){
|
||||
Drawf.target(ai.attackTarget.getX(), ai.attackTarget.getY(), 6f, Pal.remove);
|
||||
}
|
||||
|
||||
if(unit.isFlying() != flying) continue;
|
||||
|
||||
//draw target line
|
||||
|
||||
Reference in New Issue
Block a user