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

@@ -2,7 +2,7 @@ _Keep in mind that this is just a basic outline of planned features, and will be
### 3.x Planned ### 3.x Planned
- New save system: toggleable autosave, named slots, less clunky save UI - New save system: toggleable autosave, named slots, less clunky save UI
- Optimize for tablets - [DONE?] Optimize for tablets
- Teleporter UI changes, more colors (?) - 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] 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 - [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 junction not accepting blocks (low FPS)
- Fix bugs with tunnel merging and/or removing items (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 - 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 - Balancing to slow down progression
- Map editor
### Major Bugs ### Major Bugs
- Black screen when tabbing out on Android - Black screen when tabbing out on Android

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.anuke.mindustry" package="io.anuke.mindustry"
android:versionCode="35" android:versionCode="37"
android:versionName="3.1b2" > android:versionName="3.1.1" >
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="25" /> <uses-sdk android:minSdkVersion="9" android:targetSdkVersion="25" />
<uses-permission android:name="com.android.vending.BILLING" /> <uses-permission android:name="com.android.vending.BILLING" />

View File

@@ -10,9 +10,9 @@ import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.res.Configuration;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.telephony.TelephonyManager;
import io.anuke.mindustry.io.PlatformFunction; import io.anuke.mindustry.io.PlatformFunction;
import io.anuke.ucore.function.Callable; import io.anuke.ucore.function.Callable;
import io.anuke.ucore.scene.ui.layout.Unit; 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(); } }; Mindustry.donationsCallable = new Callable(){ @Override public void run(){ showDonations(); } };
if(doubleScaleTablets){ if(doubleScaleTablets && isTablet(this.getContext())){
if(isTablet(this.getContext())){ Unit.dp.addition = 0.5f;
Unit.dp.multiplier = 2f;
}else{
Unit.dp.multiplier = 1f;
}
} }
config.hideStatusBar = true; config.hideStatusBar = true;
@@ -74,9 +70,8 @@ public class AndroidLauncher extends AndroidApplication{
} }
private boolean isTablet(Context context) { private boolean isTablet(Context context) {
boolean xlarge = ((context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_XLARGE); TelephonyManager manager = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
boolean large = ((context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_LARGE); return manager.getPhoneType() == TelephonyManager.PHONE_TYPE_NONE;
return (xlarge || large);
} }
private void showDonations(){ private void showDonations(){

View File

@@ -79,7 +79,7 @@ project(":core") {
apply plugin: "java" apply plugin: "java"
dependencies { dependencies {
compile 'com.github.anuken:ucore:d56206b7c0' compile 'com.github.anuken:ucore:283ecacfef'
compile "com.badlogicgames.gdx:gdx:$gdxVersion" compile "com.badlogicgames.gdx:gdx:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-ai:1.8.1" compile "com.badlogicgames.gdx:gdx-ai:1.8.1"
} }

View File

@@ -20,8 +20,8 @@ public class Vars{
public static final float respawnduration = 60*4; public static final float respawnduration = 60*4;
//time between waves in frames (on normal mode) //time between waves in frames (on normal mode)
public static final float wavespace = 60*60*(android ? 1 : 1); public static final float wavespace = 60*60*(android ? 1 : 1);
//waves can last no longer than 5 minutes, otherwise the next one spawns //waves can last no longer than 2 minutes, otherwise the next one spawns
public static final float maxwavespace = 60*60*5; public static final float maxwavespace = 60*60*2;
//advance time the pathfinding starts at //advance time the pathfinding starts at
public static final float aheadPathfinding = 60*20; public static final float aheadPathfinding = 60*20;
//how far away from spawn points the player can't place blocks //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; vector.x += speed;
boolean shooting = !Inputs.keyDown("dash") && Inputs.buttonDown(Buttons.LEFT) && recipe == null 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)){ if(shooting && Timers.get(this, "reload", weapon.reload)){
weapon.shoot(this); weapon.shoot(this);

View File

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

View File

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