diff --git a/core/assets/cursors/target.png b/core/assets/cursors/target.png new file mode 100644 index 0000000000..1b5d8d519d Binary files /dev/null and b/core/assets/cursors/target.png differ diff --git a/core/src/mindustry/core/UI.java b/core/src/mindustry/core/UI.java index 8340a6cff6..a8cbc7b3fe 100644 --- a/core/src/mindustry/core/UI.java +++ b/core/src/mindustry/core/UI.java @@ -73,7 +73,7 @@ public class UI implements ApplicationListener, Loadable{ public ColorPicker picker; public LogicDialog logic; - public Cursor drillCursor, unloadCursor; + public Cursor drillCursor, unloadCursor, targetCursor; private @Nullable Element lastAnnouncement; @@ -128,6 +128,7 @@ public class UI implements ApplicationListener, Loadable{ drillCursor = Core.graphics.newCursor("drill", Fonts.cursorScale()); unloadCursor = Core.graphics.newCursor("unload", Fonts.cursorScale()); + targetCursor = Core.graphics.newCursor("target", Fonts.cursorScale()); } @Override diff --git a/core/src/mindustry/input/DesktopInput.java b/core/src/mindustry/input/DesktopInput.java index ade15e1911..c856a0b076 100644 --- a/core/src/mindustry/input/DesktopInput.java +++ b/core/src/mindustry/input/DesktopInput.java @@ -399,6 +399,10 @@ public class DesktopInput extends InputHandler{ cursorType = ui.drillCursor; } + if(commandMode && selectedUnits.any() && ((cursor.build != null && cursor.build.team != player.team()) || (selectedEnemyUnit(input.mouseWorldX(), input.mouseWorldY()) != null))){ + cursorType = ui.targetCursor; + } + if(getRequest(cursor.x, cursor.y) != null && mode == none){ cursorType = SystemCursor.hand; } @@ -407,6 +411,7 @@ public class DesktopInput extends InputHandler{ cursorType = ui.unloadCursor; } + if(cursor.build != null && cursor.interactable(player.team()) && !isPlacing() && Math.abs(Core.input.axisTap(Binding.rotate)) > 0 && Core.input.keyDown(Binding.rotateplaced) && cursor.block().rotate && cursor.block().quickRotate){ Call.rotateBlock(player, cursor.build, Core.input.axisTap(Binding.rotate) > 0); } diff --git a/core/src/mindustry/input/Placement.java b/core/src/mindustry/input/Placement.java index 4e6330a87a..7425deeb53 100644 --- a/core/src/mindustry/input/Placement.java +++ b/core/src/mindustry/input/Placement.java @@ -190,7 +190,6 @@ public class Placement{ (plan.tile() != null && plan.tile().block() == plan.block)); //don't count the same block as inaccessible var result = plans1.clear(); - var team = player.team(); outer: for(int i = 0; i < plans.size;){