Edit TODO, fix crashes

This commit is contained in:
Anuken
2017-12-16 23:27:02 -05:00
parent f2027cd58c
commit 9f9f153125
8 changed files with 27 additions and 19 deletions

View File

@@ -20,8 +20,8 @@ public class Vars{
public static final float respawnduration = 60*4;
//time between waves in frames (on normal mode)
public static final float wavespace = 60*60*(android ? 1 : 1);
//waves can last no longer than 5 minutes, otherwise the next one spawns
public static final float maxwavespace = 60*60*5;
//waves can last no longer than 2 minutes, otherwise the next one spawns
public static final float maxwavespace = 60*60*2;
//advance time the pathfinding starts at
public static final float aheadPathfinding = 60*20;
//how far away from spawn points the player can't place blocks

View File

@@ -87,7 +87,7 @@ public class Player extends DestructibleEntity{
vector.x += speed;
boolean shooting = !Inputs.keyDown("dash") && Inputs.buttonDown(Buttons.LEFT) && recipe == null
&& !ui.hasMouse() && !control.getInput().onConfigurable() && !Inputs.keyDown("area_delete_mode");
&& !ui.hasMouse() && !control.getInput().onConfigurable();
if(shooting && Timers.get(this, "reload", weapon.reload)){
weapon.shoot(this);

View File

@@ -22,11 +22,13 @@ public class DesktopInput extends InputHandler{
int mousex, mousey;
int endx, endy;
private boolean enableHold = false;
private boolean beganBreak;
@Override public float getCursorEndX(){ return endx; }
@Override public float getCursorEndY(){ return endy; }
@Override public float getCursorX(){ return (int)(Graphics.screen(mousex, mousey).x + 2); }
@Override public float getCursorY(){ return (int)(Gdx.graphics.getHeight() - 1 - Graphics.screen(mousex, mousey).y); }
@Override public boolean drawPlace(){ return !beganBreak; }
@Override
public boolean touchDown (int screenX, int screenY, int pointer, int button){
@@ -41,7 +43,7 @@ public class DesktopInput extends InputHandler{
public boolean touchUp(int screenX, int screenY, int pointer, int button){
if(button == Buttons.LEFT){
player.placeMode.released(getBlockX(), getBlockY(), getBlockEndX(), getBlockEndY());
}else if(button == Buttons.RIGHT){
}else if(button == Buttons.RIGHT && !beganBreak){
player.breakMode.released(getBlockX(), getBlockY(), getBlockEndX(), getBlockEndY());
}
return false;
@@ -104,8 +106,13 @@ public class DesktopInput extends InputHandler{
if(Inputs.buttonUp(Buttons.RIGHT)){
ui.hideConfig();
}
if(Inputs.buttonRelease(Buttons.RIGHT)){
beganBreak = false;
}
if(player.recipe != null && Inputs.buttonUp(Buttons.RIGHT)){
beganBreak = true;
player.recipe = null;
Cursors.restoreCursor();
}

View File

@@ -0,0 +1,5 @@
package io.anuke.mindustry.ui;
public class MapEditor{
}