This commit is contained in:
Anuken
2019-11-02 09:40:41 -04:00
parent b78e04a2de
commit ea9e23f924
3 changed files with 10 additions and 7 deletions

View File

@@ -758,8 +758,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
if(req != ignore
&& !req.breaking
&& req.block.bounds(req.x, req.y, Tmp.r1).overlaps(type.bounds(x, y, Tmp.r2))
&& !(type.canReplace(req.block) && Tmp.r1.equals(Tmp.r2))
){
&& !(type.canReplace(req.block) && Tmp.r1.equals(Tmp.r2))){
return false;
}
}

View File

@@ -217,11 +217,15 @@ public class MobileInput extends InputHandler implements GestureListener{
//actually place/break all selected blocks
if(tile != null){
if(!request.breaking){
if(validPlace(request.x, request.y, request.block, request.rotation)){
BuildRequest other = getRequest(request.x, request.y);
if(other != null){
player.buildQueue().remove(other);
}
player.addBuildRequest(request.copy());
}
rotation = request.rotation;
Block before = block;
block = request.block;
tryPlaceBlock(tile.x, tile.y);
block = before;
}else{
tryBreakBlock(tile.x, tile.y);
}

View File

@@ -114,7 +114,7 @@ public class SchematicsDialog extends FloatingDialog{
Label label = c.add(s.name()).style(Styles.outlineLabel).color(Color.white).top().growX().maxWidth(200f - 8f).get();
label.setEllipsis(true);
label.setAlignment(Align.center);
}).growX().margin(1).pad(4).maxWidth(200f - 8f).padBottom(0);
}).growX().margin(1).pad(4).maxWidth(Scl.scl(200f - 8f)).padBottom(0);
})).size(200f);
}, () -> {
if(sel[0].childrenPressed()) return;