diff --git a/TODO.md b/TODO.md index affc7e0fad..db1a551695 100644 --- a/TODO.md +++ b/TODO.md @@ -2,7 +2,7 @@ _Keep in mind that this is just a basic outline of planned features, and will be ### 3.x Planned - New save system: toggleable autosave, named slots, less clunky save UI -- Optimize for tablets +- [DONE?] Optimize for tablets - Teleporter UI changes, more colors (?) - [DONE] New building tools: selection-delete, hold to place blocks in a line, one-tap delete mode (mobile). New 'tool' menu (desktop). - [DONE] Refactor `Renderer`, remove code for rendering platform-specific placement and move to 2 different classes @@ -13,8 +13,9 @@ _Keep in mind that this is just a basic outline of planned features, and will be - Fix bugs with junction not accepting blocks (low FPS) - Fix bugs with tunnel merging and/or removing items (low FPS) - Edit descriptions for conveyors to be more clear about how to use them -- Add link to Mindustry discord everywhere +- [DONE] Add link to Mindustry discord everywhere - Balancing to slow down progression +- Map editor ### Major Bugs - Black screen when tabbing out on Android diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml index 00509484bd..dfaef6fadf 100644 --- a/android/AndroidManifest.xml +++ b/android/AndroidManifest.xml @@ -1,8 +1,8 @@ + android:versionCode="37" + android:versionName="3.1.1" > diff --git a/android/src/io/anuke/mindustry/AndroidLauncher.java b/android/src/io/anuke/mindustry/AndroidLauncher.java index 73c6e82aa6..698b5697f9 100644 --- a/android/src/io/anuke/mindustry/AndroidLauncher.java +++ b/android/src/io/anuke/mindustry/AndroidLauncher.java @@ -10,9 +10,9 @@ import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration; import android.annotation.SuppressLint; import android.content.Context; import android.content.Intent; -import android.content.res.Configuration; import android.net.Uri; import android.os.Bundle; +import android.telephony.TelephonyManager; import io.anuke.mindustry.io.PlatformFunction; import io.anuke.ucore.function.Callable; import io.anuke.ucore.scene.ui.layout.Unit; @@ -51,12 +51,8 @@ public class AndroidLauncher extends AndroidApplication{ Mindustry.donationsCallable = new Callable(){ @Override public void run(){ showDonations(); } }; - if(doubleScaleTablets){ - if(isTablet(this.getContext())){ - Unit.dp.multiplier = 2f; - }else{ - Unit.dp.multiplier = 1f; - } + if(doubleScaleTablets && isTablet(this.getContext())){ + Unit.dp.addition = 0.5f; } config.hideStatusBar = true; @@ -74,9 +70,8 @@ public class AndroidLauncher extends AndroidApplication{ } private boolean isTablet(Context context) { - boolean xlarge = ((context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_XLARGE); - boolean large = ((context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_LARGE); - return (xlarge || large); + TelephonyManager manager = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE); + return manager.getPhoneType() == TelephonyManager.PHONE_TYPE_NONE; } private void showDonations(){ diff --git a/build.gradle b/build.gradle index 104fdee05d..b8acbbda5e 100644 --- a/build.gradle +++ b/build.gradle @@ -79,7 +79,7 @@ project(":core") { apply plugin: "java" dependencies { - compile 'com.github.anuken:ucore:d56206b7c0' + compile 'com.github.anuken:ucore:283ecacfef' compile "com.badlogicgames.gdx:gdx:$gdxVersion" compile "com.badlogicgames.gdx:gdx-ai:1.8.1" } diff --git a/core/src/io/anuke/mindustry/Vars.java b/core/src/io/anuke/mindustry/Vars.java index 956d798436..1ec0230adc 100644 --- a/core/src/io/anuke/mindustry/Vars.java +++ b/core/src/io/anuke/mindustry/Vars.java @@ -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 diff --git a/core/src/io/anuke/mindustry/entities/Player.java b/core/src/io/anuke/mindustry/entities/Player.java index 389bc9ac03..60c49aee9e 100644 --- a/core/src/io/anuke/mindustry/entities/Player.java +++ b/core/src/io/anuke/mindustry/entities/Player.java @@ -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); diff --git a/core/src/io/anuke/mindustry/input/DesktopInput.java b/core/src/io/anuke/mindustry/input/DesktopInput.java index 4bf42182d7..bf19570e7d 100644 --- a/core/src/io/anuke/mindustry/input/DesktopInput.java +++ b/core/src/io/anuke/mindustry/input/DesktopInput.java @@ -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(); } diff --git a/core/src/io/anuke/mindustry/ui/MapEditor.java b/core/src/io/anuke/mindustry/ui/MapEditor.java new file mode 100644 index 0000000000..33ff2caf4a --- /dev/null +++ b/core/src/io/anuke/mindustry/ui/MapEditor.java @@ -0,0 +1,5 @@ +package io.anuke.mindustry.ui; + +public class MapEditor{ + +}