Auto-target configuration

This commit is contained in:
Anuken
2018-09-29 20:49:19 -04:00
parent e7533232c0
commit b43c542213
6 changed files with 30 additions and 24 deletions
@@ -210,33 +210,32 @@ public class DesktopInput extends InputHandler{
player.setMineTile(null);
}
if(!ui.hasMouse()){
if(Inputs.keyTap(section, "select")){
if(isPlacing()){
selectX = cursor.x;
selectY = cursor.y;
mode = placing;
}else{
//only begin shooting if there's no cursor event
if (!tileTapped(cursor) && !tryTapPlayer(Graphics.mouseWorld().x, Graphics.mouseWorld().y) && player.getPlaceQueue().size == 0 && !droppingItem &&
!tryBeginMine(cursor) && player.getMineTile() == null) {
player.isShooting = true;
}
}
}else if(Inputs.keyTap(section, "deselect") && (recipe != null || mode != none || player.isBuilding())){
if(recipe == null){
player.clearBuilding();
}
recipe = null;
mode = none;
}else if(Inputs.keyTap(section, "break")){
if(Inputs.keyTap(section, "select") && !ui.hasMouse()){
if(isPlacing()){
selectX = cursor.x;
selectY = cursor.y;
mode = breaking;
mode = placing;
}else{
//only begin shooting if there's no cursor event
if (!tileTapped(cursor) && !tryTapPlayer(Graphics.mouseWorld().x, Graphics.mouseWorld().y) && player.getPlaceQueue().size == 0 && !droppingItem &&
!tryBeginMine(cursor) && player.getMineTile() == null) {
player.isShooting = true;
}
}
}else if(Inputs.keyTap(section, "deselect") && (recipe != null || mode != none || player.isBuilding())){
if(recipe == null){
player.clearBuilding();
}
recipe = null;
mode = none;
}else if(Inputs.keyTap(section, "break") && !ui.hasMouse()){
selectX = cursor.x;
selectY = cursor.y;
mode = breaking;
}
if(Inputs.keyRelease(section, "break") || Inputs.keyRelease(section, "select")){
if(mode == placing){ //touch up while placing, place everything in selection