Great cleanup

This commit is contained in:
Skat
2020-11-07 11:37:46 +03:00
parent 29b8db0a85
commit ed36390f3c
45 changed files with 134 additions and 189 deletions

View File

@@ -47,7 +47,6 @@ public class DesktopInput extends InputHandler{
@Override
public void buildUI(Group group){
group.fill(t -> {
t.visible(() -> Core.settings.getBool("hints") && ui.hudfrag.shown && !player.dead() && !player.unit().spawnedByCore() && !(Core.settings.getBool("hints") && lastSchematic != null && !selectRequests.isEmpty()));
t.bottom();
@@ -651,7 +650,6 @@ public class DesktopInput extends InputHandler{
//update payload input
if(unit instanceof Payloadc){
if(Core.input.keyTap(Binding.pickupCargo)){
tryPickupPayload();
}

View File

@@ -128,7 +128,9 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
!netServer.admins.allowAction(player, ActionType.withdrawItem, tile.tile(), action -> {
action.item = item;
action.itemAmount = amount;
}))) throw new ValidateException(player, "Player cannot request items.");
}))){
throw new ValidateException(player, "Player cannot request items.");
}
//remove item for every controlling unit
player.unit().eachGroup(unit -> {
@@ -984,7 +986,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
}
public @Nullable Unit selectedUnit(){
Unit unit = Units.closest(player.team(), Core.input.mouseWorld().x, Core.input.mouseWorld().y, 40f, u -> u.isAI());
Unit unit = Units.closest(player.team(), Core.input.mouseWorld().x, Core.input.mouseWorld().y, 40f, Unitc::isAI);
if(unit != null){
unit.hitbox(Tmp.r1);
Tmp.r1.grow(6f);
@@ -1160,7 +1162,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
if(block instanceof PowerNode){
Seq<Point2> skip = new Seq<>();
for(int i = 1; i < points.size; i++){
int overlaps = 0;
Point2 point = points.get(i);

View File

@@ -327,7 +327,6 @@ public class MobileInput extends InputHandler implements GestureListener{
@Override
public void drawTop(){
//draw schematic selection
if(mode == schematicSelect){
drawSelection(lineStartX, lineStartY, lastLineX, lastLineY, Vars.maxSchematicSize);

View File

@@ -188,7 +188,6 @@ public class Placement{
* @param maxLength maximum length of area
*/
public static NormalizeResult normalizeArea(int tilex, int tiley, int endx, int endy, int rotation, boolean snap, int maxLength){
if(snap){
if(Math.abs(tilex - endx) > Math.abs(tiley - endy)){
endy = tiley;