From 3adc3a8b2e85e126137bbb2b977303f34164dcbe Mon Sep 17 00:00:00 2001 From: MEEP of Faith Date: Sun, 23 Apr 2023 10:53:36 -0700 Subject: [PATCH] Fix input visuals --- core/src/mindustry/input/DesktopInput.java | 7 ++++--- core/src/mindustry/input/MobileInput.java | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/core/src/mindustry/input/DesktopInput.java b/core/src/mindustry/input/DesktopInput.java index f24d4cba74..197001703b 100644 --- a/core/src/mindustry/input/DesktopInput.java +++ b/core/src/mindustry/input/DesktopInput.java @@ -199,9 +199,10 @@ public class DesktopInput extends InputHandler{ drawArrow(block, cursorX, cursorY, rotation); } Draw.color(); - boolean valid = validPlace(cursorX, cursorY, block, rotation); - drawPlan(cursorX, cursorY, block, rotation); - block.drawPlace(cursorX, cursorY, rotation, valid); + int rot = !block.rotate && block.lockRotation ? 0 : rotation; + boolean valid = validPlace(cursorX, cursorY, block, rot); + drawPlan(cursorX, cursorY, block, rot); + block.drawPlace(cursorX, cursorY, rot, valid); if(block.saveConfig){ Draw.mixcol(!valid ? Pal.breakInvalid : Color.white, (!valid ? 0.4f : 0.24f) + Mathf.absin(Time.globalTime, 6f, 0.28f)); diff --git a/core/src/mindustry/input/MobileInput.java b/core/src/mindustry/input/MobileInput.java index f9d183cafd..264b730dba 100644 --- a/core/src/mindustry/input/MobileInput.java +++ b/core/src/mindustry/input/MobileInput.java @@ -404,9 +404,10 @@ public class MobileInput extends InputHandler implements GestureListener{ //draw last placed plan if(!plan.breaking && plan == lastPlaced && plan.block != null){ - boolean valid = validPlace(tile.x, tile.y, plan.block, rotation); + int rot = !block.rotate && block.lockRotation ? 0 : rotation; + boolean valid = validPlace(tile.x, tile.y, plan.block, rot); Draw.mixcol(); - plan.block.drawPlace(tile.x, tile.y, rotation, valid); + plan.block.drawPlace(tile.x, tile.y, rot, valid); drawOverlapCheck(plan.block, tile.x, tile.y, valid); }