Compare commits
333 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c321402414 | ||
|
|
ec80fc9f3f | ||
|
|
6bfd57097f | ||
|
|
6f5df6a671 | ||
|
|
1baf3190cd | ||
|
|
66c29c49e5 | ||
|
|
e5d6740555 | ||
|
|
30b5dd63e4 | ||
|
|
f0aa8d73ea | ||
|
|
8a0761cad8 | ||
|
|
322d76b713 | ||
|
|
4f56bf3c3e | ||
|
|
942eed402a | ||
|
|
24c72650fb | ||
|
|
f5959c8829 | ||
|
|
7621ebed42 | ||
|
|
5447c71790 | ||
|
|
c5241eaaf6 | ||
|
|
9266b55ddf | ||
|
|
1bc1f66613 | ||
|
|
7795a690ed | ||
|
|
d498ac89f2 | ||
|
|
2842018c2f | ||
|
|
51641cc704 | ||
|
|
729f5ed5e4 | ||
|
|
03ff33acaf | ||
|
|
46035e76cc | ||
|
|
7c073f76ae | ||
|
|
5ced5ce253 | ||
|
|
55781e911e | ||
|
|
ee3c4a4124 | ||
|
|
6815e56e57 | ||
|
|
6c744443fb | ||
|
|
3c37047afb | ||
|
|
f31f09d77a | ||
|
|
de508ee68f | ||
|
|
a932111040 | ||
|
|
8c437eb815 | ||
|
|
1ad4815983 | ||
|
|
c75cdc6d28 | ||
|
|
b9fae7fb7d | ||
|
|
e74a3da5cd | ||
|
|
08cf986cae | ||
|
|
ba01ed0153 | ||
|
|
19ac8bd9b2 | ||
|
|
ab79ccb02b | ||
|
|
d862498516 | ||
|
|
b09b03a427 | ||
|
|
4ef2ede4cf | ||
|
|
0efaa11553 | ||
|
|
ea87b958ef | ||
|
|
ff62f075d0 | ||
|
|
348744086d | ||
|
|
d1d4f79973 | ||
|
|
2a3f7f8cb3 | ||
|
|
7eaef11a84 | ||
|
|
efe93d0117 | ||
|
|
7d12e18b98 | ||
|
|
de6bca424f | ||
|
|
03268a5575 | ||
|
|
1251680a1c | ||
|
|
cd0e49914b | ||
|
|
700e845727 | ||
|
|
bab8120814 | ||
|
|
afec65eb56 | ||
|
|
d6661da0a7 | ||
|
|
dcc4732748 | ||
|
|
6a5bf08d55 | ||
|
|
ca5db2bff8 | ||
|
|
658698ed2f | ||
|
|
7f391dacbd | ||
|
|
90e0bf95d1 | ||
|
|
930bfb26f4 | ||
|
|
7e788f212a | ||
|
|
8f99530795 | ||
|
|
434af4b998 | ||
|
|
a7c8526f3e | ||
|
|
459256e83a | ||
|
|
8dbfb87246 | ||
|
|
9f97ed331b | ||
|
|
ee043e67a4 | ||
|
|
6c3b449f74 | ||
|
|
536c6a7b2c | ||
|
|
e90e0fc615 | ||
|
|
b704121dcb | ||
|
|
5e0886d744 | ||
|
|
f819e4829b | ||
|
|
8873948e9e | ||
|
|
a25ea14436 | ||
|
|
1a922f05c1 | ||
|
|
e8268b1dab | ||
|
|
7a516930b1 | ||
|
|
92b68bdb8f | ||
|
|
a86bb9f6e6 | ||
|
|
c9777af91c | ||
|
|
2d1a97e042 | ||
|
|
ece3f96867 | ||
|
|
65a48b324d | ||
|
|
53bf622065 | ||
|
|
075be18123 | ||
|
|
044390b4b4 | ||
|
|
37d03aaebe | ||
|
|
51a51833d4 | ||
|
|
a8cfc1ef7a | ||
|
|
1d238c8315 | ||
|
|
4f96744ff2 | ||
|
|
e9783ecccc | ||
|
|
6342cc41ac | ||
|
|
c554390de5 | ||
|
|
4d8bbe3023 | ||
|
|
969076f1ef | ||
|
|
20032def7e | ||
|
|
94706460c0 | ||
|
|
b7506229f8 | ||
|
|
58c6df3537 | ||
|
|
235a1f36ec | ||
|
|
b53821976e | ||
|
|
4355881fb2 | ||
|
|
cf50d558ba | ||
|
|
7488dc3ebb | ||
|
|
b449847ad1 | ||
|
|
9785745384 | ||
|
|
56ffa7905e | ||
|
|
216433aa2d | ||
|
|
122fbbed22 | ||
|
|
042c671bd4 | ||
|
|
38fdc11917 | ||
|
|
2f4730a9c6 | ||
|
|
3759d32c89 | ||
|
|
93c2ca8df1 | ||
|
|
3c70681537 | ||
|
|
0ce08319e7 | ||
|
|
17e0489164 | ||
|
|
7953cc416b | ||
|
|
a670ac0aea | ||
|
|
ef30018008 | ||
|
|
66810c8b75 | ||
|
|
2bba55ebd5 | ||
|
|
b977ae4d3b | ||
|
|
d4f5e854c5 | ||
|
|
837f621633 | ||
|
|
a781b4a387 | ||
|
|
a73a75a7f8 | ||
|
|
17d1db913f | ||
|
|
a924509e92 | ||
|
|
04b4321ea1 | ||
|
|
1f9ebc7295 | ||
|
|
6d88111dfc | ||
|
|
184e52b4ec | ||
|
|
2a3cc3d88c | ||
|
|
ffa1aae27c | ||
|
|
7cd842df19 | ||
|
|
e399e4960c | ||
|
|
5c193a47eb | ||
|
|
b63c02cb10 | ||
|
|
09418f1a5d | ||
|
|
fa4491340a | ||
|
|
192814650d | ||
|
|
5f1addc54d | ||
|
|
9ffc8c6800 | ||
|
|
64cd8084ea | ||
|
|
2e6c9d408c | ||
|
|
f3bea49f61 | ||
|
|
48fdae754e | ||
|
|
64f2ee67b2 | ||
|
|
19d34779a0 | ||
|
|
76a6a0cf75 | ||
|
|
da47d97cd0 | ||
|
|
f59441005e | ||
|
|
e30347a11f | ||
|
|
8ac079fb72 | ||
|
|
4295f08a84 | ||
|
|
bd8eb97d46 | ||
|
|
329f656c40 | ||
|
|
f2c7a26ce0 | ||
|
|
930e25e64a | ||
|
|
963269a685 | ||
|
|
de23ef5d35 | ||
|
|
208ae6183c | ||
|
|
761ae4b816 | ||
|
|
ff308641e1 | ||
|
|
a2094ddf75 | ||
|
|
0391ed3e63 | ||
|
|
b6b3997498 | ||
|
|
9f77c0c9b7 | ||
|
|
dc4812a86e | ||
|
|
fc83b0d95b | ||
|
|
8e70568e32 | ||
|
|
f0e3a3a30c | ||
|
|
cf44efa02e | ||
|
|
ddc59dfb97 | ||
|
|
ef0a3396d7 | ||
|
|
8bf68aa020 | ||
|
|
02a90856ff | ||
|
|
8716695d4e | ||
|
|
9a1bb69cd8 | ||
|
|
6caad0daf6 | ||
|
|
6508f1541b | ||
|
|
6809b38821 | ||
|
|
7f9a3efa24 | ||
|
|
8ecea9792b | ||
|
|
7c85a03b42 | ||
|
|
d4d71b90eb | ||
|
|
fbf614a8df | ||
|
|
c02329e4b1 | ||
|
|
5aba065413 | ||
|
|
6e65096bb4 | ||
|
|
b39f25ed51 | ||
|
|
3925d5ec27 | ||
|
|
381b59acd4 | ||
|
|
5b01d923d3 | ||
|
|
108e5a2f5e | ||
|
|
e21d17a482 | ||
|
|
d4ea8c56c3 | ||
|
|
783ad64353 | ||
|
|
ac918c1a81 | ||
|
|
0f00074f77 | ||
|
|
eb20ec1556 | ||
|
|
32f9da0724 | ||
|
|
968be8eb8f | ||
|
|
d7e05cde42 | ||
|
|
557b86a7a9 | ||
|
|
f144dda8b5 | ||
|
|
80aed31135 | ||
|
|
2a21e7c2cb | ||
|
|
d281277797 | ||
|
|
fb807bcde4 | ||
|
|
ebf6f6782f | ||
|
|
008df649f0 | ||
|
|
a810e704ad | ||
|
|
d0b3167956 | ||
|
|
a726ecbdd8 | ||
|
|
da6a8f806d | ||
|
|
b47f44cacd | ||
|
|
0cc59adad7 | ||
|
|
6c076863db | ||
|
|
ddb6e74955 | ||
|
|
2094bc3d80 | ||
|
|
c922007d21 | ||
|
|
b1435c1264 | ||
|
|
be5e1648e0 | ||
|
|
a270feb1eb | ||
|
|
103b8cd13a | ||
|
|
e6dd36283d | ||
|
|
aae2d0a5dc | ||
|
|
fda1d4cc2b | ||
|
|
5be92460c1 | ||
|
|
15ce31ea3a | ||
|
|
35e5a669a0 | ||
|
|
8b8c74cf93 | ||
|
|
cc43524b4c | ||
|
|
f87d297155 | ||
|
|
605d50166a | ||
|
|
de6681d00a | ||
|
|
7632e33975 | ||
|
|
5993a596e8 | ||
|
|
2294b6babb | ||
|
|
c38f866363 | ||
|
|
511b112ac7 | ||
|
|
8cd0618e85 | ||
|
|
b4b589bfc2 | ||
|
|
cb69eb7c0f | ||
|
|
7d83cd89f2 | ||
|
|
b2dca0a34f | ||
|
|
3bd73961d7 | ||
|
|
67f574b5d8 | ||
|
|
f9b70a37aa | ||
|
|
d4047e1413 | ||
|
|
80f5b4c3b7 | ||
|
|
4668a6d8c0 | ||
|
|
e6f076306f | ||
|
|
b73dc127a3 | ||
|
|
8c8a2311d6 | ||
|
|
0555fb22ca | ||
|
|
85cde62039 | ||
|
|
46a2648d15 | ||
|
|
e55f6ecd6b | ||
|
|
c71fee3fed | ||
|
|
4d6c25c9d3 | ||
|
|
6ed4e2d946 | ||
|
|
6b4242478f | ||
|
|
ef5478279b | ||
|
|
62bb8bce1c | ||
|
|
83a5c3af8a | ||
|
|
f78abd61d4 | ||
|
|
209c6fa1c1 | ||
|
|
6e3c600a49 | ||
|
|
b1cda57174 | ||
|
|
412d92e782 | ||
|
|
c0703a6a5e | ||
|
|
64bd306c6d | ||
|
|
6be49f898c | ||
|
|
59bc73656f | ||
|
|
bed22f51b4 | ||
|
|
c1362a02f3 | ||
|
|
859a3cbe6e | ||
|
|
a6d82f44b3 | ||
|
|
e66e17a41a | ||
|
|
cfa6d7080c | ||
|
|
01ceedccd5 | ||
|
|
ed28af7c73 | ||
|
|
74cf91f99e | ||
|
|
44479930df | ||
|
|
cb1f54aac4 | ||
|
|
d68d2e9f30 | ||
|
|
948c48ea23 | ||
|
|
a9ccf6ca42 | ||
|
|
fd7b829e70 | ||
|
|
87a7cc6289 | ||
|
|
2f8b5e53bb | ||
|
|
8b7fa3b646 | ||
|
|
dd2c71fe61 | ||
|
|
3b58d57e5c | ||
|
|
cecf32e52e | ||
|
|
91a2dfab36 | ||
|
|
5e5838a8c1 | ||
|
|
0fffbc06dd | ||
|
|
4d360bfb73 | ||
|
|
e3001b614e | ||
|
|
6ecdef02ab | ||
|
|
36903eb749 | ||
|
|
f530c9514f | ||
|
|
fdffa77bc5 | ||
|
|
245dd39a60 | ||
|
|
4614aacc02 | ||
|
|
64ccdab90c | ||
|
|
02286b0c4e | ||
|
|
8e952a550b | ||
|
|
a29f95194d | ||
|
|
0e5db49b93 | ||
|
|
a2c29c0937 | ||
|
|
22328772ca | ||
|
|
52bd079c0a |
3
.gitignore
vendored
@@ -1,5 +1,6 @@
|
||||
##Packr, build stuff
|
||||
|
||||
logs/
|
||||
/core/assets/mindustry-saves/
|
||||
/core/assets/mindustry-maps/
|
||||
/core/assets/bundles/output/
|
||||
@@ -25,6 +26,8 @@
|
||||
/core/assets/version.properties
|
||||
/core/assets/locales
|
||||
/ios/src/io/anuke/mindustry/gen/
|
||||
/core/src/io/anuke/mindustry/gen/
|
||||
ios/robovm.properties
|
||||
*.gif
|
||||
|
||||
version.properties
|
||||
|
||||
38
.travis.yml
@@ -1,26 +1,20 @@
|
||||
language: android
|
||||
|
||||
jdk:
|
||||
- openjdk8
|
||||
|
||||
android:
|
||||
components:
|
||||
- android-28
|
||||
|
||||
# Additional components
|
||||
- extra-google-google_play_services
|
||||
- extra-google-m2repository
|
||||
- extra-android-m2repository
|
||||
- addon-google_apis-google-28
|
||||
- build-tools-28.0.3
|
||||
|
||||
- openjdk8
|
||||
script:
|
||||
- ./gradlew test
|
||||
- ./gradlew desktop:dist
|
||||
- ./gradlew server:dist
|
||||
|
||||
after_success:
|
||||
- chmod +x upload-build.sh
|
||||
- chmod +x cleanup_builds.sh
|
||||
- ./upload-build.sh
|
||||
- "./gradlew test"
|
||||
- "./gradlew desktop:dist -Pbuildversion=${TRAVIS_TAG:1}"
|
||||
- "./gradlew server:dist -Pbuildversion=${TRAVIS_TAG:1}"
|
||||
|
||||
deploy:
|
||||
provider: releases
|
||||
skip_cleanup: true
|
||||
draft: false
|
||||
api_key:
|
||||
secure: Cv5wFtWt62/A24EvSEQvMow7gKPbZ3oATEFPuSghhB2TQz1dA40Zee3Qvk4LFlpLrhYo4K0ZSczCZRGpR+hCd8+Dpww52bheYEvWuh3ZQfvu/fXtEx2j5PwP1qMpmIgSxETV/gkD7l9FImdh0VzktYiAvQfmi0bEocG9/D4QwjFpNat7iwBdcMiw1MvAygpdIWRsjiw0RKlB2mWarmoHhQ7Gu7qlU3j50uaEvcrtmU0pBUPggNQwQRv32i9NPvNFxrqqlUjDLIS8JFea99zCkp8BwYqbEvBIMzd+Qip1/stLJJA3+cDUClbsDtg8rAVetzpOrdLEEBmqShFe5MDl2yEHcsgpN9CFsyTaUfvB3P3rVjizvycMm42IsUkXQiarm5xTQ/TIA8Rd8AHiSKuweNCg1Fd5SFaRtKy8JVLXuxyfUccmyje6hhz2L4lS2Wfj3mAG7sqZUCXhWP79EKdGkiPOjKv4CwXEKmuH3BMVqPlNUZJr9Eg3sV1FG0h2l+MVOOnR635qdUbb49sYojYxVruMLX0BH1c4ZCu230m8CUoWA1Em1QNI75ya7+9Y5T6AsgWDVpBvdUo9fWNbdp+VQ0GskFQsJD5wtnxbcbHeFiERAgGBm7z6qt9u9LrQpBH+dsW52ADvYsu3L4nQEa+sdMHwTTwmGY+iUvsxu0DqxGg=
|
||||
file:
|
||||
- "desktop/build/libs/desktop-release.jar"
|
||||
- "server/build/libs/server-release.jar"
|
||||
on:
|
||||
repo: Anuken/Mindustry
|
||||
tags: true
|
||||
18
README.md
@@ -11,27 +11,29 @@ _[Discord](https://discord.gg/r8BkXNd)_
|
||||
|
||||
### Building
|
||||
|
||||
Bleeding-edge live builds are generated automatically for every commit. You can see them [here](https://github.com/Anuken/Mindustry/wiki).
|
||||
Bleeding-edge live builds are generated automatically for every commit. You can see them [here](https://jenkins.hellomouse.net/job/mindustry/).
|
||||
|
||||
If you'd rather compile on your own, follow these instructions.
|
||||
First, make sure you have Java 8 and JDK 8 installed. Open a terminal in the root directory, and run the following commands:
|
||||
|
||||
#### Windows
|
||||
|
||||
**_Windows_**
|
||||
_Running:_ `gradlew desktop:run`
|
||||
_Building:_ `gradlew desktop:dist`
|
||||
|
||||
_Running:_ `gradlew.bat desktop:run`
|
||||
_Building:_ `gradlew.bat desktop:dist`
|
||||
|
||||
|
||||
**_Linux_**
|
||||
#### Linux
|
||||
|
||||
_Running:_ `./gradlew desktop:run`
|
||||
_Building:_ `./gradlew desktop:dist`
|
||||
|
||||
#### For Server Builds...
|
||||
|
||||
Server builds are bundled with each released build (in Releases). If you'd rather compile on your own, replace 'desktop' with 'server' i.e. `gradlew server:dist`.
|
||||
|
||||
---
|
||||
|
||||
Gradle may take up to several minutes to download files. Be patient. <br>
|
||||
After building, the output .JAR file should be in `/desktop/build/libs/desktop-release.jar.`
|
||||
After building, the output .JAR file should be in `/desktop/build/libs/desktop-release.jar` for desktop builds, and in `/server/build/libs/server-release.jar` for server builds.
|
||||
|
||||
### Downloads
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<activity
|
||||
android:name="io.anuke.mindustry.AndroidLauncher"
|
||||
android:label="@string/app_name"
|
||||
android:screenOrientation="user"
|
||||
android:screenOrientation="sensor"
|
||||
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|screenLayout">
|
||||
|
||||
<intent-filter>
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
google()
|
||||
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
|
||||
jcenter()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.2.1'
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: "com.android.application"
|
||||
|
||||
@@ -14,9 +27,9 @@ repositories {
|
||||
dependencies {
|
||||
implementation project(":core")
|
||||
implementation project(":kryonet")
|
||||
implementation 'com.android.support:support-v4:25.3.1'
|
||||
implementation 'com.android.support:support-v4:28.0.0'
|
||||
implementation 'org.sufficientlysecure:donations:2.5'
|
||||
implementation 'com.google.android.gms:play-services-auth:11.8.0'
|
||||
implementation 'com.google.android.gms:play-services-auth:16.0.1'
|
||||
|
||||
implementation "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"
|
||||
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi"
|
||||
@@ -24,6 +37,12 @@ dependencies {
|
||||
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-arm64-v8a"
|
||||
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86"
|
||||
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86_64"
|
||||
implementation "com.badlogicgames.gdx:gdx-freetype:$gdxVersion"
|
||||
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-armeabi"
|
||||
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-armeabi-v7a"
|
||||
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-arm64-v8a"
|
||||
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-x86"
|
||||
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-x86_64"
|
||||
implementation "com.badlogicgames.gdx:gdx-controllers-android:$gdxVersion"
|
||||
}
|
||||
|
||||
@@ -74,7 +93,7 @@ android {
|
||||
|
||||
applicationId "io.anuke.mindustry"
|
||||
minSdkVersion 14
|
||||
targetSdkVersion 27
|
||||
targetSdkVersion 28
|
||||
versionCode code
|
||||
versionName versionNameResult
|
||||
}
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/layout_root"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:orientation="vertical"
|
||||
android:padding="10dp" >
|
||||
|
||||
<EditText
|
||||
android:id="@+id/gdxDialogsEditTextInput"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="text"
|
||||
android:maxLines="1"
|
||||
>
|
||||
|
||||
<requestFocus />
|
||||
|
||||
</EditText>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -19,17 +19,14 @@ 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;
|
||||
import io.anuke.mindustry.core.Platform;
|
||||
import io.anuke.mindustry.core.ThreadHandler.ThreadProvider;
|
||||
import io.anuke.mindustry.game.Saves.SaveSlot;
|
||||
import io.anuke.mindustry.io.SaveIO;
|
||||
import io.anuke.mindustry.net.Net;
|
||||
import io.anuke.mindustry.ui.dialogs.FileChooser;
|
||||
import io.anuke.ucore.function.Consumer;
|
||||
import io.anuke.ucore.scene.ui.TextField;
|
||||
import io.anuke.ucore.scene.ui.layout.Unit;
|
||||
import io.anuke.ucore.util.Bundles;
|
||||
import io.anuke.ucore.util.Strings;
|
||||
@@ -38,12 +35,7 @@ import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.text.DateFormat;
|
||||
import java.text.NumberFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
|
||||
import static io.anuke.mindustry.Vars.*;
|
||||
|
||||
@@ -58,43 +50,16 @@ public class AndroidLauncher extends PatchedAndroidApplication{
|
||||
AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
|
||||
config.useImmersiveMode = true;
|
||||
Platform.instance = new Platform(){
|
||||
DateFormat format = SimpleDateFormat.getDateTimeInstance();
|
||||
|
||||
@Override
|
||||
public String format(Date date){
|
||||
return format.format(date);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String format(int number){
|
||||
return NumberFormat.getIntegerInstance().format(number);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addDialog(TextField field, int length){
|
||||
TextFieldDialogListener.add(field, 0, length);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLocaleName(Locale locale){
|
||||
return locale.getDisplayName(locale);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openDonations(){
|
||||
showDonations();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ThreadProvider getThreadProvider(){
|
||||
return new DefaultThreadImpl();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUUID(){
|
||||
try{
|
||||
String s = Secure.getString(getContext().getContentResolver(),
|
||||
Secure.ANDROID_ID);
|
||||
String s = Secure.getString(getContext().getContentResolver(), Secure.ANDROID_ID);
|
||||
int len = s.length();
|
||||
byte[] data = new byte[len / 2];
|
||||
for(int i = 0; i < len; i += 2){
|
||||
@@ -147,6 +112,7 @@ public class AndroidLauncher extends PatchedAndroidApplication{
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
try{
|
||||
ProviderInstaller.installIfNeeded(this);
|
||||
}catch(GooglePlayServicesRepairableException e){
|
||||
|
||||
@@ -1,119 +0,0 @@
|
||||
package io.anuke.mindustry;
|
||||
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.text.InputFilter;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager.LayoutParams;
|
||||
import android.widget.EditText;
|
||||
import com.badlogic.gdx.Gdx;
|
||||
|
||||
public class AndroidTextFieldDialog{
|
||||
private Activity activity;
|
||||
private EditText userInput;
|
||||
private AlertDialog.Builder builder;
|
||||
private TextPromptListener listener;
|
||||
private boolean isBuild;
|
||||
|
||||
public AndroidTextFieldDialog(){
|
||||
this.activity = (Activity) Gdx.app;
|
||||
load();
|
||||
}
|
||||
|
||||
public AndroidTextFieldDialog show(){
|
||||
|
||||
activity.runOnUiThread(() -> {
|
||||
AlertDialog dialog = builder.create();
|
||||
|
||||
dialog.getWindow().setSoftInputMode(LayoutParams.SOFT_INPUT_STATE_VISIBLE);
|
||||
|
||||
dialog.show();
|
||||
|
||||
});
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
private AndroidTextFieldDialog load(){
|
||||
|
||||
activity.runOnUiThread(() -> {
|
||||
|
||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(activity);
|
||||
LayoutInflater li = LayoutInflater.from(activity);
|
||||
|
||||
View promptsView = li.inflate(getResourceId("gdxdialogs_inputtext", "layout"), null);
|
||||
|
||||
alertDialogBuilder.setView(promptsView);
|
||||
|
||||
userInput = promptsView.findViewById(getResourceId("gdxDialogsEditTextInput", "id"));
|
||||
|
||||
alertDialogBuilder.setCancelable(false);
|
||||
builder = alertDialogBuilder;
|
||||
|
||||
isBuild = true;
|
||||
});
|
||||
|
||||
// Wait till TextPrompt is built.
|
||||
while(!isBuild){
|
||||
try{
|
||||
Thread.sleep(10);
|
||||
}catch(InterruptedException ignored){
|
||||
}
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getResourceId(String pVariableName, String pVariableType){
|
||||
try{
|
||||
return activity.getResources().getIdentifier(pVariableName, pVariableType, activity.getPackageName());
|
||||
}catch(Exception e){
|
||||
Gdx.app.error("Android Dialogs", "Cannot find resouce with name: " + pVariableName
|
||||
+ " Did you copy the layouts to /res/layouts and /res/layouts_v14 ?");
|
||||
e.printStackTrace();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
public AndroidTextFieldDialog setText(CharSequence value){
|
||||
userInput.append(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public AndroidTextFieldDialog setCancelButtonLabel(CharSequence label){
|
||||
builder.setNegativeButton(label, (dialog, id) -> dialog.cancel());
|
||||
return this;
|
||||
}
|
||||
|
||||
public AndroidTextFieldDialog setConfirmButtonLabel(CharSequence label){
|
||||
builder.setPositiveButton(label, (dialog, id) -> {
|
||||
if(listener != null && !userInput.getText().toString().isEmpty()){
|
||||
listener.confirm(userInput.getText().toString());
|
||||
}
|
||||
|
||||
});
|
||||
return this;
|
||||
}
|
||||
|
||||
public AndroidTextFieldDialog setTextPromptListener(TextPromptListener listener){
|
||||
this.listener = listener;
|
||||
return this;
|
||||
}
|
||||
|
||||
public AndroidTextFieldDialog setInputType(int type){
|
||||
userInput.setInputType(type);
|
||||
return this;
|
||||
}
|
||||
|
||||
public AndroidTextFieldDialog setMaxLength(int length){
|
||||
userInput.setFilters(new InputFilter[]{new InputFilter.LengthFilter(length)});
|
||||
return this;
|
||||
}
|
||||
|
||||
public interface TextPromptListener{
|
||||
void confirm(String text);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -68,7 +68,6 @@ public class DonationsActivity extends FragmentActivity{
|
||||
Fragment fragment = fragmentManager.findFragmentByTag("donationsFragment");
|
||||
if(fragment != null){
|
||||
fragment.onActivityResult(requestCode, resultCode, data);
|
||||
//TODO donation event, set settings?
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
package io.anuke.mindustry;
|
||||
|
||||
|
||||
import android.text.InputType;
|
||||
import com.badlogic.gdx.Application.ApplicationType;
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import io.anuke.ucore.scene.event.ChangeListener;
|
||||
import io.anuke.ucore.scene.event.ClickListener;
|
||||
import io.anuke.ucore.scene.event.InputEvent;
|
||||
import io.anuke.ucore.scene.event.InputListener;
|
||||
import io.anuke.ucore.scene.ui.TextField;
|
||||
|
||||
public class TextFieldDialogListener extends ClickListener{
|
||||
private TextField field;
|
||||
private int type;
|
||||
private int max;
|
||||
|
||||
//type - 0 is text, 1 is numbers, 2 is decimals
|
||||
public TextFieldDialogListener(TextField field, int type, int max){
|
||||
this.field = field;
|
||||
this.type = type;
|
||||
this.max = max;
|
||||
}
|
||||
|
||||
public static void add(TextField field, int type, int max){
|
||||
field.addListener(new TextFieldDialogListener(field, type, max));
|
||||
field.addListener(new InputListener(){
|
||||
public boolean touchDown(InputEvent event, float x, float y, int pointer, int button){
|
||||
Gdx.input.setOnscreenKeyboardVisible(false);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static void add(TextField field){
|
||||
add(field, 0, 16);
|
||||
}
|
||||
|
||||
public void clicked(final InputEvent event, float x, float y){
|
||||
|
||||
if(Gdx.app.getType() == ApplicationType.Desktop) return;
|
||||
|
||||
AndroidTextFieldDialog dialog = new AndroidTextFieldDialog();
|
||||
|
||||
dialog.setTextPromptListener(text -> {
|
||||
field.clearText();
|
||||
field.appendText(text);
|
||||
field.fire(new ChangeListener.ChangeEvent());
|
||||
Gdx.graphics.requestRendering();
|
||||
});
|
||||
|
||||
if(type == 0){
|
||||
dialog.setInputType(InputType.TYPE_CLASS_TEXT);
|
||||
}else if(type == 1){
|
||||
dialog.setInputType(InputType.TYPE_CLASS_NUMBER);
|
||||
}else if(type == 2){
|
||||
dialog.setInputType(InputType.TYPE_NUMBER_FLAG_DECIMAL);
|
||||
}
|
||||
|
||||
dialog.setConfirmButtonLabel("OK").setText(field.getText());
|
||||
dialog.setCancelButtonLabel("Cancel");
|
||||
dialog.setMaxLength(max);
|
||||
dialog.show();
|
||||
event.cancel();
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
apply plugin: "java"
|
||||
|
||||
sourceCompatibility = 1.8
|
||||
sourceSets.main.java.srcDirs = [ "src/" ]
|
||||
sourceSets.main.java.srcDirs = [ "src/main/java/" ]
|
||||
sourceSets.main.resources.srcDirs = [ "src/main/resources/" ]
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package io.anuke.annotations;
|
||||
|
||||
import io.anuke.annotations.MethodEntry;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/** Represents a class witha list method entries to include in it. */
|
||||
@@ -2,6 +2,8 @@ package io.anuke.annotations;
|
||||
|
||||
import com.squareup.javapoet.*;
|
||||
import io.anuke.annotations.IOFinder.ClassSerializer;
|
||||
import io.anuke.annotations.MethodEntry;
|
||||
import io.anuke.annotations.Utils;
|
||||
|
||||
import javax.lang.model.element.Modifier;
|
||||
import javax.lang.model.element.TypeElement;
|
||||
@@ -52,7 +52,7 @@ public class SerializeAnnotationProcessor extends AbstractProcessor{
|
||||
|
||||
TypeSpec.Builder serializer = TypeSpec.anonymousClassBuilder("")
|
||||
.addSuperinterface(ParameterizedTypeName.get(
|
||||
ClassName.get(Class.forName("io.anuke.ucore.io.TypeSerializer")), type));
|
||||
ClassName.bestGuess("io.anuke.ucore.io.TypeSerializer"), type));
|
||||
|
||||
MethodSpec.Builder writeMethod = MethodSpec.methodBuilder("write")
|
||||
.returns(void.class)
|
||||
@@ -0,0 +1,2 @@
|
||||
io.anuke.annotations.RemoteMethodAnnotationProcessor
|
||||
io.anuke.annotations.SerializeAnnotationProcessor
|
||||
63
build.gradle
@@ -8,8 +8,6 @@ buildscript {
|
||||
}
|
||||
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.2.1'
|
||||
classpath "com.badlogicgames.gdx:gdx-tools:1.9.8"
|
||||
}
|
||||
}
|
||||
@@ -21,17 +19,17 @@ allprojects {
|
||||
version = 'release'
|
||||
|
||||
ext {
|
||||
versionNumber = '4.0'
|
||||
versionNumber = '4'
|
||||
versionModifier = 'alpha'
|
||||
versionType = 'official'
|
||||
appName = 'Mindustry'
|
||||
gdxVersion = '1.9.8'
|
||||
gdxVersion = '1.9.9'
|
||||
roboVMVersion = '2.3.0'
|
||||
uCoreVersion = 'd5f892dcf1773b0f6d47d2190d139cc6342ac75f'
|
||||
uCoreVersion = '09e13f973a0769d971316d1d4f4a1eef3570926f'
|
||||
|
||||
getVersionString = {
|
||||
String buildVersion = getBuildVersion()
|
||||
return "$versionNumber-$versionType-$buildVersion"
|
||||
return "$versionNumber-$versionModifier-$buildVersion"
|
||||
}
|
||||
|
||||
getBuildVersion = {
|
||||
@@ -97,28 +95,11 @@ project(":desktop") {
|
||||
compile "com.badlogicgames.gdx:gdx-backend-lwjgl3:$gdxVersion"
|
||||
compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
|
||||
compile "com.badlogicgames.gdx:gdx-controllers-lwjgl3:$gdxVersion"
|
||||
compile "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-desktop"
|
||||
compile 'com.github.MinnDevelopment:java-discord-rpc:v2.0.0'
|
||||
}
|
||||
}
|
||||
|
||||
project(":html") {
|
||||
apply plugin: "gwt"
|
||||
apply plugin: "war"
|
||||
|
||||
dependencies {
|
||||
compile project(":core")
|
||||
compileOnly project(":annotations")
|
||||
|
||||
compile "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion"
|
||||
compile "com.badlogicgames.gdx:gdx:$gdxVersion:sources"
|
||||
compile "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion:sources"
|
||||
|
||||
compile "com.badlogicgames.gdx:gdx-controllers:$gdxVersion:sources"
|
||||
compile "com.badlogicgames.gdx:gdx-controllers-gwt:$gdxVersion"
|
||||
compile "com.badlogicgames.gdx:gdx-controllers-gwt:$gdxVersion:sources"
|
||||
}
|
||||
}
|
||||
|
||||
project(":ios") {
|
||||
apply plugin: "java"
|
||||
apply plugin: "robovm"
|
||||
@@ -129,16 +110,34 @@ project(":ios") {
|
||||
include "**/*.java"
|
||||
}
|
||||
|
||||
into "ios/src/io/anuke/mindustry/gen"
|
||||
into "core/src/io/anuke/mindustry/gen"
|
||||
}
|
||||
|
||||
doFirst{
|
||||
delete{
|
||||
delete "ios/src/io/anuke/mindustry/gen/"
|
||||
delete "core/src/io/anuke/mindustry/gen/"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
task incrementConfig{
|
||||
def vfile = file('robovm.properties')
|
||||
|
||||
def props = new Properties()
|
||||
if(vfile.exists()){
|
||||
props.load(new FileInputStream(vfile))
|
||||
}
|
||||
|
||||
props['app.id'] = 'io.anuke.mindustry'
|
||||
props['app.version'] = '4.0'
|
||||
props['app.mainclass'] = 'io.anuke.mindustry.IOSLauncher'
|
||||
props['app.executable'] = 'IOSLauncher'
|
||||
props['app.name'] = 'Mindustry'
|
||||
props['app.build'] = (!props.hasProperty("app.build") ? 40 : props['app.build'].toInteger() + 1)+""
|
||||
props.store(vfile.newWriter(), null)
|
||||
}
|
||||
|
||||
build.dependsOn(incrementConfig)
|
||||
build.dependsOn(copyGen)
|
||||
|
||||
dependencies {
|
||||
@@ -149,6 +148,8 @@ project(":ios") {
|
||||
compile "com.mobidevelop.robovm:robovm-cocoatouch:$roboVMVersion"
|
||||
compile "com.badlogicgames.gdx:gdx-backend-robovm:$gdxVersion"
|
||||
compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-ios"
|
||||
compile "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-ios"
|
||||
compileOnly project(":annotations")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,7 +161,6 @@ project(":core") {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly project(":annotations")
|
||||
build.finalizedBy(finish)
|
||||
|
||||
def comp = System.properties["release"] == null || System.properties["release"] == "false"
|
||||
@@ -178,11 +178,11 @@ project(":core") {
|
||||
|
||||
compile "com.badlogicgames.gdx:gdx:$gdxVersion"
|
||||
compile "com.badlogicgames.gdx:gdx-controllers:$gdxVersion"
|
||||
}
|
||||
compile "com.badlogicgames.gdx:gdx-freetype:$gdxVersion"
|
||||
|
||||
compileJava.options.compilerArgs = [
|
||||
"-processor", "io.anuke.annotations.RemoteMethodAnnotationProcessor,io.anuke.annotations.SerializeAnnotationProcessor"
|
||||
]
|
||||
compileOnly project(":annotations")
|
||||
annotationProcessor project(":annotations")
|
||||
}
|
||||
}
|
||||
|
||||
project(":server") {
|
||||
@@ -195,7 +195,6 @@ project(":server") {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly project(":annotations")
|
||||
|
||||
compile project(":core")
|
||||
compile project(":kryonet")
|
||||
|
||||
BIN
core/assets-raw/fonts/chinese/wqy-microhei.ttc
Normal file
BIN
core/assets-raw/fonts/cyrillic/Exo2-Regular.ttf
Normal file
BIN
core/assets-raw/fonts/korean/Sunflower-Medium.ttf
Normal file
BIN
core/assets-raw/fonts/pixel_UNEDITED.ttf
Normal file
|
Before Width: | Height: | Size: 782 B After Width: | Height: | Size: 405 B |
|
Before Width: | Height: | Size: 124 B After Width: | Height: | Size: 83 B |
|
Before Width: | Height: | Size: 139 B After Width: | Height: | Size: 88 B |
|
Before Width: | Height: | Size: 120 B After Width: | Height: | Size: 78 B |
|
Before Width: | Height: | Size: 199 B After Width: | Height: | Size: 120 B |
|
Before Width: | Height: | Size: 75 B After Width: | Height: | Size: 75 B |
|
Before Width: | Height: | Size: 119 B After Width: | Height: | Size: 119 B |
|
Before Width: | Height: | Size: 255 B After Width: | Height: | Size: 118 B |
|
Before Width: | Height: | Size: 124 B After Width: | Height: | Size: 83 B |
|
Before Width: | Height: | Size: 143 B After Width: | Height: | Size: 91 B |
|
Before Width: | Height: | Size: 125 B After Width: | Height: | Size: 81 B |
|
Before Width: | Height: | Size: 210 B After Width: | Height: | Size: 120 B |
|
Before Width: | Height: | Size: 351 B After Width: | Height: | Size: 201 B |
|
Before Width: | Height: | Size: 157 B |
|
Before Width: | Height: | Size: 374 B After Width: | Height: | Size: 205 B |
|
Before Width: | Height: | Size: 111 B After Width: | Height: | Size: 111 B |
|
Before Width: | Height: | Size: 241 B After Width: | Height: | Size: 136 B |
|
Before Width: | Height: | Size: 207 B After Width: | Height: | Size: 124 B |
|
Before Width: | Height: | Size: 207 B After Width: | Height: | Size: 120 B |
|
Before Width: | Height: | Size: 228 B After Width: | Height: | Size: 135 B |
|
Before Width: | Height: | Size: 234 B After Width: | Height: | Size: 135 B |
|
Before Width: | Height: | Size: 174 B After Width: | Height: | Size: 175 B |
|
Before Width: | Height: | Size: 92 B After Width: | Height: | Size: 94 B |
BIN
core/assets-raw/sprites/items/item-phase-fabric.png
Normal file
|
After Width: | Height: | Size: 126 B |
|
Before Width: | Height: | Size: 132 B |
|
Before Width: | Height: | Size: 136 B After Width: | Height: | Size: 133 B |
|
Before Width: | Height: | Size: 137 B |
|
Before Width: | Height: | Size: 137 B |
|
Before Width: | Height: | Size: 132 B |
|
Before Width: | Height: | Size: 136 B After Width: | Height: | Size: 133 B |
|
Before Width: | Height: | Size: 112 B After Width: | Height: | Size: 112 B |
|
Before Width: | Height: | Size: 136 B After Width: | Height: | Size: 136 B |
|
Before Width: | Height: | Size: 141 B After Width: | Height: | Size: 141 B |
|
Before Width: | Height: | Size: 124 B After Width: | Height: | Size: 124 B |
|
Before Width: | Height: | Size: 225 B |
|
Before Width: | Height: | Size: 225 B After Width: | Height: | Size: 373 B |
BIN
core/assets-raw/sprites/ui/empty-sector.png
Normal file
|
After Width: | Height: | Size: 230 B |
BIN
core/assets-raw/sprites/ui/icons-category/icon-crafting.png
Normal file
|
After Width: | Height: | Size: 231 B |
BIN
core/assets-raw/sprites/ui/icons-category/icon-defense.png
Normal file
|
After Width: | Height: | Size: 273 B |
BIN
core/assets-raw/sprites/ui/icons-category/icon-distribution.png
Normal file
|
After Width: | Height: | Size: 204 B |
BIN
core/assets-raw/sprites/ui/icons-category/icon-effect.png
Normal file
|
After Width: | Height: | Size: 268 B |
BIN
core/assets-raw/sprites/ui/icons-category/icon-liquid.png
Normal file
|
After Width: | Height: | Size: 266 B |
BIN
core/assets-raw/sprites/ui/icons-category/icon-power.png
Normal file
|
After Width: | Height: | Size: 231 B |
BIN
core/assets-raw/sprites/ui/icons-category/icon-production.png
Normal file
|
After Width: | Height: | Size: 246 B |
BIN
core/assets-raw/sprites/ui/icons-category/icon-turret.png
Normal file
|
After Width: | Height: | Size: 246 B |
BIN
core/assets-raw/sprites/ui/icons-category/icon-units.png
Normal file
|
After Width: | Height: | Size: 238 B |
BIN
core/assets-raw/sprites/ui/icons-category/icon-upgrade.png
Normal file
|
After Width: | Height: | Size: 252 B |
|
Before Width: | Height: | Size: 109 B |
|
Before Width: | Height: | Size: 104 B |
|
Before Width: | Height: | Size: 97 B |
|
Before Width: | Height: | Size: 110 B After Width: | Height: | Size: 110 B |
BIN
core/assets-raw/sprites/ui/icons/icon-mission-background.png
Normal file
|
After Width: | Height: | Size: 115 B |
BIN
core/assets-raw/sprites/ui/icons/icon-mission-battle.png
Normal file
|
After Width: | Height: | Size: 95 B |
BIN
core/assets-raw/sprites/ui/icons/icon-mission-defense.png
Normal file
|
After Width: | Height: | Size: 103 B |
BIN
core/assets-raw/sprites/ui/icons/icon-mission-done.png
Normal file
|
After Width: | Height: | Size: 104 B |
|
Before Width: | Height: | Size: 98 B After Width: | Height: | Size: 98 B |
|
Before Width: | Height: | Size: 97 B |
|
Before Width: | Height: | Size: 112 B |
|
Before Width: | Height: | Size: 116 B |
|
Before Width: | Height: | Size: 219 B After Width: | Height: | Size: 359 B |
|
Before Width: | Height: | Size: 143 B After Width: | Height: | Size: 142 B |
|
Before Width: | Height: | Size: 395 B After Width: | Height: | Size: 392 B |
|
Before Width: | Height: | Size: 125 B After Width: | Height: | Size: 211 B |
BIN
core/assets-raw/sprites/ui/sector-edge.png
Normal file
|
After Width: | Height: | Size: 167 B |
BIN
core/assets-raw/sprites/ui/sector-select.png
Normal file
|
After Width: | Height: | Size: 154 B |
|
Before Width: | Height: | Size: 123 B After Width: | Height: | Size: 123 B |
|
Before Width: | Height: | Size: 123 B After Width: | Height: | Size: 123 B |
|
Before Width: | Height: | Size: 553 B |
|
Before Width: | Height: | Size: 551 B |
|
Before Width: | Height: | Size: 551 B |