Updated uCore references
This commit is contained in:
@@ -13,9 +13,7 @@ import io.anuke.mindustry.resource.ItemStack;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.mindustry.world.blocks.Blocks;
|
||||
import io.anuke.mindustry.world.blocks.ProductionBlocks;
|
||||
import io.anuke.ucore.core.Effects;
|
||||
import io.anuke.ucore.core.Graphics;
|
||||
import io.anuke.ucore.core.Sounds;
|
||||
import io.anuke.ucore.core.*;
|
||||
import io.anuke.ucore.scene.utils.Cursors;
|
||||
import io.anuke.ucore.util.Mathf;
|
||||
|
||||
@@ -51,7 +49,7 @@ public class AndroidInput extends InputAdapter{
|
||||
|
||||
public static void breakBlock(){
|
||||
Tile tile = selected();
|
||||
player.breaktime += Mathf.delta();
|
||||
player.breaktime += Timers.delta();
|
||||
if(player.breaktime >= tile.block().breaktime){
|
||||
if(tile.block().drops != null){
|
||||
Inventory.addItem(tile.block().drops.item, tile.block().drops.amount);
|
||||
@@ -101,7 +99,7 @@ public class AndroidInput extends InputAdapter{
|
||||
if(Gdx.input.isTouched(0)
|
||||
&& Mathf.near2d(lmousex, lmousey, Gdx.input.getX(0), Gdx.input.getY(0), 50)
|
||||
&& !ui.hasMouse() && player.recipe == null){
|
||||
warmup += Mathf.delta();
|
||||
warmup += Timers.delta();
|
||||
|
||||
mousex = Gdx.input.getX(0);
|
||||
mousey = Gdx.input.getY(0);
|
||||
@@ -111,7 +109,7 @@ public class AndroidInput extends InputAdapter{
|
||||
if(sel == null) return;
|
||||
|
||||
if(warmup > warmupDelay && sel.block() != ProductionBlocks.core && sel.breakable()){
|
||||
player.breaktime += Mathf.delta();
|
||||
player.breaktime += Timers.delta();
|
||||
|
||||
if(player.breaktime > selected().block().breaktime){
|
||||
breakBlock();
|
||||
|
||||
@@ -9,9 +9,7 @@ import com.badlogic.gdx.math.Vector2;
|
||||
import io.anuke.mindustry.World;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.mindustry.world.blocks.Blocks;
|
||||
import io.anuke.ucore.core.Effects;
|
||||
import io.anuke.ucore.core.Sounds;
|
||||
import io.anuke.ucore.util.Mathf;
|
||||
import io.anuke.ucore.core.*;
|
||||
|
||||
public class GestureHandler extends GestureAdapter{
|
||||
Vector2 pinch1 = new Vector2(-1, -1), pinch2 = pinch1.cpy();
|
||||
@@ -21,7 +19,7 @@ public class GestureHandler extends GestureAdapter{
|
||||
@Override
|
||||
public boolean longPress(float x, float y){
|
||||
Tile tile = World.cursorTile();
|
||||
player.breaktime += Mathf.delta();
|
||||
player.breaktime += Timers.delta();
|
||||
if(player.breaktime >= tile.block().breaktime){
|
||||
Effects.effect("break", tile.worldx(), tile.worldy());
|
||||
Effects.shake(3f, 1f);
|
||||
@@ -35,8 +33,8 @@ public class GestureHandler extends GestureAdapter{
|
||||
@Override
|
||||
public boolean pan(float x, float y, float deltaX, float deltaY){
|
||||
if(player.recipe == null){
|
||||
player.x -= deltaX*control.camera.zoom/control.cameraScale;
|
||||
player.y += deltaY*control.camera.zoom/control.cameraScale;
|
||||
player.x -= deltaX*control.camera.zoom/Core.cameraScale;
|
||||
player.y += deltaY*control.camera.zoom/Core.cameraScale;
|
||||
}else{
|
||||
AndroidInput.mousex += deltaX;
|
||||
AndroidInput.mousey += deltaY;
|
||||
@@ -57,8 +55,8 @@ public class GestureHandler extends GestureAdapter{
|
||||
|
||||
Vector2 vec = (vector.set(pointer1).add(pointer2).scl(0.5f)).sub(pinch1.add(pinch2).scl(0.5f));
|
||||
|
||||
player.x -= vec.x*control.camera.zoom/control.cameraScale;
|
||||
player.y += vec.y*control.camera.zoom/control.cameraScale;
|
||||
player.x -= vec.x*control.camera.zoom/Core.cameraScale;
|
||||
player.y += vec.y*control.camera.zoom/Core.cameraScale;
|
||||
|
||||
pinch1.set(pointer1);
|
||||
pinch2.set(pointer2);
|
||||
|
||||
@@ -12,9 +12,7 @@ import io.anuke.mindustry.resource.ItemStack;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.mindustry.world.blocks.Blocks;
|
||||
import io.anuke.mindustry.world.blocks.ProductionBlocks;
|
||||
import io.anuke.ucore.core.Effects;
|
||||
import io.anuke.ucore.core.Inputs;
|
||||
import io.anuke.ucore.core.Sounds;
|
||||
import io.anuke.ucore.core.*;
|
||||
import io.anuke.ucore.scene.utils.Cursors;
|
||||
import io.anuke.ucore.util.Mathf;
|
||||
|
||||
@@ -84,7 +82,7 @@ public class Input{
|
||||
if(Inputs.buttonDown(Buttons.RIGHT) && World.cursorNear() && cursor.breakable()
|
||||
&& cursor.block() != ProductionBlocks.core){
|
||||
Tile tile = cursor;
|
||||
player.breaktime += Mathf.delta();
|
||||
player.breaktime += Timers.delta();
|
||||
if(player.breaktime >= tile.block().breaktime){
|
||||
if(tile.block().drops != null){
|
||||
Inventory.addItem(tile.block().drops.item, tile.block().drops.amount);
|
||||
|
||||
Reference in New Issue
Block a user