Prevent right-click from deconstructing when schematic is selected; allow deconstruct cancel with left-click
This commit is contained in:
@@ -150,7 +150,7 @@ public class DesktopInput extends InputHandler{
|
|||||||
if(state.is(State.menu) || Core.scene.hasDialog()) return;
|
if(state.is(State.menu) || Core.scene.hasDialog()) return;
|
||||||
|
|
||||||
//zoom camera
|
//zoom camera
|
||||||
if(!Core.scene.hasScroll() && Math.abs(Core.input.axisTap(Binding.zoom)) > 0 && !Core.input.keyDown(Binding.rotateplaced) && (Core.input.keyDown(Binding.diagonal_placement) || ((block == null || !block.rotate) && selectRequests.isEmpty()))){
|
if(!Core.scene.hasScroll() && Math.abs(Core.input.axisTap(Binding.zoom)) > 0 && !Core.input.keyDown(Binding.rotateplaced) && (Core.input.keyDown(Binding.diagonal_placement) || ((!isPlacing() || !block.rotate) && selectRequests.isEmpty()))){
|
||||||
renderer.scaleCamera(Core.input.axisTap(Binding.zoom));
|
renderer.scaleCamera(Core.input.axisTap(Binding.zoom));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -166,11 +166,6 @@ public class DesktopInput extends InputHandler{
|
|||||||
mode = none;
|
mode = none;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(mode != none || isPlacing()){
|
|
||||||
selectRequests.clear();
|
|
||||||
lastSchematic = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(player.isShooting && !canShoot()){
|
if(player.isShooting && !canShoot()){
|
||||||
player.isShooting = false;
|
player.isShooting = false;
|
||||||
}
|
}
|
||||||
@@ -354,7 +349,9 @@ public class DesktopInput extends InputHandler{
|
|||||||
if(Core.input.keyTap(Binding.select) && !Core.scene.hasMouse()){
|
if(Core.input.keyTap(Binding.select) && !Core.scene.hasMouse()){
|
||||||
BuildRequest req = getRequest(cursorX, cursorY);
|
BuildRequest req = getRequest(cursorX, cursorY);
|
||||||
|
|
||||||
if(!selectRequests.isEmpty()){
|
if(Core.input.keyDown(Binding.break_block)){
|
||||||
|
mode = none;
|
||||||
|
}else if(!selectRequests.isEmpty()){
|
||||||
flushRequests(selectRequests);
|
flushRequests(selectRequests);
|
||||||
}else if(isPlacing()){
|
}else if(isPlacing()){
|
||||||
selectX = cursorX;
|
selectX = cursorX;
|
||||||
@@ -376,9 +373,12 @@ public class DesktopInput extends InputHandler{
|
|||||||
}else if(!Core.scene.hasKeyboard()){ //if it's out of bounds, shooting is just fine
|
}else if(!Core.scene.hasKeyboard()){ //if it's out of bounds, shooting is just fine
|
||||||
player.isShooting = true;
|
player.isShooting = true;
|
||||||
}
|
}
|
||||||
}else if(Core.input.keyTap(Binding.deselect) && block != null){
|
}else if(Core.input.keyTap(Binding.deselect) && isPlacing()){
|
||||||
block = null;
|
block = null;
|
||||||
mode = none;
|
mode = none;
|
||||||
|
}else if(Core.input.keyTap(Binding.deselect) && !selectRequests.isEmpty()){
|
||||||
|
selectRequests.clear();
|
||||||
|
lastSchematic = null;
|
||||||
}else if(Core.input.keyTap(Binding.break_block) && !Core.scene.hasMouse()){
|
}else if(Core.input.keyTap(Binding.break_block) && !Core.scene.hasMouse()){
|
||||||
//is recalculated because setting the mode to breaking removes potential multiblock cursor offset
|
//is recalculated because setting the mode to breaking removes potential multiblock cursor offset
|
||||||
deleting = false;
|
deleting = false;
|
||||||
|
|||||||
@@ -588,7 +588,7 @@ public class MobileInput extends InputHandler implements GestureListener{
|
|||||||
}
|
}
|
||||||
|
|
||||||
//zoom camera
|
//zoom camera
|
||||||
if(Math.abs(Core.input.axisTap(Binding.zoom)) > 0 && !Core.input.keyDown(Binding.rotateplaced) && (Core.input.keyDown(Binding.diagonal_placement) || ((block == null || !block.rotate) && selectRequests.isEmpty()))){
|
if(Math.abs(Core.input.axisTap(Binding.zoom)) > 0 && !Core.input.keyDown(Binding.rotateplaced) && (Core.input.keyDown(Binding.diagonal_placement) || ((!isPlacing() || !block.rotate) && selectRequests.isEmpty()))){
|
||||||
renderer.scaleCamera(Core.input.axisTap(Binding.zoom));
|
renderer.scaleCamera(Core.input.axisTap(Binding.zoom));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user