Merge branch 'master' of https://github.com/Anuken/Mindustry into 4.0

This commit is contained in:
Anuken
2018-04-28 16:28:58 -04:00
114 changed files with 509 additions and 129 deletions

View File

@@ -10,6 +10,7 @@ repositories {
dependencies {
implementation 'com.android.support:support-v4:22.1.1'
implementation 'org.sufficientlysecure:donations:2.5'
implementation 'com.google.android.gms:play-services-auth:11.8.0'
}
task deploy(type: Copy){
@@ -22,7 +23,7 @@ task deploy(type: Copy){
android {
buildToolsVersion '26.0.2'
compileSdkVersion 27
compileSdkVersion 26
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
@@ -58,7 +59,7 @@ android {
}
applicationId "io.anuke.mindustry"
minSdkVersion 9
minSdkVersion 14
targetSdkVersion 27
versionCode code
versionName versionNameResult

View File

@@ -8,9 +8,14 @@ import android.os.Build;
import android.os.Bundle;
import android.provider.Settings.Secure;
import android.telephony.TelephonyManager;
import android.util.Log;
import com.badlogic.gdx.backends.android.AndroidApplication;
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration;
import com.badlogic.gdx.utils.Base64Coder;
import com.google.android.gms.common.GoogleApiAvailability;
import com.google.android.gms.common.GooglePlayServicesNotAvailableException;
import com.google.android.gms.common.GooglePlayServicesRepairableException;
import com.google.android.gms.security.ProviderInstaller;
import io.anuke.kryonet.DefaultThreadImpl;
import io.anuke.kryonet.KryoClient;
import io.anuke.kryonet.KryoServer;
@@ -119,9 +124,8 @@ public class AndroidLauncher extends AndroidApplication{
return data;
}catch (Exception e){
Settings.defaults("uuid", "");
String uuid = Settings.getString("uuid");
String uuid = Settings.getString("uuid", "");
if(uuid.isEmpty()){
byte[] result = new byte[8];
new Random().nextBytes(result);
@@ -135,6 +139,15 @@ public class AndroidLauncher extends AndroidApplication{
}
};
try {
ProviderInstaller.installIfNeeded(this);
} catch (GooglePlayServicesRepairableException e) {
GoogleApiAvailability apiAvailability = GoogleApiAvailability.getInstance();
apiAvailability.getErrorDialog(this, e.getConnectionStatusCode(), 0).show();
} catch (GooglePlayServicesNotAvailableException e) {
Log.e("SecurityException", "Google Play Services not available.");
}
if(doubleScaleTablets && isTablet(this.getContext())){
Unit.dp.addition = 0.5f;
}

View File

@@ -26,7 +26,7 @@ public class TextFieldDialogListener extends ClickListener{
}
public static void add(TextField field){
add(field, 0, 15);
add(field, 0, 16);
}
//type - 0 is text, 1 is numbers, 2 is decimals

View File

@@ -7,6 +7,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.mobidevelop.robovm:robovm-gradle-plugin:2.3.0'
classpath 'de.richsource.gradle.plugins:gwt-gradle-plugin:0.6'
classpath 'com.android.tools.build:gradle:3.0.1'
classpath "com.badlogicgames.gdx:gdx-tools:1.9.8"
@@ -24,6 +25,7 @@ allprojects {
versionType = 'pre-alpha'
appName = 'Mindustry'
gdxVersion = '1.9.8'
roboVMVersion = '2.3.0'
aiVersion = '1.8.1'
uCoreVersion = 'dd5eb72'
@@ -103,6 +105,27 @@ project(":android") {
}
}
project(":ios") {
apply plugin: "java"
apply plugin: "robovm"
dependencies {
compile project(":core")
implementation project(":kryonet")
compile "com.mobidevelop.robovm:robovm-rt:$roboVMVersion"
compile "com.mobidevelop.robovm:robovm-cocoatouch:$roboVMVersion"
compile "com.badlogicgames.gdx:gdx-backend-robovm:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-ios"
}
robovm {
iosSignIdentity = "a"
iosProvisioningProfile = ""
}
}
project(":core") {
apply plugin: "java"

View File

@@ -1,4 +1,4 @@
text.about=Created by [ROYAL]Anuken[] - [SKY]anukendev@gmail.com[]\nOriginally an entry in the [orange]GDL[] Metal Monstrosity Jam.\n\nCredits:\n- SFX made with [YELLOW]bfxr[]\n- Music made by [GREEN]RoccoW[] / found on [lime]FreeMusicArchive.org[]\n\nSpecial thanks to:\n- [coral]MitchellFJN[]: extensive playtesting and feedback\n- [sky]Luxray5474[]: wiki work, code contributions\n- [lime]Epowerj[]: code build system, icon\n- All the beta testers on itch.io and Google Play\n
text.about=Created by [ROYAL]Anuken[] - [SKY]anukendev@gmail.com[]\nOriginally an entry in the [orange]GDL[] Metal Monstrosity Jam.\n\nCredits:\n- SFX made with [YELLOW]bfxr[]\n- Music made by [GREEN]a drop a day[]\n\nSpecial thanks to:\n- [coral]MitchellFJN[]: extensive playtesting and feedback\n- [sky]Luxray5474[]: wiki work, code contributions\n- [lime]Epowerj[]: code build system, icon\n- All the beta testers on itch.io and Google Play\n
text.credits=Credits
text.discord=Join the mindustry discord!
text.changes=[SCARLET]Attention!\n[]Some important game mechanics have been changed.\n\n- [accent]Teleporters[] now use power.\n- [accent]Smelteries[] and [accent]crucibles[] now have a maximum item capacity.\n- [accent]Crucibles[] now require coal as fuel.
@@ -133,7 +133,8 @@ text.back=Back
text.quit.confirm=Are you sure you want to quit?
text.changelog.title=Changelog
text.changelog.loading=Getting changelog...
text.changelog.error.android=[orange]Note that the changelog does not work on Android 4.4 and below!\nThis is due to an internal Android bug.
text.changelog.error.android=[orange]Note that the changelog sometimes does not work on Android 4.4 and below!\nThis is due to an internal Android bug.
text.changelog.error.ios=[orange]The changelog is currently not supported in iOS.
text.changelog.error=[scarlet]Error getting changelog!\nCheck your internet connection.
text.changelog.current=[yellow][[Current version]
text.changelog.latest=[orange][[Latest version]

BIN
core/assets/music/1.mp3 Normal file

Binary file not shown.

Binary file not shown.

BIN
core/assets/music/2.mp3 Normal file

Binary file not shown.

Binary file not shown.

BIN
core/assets/music/3.mp3 Normal file

Binary file not shown.

Binary file not shown.

BIN
core/assets/music/4.mp3 Normal file

Binary file not shown.

Binary file not shown.

BIN
core/assets/music/5.mp3 Normal file

Binary file not shown.

BIN
core/assets/music/6.mp3 Normal file

Binary file not shown.

BIN
core/assets/sounds/bang.mp3 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
core/assets/sounds/die.mp3 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
core/assets/sounds/ping.mp3 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -27,9 +27,12 @@ import java.util.Locale;
public class Vars{
public static final boolean testAndroid = false;
public static final boolean testMobile = false;
//shorthand for whether or not this is running on android
public static final boolean android = (Gdx.app.getType() == ApplicationType.Android) || testAndroid;
public static final boolean mobile = (Gdx.app.getType() == ApplicationType.Android) ||
Gdx.app.getType() == ApplicationType.iOS || testMobile;
public static final boolean ios = Gdx.app.getType() == ApplicationType.iOS;
public static final boolean android = Gdx.app.getType() == ApplicationType.Android;
//shorthand for whether or not this is running on GWT
public static final boolean gwt = (Gdx.app.getType() == ApplicationType.WebGL);
//whether to send block state change events to players
@@ -39,7 +42,7 @@ public class Vars{
//respawn time in frames
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);
public static final float wavespace = 60*60*(mobile ? 1 : 1);
//waves can last no longer than 3 minutes, otherwise the next one spawns
public static final float maxwavespace = 60*60*4f;
//advance time the pathfinding starts at

View File

@@ -60,7 +60,7 @@ public class Control extends Module{
Gdx.input.setCatchBackKey(true);
if(android){
if(mobile){
input = new AndroidInput();
}else{
input = new DesktopInput();
@@ -98,19 +98,21 @@ public class Control extends Module{
item.init();
}
Sounds.load("shoot.ogg", "place.ogg", "explosion.ogg", "enemyshoot.ogg",
"corexplode.ogg", "break.ogg", "spawn.ogg", "flame.ogg", "die.ogg",
"respawn.ogg", "purchase.ogg", "flame2.ogg", "bigshot.ogg", "laser.ogg", "lasershot.ogg",
"ping.ogg", "tesla.ogg", "waveend.ogg", "railgun.ogg", "blast.ogg", "bang2.ogg");
Sounds.load("shoot.mp3", "place.mp3", "explosion.mp3", "enemyshoot.mp3",
"corexplode.mp3", "break.mp3", "spawn.mp3", "flame.mp3", "die.mp3",
"respawn.mp3", "purchase.mp3", "flame2.mp3", "bigshot.mp3", "laser.mp3", "lasershot.mp3",
"ping.mp3", "tesla.mp3", "waveend.mp3", "railgun.mp3", "blast.mp3", "bang2.mp3");
Sounds.setFalloff(9000f);
Musics.load("1.mp3", "2.mp3", "3.mp3", "4.mp3", "5.mp3", "6.mp3");
DefaultKeybinds.load();
Settings.defaultList(
"ip", "localhost",
"port", port+"",
"name", android || gwt ? "player" : UCore.getProperty("user.name"),
"name", mobile || gwt ? "player" : UCore.getProperty("user.name"),
"servers", "",
"color", Color.rgba8888(playerColors[8]),
"lastVersion", "3.2",
@@ -121,7 +123,7 @@ public class Control extends Module{
player = new Player();
player.name = Settings.getString("name");
player.mech = android ? Mechs.standardShip : Mechs.standard;
player.mech = mobile ? Mechs.standardShip : Mechs.standard;
player.color.set(Settings.getInt("color"));
player.isLocal = true;

View File

@@ -68,7 +68,7 @@ public class NetClient extends Module {
ConnectPacket c = new ConnectPacket();
c.name = player.name;
c.android = android;
c.android = mobile;
c.color = Color.rgba8888(player.color);
c.uuid = Platform.instance.getUUID();

View File

@@ -170,7 +170,7 @@ public class NetServer extends Module{
if(!Timers.get("fastshoot-" + id + "-" + weapon.id, wtrc)){
info.fastShots.getAndIncrement(weapon.id, 0, 1);
if(info.fastShots.get(weapon.id, 0) > (int)(wtrc / (weapon.getReload() / 2f)) + 6){
if(info.fastShots.get(weapon.id, 0) > (int)(wtrc / (weapon.getReload() / 2f)) + 8){
kick(id, KickReason.kick);
}
}else{

View File

@@ -173,7 +173,7 @@ public class Renderer extends RendererModule{
float deltax = camera.position.x - prex, deltay = camera.position.y - prey;
if(android){
if(mobile){
player.x += camera.position.x - prevx;
player.y += camera.position.y - prevy;
}
@@ -405,7 +405,7 @@ public class Renderer extends RendererModule{
int tilex = control.input().getBlockX();
int tiley = control.input().getBlockY();
if(android){
if(mobile){
Vector2 vec = Graphics.world(Gdx.input.getX(0), Gdx.input.getY(0));
tilex = Mathf.scl2(vec.x, tilesize);
tiley = Mathf.scl2(vec.y, tilesize);
@@ -414,7 +414,7 @@ public class Renderer extends RendererModule{
InputHandler input = control.input();
//draw placement box
if((input.recipe != null && state.inventory.hasItems(input.recipe.requirements) && (!ui.hasMouse() || android)
if((input.recipe != null && state.inventory.hasItems(input.recipe.requirements) && (!ui.hasMouse() || mobile)
&& control.input().drawPlace())){
input.placeMode.draw(control.input().getBlockX(), control.input().getBlockY(),
@@ -425,7 +425,7 @@ public class Renderer extends RendererModule{
}else if(input.breakMode.delete && control.input().drawPlace()
&& (input.recipe == null || !state.inventory.hasItems(input.recipe.requirements))
&& (input.placeMode.delete || input.breakMode.both || !android)){
&& (input.placeMode.delete || input.breakMode.both || !mobile)){
if(input.breakMode == PlaceMode.holdDelete)
input.breakMode.draw(tilex, tiley, 0, 0);

View File

@@ -166,7 +166,7 @@ public class MapEditorDialog extends Dialog{
openImage.show();
menu.hide();
});
/*
loadDialog = new MapLoadDialog(map -> {
@@ -365,13 +365,13 @@ public class MapEditorDialog extends Dialog{
}}.left().growY().end();
new table("button"){{
margin(5);
marginBottom(10);
add(view).grow();
}}.grow().end();
new table(){{
row();
@@ -413,7 +413,7 @@ public class MapEditorDialog extends Dialog{
}
}
}
private void addBlockSelection(Table table){
Table content = new Table();
pane = new ScrollPane(content, "volume");

View File

@@ -28,7 +28,7 @@ public class BlockRenderer{
private int iterateidx = 0;
private float storeX, storeY;
public BlockRenderer(){
floorRenderer = new FloorRenderer();
@@ -59,7 +59,7 @@ public class BlockRenderer{
int rangex = (int) (camera.viewportWidth * camera.zoom / tilesize / 2)+2;
int rangey = (int) (camera.viewportHeight * camera.zoom / tilesize / 2)+2;
int expandr = 4;
Graphics.surface(renderer.shadowSurface);

View File

@@ -25,8 +25,8 @@ public abstract class InputHandler extends InputAdapter{
public float breaktime = 0;
public Recipe recipe;
public int rotation;
public PlaceMode placeMode = android ? PlaceMode.cursor : PlaceMode.hold;
public PlaceMode breakMode = android ? PlaceMode.none : PlaceMode.holdDelete;
public PlaceMode placeMode = mobile ? PlaceMode.cursor : PlaceMode.hold;
public PlaceMode breakMode = mobile ? PlaceMode.none : PlaceMode.holdDelete;
public PlaceMode lastPlaceMode = placeMode;
public PlaceMode lastBreakMode = breakMode;
public boolean droppingItem, transferring;

View File

@@ -28,8 +28,8 @@ public enum PlaceMode{
float x = tilex * tilesize;
float y = tiley * tilesize;
boolean valid = control.input().validPlace(tilex, tiley, control.input().recipe.result) && (android || control.input().cursorNear());
boolean valid = control.input().validPlace(tilex, tiley, control.input().recipe.result) && (mobile || control.input().cursorNear());
Vector2 offset = control.input().recipe.result.getPlaceOffset();
float si = MathUtils.sin(Timers.time() / 6f) + 1.5f;
@@ -89,7 +89,7 @@ public enum PlaceMode{
tile = tile.getLinked();
float fin = control.input().breaktime / tile.getBreakTime();
if(android && control.input().breaktime > 0){
if(mobile && control.input().breaktime > 0){
Draw.color(Colors.get("breakStart"), Colors.get("break"), fin);
Lines.poly(tile.drawx(), tile.drawy(), 25, 4 + (1f - fin) * 26);
}
@@ -169,8 +169,8 @@ public enum PlaceMode{
process(tilex, tiley, endx, endy);
tilex = this.tilex; tiley = this.tiley;
endx = this.endx; endy = this.endy;
if(android){
if(mobile){
ToolFragment t = ui.toolfrag;
if(!t.confirming || t.px != tilex || t.py != tiley || t.px2 != endx || t.py2 != endy) {
t.confirming = true;
@@ -236,7 +236,7 @@ public enum PlaceMode{
}
public void draw(int tilex, int tiley, int endx, int endy){
if(android && !Gdx.input.isTouched(0) && !control.showCursor()){
if(mobile && !Gdx.input.isTouched(0) && !control.showCursor()){
return;
}
@@ -300,8 +300,8 @@ public enum PlaceMode{
Lines.stroke(2f);
Draw.color("placeInvalid");
Lines.crect(
px * t + (isX ? 0 : offset.x) + (ex < tx && isX ? t : 0) - (block.size == 3 && ex > tx && isX ? t : 0),
py * t + (isX ? offset.y : 0) + (ey < ty && !isX ? t : 0) - (block.size == 3 && ey > ty && !isX ? t : 0),
px * t + (isX ? 0 : offset.x) + (ex < tx && isX && block.size > 1 ? t : 0) - (block.size == 3 && ex > tx && isX ? t : 0),
py * t + (isX ? offset.y : 0) + (ey < ty && !isX && block.size > 1 ? t : 0) - (block.size == 3 && ey > ty && !isX ? t : 0),
t*(isX ? 1 : block.size),
t*(isX ? block.size : 1));
Draw.color("place");

View File

@@ -1,12 +1,15 @@
package io.anuke.mindustry.io;
import com.badlogic.gdx.utils.Base64Coder;
import io.anuke.mindustry.core.ThreadHandler.ThreadProvider;
import io.anuke.ucore.core.Settings;
import io.anuke.ucore.entities.Entity;
import io.anuke.ucore.entities.EntityGroup;
import io.anuke.ucore.scene.ui.TextField;
import java.util.Date;
import java.util.Locale;
import java.util.Random;
public abstract class Platform {
public static Platform instance = new Platform() {};
@@ -31,7 +34,18 @@ public abstract class Platform {
}
public boolean isDebug(){return false;}
/**Must be 8 bytes in length.*/
public byte[] getUUID(){return null;}
public byte[] getUUID(){
String uuid = Settings.getString("uuid", "");
if(uuid.isEmpty()){
byte[] result = new byte[8];
new Random().nextBytes(result);
uuid = new String(Base64Coder.encode(result));
Settings.putString("uuid", uuid);
Settings.save();
return result;
}
return Base64Coder.decode(uuid);
}
public ThreadProvider getThreadProvider(){
return new ThreadProvider() {
@Override public boolean isOnThread() {return true;}

View File

@@ -44,6 +44,11 @@ public class ChangelogDialog extends FloatingDialog{
table.row();
table.add("$text.changelog.error.android").padTop(8);
}
if(Vars.ios){
table.row();
table.add("$text.changelog.error.ios").padTop(8);
}
}else{
for(VersionInfo info : versions){
Table in = new Table("clear");

View File

@@ -35,7 +35,7 @@ public class PausedDialog extends FloatingDialog{
if(!Net.active()) state.set(State.paused);
});
if(!android){
if(!mobile){
content().defaults().width(220).height(50);
content().addButton("$text.back", () -> {

View File

@@ -84,7 +84,7 @@ public class SettingsMenuDialog extends SettingsDialog{
menu.addButton("$text.settings.graphics", () -> visible(1));
menu.row();
menu.addButton("$text.settings.sound", () -> visible(2));
if(!Vars.android) {
if(!Vars.mobile) {
menu.row();
menu.addButton("$text.settings.controls", ui.controls::show);
}
@@ -142,7 +142,7 @@ public class SettingsMenuDialog extends SettingsDialog{
}
}
if(!android && !gwt) {
if(!mobile && !gwt) {
graphics.checkPref("vsync", true, b -> Gdx.graphics.setVSync(b));
graphics.checkPref("fullscreen", false, b -> {
if (b) {

View File

@@ -39,7 +39,7 @@ public class BlocksFragment implements Fragment{
private boolean shown = true;
private Recipe hoveredDescriptionRecipe;
private IntSet itemset = new IntSet();
public void build(){
InputHandler input = control.input();

View File

@@ -107,12 +107,12 @@ public class ChatFragment extends Table implements Fragment{
add(chatfield).padBottom(offsety).padLeft(offsetx).growX().padRight(offsetx).height(28);
if(Vars.android) {
if(Vars.mobile) {
marginBottom(105f);
marginRight(240f);
}
if(Vars.android) {
if(Vars.mobile) {
addImageButton("icon-arrow-right", 14 * 2, this::toggle).size(46f, 51f).visible(() -> chatOpen).pad(2f);
}
}

View File

@@ -71,14 +71,14 @@ public class HudFragment implements Fragment{
}).get();
new imagebutton("icon-pause", isize, () -> {
if(android) DebugFragment.printDebugInfo();
if (Net.active() && android) {
if(mobile) DebugFragment.printDebugInfo();
if (Net.active() && mobile) {
ui.listfrag.visible = !ui.listfrag.visible;
} else {
state.set(state.is(State.paused) ? State.playing : State.paused);
}
}).update(i -> {
if (Net.active() && android) {
if (Net.active() && mobile) {
i.getStyle().imageUp = Core.skin.getDrawable("icon-players");
} else {
i.setDisabled(Net.active());
@@ -87,7 +87,7 @@ public class HudFragment implements Fragment{
}).get();
new imagebutton("icon-settings", isize, () -> {
if (Net.active() && android) {
if (Net.active() && mobile) {
if (ui.chatfrag.chatOpen()) {
ui.chatfrag.hide();
} else {
@@ -97,7 +97,7 @@ public class HudFragment implements Fragment{
ui.settings.show();
}
}).update(i -> {
if (Net.active() && android) {
if (Net.active() && mobile) {
i.getStyle().imageUp = Core.skin.getDrawable("icon-chat");
} else {
i.getStyle().imageUp = Core.skin.getDrawable("icon-settings");

View File

@@ -18,7 +18,7 @@ public class MenuFragment implements Fragment{
new table(){{
visible(() -> state.is(State.menu));
if(!android){
if(!mobile){
new table(){{
float w = 200f;

View File

@@ -29,7 +29,7 @@ public class PlacementFragment implements Fragment{
Label modelabel;
public void build(){
if(!android) return;
if(!mobile) return;
InputHandler input = control.input();

View File

@@ -63,7 +63,7 @@ public class PlayerListFragment implements Fragment{
}}.end();
update(t -> {
if(!android){
if(!mobile){
visible = Inputs.keyDown("player_list");
}
if(!(Net.active() && !state.is(State.menu))){

View File

@@ -11,8 +11,6 @@ import io.anuke.ucore.core.Core;
import io.anuke.ucore.core.Graphics;
import io.anuke.ucore.scene.ui.layout.Table;
import static io.anuke.mindustry.Vars.*;
public class ToolFragment implements Fragment{
private Table tools;
public int px, py, px2, py2;
@@ -50,7 +48,7 @@ public class ToolFragment implements Fragment{
Core.scene.add(tools);
tools.setVisible(() ->
!state.is(State.menu) && android && ((input.recipe != null && state.inventory.hasItems(input.recipe.requirements) &&
!state.is(State.menu) && mobile && ((input.recipe != null && state.inventory.hasItems(input.recipe.requirements) &&
input.placeMode == PlaceMode.cursor) || confirming)
);

View File

@@ -48,7 +48,7 @@ public class WeaponFactory extends Block{
@Override
public boolean isConfigurable(Tile tile){
return !Vars.android;
return !Vars.mobile;
}
@Override

View File

@@ -13,18 +13,23 @@ ext.writeVersion = {
def pfile = new File('core/assets/version.properties')
def props = new Properties()
pfile.createNewFile()
try{
pfile.createNewFile()
}catch (Exception e){}
props.load(new FileInputStream(pfile))
if(pfile.exists()) {
String code = getBuildVersion()
props.load(new FileInputStream(pfile))
props["name"] = appName
props["version"] = versionType
props["code"] = versionNumber
props["build"] = code
String code = getBuildVersion()
props.store(pfile.newWriter(), "Autogenerated file. Do not modify.")
props["name"] = appName
props["version"] = versionType
props["code"] = versionNumber
props["build"] = code
props.store(pfile.newWriter(), "Autogenerated file. Do not modify.")
}
}
ext.getPlatform = {
@@ -51,6 +56,9 @@ task run(dependsOn: classes, type: JavaExec) {
classpath = sourceSets.main.runtimeClasspath
standardInput = System.in
workingDir = project.assetsDir
if(System.getProperty("os.name").toLowerCase().contains("mac")){
jvmArgs "-XstartOnFirstThread"
}
ignoreExitValue = true
if (project.hasProperty("appArgs")) {
args Eval.me(appArgs)

Binary file not shown.

View File

@@ -1,4 +1,4 @@
#Tue Dec 19 19:08:24 EST 2017
#Sat Apr 28 09:57:33 EDT 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME

110
gradlew vendored
View File

@@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/usr/bin/env sh
##############################################################################
##
@@ -6,47 +6,6 @@
##
##############################################################################
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn ( ) {
echo "$*"
}
die ( ) {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
esac
# For Cygwin, ensure paths are in UNIX format before anything is touched.
if $cygwin ; then
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
@@ -61,9 +20,49 @@ while [ -h "$PRG" ] ; do
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >&-
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >&-
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
@@ -90,7 +89,7 @@ location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
@@ -114,6 +113,7 @@ fi
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
@@ -154,11 +154,19 @@ if $cygwin ; then
esac
fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
APP_ARGS=$(save "$@")
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi
exec "$JAVACMD" "$@"

14
gradlew.bat vendored
View File

@@ -8,14 +8,14 @@
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
@@ -46,10 +46,9 @@ echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windowz variants
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
@@ -60,11 +59,6 @@ set _SKIP=2
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line

58
ios/Info.plist.xml Normal file
View File

@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>${app.name}</string>
<key>CFBundleExecutable</key>
<string>${app.executable}</string>
<key>CFBundleIdentifier</key>
<string>${app.id}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${app.name}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>${app.version}</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>${app.build}</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>UIStatusBarHidden</key>
<true/>
<key>UIDeviceFamily</key>
<array>
<integer>1</integer>
<integer>2</integer>
</array>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
<string>opengles-2</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>CFBundleIcons</key>
<dict>
<key>CFBundlePrimaryIcon</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>Icon</string>
<string>Icon-72</string>
</array>
</dict>
</dict>
</dict>
</plist>

22
ios/build.gradle Normal file
View File

@@ -0,0 +1,22 @@
sourceSets.main.java.srcDirs = [ "src/" ]
sourceCompatibility = '1.8'
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
ext {
mainClassName = "io.anuke.mindustry.IOSLauncher"
}
launchIPhoneSimulator.dependsOn build
launchIPadSimulator.dependsOn build
launchIOSDevice.dependsOn build
createIPA.dependsOn build
robovm {
archs = "thumbv7:arm64"
}
eclipse.project {
name = appName + "-ios"
natures 'org.robovm.eclipse.RoboVMNature'
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 622 KiB

BIN
ios/data/Default-667h.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 783 KiB

BIN
ios/data/Default-736h.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

Some files were not shown because too many files have changed in this diff Show More