From b5b75656d11e3f73447d9b5961341152f0259d9f Mon Sep 17 00:00:00 2001 From: Sunny Kim <58885089+sk7725@users.noreply.github.com> Date: Sat, 12 Sep 2020 23:11:10 +0900 Subject: [PATCH] Block Fields for Modding (#2538) * quickRotate * quickRotate and rotateArrow * rotateArrow * rotateArrow * Update contributors * quickRotate * removed rotateArrow * remove rotateArrow * removal --- core/assets/contributors | 1 + core/src/mindustry/graphics/OverlayRenderer.java | 2 +- core/src/mindustry/input/DesktopInput.java | 2 +- core/src/mindustry/world/Block.java | 2 ++ 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/core/assets/contributors b/core/assets/contributors index ee8b77ddb9..f52a9bfccb 100644 --- a/core/assets/contributors +++ b/core/assets/contributors @@ -89,3 +89,4 @@ Daniel Dusek DeltaNedas GioIacca9 SnakkiZXZ +sk7725 diff --git a/core/src/mindustry/graphics/OverlayRenderer.java b/core/src/mindustry/graphics/OverlayRenderer.java index 89594886b7..ea988e5e78 100644 --- a/core/src/mindustry/graphics/OverlayRenderer.java +++ b/core/src/mindustry/graphics/OverlayRenderer.java @@ -140,7 +140,7 @@ public class OverlayRenderer{ build.drawDisabled(); } - if(Core.input.keyDown(Binding.rotateplaced) && build.block.rotate && build.interactable(player.team())){ + if(Core.input.keyDown(Binding.rotateplaced) && build.block.rotate && build.block.quickRotate && build.interactable(player.team())){ control.input.drawArrow(build.block, build.tileX(), build.tileY(), build.rotation, true); Draw.color(Pal.accent, 0.3f + Mathf.absin(4f, 0.2f)); Fill.square(build.x, build.y, build.block.size * tilesize/2f); diff --git a/core/src/mindustry/input/DesktopInput.java b/core/src/mindustry/input/DesktopInput.java index a56fb2cb3b..bf7204c8cf 100644 --- a/core/src/mindustry/input/DesktopInput.java +++ b/core/src/mindustry/input/DesktopInput.java @@ -306,7 +306,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){ + 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/world/Block.java b/core/src/mindustry/world/Block.java index 255e269ecb..237ec5217d 100644 --- a/core/src/mindustry/world/Block.java +++ b/core/src/mindustry/world/Block.java @@ -195,6 +195,8 @@ public class Block extends UnlockableContent{ public float buildCostMultiplier = 1f; /** Whether this block has instant transfer.*/ public boolean instantTransfer = false; + /** Whether you can rotate this block with Keybind rotateplaced + Scroll Wheel. */ + public boolean quickRotate = true; protected Prov entityType = null; //initialized later public ObjectMap, Cons2> configurations = new ObjectMap<>();