More character support, made menus collapsible

This commit is contained in:
Anuken
2017-12-27 23:05:10 -05:00
parent c693674ac6
commit b25c611c33
35 changed files with 569 additions and 343 deletions

View File

@@ -47,9 +47,9 @@ public class AndroidInput extends InputHandler{
return false;
}
if(placing && pointer == 0 && !player.placeMode.pan && player.recipe != null){
if(placing && pointer == 0 && !player.placeMode.pan && !breaking()){
player.placeMode.released(getBlockX(), getBlockY(), getBlockEndX(), getBlockEndY());
}else if(pointer == 0 && !player.breakMode.pan && player.recipe == null && drawPlace()){
}else if(pointer == 0 && !player.breakMode.pan && breaking() && drawPlace()){
player.breakMode.released(getBlockX(), getBlockY(), getBlockEndX(), getBlockEndY());
}
placing = false;
@@ -64,7 +64,7 @@ public class AndroidInput extends InputHandler{
lmousex = screenX;
lmousey = screenY;
if((!player.placeMode.pan || player.recipe == null) && pointer == 0){
if((!player.placeMode.pan || breaking()) && pointer == 0){
mousex = screenX;
mousey = screenY;
}
@@ -184,4 +184,8 @@ public class AndroidInput extends InputHandler{
}
return false;
}
public boolean breaking(){
return player.recipe == null;
}
}

View File

@@ -151,4 +151,9 @@ public class DesktopInput extends InputHandler{
}
return 0;
}
@Override
public boolean keyDown(int keycode) {
return super.keyDown(keycode);
}
}

View File

@@ -190,7 +190,8 @@ public abstract class InputHandler extends InputAdapter{
int worldy = dy + offsety + y;
if(!(worldx == x && worldy == y)){
Tile toplace = world.tile(worldx, worldy);
toplace.setLinked((byte)(dx + offsetx), (byte)(dy + offsety));
if(toplace != null)
toplace.setLinked((byte)(dx + offsetx), (byte)(dy + offsety));
}
if(effects) Effects.effect(Fx.place, worldx * Vars.tilesize, worldy * Vars.tilesize);
@@ -201,6 +202,8 @@ public abstract class InputHandler extends InputAdapter{
}
if(effects && sound) Sounds.play("place");
result.placed(tile);
}
public void breakBlock(int x, int y, boolean sound){