Fixed many placement mode bugs

This commit is contained in:
Anuken
2018-03-15 14:25:45 -04:00
parent ae89a004a6
commit 2037ebaaba
6 changed files with 28 additions and 11 deletions

View File

@@ -20,9 +20,9 @@ public class AndroidInput extends InputHandler{
public float lmousex, lmousey;
public float mousex, mousey;
public boolean brokeBlock = false;
public boolean placing = false;
private boolean enableHold = false;
private boolean placing = false;
private float warmup;
private float warmupDelay = 20;
@@ -48,6 +48,7 @@ public class AndroidInput extends InputHandler{
}else if(pointer == 0 && !breakMode.pan && breaking() && drawPlace()){
breakMode.released(getBlockX(), getBlockY(), getBlockEndX(), getBlockEndY());
}
placing = false;
return false;
}

View File

@@ -47,7 +47,7 @@ public class GestureHandler extends GestureAdapter{
if(control.showCursor() && !Inputs.keyDown("select")) return false;
if(!control.showCursor() && !(control.input().recipe != null
&& state.inventory.hasItems(control.input().recipe.requirements) && control.input().placeMode.lockCamera) &&
&& control.input().placeMode.lockCamera) &&
!(control.input().recipe == null && control.input().breakMode.lockCamera)){
float dx = deltaX*Core.camera.zoom/Core.cameraScale, dy = deltaY*Core.camera.zoom/Core.cameraScale;
player.x -= dx;

View File

@@ -164,7 +164,6 @@ public enum PlaceMode{
}
public void released(int tilex, int tiley, int endx, int endy){
process(tilex, tiley, endx, endy);
tilex = this.tilex; tiley = this.tiley;
endx = this.endx; endy = this.endy;