From b6beacf0530a24c878e7b65f5b34759f59b5a0dd Mon Sep 17 00:00:00 2001 From: Anuken Date: Mon, 15 Oct 2018 02:05:25 -0300 Subject: [PATCH 1/2] Input cleanup --- core/src/io/anuke/mindustry/input/DesktopInput.java | 3 --- core/src/io/anuke/mindustry/input/InputHandler.java | 4 ++++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/core/src/io/anuke/mindustry/input/DesktopInput.java b/core/src/io/anuke/mindustry/input/DesktopInput.java index 6f1ae59362..1bf0952cf5 100644 --- a/core/src/io/anuke/mindustry/input/DesktopInput.java +++ b/core/src/io/anuke/mindustry/input/DesktopInput.java @@ -202,9 +202,6 @@ public class DesktopInput extends InputHandler{ Tile selected = tileAt(Gdx.input.getX(), Gdx.input.getY()); int cursorX = tileX(Gdx.input.getX()); int cursorY = tileY(Gdx.input.getY()); - //if(cursor == null){ - // return; - //} if(Inputs.keyTap(section, "deselect")){ player.setMineTile(null); diff --git a/core/src/io/anuke/mindustry/input/InputHandler.java b/core/src/io/anuke/mindustry/input/InputHandler.java index daef36d06a..6edbe0331e 100644 --- a/core/src/io/anuke/mindustry/input/InputHandler.java +++ b/core/src/io/anuke/mindustry/input/InputHandler.java @@ -191,6 +191,10 @@ public abstract class InputHandler extends InputAdapter{ consumed = true; frag.config.hideConfig(); } + + if(frag.config.isShown()){ + consumed = true; + } } //call tapped event From 21bc195213f659e34c7f9e9afd7fa5f7456079fb Mon Sep 17 00:00:00 2001 From: LQ Date: Mon, 15 Oct 2018 22:17:52 +0800 Subject: [PATCH 2/2] make sure new sector include target sector (#244) if shiftx, shifty calc from total width,height, the result sector did not include the target sector --- core/src/io/anuke/mindustry/maps/Sectors.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/io/anuke/mindustry/maps/Sectors.java b/core/src/io/anuke/mindustry/maps/Sectors.java index adc7ca0a90..49551d6c3d 100644 --- a/core/src/io/anuke/mindustry/maps/Sectors.java +++ b/core/src/io/anuke/mindustry/maps/Sectors.java @@ -370,7 +370,7 @@ public class Sectors{ for(int x = 1; x <= width; x++){ for(int y = 1; y <= height; y++){ for(GridPoint2 point : Geometry.d8edge){ - int shiftx = (int)(-width/2f + (point.x * (width - 1))/2f), shifty = (int)(-height/2f + (point.y * (height - 1))/2f); + int shiftx = (int)(-x/2f + (point.x * (x - 1))/2f), shifty = (int)(-y/2f + (point.y * (y - 1))/2f); if(canFit(sector.x + shiftx, sector.y + shifty, x, y)){ finalWidth = x; finalHeight = y;