More UI changes, made weapons usable, fixed ammo for turret types
This commit is contained in:
@@ -14,7 +14,6 @@ import io.anuke.mindustry.world.World;
|
||||
import io.anuke.mindustry.world.blocks.Blocks;
|
||||
import io.anuke.mindustry.world.blocks.ProductionBlocks;
|
||||
import io.anuke.ucore.core.*;
|
||||
import io.anuke.ucore.scene.utils.Cursors;
|
||||
import io.anuke.ucore.util.Mathf;
|
||||
|
||||
public class AndroidInput extends InputAdapter{
|
||||
@@ -87,11 +86,6 @@ public class AndroidInput extends InputAdapter{
|
||||
for(ItemStack stack : player.recipe.requirements){
|
||||
Inventory.removeItem(stack);
|
||||
}
|
||||
|
||||
if(!Inventory.hasItems(player.recipe.requirements)){
|
||||
player.recipe = null;
|
||||
Cursors.restoreCursor();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,9 @@ import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.input.GestureDetector.GestureAdapter;
|
||||
import com.badlogic.gdx.math.Vector2;
|
||||
|
||||
import io.anuke.mindustry.GameState;
|
||||
import io.anuke.mindustry.GameState.State;
|
||||
import io.anuke.mindustry.Inventory;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.mindustry.world.World;
|
||||
import io.anuke.mindustry.world.blocks.Blocks;
|
||||
@@ -22,7 +25,7 @@ public class GestureHandler extends GestureAdapter{
|
||||
public boolean longPress(float x, float y){
|
||||
Tile tile = World.cursorTile();
|
||||
player.breaktime += Timers.delta();
|
||||
if(player.breaktime >= tile.block().breaktime){
|
||||
if(!GameState.is(State.menu) && player.breaktime >= tile.block().breaktime){
|
||||
Effects.effect("break", tile.worldx(), tile.worldy());
|
||||
Effects.shake(3f, 1f);
|
||||
tile.setBlock(Blocks.air);
|
||||
@@ -34,7 +37,7 @@ public class GestureHandler extends GestureAdapter{
|
||||
|
||||
@Override
|
||||
public boolean pan(float x, float y, float deltaX, float deltaY){
|
||||
if(player.recipe == null){
|
||||
if(player.recipe == null || !Inventory.hasItems(player.recipe.requirements)){
|
||||
player.x -= deltaX*Core.camera.zoom/Core.cameraScale;
|
||||
player.y += deltaY*Core.camera.zoom/Core.cameraScale;
|
||||
}else{
|
||||
|
||||
@@ -42,11 +42,12 @@ public class Input{
|
||||
|
||||
//TODO restore cursor when requirements are back
|
||||
|
||||
for(int i = 0; i < 9; i ++)
|
||||
for(int i = 0; i < 9; i ++){
|
||||
if(Inputs.keyUp(Keys.valueOf(""+(i+1))) && i < control.getWeapons().size){
|
||||
player.weapon = control.getWeapons().get(i);
|
||||
ui.updateWeapons();
|
||||
}
|
||||
}
|
||||
|
||||
if(Inputs.buttonUp(Buttons.LEFT) && player.recipe != null &&
|
||||
World.validPlace(World.tilex(), World.tiley(), player.recipe.result) && !ui.hasMouse() &&
|
||||
|
||||
Reference in New Issue
Block a user