Compare commits
558 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
69944a2b63 | ||
|
|
0ceb58a105 | ||
|
|
5e8da856e7 | ||
|
|
ee412e1994 | ||
|
|
02736524bd | ||
|
|
c357b97b3b | ||
|
|
dbe7251c6b | ||
|
|
7ae90f655c | ||
|
|
669ce6dfbb | ||
|
|
4dc55e5594 | ||
|
|
4b824f7a4c | ||
|
|
3435132e87 | ||
|
|
d49b15b2a0 | ||
|
|
0c59553b3d | ||
|
|
4a50192937 | ||
|
|
f65ab00250 | ||
|
|
f71c3af2e1 | ||
|
|
77fb9e3d3e | ||
|
|
c1d6674797 | ||
|
|
659aaba0b9 | ||
|
|
a3816f6355 | ||
|
|
4829f040c2 | ||
|
|
59826f5189 | ||
|
|
a6fac9e56a | ||
|
|
68f0ef1bd2 | ||
|
|
d53882a086 | ||
|
|
7c7306d37b | ||
|
|
d5a9938354 | ||
|
|
3fad378b69 | ||
|
|
afb47344c6 | ||
|
|
5ba7e1d08b | ||
|
|
681347e933 | ||
|
|
f1bf8a0f1a | ||
|
|
874b41cb46 | ||
|
|
d3876b6376 | ||
|
|
f72f2bdf5d | ||
|
|
af91e17b13 | ||
|
|
69bfd8f54d | ||
|
|
369c3b569c | ||
|
|
8480e656b9 | ||
|
|
fb29324905 | ||
|
|
ed88633712 | ||
|
|
cd456f80a4 | ||
|
|
6d61515e28 | ||
|
|
38af936e3f | ||
|
|
d59f5ddc59 | ||
|
|
6c07c5006a | ||
|
|
d4d060a500 | ||
|
|
55e43761e9 | ||
|
|
b1edaa1408 | ||
|
|
d8d9762998 | ||
|
|
dd93284062 | ||
|
|
19c76fc741 | ||
|
|
1013455b0f | ||
|
|
066e4380e1 | ||
|
|
55da9df2a1 | ||
|
|
4b26c57a20 | ||
|
|
d0491dd68a | ||
|
|
cd8cc34c31 | ||
|
|
0249ebf718 | ||
|
|
7fb4eeb998 | ||
|
|
0cd7313523 | ||
|
|
5c3fc2a6ba | ||
|
|
19f888061f | ||
|
|
4e8a02be7d | ||
|
|
2231062c19 | ||
|
|
fb4faa15bb | ||
|
|
e6d05926dd | ||
|
|
ca9f18325c | ||
|
|
bd96ae5a48 | ||
|
|
cf1cc2ca49 | ||
|
|
bbaaa91575 | ||
|
|
41b21c81a0 | ||
|
|
44842d3221 | ||
|
|
d9c7665aca | ||
|
|
565b79d1b2 | ||
|
|
f30dc7dcd9 | ||
|
|
e4cdf515c9 | ||
|
|
ad3463cbc4 | ||
|
|
db733bced6 | ||
|
|
7aa71a7201 | ||
|
|
6fe55661ed | ||
|
|
af89efcfc4 | ||
|
|
82493c596d | ||
|
|
5a3fbf33df | ||
|
|
5bed0f3bcc | ||
|
|
87f6ff7be6 | ||
|
|
fa56996e10 | ||
|
|
b867cdb8b9 | ||
|
|
3bac32e04a | ||
|
|
c4c0f45228 | ||
|
|
d981bb95b9 | ||
|
|
c9f0a59339 | ||
|
|
ec58e868fd | ||
|
|
aa5152ac70 | ||
|
|
2cc627e7d0 | ||
|
|
8653e7bbb1 | ||
|
|
4fb7430fb7 | ||
|
|
e90c8c4d3e | ||
|
|
06e6deae42 | ||
|
|
38fe99f10e | ||
|
|
05ab62f038 | ||
|
|
168011586b | ||
|
|
b5f1e566b2 | ||
|
|
9b6fb2f382 | ||
|
|
24bb2428e7 | ||
|
|
75ba33abc0 | ||
|
|
ff54629550 | ||
|
|
b492c7ae27 | ||
|
|
5d04f93a88 | ||
|
|
5651d1b023 | ||
|
|
6822e3f5b8 | ||
|
|
3cbb02f9fb | ||
|
|
0f79298c28 | ||
|
|
8f4bd09635 | ||
|
|
0a9cad2ea6 | ||
|
|
dc21adfda5 | ||
|
|
a7bfe18f4a | ||
|
|
9cc76a148b | ||
|
|
1d95a255bc | ||
|
|
3f8d412d1c | ||
|
|
b2c35d45c3 | ||
|
|
35ab90e445 | ||
|
|
9bfb5216f9 | ||
|
|
b10656294e | ||
|
|
316f4d471f | ||
|
|
ef0b56eb22 | ||
|
|
e640042e5d | ||
|
|
2c0d2c5e22 | ||
|
|
9eed39c2ae | ||
|
|
e8d89b6c43 | ||
|
|
494c3ffbc4 | ||
|
|
40d27c787c | ||
|
|
2fe5b44698 | ||
|
|
5cc32b9001 | ||
|
|
d481af43c7 | ||
|
|
1cd43f938f | ||
|
|
528f5295c2 | ||
|
|
aaedeea870 | ||
|
|
c684c32abe | ||
|
|
34df9cca2c | ||
|
|
c678b53d3f | ||
|
|
ea30cc7d19 | ||
|
|
a2772d09f3 | ||
|
|
a0016f001c | ||
|
|
ca532f271f | ||
|
|
89402fd097 | ||
|
|
75451743aa | ||
|
|
b4d9a6a507 | ||
|
|
335afa56a1 | ||
|
|
485592bdac | ||
|
|
ee9289fc24 | ||
|
|
a0c281a0a9 | ||
|
|
ad0b0858f6 | ||
|
|
c2191872ac | ||
|
|
5f361413bb | ||
|
|
3414026828 | ||
|
|
7089fae0d5 | ||
|
|
80bdf1e19c | ||
|
|
e0c1f2a31a | ||
|
|
92cfa2b033 | ||
|
|
877cd5968c | ||
|
|
b39464a7d1 | ||
|
|
52332e5821 | ||
|
|
7f2c7685b4 | ||
|
|
7e80a60e65 | ||
|
|
44544020ec | ||
|
|
3b9d3fd233 | ||
|
|
4e2d2ee378 | ||
|
|
7aafa8b150 | ||
|
|
6d9a59c60b | ||
|
|
39e0977231 | ||
|
|
f8f140090f | ||
|
|
f063f7b2d3 | ||
|
|
60306f146f | ||
|
|
3b873b7cb2 | ||
|
|
26d44ea030 | ||
|
|
b369751a75 | ||
|
|
6e2cd81c9f | ||
|
|
e953bd40eb | ||
|
|
233ae99d3f | ||
|
|
ddca5ef25a | ||
|
|
ae88f286a6 | ||
|
|
25af0c4302 | ||
|
|
96b398867b | ||
|
|
97d1c49a3c | ||
|
|
e83dfd3d5a | ||
|
|
1142af853d | ||
|
|
4d502fe073 | ||
|
|
b022333df1 | ||
|
|
725b2188aa | ||
|
|
1f20d19aea | ||
|
|
ec9f91519d | ||
|
|
ae4e3e2d33 | ||
|
|
b931493d2f | ||
|
|
7b0c07533b | ||
|
|
33f0d64971 | ||
|
|
d10592a397 | ||
|
|
641937f952 | ||
|
|
b5ed309405 | ||
|
|
9bfbd7c953 | ||
|
|
57924afa3f | ||
|
|
76f11099b7 | ||
|
|
efcf802682 | ||
|
|
b095840dc8 | ||
|
|
5f9370da9a | ||
|
|
7a6eb08e53 | ||
|
|
865c3f28d5 | ||
|
|
d5916f3bc3 | ||
|
|
3ce870fb19 | ||
|
|
a575284bfe | ||
|
|
89d79fdc65 | ||
|
|
05c0fd2f40 | ||
|
|
bc3c2c46a8 | ||
|
|
3d69e9c763 | ||
|
|
9f5a0ca4e9 | ||
|
|
43245681fe | ||
|
|
9d214a77d7 | ||
|
|
5134aca723 | ||
|
|
40405332ec | ||
|
|
8d61f3b479 | ||
|
|
bd15287420 | ||
|
|
5dfc3fd576 | ||
|
|
1e80bdf19f | ||
|
|
76cd7ba8d1 | ||
|
|
1dfa0d08de | ||
|
|
1fc9c82aaf | ||
|
|
600a2b5ad7 | ||
|
|
cb60556ac0 | ||
|
|
62f683b871 | ||
|
|
f22d32c15e | ||
|
|
a3d8586199 | ||
|
|
0a471441cc | ||
|
|
73149123b4 | ||
|
|
5c6f2171f4 | ||
|
|
fd973038bb | ||
|
|
b7dff91d01 | ||
|
|
e314d199f0 | ||
|
|
3938c199f6 | ||
|
|
962eef4a1d | ||
|
|
97443a86cb | ||
|
|
7137616224 | ||
|
|
444825a5c1 | ||
|
|
986deaa6c7 | ||
|
|
7b27903de2 | ||
|
|
bbadf6795e | ||
|
|
8b9be6eafe | ||
|
|
da336ea412 | ||
|
|
f1cf95d412 | ||
|
|
6642a3e9ad | ||
|
|
49db7773e8 | ||
|
|
9372819fb8 | ||
|
|
9d07d81551 | ||
|
|
3c9bcf05e2 | ||
|
|
3338da2a91 | ||
|
|
b31858a64f | ||
|
|
8f2a8dc9ba | ||
|
|
44e54cd4df | ||
|
|
36c41557ea | ||
|
|
d0d72101ab | ||
|
|
7b41d65fa6 | ||
|
|
5f9000db92 | ||
|
|
de031b1ddb | ||
|
|
58f46bb75f | ||
|
|
d1e07ec0a2 | ||
|
|
0d4716f3b4 | ||
|
|
9ddfd650dd | ||
|
|
cf9cda4936 | ||
|
|
1880c32f90 | ||
|
|
6d72c08d63 | ||
|
|
95ac1b2c21 | ||
|
|
a33fd45136 | ||
|
|
4e43d2a96b | ||
|
|
d68c8fe72c | ||
|
|
c9d0619289 | ||
|
|
8ea33946c4 | ||
|
|
bef7394004 | ||
|
|
4042bf042e | ||
|
|
643b698c30 | ||
|
|
aba3e3985a | ||
|
|
91f679f762 | ||
|
|
3eeed507cc | ||
|
|
988e1d6e30 | ||
|
|
04b4aabcf6 | ||
|
|
d97fe47206 | ||
|
|
0d8748a6ce | ||
|
|
b360a39fcf | ||
|
|
70b071fa26 | ||
|
|
64badb2cb7 | ||
|
|
3da6634242 | ||
|
|
4b8d072854 | ||
|
|
a1ea393f35 | ||
|
|
32abd991e7 | ||
|
|
3294f800be | ||
|
|
74e3dc2d7d | ||
|
|
a7a49a823b | ||
|
|
14c943adfe | ||
|
|
fb84b4b7c1 | ||
|
|
4089ee424c | ||
|
|
9bf010e222 | ||
|
|
0553fb6b79 | ||
|
|
4bb6a25055 | ||
|
|
66ff7b1592 | ||
|
|
be32810608 | ||
|
|
88f48599a0 | ||
|
|
014e2ac8b8 | ||
|
|
bae88ec416 | ||
|
|
46230ad307 | ||
|
|
963a207194 | ||
|
|
59419e13d9 | ||
|
|
82f43a362f | ||
|
|
b370e04035 | ||
|
|
dfd6e7a07b | ||
|
|
a873560d4e | ||
|
|
f7eea51066 | ||
|
|
c6777bd219 | ||
|
|
8eb4d25638 | ||
|
|
98c35c5291 | ||
|
|
191c6e9016 | ||
|
|
33c1579e9c | ||
|
|
52af0b1db9 | ||
|
|
492cb49805 | ||
|
|
e482c2c318 | ||
|
|
5b387e7e17 | ||
|
|
b2e70a44be | ||
|
|
452a8aaa0c | ||
|
|
c3f392a01c | ||
|
|
7d9b6a41fc | ||
|
|
f4f4cf3947 | ||
|
|
28e930eb4b | ||
|
|
301387fb32 | ||
|
|
5955387bdd | ||
|
|
150491ff2c | ||
|
|
c7d735bf56 | ||
|
|
1f4dbd0024 | ||
|
|
ddef78c7d8 | ||
|
|
dc435d88f4 | ||
|
|
84aff0112d | ||
|
|
a13f8ed05f | ||
|
|
0429abbb28 | ||
|
|
562d3e6528 | ||
|
|
ac27b484fa | ||
|
|
3c57c3e492 | ||
|
|
83f9f5d34a | ||
|
|
c659e4f0aa | ||
|
|
723ee3c647 | ||
|
|
32baa279e2 | ||
|
|
17b17979ab | ||
|
|
c94ab5b05a | ||
|
|
625a0125cb | ||
|
|
9f8c1b3d20 | ||
|
|
cc6ed88878 | ||
|
|
73523a96fa | ||
|
|
62e3bc86eb | ||
|
|
a12af852ab | ||
|
|
6f2fc00045 | ||
|
|
9e0de644c4 | ||
|
|
393bdfccaf | ||
|
|
56c39799c8 | ||
|
|
7f2a1374e4 | ||
|
|
6fa0ac56ac | ||
|
|
89ee04c942 | ||
|
|
c058163ab4 | ||
|
|
2832dc69ef | ||
|
|
cb2e2ab9b2 | ||
|
|
f342c38c62 | ||
|
|
811e456f8f | ||
|
|
000503d674 | ||
|
|
d0bd29cfa0 | ||
|
|
d56565990e | ||
|
|
b68734d679 | ||
|
|
bf21c94bd7 | ||
|
|
b6b9685d57 | ||
|
|
f8adbda9c5 | ||
|
|
c9178c3f2f | ||
|
|
84786c12d8 | ||
|
|
335b6ae0cc | ||
|
|
9bde68a86f | ||
|
|
c3201178ae | ||
|
|
366636ef7d | ||
|
|
47112e233e | ||
|
|
88f005be0c | ||
|
|
f454cd3291 | ||
|
|
23038dc6f7 | ||
|
|
58b4f64125 | ||
|
|
974ab59fd2 | ||
|
|
f2f6dc89a2 | ||
|
|
bff9d89232 | ||
|
|
a818da5eb7 | ||
|
|
a1269c05c5 | ||
|
|
d0ff0307f5 | ||
|
|
c4aa0b2863 | ||
|
|
85fd2ad804 | ||
|
|
0770574f17 | ||
|
|
6314bf51df | ||
|
|
4c08c98f8c | ||
|
|
2341da995e | ||
|
|
4ef60af4a8 | ||
|
|
16f6b51857 | ||
|
|
59e53eb672 | ||
|
|
c7724e9122 | ||
|
|
2c4379acd1 | ||
|
|
69e7b442e2 | ||
|
|
70a4c2f3ed | ||
|
|
83c86b3883 | ||
|
|
9924796ad9 | ||
|
|
b587b6bb4d | ||
|
|
4811578c95 | ||
|
|
0a07c62b63 | ||
|
|
c1ff370923 | ||
|
|
e55575f093 | ||
|
|
703f034054 | ||
|
|
2d504521b1 | ||
|
|
8359789d4f | ||
|
|
8162e13f04 | ||
|
|
282aab5939 | ||
|
|
5c6bcbf9cd | ||
|
|
8ef1d54a16 | ||
|
|
e8bbc2bf4c | ||
|
|
b02053a70c | ||
|
|
99f2b8f536 | ||
|
|
8346d5fc13 | ||
|
|
3a841c6c0f | ||
|
|
ecd30094b1 | ||
|
|
81909bd1a9 | ||
|
|
1cb01af77b | ||
|
|
a65592d511 | ||
|
|
4ee6f60531 | ||
|
|
319d65f9a3 | ||
|
|
bc8c99df15 | ||
|
|
aef3a719fe | ||
|
|
2726ebe191 | ||
|
|
85767d4946 | ||
|
|
86a78b206a | ||
|
|
4e308d6600 | ||
|
|
7f2cc59b3c | ||
|
|
878901d05d | ||
|
|
d1304abb9e | ||
|
|
4ae39e851d | ||
|
|
06c5c92d2c | ||
|
|
fc6e529049 | ||
|
|
438f128e2e | ||
|
|
878af1ea28 | ||
|
|
8e84e7284e | ||
|
|
77d4b0972d | ||
|
|
2a518fa7c9 | ||
|
|
04c8ecf4af | ||
|
|
67743dded5 | ||
|
|
5acda423d8 | ||
|
|
8b3995686f | ||
|
|
f388ca298e | ||
|
|
636b92205b | ||
|
|
26d26b5e7a | ||
|
|
01efb59d25 | ||
|
|
b1980a17ac | ||
|
|
69ee5257f2 | ||
|
|
5573031d07 | ||
|
|
b812fcddf8 | ||
|
|
8393639735 | ||
|
|
dafbba0907 | ||
|
|
28ab2b3917 | ||
|
|
2be3cc2f1e | ||
|
|
d8085d88a8 | ||
|
|
d6b023709d | ||
|
|
2459fb23ae | ||
|
|
4bd3f415a9 | ||
|
|
4414ee6d38 | ||
|
|
fdd84066f5 | ||
|
|
4ebf39449e | ||
|
|
d4f26e0340 | ||
|
|
a00a208ff8 | ||
|
|
bc77fd619d | ||
|
|
5eadd6608d | ||
|
|
1340b8d4d8 | ||
|
|
9db86f212f | ||
|
|
697894274f | ||
|
|
7292479d9c | ||
|
|
301c11c208 | ||
|
|
71b218ad62 | ||
|
|
ec2f21b944 | ||
|
|
c65b3f3aca | ||
|
|
43280ee077 | ||
|
|
c7e4fb8021 | ||
|
|
132d058098 | ||
|
|
c678a5502d | ||
|
|
0ee35721b0 | ||
|
|
1932f9a9c3 | ||
|
|
8e85b71669 | ||
|
|
f439afae9e | ||
|
|
fdd749be18 | ||
|
|
666e3e51a3 | ||
|
|
b930d5a1f9 | ||
|
|
5c10a2662d | ||
|
|
214f451cc1 | ||
|
|
67b4fa6f68 | ||
|
|
aa3e7a8ef5 | ||
|
|
7bf6099528 | ||
|
|
e90a4eb71d | ||
|
|
7b83406ee4 | ||
|
|
c4157d2ec8 | ||
|
|
2bdfaef2d9 | ||
|
|
2b0fbd9904 | ||
|
|
0ffa0351b5 | ||
|
|
951cbf3d16 | ||
|
|
69454048ad | ||
|
|
c4ceb89240 | ||
|
|
4a638cba79 | ||
|
|
c209528271 | ||
|
|
0d1f590937 | ||
|
|
b59b839029 | ||
|
|
513243ba0f | ||
|
|
795e774119 | ||
|
|
d02d419729 | ||
|
|
518bffe644 | ||
|
|
88d1b31aff | ||
|
|
4db2dbff44 | ||
|
|
32ad577f6d | ||
|
|
3310f49f68 | ||
|
|
bf7803d554 | ||
|
|
c9bd253960 | ||
|
|
859591cea5 | ||
|
|
b99b13a6e4 | ||
|
|
c80be4940f | ||
|
|
52374ce06d | ||
|
|
5a594f7d9a | ||
|
|
aff87a26ce | ||
|
|
18aae0cfa5 | ||
|
|
6f0bc2ecf8 | ||
|
|
8d2a637bd8 | ||
|
|
54180c4768 | ||
|
|
4e22384ed1 | ||
|
|
029f801159 | ||
|
|
fd53671430 | ||
|
|
7b09548261 | ||
|
|
63e1311656 | ||
|
|
36a303a86f | ||
|
|
61f903dcf1 | ||
|
|
2a10562e9e | ||
|
|
d64796f32a | ||
|
|
f2d67d0a5d | ||
|
|
ad39a51fe8 | ||
|
|
14d0927fb6 | ||
|
|
1697465d0d | ||
|
|
e52965d039 | ||
|
|
a8d957bf7d | ||
|
|
b6b5343e04 | ||
|
|
d4c318438d | ||
|
|
d8d04f2ac3 | ||
|
|
1c38e73290 | ||
|
|
7fc6b9b940 | ||
|
|
ed50ed8550 | ||
|
|
fb4c65dae0 | ||
|
|
fc9543baa7 | ||
|
|
89a4e6506f | ||
|
|
22656a40b2 | ||
|
|
6fa9abd896 | ||
|
|
b7a0ebad17 | ||
|
|
f8526e1ac7 |
17
.github/workflows/gradle.yml
vendored
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
name: Java CI
|
||||||
|
|
||||||
|
on: [push]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v1
|
||||||
|
- name: Set up JDK 1.8
|
||||||
|
uses: actions/setup-java@v1
|
||||||
|
with:
|
||||||
|
java-version: 1.8
|
||||||
|
- name: Run unit tests with gradle
|
||||||
|
run: ./gradlew test
|
||||||
8
.gitignore
vendored
@@ -10,6 +10,7 @@ logs/
|
|||||||
/desktop/mindustry-maps/
|
/desktop/mindustry-maps/
|
||||||
/desktop/gifexport/
|
/desktop/gifexport/
|
||||||
/core/lib/
|
/core/lib/
|
||||||
|
/ios/assets/
|
||||||
/core/assets-raw/sprites/generated/
|
/core/assets-raw/sprites/generated/
|
||||||
/core/assets-raw/sprites_out/
|
/core/assets-raw/sprites_out/
|
||||||
/annotations/build/
|
/annotations/build/
|
||||||
@@ -18,6 +19,11 @@ logs/
|
|||||||
/tools/build/
|
/tools/build/
|
||||||
/tests/build/
|
/tests/build/
|
||||||
/server/build/
|
/server/build/
|
||||||
|
changelog
|
||||||
|
saves/
|
||||||
|
core/assets/saves/
|
||||||
|
/core/assets/saves/
|
||||||
|
steam_appid.txt
|
||||||
/test_files/
|
/test_files/
|
||||||
/annotations/build/
|
/annotations/build/
|
||||||
/android/assets/mindustry-maps/
|
/android/assets/mindustry-maps/
|
||||||
@@ -30,7 +36,9 @@ logs/
|
|||||||
ios/robovm.properties
|
ios/robovm.properties
|
||||||
packr-out/
|
packr-out/
|
||||||
config/
|
config/
|
||||||
|
changelog
|
||||||
*.gif
|
*.gif
|
||||||
|
/core/assets/saves/
|
||||||
|
|
||||||
version.properties
|
version.properties
|
||||||
|
|
||||||
|
|||||||
21
.travis.yml
@@ -1,11 +1,25 @@
|
|||||||
jdk:
|
jdk:
|
||||||
- openjdk8
|
- openjdk8
|
||||||
|
dist: trusty
|
||||||
|
android:
|
||||||
|
components:
|
||||||
|
- android-29
|
||||||
|
- build-tools-29.0.2
|
||||||
|
|
||||||
script:
|
script:
|
||||||
|
- git clone --depth=1 --branch=master https://github.com/Anuken/MindustryBuilds ../MindustryBuilds
|
||||||
|
- cd ../MindustryBuilds
|
||||||
|
- echo ${TRAVIS_TAG}
|
||||||
|
- if [ -n "$TRAVIS_TAG" ]; then echo versionName=4-fdroid-${TRAVIS_TAG:1}$'\n'versionCode=${TRAVIS_TAG:1} > version_fdroid.txt; git add .; git commit -m "Updating to build ${TRAVIS_TAG}"; fi
|
||||||
|
- git tag ${TRAVIS_BUILD_NUMBER}
|
||||||
|
- git config --global user.name "Build Uploader"
|
||||||
|
- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then git push https://Anuken:${GH_PUSH_TOKEN}@github.com/Anuken/MindustryBuilds ${TRAVIS_BUILD_NUMBER}; git push https://Anuken:${GH_PUSH_TOKEN}@github.com/Anuken/MindustryBuilds; fi
|
||||||
|
- cd ../Mindustry
|
||||||
- git clone --depth=1 --branch=master https://github.com/Anuken/Arc ../Arc
|
- git clone --depth=1 --branch=master https://github.com/Anuken/Arc ../Arc
|
||||||
|
- if [ -n "$TRAVIS_TAG" ]; then cd ../Arc; git tag ${TRAVIS_TAG}; git push https://Anuken:${GH_PUSH_TOKEN}@github.com/Anuken/Arc ${TRAVIS_TAG}; cd ../Mindustry; fi
|
||||||
- "./gradlew test"
|
- "./gradlew test"
|
||||||
- "./gradlew desktop:dist -Pbuildversion=${TRAVIS_TAG:1}"
|
- "./gradlew desktop:dist -Pbuildversion=${TRAVIS_TAG:1}"
|
||||||
- "./gradlew server:dist -Pbuildversion=${TRAVIS_TAG:1}"
|
- "./gradlew server:dist -Pbuildversion=${TRAVIS_TAG:1}"
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
- provider: releases
|
- provider: releases
|
||||||
skip_cleanup: true
|
skip_cleanup: true
|
||||||
@@ -13,7 +27,7 @@ deploy:
|
|||||||
api_key:
|
api_key:
|
||||||
secure: Cv5wFtWt62/A24EvSEQvMow7gKPbZ3oATEFPuSghhB2TQz1dA40Zee3Qvk4LFlpLrhYo4K0ZSczCZRGpR+hCd8+Dpww52bheYEvWuh3ZQfvu/fXtEx2j5PwP1qMpmIgSxETV/gkD7l9FImdh0VzktYiAvQfmi0bEocG9/D4QwjFpNat7iwBdcMiw1MvAygpdIWRsjiw0RKlB2mWarmoHhQ7Gu7qlU3j50uaEvcrtmU0pBUPggNQwQRv32i9NPvNFxrqqlUjDLIS8JFea99zCkp8BwYqbEvBIMzd+Qip1/stLJJA3+cDUClbsDtg8rAVetzpOrdLEEBmqShFe5MDl2yEHcsgpN9CFsyTaUfvB3P3rVjizvycMm42IsUkXQiarm5xTQ/TIA8Rd8AHiSKuweNCg1Fd5SFaRtKy8JVLXuxyfUccmyje6hhz2L4lS2Wfj3mAG7sqZUCXhWP79EKdGkiPOjKv4CwXEKmuH3BMVqPlNUZJr9Eg3sV1FG0h2l+MVOOnR635qdUbb49sYojYxVruMLX0BH1c4ZCu230m8CUoWA1Em1QNI75ya7+9Y5T6AsgWDVpBvdUo9fWNbdp+VQ0GskFQsJD5wtnxbcbHeFiERAgGBm7z6qt9u9LrQpBH+dsW52ADvYsu3L4nQEa+sdMHwTTwmGY+iUvsxu0DqxGg=
|
secure: Cv5wFtWt62/A24EvSEQvMow7gKPbZ3oATEFPuSghhB2TQz1dA40Zee3Qvk4LFlpLrhYo4K0ZSczCZRGpR+hCd8+Dpww52bheYEvWuh3ZQfvu/fXtEx2j5PwP1qMpmIgSxETV/gkD7l9FImdh0VzktYiAvQfmi0bEocG9/D4QwjFpNat7iwBdcMiw1MvAygpdIWRsjiw0RKlB2mWarmoHhQ7Gu7qlU3j50uaEvcrtmU0pBUPggNQwQRv32i9NPvNFxrqqlUjDLIS8JFea99zCkp8BwYqbEvBIMzd+Qip1/stLJJA3+cDUClbsDtg8rAVetzpOrdLEEBmqShFe5MDl2yEHcsgpN9CFsyTaUfvB3P3rVjizvycMm42IsUkXQiarm5xTQ/TIA8Rd8AHiSKuweNCg1Fd5SFaRtKy8JVLXuxyfUccmyje6hhz2L4lS2Wfj3mAG7sqZUCXhWP79EKdGkiPOjKv4CwXEKmuH3BMVqPlNUZJr9Eg3sV1FG0h2l+MVOOnR635qdUbb49sYojYxVruMLX0BH1c4ZCu230m8CUoWA1Em1QNI75ya7+9Y5T6AsgWDVpBvdUo9fWNbdp+VQ0GskFQsJD5wtnxbcbHeFiERAgGBm7z6qt9u9LrQpBH+dsW52ADvYsu3L4nQEa+sdMHwTTwmGY+iUvsxu0DqxGg=
|
||||||
file:
|
file:
|
||||||
- desktop/build/libs/desktop-release.jar
|
- desktop/build/libs/Mindustry.jar
|
||||||
- server/build/libs/server-release.jar
|
- server/build/libs/server-release.jar
|
||||||
on:
|
on:
|
||||||
repo: Anuken/Mindustry
|
repo: Anuken/Mindustry
|
||||||
@@ -25,4 +39,5 @@ deploy:
|
|||||||
tags: true
|
tags: true
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
secure: TqlUl/ojjkCMVOGbCTKz7Cnr4F08UyWzY/CiJ0vvUOGJGZ1qm7XavAlDf5XT0egU4mvr37THubFO8vojbqmrmy0oZnYh3njKFA8axgyZ8PyKkjGHOfd0i6qyEWsOr9H90/2X8r3LwEeLaDFyHpu3wljIGBjweg53g2qwmDwCFa9UR80FJZ+xDB+rD6B3cXT0DTEkCoLZXLqXm0Y3HvBdSuBL1LR/FNb2BSxNq+tNLGiz1kdQZV5erausbbZypBoGxzz63xAnyz2kkFz73A8xQYVTzGbFodTPz7HM13GVZ5s43I03Y+HYyHBgBaSLziO2hi2kzVJccOwzBp7wS4fs1MqsFY5+IeWJ9k+hm89NiYT7+6zlEgoUMlIniny1qLqWTzx7btUeuC/y/h5TVBNgaV+z0jmHycHfeSyq5I+vmX4J8qe3wmaN8TcdqYKU5nIznOTk3CM5Fzu0Bs9vkCkOxmormmcjMFW1RbdOLc/hpZWZggsBA88sNEAI8eq+r5QEeqzeCx8YKoZDjdrsqvgLMc3El3gS9oMGxkn0Y/TEcqs9Tc4BXtTkqIA68hD0DYzlAxYjVbbkAI9Hh9lHNvV3Dr/oCkGXQ/HflM143kj1L3tSBZpqeqQE2XhngB5nqpS3OZTmZbMTQ8qD2luU18yaTGMLF5tJS/fdKPRx0gQ1kL8=
|
- secure: TqlUl/ojjkCMVOGbCTKz7Cnr4F08UyWzY/CiJ0vvUOGJGZ1qm7XavAlDf5XT0egU4mvr37THubFO8vojbqmrmy0oZnYh3njKFA8axgyZ8PyKkjGHOfd0i6qyEWsOr9H90/2X8r3LwEeLaDFyHpu3wljIGBjweg53g2qwmDwCFa9UR80FJZ+xDB+rD6B3cXT0DTEkCoLZXLqXm0Y3HvBdSuBL1LR/FNb2BSxNq+tNLGiz1kdQZV5erausbbZypBoGxzz63xAnyz2kkFz73A8xQYVTzGbFodTPz7HM13GVZ5s43I03Y+HYyHBgBaSLziO2hi2kzVJccOwzBp7wS4fs1MqsFY5+IeWJ9k+hm89NiYT7+6zlEgoUMlIniny1qLqWTzx7btUeuC/y/h5TVBNgaV+z0jmHycHfeSyq5I+vmX4J8qe3wmaN8TcdqYKU5nIznOTk3CM5Fzu0Bs9vkCkOxmormmcjMFW1RbdOLc/hpZWZggsBA88sNEAI8eq+r5QEeqzeCx8YKoZDjdrsqvgLMc3El3gS9oMGxkn0Y/TEcqs9Tc4BXtTkqIA68hD0DYzlAxYjVbbkAI9Hh9lHNvV3Dr/oCkGXQ/HflM143kj1L3tSBZpqeqQE2XhngB5nqpS3OZTmZbMTQ8qD2luU18yaTGMLF5tJS/fdKPRx0gQ1kL8=
|
||||||
|
- secure: VEskj/0TVX2o7iUVXuVPysj/VSWmPhDl57SrT7/nBNN/P/8N5jFAvx8PMzG7qT0S5FzKxuV20psE4WylUGRKdeRtK7/QNBV7T3YqYYM6BUB1VeRpxe5hLxTeuBK3izglFO8DkdDqjUtzQSjzkoYT75ilROjhBrBUPhVek7UlbBHbaklPWYFXHnJmYS1FpZTdzqIj+Y0Gd1PSL2MzK4X74aAHl0qaDgsTwYwtKs7IAz+kFaTZBRpi9VjQHAFhDlkDR3jo9wQjH8/F6x0lCgV/FulSc37Okdb40sLFG98xcEA6gWh1NPMkz8CulUdVE7mj7SJNxLbNvoMNrWOVRjmEsn59p/9LiNC1F9ncFz9vjQjAmi7rMFFGHGxe5nn8cIAkpTvHQQkZoWHAA9SNJTDMMf09m2pRy/vvzx+a6NVxyC9iNrhLlnBg4gxAqRh0S6NU0uL+fuygKixn7rqlnb7KMT7bAbfcuV+dng6c8V7hYKDCh7sJbH8iJump1xkwoM7ecnU8fxJF/oKOr/fbk0Bfxu+Q9qYLrV1+DEdm93Vl2Thq+DBKmI66jRGSva6HeCLFo81PEiEjP1nLv75+kvVfOqVqJrZD1BrvoG2eWT/3hVLrN2kEIWWlpvQVC7FL11yWmYtAuOBh/vfhI76zKr+YTS6ccG9rqW4XeYjJytshe8M=
|
||||||
|
|||||||
21
README.md
@@ -29,6 +29,13 @@ _Building:_ `./gradlew desktop:dist`
|
|||||||
|
|
||||||
Server builds are bundled with each released build (in Releases). If you'd rather compile on your own, replace 'desktop' with 'server', e.g. `gradlew server:dist`.
|
Server builds are bundled with each released build (in Releases). If you'd rather compile on your own, replace 'desktop' with 'server', e.g. `gradlew server:dist`.
|
||||||
|
|
||||||
|
#### Android
|
||||||
|
|
||||||
|
1. Install the Android SDK [here.](https://developer.android.com/studio#downloads) Make sure you're downloading the "Command line tools only", as Android Studio is not required.
|
||||||
|
2. Create a file named `local.properties` inside the Mindustry directory, with its contents looking like this: `sdk.dir=<Path to Android SDK you just downloaded, without these bracket>`. For example, if you're on Windows and installed the tools to C:\\tools, your local.properties would contain `sdk.dir=C:\\tools` (*note the double backslashes are required instead of single ones!*).
|
||||||
|
3. Run `gradlew android:assembleDebug` (or `./gradlew` if on linux/mac). This will create an unsigned APK in `android/build/outputs/apk`.
|
||||||
|
4. (Optional) To debug the application on a connected phone, do `gradlew android:installDebug android:run`. It is **highly recommended** to use IntelliJ for this instead, however.
|
||||||
|
|
||||||
##### Troubleshooting
|
##### Troubleshooting
|
||||||
|
|
||||||
If the terminal returns `Permission denied` or `Command not found` on Mac/Linux, run `chmod +x ./gradlew` before running `./gradlew`. *This is a one-time procedure.*
|
If the terminal returns `Permission denied` or `Command not found` on Mac/Linux, run `chmod +x ./gradlew` before running `./gradlew`. *This is a one-time procedure.*
|
||||||
@@ -36,10 +43,18 @@ If the terminal returns `Permission denied` or `Command not found` on Mac/Linux,
|
|||||||
---
|
---
|
||||||
|
|
||||||
Gradle may take up to several minutes to download files. Be patient. <br>
|
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` for desktop builds, and in `/server/build/libs/server-release.jar` for server builds.
|
After building, the output .JAR file should be in `/desktop/build/libs/Mindustry.jar` for desktop builds, and in `/server/build/libs/server-release.jar` for server builds.
|
||||||
|
|
||||||
### Downloads
|
### Downloads
|
||||||
|
|
||||||
<a href="https://anuke.itch.io/mindustry"><img src="https://static.itch.io/images/badge.svg" width="auto" height="75"></a>
|
[<img src="https://static.itch.io/images/badge.svg"
|
||||||
|
alt="Get it on Itch.io"
|
||||||
|
height="60">](https://anuke.itch.io/mindustry)
|
||||||
|
|
||||||
<a href="https://play.google.com/store/apps/details?id=io.anuke.mindustry&hl=en"><img src="https://upload.wikimedia.org/wikipedia/commons/thumb/c/cd/Get_it_on_Google_play.svg/1280px-Get_it_on_Google_play.svg.png" width="auto" height="75"></a>
|
[<img src="https://play.google.com/intl/en_us/badges/images/generic/en-play-badge.png"
|
||||||
|
alt="Get it on Google Play"
|
||||||
|
height="80">](https://play.google.com/store/apps/details?id=io.anuke.mindustry)
|
||||||
|
|
||||||
|
[<img src="https://fdroid.gitlab.io/artwork/badge/get-it-on.png"
|
||||||
|
alt="Get it on F-Droid"
|
||||||
|
height="80">](https://f-droid.org/packages/io.anuke.mindustry/)
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
## Translating for Mindustry
|
## Translating for Mindustry
|
||||||
|
|
||||||
**DISCLAIMER:** *Currently, 4.0 is far from done, which means that things such as block names, descriptions, and core text will be changing often. If you begin translating now, you might have to re-do large chunks of the bundle before final release.*
|
|
||||||
|
|
||||||
|
|
||||||
To begin, log in to your GitHub account, or if you don't have one yet, create it [here](https://github.com/).
|
To begin, log in to your GitHub account, or if you don't have one yet, create it [here](https://github.com/).
|
||||||
|
|
||||||
Consult [this list](https://www.science.co.il/language/Locale-codes.php) to find the locale code for your language. Once you've found it,
|
Consult [this list](https://www.science.co.il/language/Locale-codes.php) to find the locale code for your language. Once you've found it,
|
||||||
|
|||||||
@@ -28,14 +28,6 @@
|
|||||||
<category android:name="android.intent.category.LAUNCHER"/>
|
<category android:name="android.intent.category.LAUNCHER"/>
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.intent.action.VIEW"/>
|
|
||||||
<category android:name="android.intent.category.DEFAULT"/>
|
|
||||||
<category android:name="android.intent.category.BROWSABLE"/>
|
|
||||||
<data android:mimeType="application/octet-stream"/>
|
|
||||||
<data android:scheme="file" android:host="*" android:pathPattern=".*\\.mmap"/>
|
|
||||||
</intent-filter>
|
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.VIEW"/>
|
<action android:name="android.intent.action.VIEW"/>
|
||||||
<category android:name="android.intent.category.DEFAULT"/>
|
<category android:name="android.intent.category.DEFAULT"/>
|
||||||
@@ -43,21 +35,6 @@
|
|||||||
<data android:mimeType="application/octet-stream" />
|
<data android:mimeType="application/octet-stream" />
|
||||||
<data android:scheme="file" android:host="*" android:pathPattern=".*\\.msav"/>
|
<data android:scheme="file" android:host="*" android:pathPattern=".*\\.msav"/>
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
|
||||||
|
|
||||||
<intent-filter android:icon="@mipmap/ic_launcher"
|
|
||||||
android:label="Mindustry Map"
|
|
||||||
android:priority="1">
|
|
||||||
<action android:name="android.intent.action.VIEW"/>
|
|
||||||
<category android:name="android.intent.category.DEFAULT"/>
|
|
||||||
<data android:scheme="file" android:host="*" android:pathPattern=".*\\.mmap" android:mimeType="*/*"/>
|
|
||||||
</intent-filter>
|
|
||||||
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.intent.action.VIEW"/>
|
|
||||||
<category android:name="android.intent.category.DEFAULT"/>
|
|
||||||
<data android:scheme="file" android:host="*" android:pathPattern=".*\\.msav" android:mimeType="*/*"/>
|
|
||||||
</intent-filter>
|
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
</application>
|
</application>
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ repositories{
|
|||||||
|
|
||||||
dependencies{
|
dependencies{
|
||||||
implementation project(":core")
|
implementation project(":core")
|
||||||
implementation project(":net")
|
|
||||||
|
|
||||||
implementation arcModule("backends:backend-android")
|
implementation arcModule("backends:backend-android")
|
||||||
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi"
|
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi"
|
||||||
@@ -46,12 +45,12 @@ task deploy(type: Copy){
|
|||||||
|
|
||||||
from "build/outputs/apk/release/android-release.apk"
|
from "build/outputs/apk/release/android-release.apk"
|
||||||
into "../deploy/"
|
into "../deploy/"
|
||||||
rename("android-release.apk", appName + "-android-" + getVersionString() + ".apk")
|
rename("android-release.apk", "${generateDeployName('android')}.apk")
|
||||||
}
|
}
|
||||||
|
|
||||||
android{
|
android{
|
||||||
buildToolsVersion '28.0.3'
|
buildToolsVersion '29.0.2'
|
||||||
compileSdkVersion 28
|
compileSdkVersion 29
|
||||||
sourceSets{
|
sourceSets{
|
||||||
main{
|
main{
|
||||||
manifest.srcFile 'AndroidManifest.xml'
|
manifest.srcFile 'AndroidManifest.xml'
|
||||||
@@ -70,27 +69,19 @@ android{
|
|||||||
}
|
}
|
||||||
|
|
||||||
defaultConfig{
|
defaultConfig{
|
||||||
def vfile = file('../core/assets/version.properties')
|
Properties props = new Properties().with{p -> p.load(file('../core/assets/version.properties').newReader()); return p }
|
||||||
|
Integer vcode = props['androidBuildCode']?.toInteger() ?: 1
|
||||||
def code = 0
|
def versionNameResult = "$versionNumber-$versionType-${getBuildVersion().replace(" ", "-")}"
|
||||||
def versionNameResult = "unknown"
|
|
||||||
|
|
||||||
if(vfile.exists()){
|
|
||||||
def props = new Properties()
|
|
||||||
props.load(new FileInputStream(vfile))
|
|
||||||
|
|
||||||
code = (props['androidBuildCode'] == null ? 0 : props['androidBuildCode']).toInteger() + 1
|
|
||||||
|
|
||||||
props['androidBuildCode'] = code.toString()
|
|
||||||
props.store(vfile.newWriter(), "Autogenerated file. Do not modify.")
|
|
||||||
versionNameResult = "$versionNumber-$versionType-${props['build'].replace(" ", "-")}"
|
|
||||||
}
|
|
||||||
|
|
||||||
applicationId "io.anuke.mindustry"
|
applicationId "io.anuke.mindustry"
|
||||||
minSdkVersion 14
|
minSdkVersion 14
|
||||||
targetSdkVersion 28
|
targetSdkVersion 29
|
||||||
versionCode code
|
|
||||||
versionName versionNameResult
|
versionName versionNameResult
|
||||||
|
versionCode vcode
|
||||||
|
|
||||||
|
props['androidBuildCode'] = (vcode + 1).toString()
|
||||||
|
props.store(file('../core/assets/version.properties').newWriter(), null)
|
||||||
}
|
}
|
||||||
|
|
||||||
compileOptions{
|
compileOptions{
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 87 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 45 KiB |
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 6.1 KiB |
|
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 5.0 KiB |
|
Before Width: | Height: | Size: 8.4 KiB After Width: | Height: | Size: 8.3 KiB |
|
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 7.6 KiB |
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.1 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 9.8 KiB After Width: | Height: | Size: 9.5 KiB |
|
Before Width: | Height: | Size: 9.8 KiB After Width: | Height: | Size: 7.4 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 29 KiB |
@@ -1,32 +1,26 @@
|
|||||||
package io.anuke.mindustry;
|
package io.anuke.mindustry;
|
||||||
|
|
||||||
import android.Manifest;
|
import android.app.*;
|
||||||
import android.content.Context;
|
import android.content.*;
|
||||||
import android.content.Intent;
|
import android.content.pm.*;
|
||||||
import android.content.pm.ActivityInfo;
|
import android.net.*;
|
||||||
import android.content.pm.PackageManager;
|
import android.os.Build.*;
|
||||||
import android.net.Uri;
|
import android.os.*;
|
||||||
import android.os.Build;
|
import android.provider.Settings.*;
|
||||||
import android.os.Bundle;
|
import android.telephony.*;
|
||||||
import android.provider.Settings.Secure;
|
import io.anuke.arc.*;
|
||||||
import android.telephony.TelephonyManager;
|
import io.anuke.arc.backends.android.surfaceview.*;
|
||||||
import io.anuke.arc.Core;
|
import io.anuke.arc.files.*;
|
||||||
import io.anuke.arc.backends.android.surfaceview.AndroidApplication;
|
import io.anuke.arc.function.*;
|
||||||
import io.anuke.arc.backends.android.surfaceview.AndroidApplicationConfiguration;
|
import io.anuke.arc.scene.ui.layout.*;
|
||||||
import io.anuke.arc.files.FileHandle;
|
import io.anuke.arc.util.*;
|
||||||
import io.anuke.arc.function.Consumer;
|
import io.anuke.arc.util.serialization.*;
|
||||||
import io.anuke.arc.function.Predicate;
|
import io.anuke.mindustry.game.Saves.*;
|
||||||
import io.anuke.arc.scene.ui.layout.Unit;
|
import io.anuke.mindustry.io.*;
|
||||||
import io.anuke.arc.util.Strings;
|
import io.anuke.mindustry.ui.dialogs.*;
|
||||||
import io.anuke.arc.util.serialization.Base64Coder;
|
|
||||||
import io.anuke.mindustry.core.Platform;
|
|
||||||
import io.anuke.mindustry.game.Saves.SaveSlot;
|
|
||||||
import io.anuke.mindustry.io.SaveIO;
|
|
||||||
import io.anuke.mindustry.net.*;
|
|
||||||
import io.anuke.mindustry.ui.dialogs.FileChooser;
|
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.util.ArrayList;
|
import java.lang.System;
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.*;
|
import static io.anuke.mindustry.Vars.*;
|
||||||
|
|
||||||
@@ -34,14 +28,16 @@ public class AndroidLauncher extends AndroidApplication{
|
|||||||
public static final int PERMISSION_REQUEST_CODE = 1;
|
public static final int PERMISSION_REQUEST_CODE = 1;
|
||||||
boolean doubleScaleTablets = true;
|
boolean doubleScaleTablets = true;
|
||||||
FileChooser chooser;
|
FileChooser chooser;
|
||||||
|
Runnable permCallback;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState){
|
protected void onCreate(Bundle savedInstanceState){
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
|
if(doubleScaleTablets && isTablet(this.getContext())){
|
||||||
config.useImmersiveMode = true;
|
Scl.setAddition(0.5f);
|
||||||
config.depth = 0;
|
}
|
||||||
Platform.instance = new Platform(){
|
|
||||||
|
initialize(new ClientLauncher(){
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void hide(){
|
public void hide(){
|
||||||
@@ -71,21 +67,38 @@ public class AndroidLauncher extends AndroidApplication{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void showFileChooser(String text, String content, Consumer<FileHandle> cons, boolean open, Predicate<String> filetype){
|
public void showFileChooser(boolean open, String extension, Consumer<FileHandle> cons){
|
||||||
chooser = new FileChooser(text, file -> filetype.test(file.extension().toLowerCase()), open, cons);
|
if(VERSION.SDK_INT >= 19){
|
||||||
if(Build.VERSION.SDK_INT < Build.VERSION_CODES.M || (checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED &&
|
Intent intent = new Intent(open ? Intent.ACTION_OPEN_DOCUMENT : Intent.ACTION_CREATE_DOCUMENT);
|
||||||
checkSelfPermission(Manifest.permission.READ_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED)){
|
intent.addCategory(Intent.CATEGORY_OPENABLE);
|
||||||
chooser.show();
|
intent.setType("*/*");
|
||||||
chooser = null;
|
addResultListener(i -> startActivityForResult(intent, i), (code, in) -> {
|
||||||
|
if(code == Activity.RESULT_OK && in != null && in.getData() != null){
|
||||||
|
Uri uri = in.getData();
|
||||||
|
|
||||||
|
Core.app.post(() -> Core.app.post(() -> cons.accept(new FileHandle(uri.getPath()){
|
||||||
|
@Override
|
||||||
|
public InputStream read(){
|
||||||
|
try{
|
||||||
|
return getContentResolver().openInputStream(uri);
|
||||||
|
}catch(IOException e){
|
||||||
|
throw new ArcRuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public OutputStream write(boolean append){
|
||||||
|
try{
|
||||||
|
return getContentResolver().openOutputStream(uri);
|
||||||
|
}catch(IOException e){
|
||||||
|
throw new ArcRuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})));
|
||||||
|
}
|
||||||
|
});
|
||||||
}else{
|
}else{
|
||||||
ArrayList<String> perms = new ArrayList<>();
|
super.showFileChooser(open, extension, cons);
|
||||||
if(checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED){
|
|
||||||
perms.add(Manifest.permission.WRITE_EXTERNAL_STORAGE);
|
|
||||||
}
|
|
||||||
if(checkSelfPermission(Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED){
|
|
||||||
perms.add(Manifest.permission.READ_EXTERNAL_STORAGE);
|
|
||||||
}
|
|
||||||
requestPermissions(perms.toArray(new String[0]), PERMISSION_REQUEST_CODE);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -96,23 +109,18 @@ public class AndroidLauncher extends AndroidApplication{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void endForceLandscape(){
|
public void endForceLandscape(){
|
||||||
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR);
|
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_USER);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canDonate(){
|
public boolean canDonate(){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
}, new AndroidApplicationConfiguration(){{
|
||||||
|
useImmersiveMode = true;
|
||||||
if(doubleScaleTablets && isTablet(this.getContext())){
|
depth = 0;
|
||||||
Unit.dp.addition = 0.5f;
|
hideStatusBar = true;
|
||||||
}
|
}});
|
||||||
|
|
||||||
config.hideStatusBar = true;
|
|
||||||
Net.setClientProvider(new ArcNetClient());
|
|
||||||
Net.setServerProvider(new ArcNetServer());
|
|
||||||
initialize(new Mindustry(), config);
|
|
||||||
checkFiles(getIntent());
|
checkFiles(getIntent());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -123,7 +131,11 @@ public class AndroidLauncher extends AndroidApplication{
|
|||||||
if(i != PackageManager.PERMISSION_GRANTED) return;
|
if(i != PackageManager.PERMISSION_GRANTED) return;
|
||||||
}
|
}
|
||||||
if(chooser != null){
|
if(chooser != null){
|
||||||
chooser.show();
|
Core.app.post(chooser::show);
|
||||||
|
}
|
||||||
|
if(permCallback != null){
|
||||||
|
Core.app.post(permCallback);
|
||||||
|
permCallback = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -156,10 +168,10 @@ public class AndroidLauncher extends AndroidApplication{
|
|||||||
SaveSlot slot = control.saves.importSave(file);
|
SaveSlot slot = control.saves.importSave(file);
|
||||||
ui.load.runLoadSave(slot);
|
ui.load.runLoadSave(slot);
|
||||||
}catch(IOException e){
|
}catch(IOException e){
|
||||||
ui.showError(Core.bundle.format("save.import.fail", Strings.parseException(e, true)));
|
ui.showException("$save.import.fail", e);
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
ui.showError("$save.import.invalid");
|
ui.showErrorMessage("$save.import.invalid");
|
||||||
}
|
}
|
||||||
}else if(map){ //open map
|
}else if(map){ //open map
|
||||||
FileHandle file = Core.files.local("temp-map." + mapExtension);
|
FileHandle file = Core.files.local("temp-map." + mapExtension);
|
||||||
|
|||||||
@@ -4,6 +4,11 @@ import java.lang.annotation.*;
|
|||||||
|
|
||||||
public class Annotations{
|
public class Annotations{
|
||||||
|
|
||||||
|
@Target(ElementType.TYPE)
|
||||||
|
@Retention(RetentionPolicy.SOURCE)
|
||||||
|
public @interface StyleDefaults {
|
||||||
|
}
|
||||||
|
|
||||||
/** Indicates that a method should always call its super version. */
|
/** Indicates that a method should always call its super version. */
|
||||||
@Target(ElementType.METHOD)
|
@Target(ElementType.METHOD)
|
||||||
@Retention(RetentionPolicy.SOURCE)
|
@Retention(RetentionPolicy.SOURCE)
|
||||||
@@ -25,7 +30,7 @@ public class Annotations{
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Indicates that a method return or field cannot be null.*/
|
/** Indicates that a method return or field cannot be null.*/
|
||||||
@Target({ElementType.METHOD, ElementType.FIELD})
|
@Target({ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER, ElementType.LOCAL_VARIABLE})
|
||||||
@Retention(RetentionPolicy.SOURCE)
|
@Retention(RetentionPolicy.SOURCE)
|
||||||
public @interface NonNull{
|
public @interface NonNull{
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,172 @@
|
|||||||
|
package io.anuke.annotations;
|
||||||
|
|
||||||
|
import com.squareup.javapoet.*;
|
||||||
|
import io.anuke.annotations.Annotations.*;
|
||||||
|
|
||||||
|
import javax.annotation.processing.*;
|
||||||
|
import javax.lang.model.*;
|
||||||
|
import javax.lang.model.element.*;
|
||||||
|
import javax.tools.Diagnostic.*;
|
||||||
|
import javax.tools.*;
|
||||||
|
import java.nio.file.*;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
@SupportedSourceVersion(SourceVersion.RELEASE_8)
|
||||||
|
@SupportedAnnotationTypes("io.anuke.annotations.Annotations.StyleDefaults")
|
||||||
|
public class AssetsAnnotationProcessor extends AbstractProcessor{
|
||||||
|
/** Name of the base package to put all the generated classes. */
|
||||||
|
private static final String packageName = "io.anuke.mindustry.gen";
|
||||||
|
private String path;
|
||||||
|
private int round;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public synchronized void init(ProcessingEnvironment processingEnv){
|
||||||
|
super.init(processingEnv);
|
||||||
|
//put all relevant utils into utils class
|
||||||
|
Utils.typeUtils = processingEnv.getTypeUtils();
|
||||||
|
Utils.elementUtils = processingEnv.getElementUtils();
|
||||||
|
Utils.filer = processingEnv.getFiler();
|
||||||
|
Utils.messager = processingEnv.getMessager();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv){
|
||||||
|
if(round++ != 0) return false; //only process 1 round
|
||||||
|
|
||||||
|
try{
|
||||||
|
path = Paths.get(Utils.filer.createResource(StandardLocation.CLASS_OUTPUT, "no", "no")
|
||||||
|
.toUri().toURL().toString().substring(System.getProperty("os.name").contains("Windows") ? 6 : "file:".length()))
|
||||||
|
.getParent().getParent().getParent().getParent().getParent().getParent().toString();
|
||||||
|
|
||||||
|
processSounds("Sounds", path + "/assets/sounds", "io.anuke.arc.audio.Sound");
|
||||||
|
processSounds("Musics", path + "/assets/music", "io.anuke.arc.audio.Music");
|
||||||
|
processUI(roundEnv.getElementsAnnotatedWith(StyleDefaults.class));
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}catch(Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void processUI(Set<? extends Element> elements) throws Exception{
|
||||||
|
String[] iconSizes = {"small", "smaller", "tiny"};
|
||||||
|
|
||||||
|
TypeSpec.Builder type = TypeSpec.classBuilder("Tex").addModifiers(Modifier.PUBLIC);
|
||||||
|
TypeSpec.Builder ictype = TypeSpec.classBuilder("Icon").addModifiers(Modifier.PUBLIC);
|
||||||
|
MethodSpec.Builder load = MethodSpec.methodBuilder("load").addModifiers(Modifier.PUBLIC, Modifier.STATIC);
|
||||||
|
MethodSpec.Builder loadStyles = MethodSpec.methodBuilder("loadStyles").addModifiers(Modifier.PUBLIC, Modifier.STATIC);
|
||||||
|
MethodSpec.Builder icload = MethodSpec.methodBuilder("load").addModifiers(Modifier.PUBLIC, Modifier.STATIC);
|
||||||
|
String resources = path + "/assets-raw/sprites/ui";
|
||||||
|
Files.walk(Paths.get(resources)).forEach(p -> {
|
||||||
|
if(Files.isDirectory(p) || p.getFileName().toString().equals(".DS_Store")) return;
|
||||||
|
|
||||||
|
String filename = p.getFileName().toString();
|
||||||
|
filename = filename.substring(0, filename.indexOf("."));
|
||||||
|
|
||||||
|
ArrayList<String> names = new ArrayList<>();
|
||||||
|
names.add("");
|
||||||
|
if(filename.contains("icon")){
|
||||||
|
names.addAll(Arrays.asList(iconSizes));
|
||||||
|
}
|
||||||
|
|
||||||
|
for(String suffix : names){
|
||||||
|
suffix = suffix.isEmpty() ? "" : "-" + suffix;
|
||||||
|
|
||||||
|
String sfilen = filename + suffix;
|
||||||
|
String dtype = p.getFileName().toString().endsWith(".9.png") ? "io.anuke.arc.scene.style.NinePatchDrawable" : "io.anuke.arc.scene.style.TextureRegionDrawable";
|
||||||
|
|
||||||
|
String varname = capitalize(sfilen);
|
||||||
|
TypeSpec.Builder ttype = type;
|
||||||
|
MethodSpec.Builder tload = load;
|
||||||
|
if(varname.startsWith("icon")){
|
||||||
|
varname = varname.substring("icon".length());
|
||||||
|
varname = Character.toLowerCase(varname.charAt(0)) + varname.substring(1);
|
||||||
|
ttype = ictype;
|
||||||
|
tload = icload;
|
||||||
|
if(SourceVersion.isKeyword(varname)) varname += "i";
|
||||||
|
}
|
||||||
|
|
||||||
|
if(SourceVersion.isKeyword(varname)) varname += "s";
|
||||||
|
|
||||||
|
ttype.addField(ClassName.bestGuess(dtype), varname, Modifier.STATIC, Modifier.PUBLIC);
|
||||||
|
tload.addStatement(varname + " = ("+dtype+")io.anuke.arc.Core.atlas.drawable($S)", sfilen);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
for(Element elem : elements){
|
||||||
|
TypeElement t = (TypeElement)elem;
|
||||||
|
t.getEnclosedElements().stream().filter(e -> e.getKind() == ElementKind.FIELD).forEach(field -> {
|
||||||
|
String fname = field.getSimpleName().toString();
|
||||||
|
if(fname.startsWith("default")){
|
||||||
|
loadStyles.addStatement("io.anuke.arc.Core.scene.addStyle(" + field.asType().toString() + ".class, io.anuke.mindustry.ui.Styles." + fname + ")");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
ictype.addMethod(icload.build());
|
||||||
|
JavaFile.builder(packageName, ictype.build()).build().writeTo(Utils.filer);
|
||||||
|
|
||||||
|
type.addMethod(load.build());
|
||||||
|
type.addMethod(loadStyles.build());
|
||||||
|
JavaFile.builder(packageName, type.build()).build().writeTo(Utils.filer);
|
||||||
|
}
|
||||||
|
|
||||||
|
void processSounds(String classname, String path, String rtype) throws Exception{
|
||||||
|
TypeSpec.Builder type = TypeSpec.classBuilder(classname).addModifiers(Modifier.PUBLIC);
|
||||||
|
MethodSpec.Builder dispose = MethodSpec.methodBuilder("dispose").addModifiers(Modifier.PUBLIC, Modifier.STATIC);
|
||||||
|
MethodSpec.Builder loadBegin = MethodSpec.methodBuilder("load").addModifiers(Modifier.PUBLIC, Modifier.STATIC);
|
||||||
|
|
||||||
|
HashSet<String> names = new HashSet<>();
|
||||||
|
Files.list(Paths.get(path)).forEach(p -> {
|
||||||
|
String fname = p.getFileName().toString();
|
||||||
|
String name = p.getFileName().toString();
|
||||||
|
name = name.substring(0, name.indexOf("."));
|
||||||
|
|
||||||
|
if(names.contains(name)){
|
||||||
|
Utils.messager.printMessage(Kind.ERROR, "Duplicate file name: " + p.toString() + "!");
|
||||||
|
}else{
|
||||||
|
names.add(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(SourceVersion.isKeyword(name)){
|
||||||
|
name = name + "s";
|
||||||
|
}
|
||||||
|
|
||||||
|
String filepath = path.substring(path.lastIndexOf("/") + 1) + "/" + fname;
|
||||||
|
|
||||||
|
String filename = "io.anuke.arc.Core.app.getType() != io.anuke.arc.Application.ApplicationType.iOS ? \"" + filepath + "\" : \"" + filepath.replace(".ogg", ".mp3")+"\"";
|
||||||
|
|
||||||
|
loadBegin.addStatement("io.anuke.arc.Core.assets.load("+filename +", "+rtype+".class).loaded = a -> " + name + " = ("+rtype+")a", filepath, filepath.replace(".ogg", ".mp3"));
|
||||||
|
|
||||||
|
dispose.addStatement(name + ".dispose()");
|
||||||
|
dispose.addStatement(name + " = null");
|
||||||
|
type.addField(FieldSpec.builder(ClassName.bestGuess(rtype), name, Modifier.STATIC, Modifier.PUBLIC).initializer("new io.anuke.arc.audio.mock.Mock" + rtype.substring(rtype.lastIndexOf(".") + 1)+ "()").build());
|
||||||
|
});
|
||||||
|
|
||||||
|
if(classname.equals("Sounds")){
|
||||||
|
type.addField(FieldSpec.builder(ClassName.bestGuess(rtype), "none", Modifier.STATIC, Modifier.PUBLIC).initializer("new io.anuke.arc.audio.mock.Mock" + rtype.substring(rtype.lastIndexOf(".") + 1)+ "()").build());
|
||||||
|
}
|
||||||
|
|
||||||
|
type.addMethod(loadBegin.build());
|
||||||
|
type.addMethod(dispose.build());
|
||||||
|
JavaFile.builder(packageName, type.build()).build().writeTo(Utils.filer);
|
||||||
|
}
|
||||||
|
|
||||||
|
static String capitalize(String s){
|
||||||
|
StringBuilder result = new StringBuilder(s.length());
|
||||||
|
|
||||||
|
for(int i = 0; i < s.length(); i++){
|
||||||
|
char c = s.charAt(i);
|
||||||
|
if(c != '_' && c != '-'){
|
||||||
|
if(i > 0 && (s.charAt(i - 1) == '_' || s.charAt(i - 1) == '-')){
|
||||||
|
result.append(Character.toUpperCase(c));
|
||||||
|
}else{
|
||||||
|
result.append(c);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -54,8 +54,20 @@ class CodeAnalyzerTreeScanner extends TreePathScanner<Object, Trees> {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public boolean checkScope (Scope members) {
|
public boolean checkScope (Scope members) {
|
||||||
for (Symbol s : members.getElements()) {
|
Iterable<Symbol> it;
|
||||||
|
try{
|
||||||
|
it = (Iterable<Symbol>)members.getClass().getMethod("getElements").invoke(members);
|
||||||
|
}catch(Throwable t){
|
||||||
|
try{
|
||||||
|
it = (Iterable<Symbol>)members.getClass().getMethod("getSymbols").invoke(members);
|
||||||
|
}catch(Exception e){
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (Symbol s : it) {
|
||||||
if (s instanceof MethodSymbol) {
|
if (s instanceof MethodSymbol) {
|
||||||
MethodSymbol ms = (MethodSymbol) s;
|
MethodSymbol ms = (MethodSymbol) s;
|
||||||
|
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ public class RemoteReadGenerator{
|
|||||||
if(entry.forward && entry.where.isServer && needsPlayer){
|
if(entry.forward && entry.where.isServer && needsPlayer){
|
||||||
//call forwarded method
|
//call forwarded method
|
||||||
readBlock.addStatement(packageName + "." + entry.className + "." + entry.element.getSimpleName() +
|
readBlock.addStatement(packageName + "." + entry.className + "." + entry.element.getSimpleName() +
|
||||||
"__forward(player.con.id" + (varResult.length() == 0 ? "" : ", ") + varResult.toString() + ")");
|
"__forward(player.con" + (varResult.length() == 0 ? "" : ", ") + varResult.toString() + ")");
|
||||||
}
|
}
|
||||||
|
|
||||||
readBlock.nextControlFlow("catch (java.lang.Exception e)");
|
readBlock.nextControlFlow("catch (java.lang.Exception e)");
|
||||||
|
|||||||
@@ -85,19 +85,19 @@ public class RemoteWriteGenerator{
|
|||||||
|
|
||||||
//if toAll is false, it's a 'send to one player' variant, so add the player as a parameter
|
//if toAll is false, it's a 'send to one player' variant, so add the player as a parameter
|
||||||
if(!toAll){
|
if(!toAll){
|
||||||
method.addParameter(int.class, "playerClientID");
|
method.addParameter(ClassName.bestGuess("io.anuke.mindustry.net.NetConnection"), "playerConnection");
|
||||||
}
|
}
|
||||||
|
|
||||||
//add sender to ignore
|
//add sender to ignore
|
||||||
if(forwarded){
|
if(forwarded){
|
||||||
method.addParameter(int.class, "exceptSenderID");
|
method.addParameter(ClassName.bestGuess("io.anuke.mindustry.net.NetConnection"), "exceptConnection");
|
||||||
}
|
}
|
||||||
|
|
||||||
//call local method if applicable, shouldn't happen when forwarding method as that already happens by default
|
//call local method if applicable, shouldn't happen when forwarding method as that already happens by default
|
||||||
if(!forwarded && methodEntry.local != Loc.none){
|
if(!forwarded && methodEntry.local != Loc.none){
|
||||||
//add in local checks
|
//add in local checks
|
||||||
if(methodEntry.local != Loc.both){
|
if(methodEntry.local != Loc.both){
|
||||||
method.beginControlFlow("if(" + getCheckString(methodEntry.local) + " || !io.anuke.mindustry.net.Net.active())");
|
method.beginControlFlow("if(" + getCheckString(methodEntry.local) + " || !io.anuke.mindustry.Vars.net.active())");
|
||||||
}
|
}
|
||||||
|
|
||||||
//concatenate parameters
|
//concatenate parameters
|
||||||
@@ -159,7 +159,7 @@ public class RemoteWriteGenerator{
|
|||||||
boolean writePlayerSkipCheck = methodEntry.where == Loc.both && i == 0;
|
boolean writePlayerSkipCheck = methodEntry.where == Loc.both && i == 0;
|
||||||
|
|
||||||
if(writePlayerSkipCheck){ //write begin check
|
if(writePlayerSkipCheck){ //write begin check
|
||||||
method.beginControlFlow("if(io.anuke.mindustry.net.Net.server())");
|
method.beginControlFlow("if(io.anuke.mindustry.Vars.net.server())");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Utils.isPrimitive(typeName)){ //check if it's a primitive, and if so write it
|
if(Utils.isPrimitive(typeName)){ //check if it's a primitive, and if so write it
|
||||||
@@ -194,18 +194,18 @@ public class RemoteWriteGenerator{
|
|||||||
|
|
||||||
if(forwarded){ //forward packet
|
if(forwarded){ //forward packet
|
||||||
if(!methodEntry.local.isClient){ //if the client doesn't get it called locally, forward it back after validation
|
if(!methodEntry.local.isClient){ //if the client doesn't get it called locally, forward it back after validation
|
||||||
sendString = "send(";
|
sendString = "io.anuke.mindustry.Vars.net.send(";
|
||||||
}else{
|
}else{
|
||||||
sendString = "sendExcept(exceptSenderID, ";
|
sendString = "io.anuke.mindustry.Vars.net.sendExcept(exceptConnection, ";
|
||||||
}
|
}
|
||||||
}else if(toAll){ //send to all players / to server
|
}else if(toAll){ //send to all players / to server
|
||||||
sendString = "send(";
|
sendString = "io.anuke.mindustry.Vars.net.send(";
|
||||||
}else{ //send to specific client from server
|
}else{ //send to specific client from server
|
||||||
sendString = "sendTo(playerClientID, ";
|
sendString = "playerConnection.send(";
|
||||||
}
|
}
|
||||||
|
|
||||||
//send the actual packet
|
//send the actual packet
|
||||||
method.addStatement("io.anuke.mindustry.net.Net." + sendString + "packet, " +
|
method.addStatement(sendString + "packet, " +
|
||||||
(methodEntry.unreliable ? "io.anuke.mindustry.net.Net.SendMode.udp" : "io.anuke.mindustry.net.Net.SendMode.tcp") + ")");
|
(methodEntry.unreliable ? "io.anuke.mindustry.net.Net.SendMode.udp" : "io.anuke.mindustry.net.Net.SendMode.tcp") + ")");
|
||||||
|
|
||||||
|
|
||||||
@@ -217,8 +217,8 @@ public class RemoteWriteGenerator{
|
|||||||
}
|
}
|
||||||
|
|
||||||
private String getCheckString(Loc loc){
|
private String getCheckString(Loc loc){
|
||||||
return loc.isClient && loc.isServer ? "io.anuke.mindustry.net.Net.server() || io.anuke.mindustry.net.Net.client()" :
|
return loc.isClient && loc.isServer ? "io.anuke.mindustry.Vars.net.server() || io.anuke.mindustry.Vars.net.client()" :
|
||||||
loc.isClient ? "io.anuke.mindustry.net.Net.client()" :
|
loc.isClient ? "io.anuke.mindustry.Vars.net.client()" :
|
||||||
loc.isServer ? "io.anuke.mindustry.net.Net.server()" : "false";
|
loc.isServer ? "io.anuke.mindustry.Vars.net.server()" : "false";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,3 +2,4 @@ io.anuke.annotations.RemoteMethodAnnotationProcessor
|
|||||||
io.anuke.annotations.SerializeAnnotationProcessor
|
io.anuke.annotations.SerializeAnnotationProcessor
|
||||||
io.anuke.annotations.StructAnnotationProcessor
|
io.anuke.annotations.StructAnnotationProcessor
|
||||||
io.anuke.annotations.CallSuperAnnotationProcessor
|
io.anuke.annotations.CallSuperAnnotationProcessor
|
||||||
|
io.anuke.annotations.AssetsAnnotationProcessor
|
||||||
90
build.gradle
@@ -8,22 +8,25 @@ buildscript{
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies{
|
dependencies{
|
||||||
classpath 'com.mobidevelop.robovm:robovm-gradle-plugin:2.3.6'
|
classpath 'com.mobidevelop.robovm:robovm-gradle-plugin:2.3.7'
|
||||||
classpath "com.badlogicgames.gdx:gdx-tools:1.9.9"
|
classpath "com.badlogicgames.gdx:gdx-tools:1.9.10"
|
||||||
classpath "com.badlogicgames.packr:packr:2.1-SNAPSHOT"
|
classpath "com.badlogicgames.packr:packr:2.1-SNAPSHOT"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
allprojects{
|
allprojects{
|
||||||
version = 'release'
|
version = 'release'
|
||||||
|
apply plugin: 'maven'
|
||||||
|
group = 'com.github.Anuken'
|
||||||
|
|
||||||
ext{
|
ext{
|
||||||
versionNumber = '4'
|
versionNumber = '4'
|
||||||
versionModifier = 'beta'
|
if(!project.hasProperty("versionModifier")) versionModifier = 'release'
|
||||||
if(!project.hasProperty("versionType")) versionType = 'official'
|
if(!project.hasProperty("versionType")) versionType = 'official'
|
||||||
appName = 'Mindustry'
|
appName = 'Mindustry'
|
||||||
gdxVersion = '1.9.9'
|
gdxVersion = '1.9.10'
|
||||||
roboVMVersion = '2.3.6'
|
roboVMVersion = '2.3.7'
|
||||||
|
steamworksVersion = '1.8.0'
|
||||||
arcHash = null
|
arcHash = null
|
||||||
|
|
||||||
debugged = {
|
debugged = {
|
||||||
@@ -31,20 +34,11 @@ allprojects{
|
|||||||
}
|
}
|
||||||
|
|
||||||
localArc = {
|
localArc = {
|
||||||
return (!project.hasProperty("release")) && new File(projectDir.parent, '../Arc').exists()
|
return !project.hasProperty("release") && new File(projectDir.parent, '../Arc').exists()
|
||||||
}
|
}
|
||||||
|
|
||||||
getArcHash = {
|
getArcHash = {
|
||||||
//get latest commit hash from github since JITPack's '-snapshot' version doesn't work correctly
|
return new Properties().with{ p -> p.load(new File((File)projectDir, 'gradle.properties').newReader()); return p }["archash"]
|
||||||
if(arcHash == null){
|
|
||||||
try{
|
|
||||||
arcHash = 'git ls-remote https://github.com/Anuken/Arc.git'.execute().text.split("\t")[0]
|
|
||||||
}catch(e){
|
|
||||||
e.printStackTrace()
|
|
||||||
arcHash = "-SNAPSHOT"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return arcHash
|
|
||||||
}
|
}
|
||||||
|
|
||||||
arcModule = { String name ->
|
arcModule = { String name ->
|
||||||
@@ -57,11 +51,36 @@ allprojects{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
generateDeployName = { String platform ->
|
||||||
|
if(platform == "windows"){
|
||||||
|
platform += "64"
|
||||||
|
}
|
||||||
|
platform = platform.capitalize()
|
||||||
|
|
||||||
|
if(platform.endsWith("64") || platform.endsWith("32")){
|
||||||
|
platform = "${platform.substring(0, platform.length() - 2)}-${platform.substring(platform.length() - 2)}bit"
|
||||||
|
}
|
||||||
|
|
||||||
|
return "[${platform}]${getModifierString()}[${getNeatVersionString()}]${appName}"
|
||||||
|
}
|
||||||
|
|
||||||
getVersionString = {
|
getVersionString = {
|
||||||
String buildVersion = getBuildVersion()
|
String buildVersion = getBuildVersion()
|
||||||
return "$versionNumber-$versionModifier-$buildVersion"
|
return "$versionNumber-$versionModifier-$buildVersion"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getNeatVersionString = {
|
||||||
|
String buildVersion = getBuildVersion()
|
||||||
|
return "v$buildVersion"
|
||||||
|
}
|
||||||
|
|
||||||
|
getModifierString = {
|
||||||
|
if(versionModifier != "release"){
|
||||||
|
return "[${versionModifier.toUpperCase()}]"
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
getBuildVersion = {
|
getBuildVersion = {
|
||||||
if(!project.hasProperty("buildversion")) return "custom build"
|
if(!project.hasProperty("buildversion")) return "custom build"
|
||||||
return project.getProperties()["buildversion"]
|
return project.getProperties()["buildversion"]
|
||||||
@@ -94,6 +113,7 @@ allprojects{
|
|||||||
props.load(new FileInputStream(pfile))
|
props.load(new FileInputStream(pfile))
|
||||||
|
|
||||||
String buildid = getBuildVersion()
|
String buildid = getBuildVersion()
|
||||||
|
println("Compiling with build: '$buildid'")
|
||||||
|
|
||||||
props["type"] = versionType
|
props["type"] = versionType
|
||||||
props["number"] = versionNumber
|
props["number"] = versionNumber
|
||||||
@@ -122,14 +142,16 @@ project(":desktop"){
|
|||||||
|
|
||||||
dependencies{
|
dependencies{
|
||||||
compile project(":core")
|
compile project(":core")
|
||||||
compile project(":net")
|
|
||||||
|
|
||||||
if(debugged()) compile project(":debug")
|
if(debugged()) compile project(":debug")
|
||||||
|
|
||||||
compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
|
compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
|
||||||
compile "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-desktop"
|
compile "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-desktop"
|
||||||
|
|
||||||
compile arcModule("backends:backend-lwjgl3")
|
compile "com.code-disaster.steamworks4j:steamworks4j:$steamworksVersion"
|
||||||
|
compile "com.code-disaster.steamworks4j:steamworks4j-server:$steamworksVersion"
|
||||||
|
|
||||||
|
compile arcModule("backends:backend-sdl")
|
||||||
compile 'com.github.MinnDevelopment:java-discord-rpc:v2.0.2'
|
compile 'com.github.MinnDevelopment:java-discord-rpc:v2.0.2'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -147,7 +169,7 @@ project(":ios"){
|
|||||||
}
|
}
|
||||||
|
|
||||||
props['app.id'] = 'io.anuke.mindustry'
|
props['app.id'] = 'io.anuke.mindustry'
|
||||||
props['app.version'] = '4.0'
|
props['app.version'] = '4.2.1'
|
||||||
props['app.mainclass'] = 'io.anuke.mindustry.IOSLauncher'
|
props['app.mainclass'] = 'io.anuke.mindustry.IOSLauncher'
|
||||||
props['app.executable'] = 'IOSLauncher'
|
props['app.executable'] = 'IOSLauncher'
|
||||||
props['app.name'] = 'Mindustry'
|
props['app.name'] = 'Mindustry'
|
||||||
@@ -157,7 +179,6 @@ project(":ios"){
|
|||||||
|
|
||||||
dependencies{
|
dependencies{
|
||||||
compile project(":core")
|
compile project(":core")
|
||||||
compile project(":net")
|
|
||||||
compileOnly project(":annotations")
|
compileOnly project(":annotations")
|
||||||
|
|
||||||
compile arcModule("backends:backend-robovm")
|
compile arcModule("backends:backend-robovm")
|
||||||
@@ -173,7 +194,9 @@ project(":core"){
|
|||||||
apply plugin: "java"
|
apply plugin: "java"
|
||||||
|
|
||||||
task preGen{
|
task preGen{
|
||||||
|
outputs.upToDateWhen{ false }
|
||||||
generateLocales()
|
generateLocales()
|
||||||
|
writeVersion()
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies{
|
dependencies{
|
||||||
@@ -204,6 +227,7 @@ project(":core"){
|
|||||||
|
|
||||||
compileJava.dependsOn(preGen)
|
compileJava.dependsOn(preGen)
|
||||||
|
|
||||||
|
compile "org.lz4:lz4-java:1.4.1"
|
||||||
compile arcModule("arc-core")
|
compile arcModule("arc-core")
|
||||||
compile arcModule("extensions:freetype")
|
compile arcModule("extensions:freetype")
|
||||||
compile arcModule("extensions:arcnet")
|
compile arcModule("extensions:arcnet")
|
||||||
@@ -219,7 +243,6 @@ project(":server"){
|
|||||||
|
|
||||||
dependencies{
|
dependencies{
|
||||||
compile project(":core")
|
compile project(":core")
|
||||||
compile project(":net")
|
|
||||||
compile arcModule("backends:backend-headless")
|
compile arcModule("backends:backend-headless")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -251,7 +274,7 @@ project(":tools"){
|
|||||||
compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
|
compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
|
||||||
compile "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-desktop"
|
compile "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-desktop"
|
||||||
|
|
||||||
compile arcModule("backends:backend-lwjgl3")
|
compile arcModule("backends:backend-sdl")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -264,12 +287,23 @@ project(":annotations"){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
project(":net"){
|
task deployAll{
|
||||||
apply plugin: "java"
|
task cleanDeployOutput{
|
||||||
|
doFirst{
|
||||||
|
if("${getBuildVersion()}" == "custom build" || "${getBuildVersion()}" == "") throw new IllegalArgumentException("----\n\nSET A BUILD NUMBER FIRST!\n\n----")
|
||||||
|
if(!project.hasProperty("release")) throw new IllegalArgumentException("----\n\nSET THE RELEASE PROJECT PROPERTY FIRST!\n\n----")
|
||||||
|
|
||||||
dependencies{
|
delete{
|
||||||
compile project(":core")
|
delete "deploy/"
|
||||||
compile "org.lz4:lz4-java:1.4.1"
|
|
||||||
compile 'com.github.Anuken:WaifUPnP:05eb46bc577fd7674596946ba288c96c0cedd893'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependsOn cleanDeployOutput
|
||||||
|
dependsOn "desktop:packrLinux64"
|
||||||
|
dependsOn "desktop:packrWindows64"
|
||||||
|
dependsOn "desktop:packrWindows32"
|
||||||
|
dependsOn "desktop:packrMacOS"
|
||||||
|
dependsOn "server:deploy"
|
||||||
|
dependsOn "android:deploy"
|
||||||
|
}
|
||||||
|
|||||||
BIN
core/assets-raw/sprites/blocks/drills/drill-top.png
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 6.1 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 2.1 KiB |
BIN
core/assets-raw/sprites/blocks/environment/sand-boulder1.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
core/assets-raw/sprites/blocks/environment/sand-boulder2.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
BIN
core/assets-raw/sprites/blocks/environment/snow-pine.png
Normal file
|
After Width: | Height: | Size: 6.5 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 206 B After Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.7 KiB |
BIN
core/assets-raw/sprites/blocks/units/command-center.png
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 312 B After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 340 B After Width: | Height: | Size: 5.8 KiB |
|
Before Width: | Height: | Size: 466 B After Width: | Height: | Size: 7.6 KiB |
|
Before Width: | Height: | Size: 409 B After Width: | Height: | Size: 6.6 KiB |
|
Before Width: | Height: | Size: 384 B After Width: | Height: | Size: 5.5 KiB |
|
Before Width: | Height: | Size: 543 B After Width: | Height: | Size: 7.3 KiB |
|
Before Width: | Height: | Size: 452 B After Width: | Height: | Size: 6.6 KiB |
|
Before Width: | Height: | Size: 429 B After Width: | Height: | Size: 5.6 KiB |
BIN
core/assets-raw/sprites/ui/button-edge-over-4.9.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
core/assets-raw/sprites/ui/button-square-down.9.png
Normal file
|
After Width: | Height: | Size: 5.6 KiB |
BIN
core/assets-raw/sprites/ui/button-square-over.9.png
Normal file
|
After Width: | Height: | Size: 6.5 KiB |
BIN
core/assets-raw/sprites/ui/button-square.9.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
core/assets-raw/sprites/ui/button-trans.9.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 5.5 KiB |
|
Before Width: | Height: | Size: 91 B After Width: | Height: | Size: 91 B |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.1 KiB |
BIN
core/assets-raw/sprites/ui/icons/icon-command-attack.png
Normal file
|
After Width: | Height: | Size: 109 B |
BIN
core/assets-raw/sprites/ui/icons/icon-command-idle.png
Normal file
|
After Width: | Height: | Size: 95 B |
BIN
core/assets-raw/sprites/ui/icons/icon-command-patrol.png
Normal file
|
After Width: | Height: | Size: 104 B |
BIN
core/assets-raw/sprites/ui/icons/icon-command-retreat.png
Normal file
|
After Width: | Height: | Size: 94 B |
BIN
core/assets-raw/sprites/ui/icons/icon-fdroid.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
core/assets-raw/sprites/ui/icons/icon-mode-attack.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
core/assets-raw/sprites/ui/icons/icon-mode-pvp.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
core/assets-raw/sprites/ui/icons/icon-mode-survival.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
core/assets-raw/sprites/ui/icons/icon-workshop.png
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
core/assets-raw/sprites/ui/nomap.png
Normal file
|
After Width: | Height: | Size: 6.7 KiB |
|
Before Width: | Height: | Size: 168 B After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 165 B After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 297 B After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 517 B After Width: | Height: | Size: 6.6 KiB |
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 426 B After Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 449 B After Width: | Height: | Size: 5.9 KiB |
|
Before Width: | Height: | Size: 422 B After Width: | Height: | Size: 5.9 KiB |
|
Before Width: | Height: | Size: 437 B After Width: | Height: | Size: 6.2 KiB |
8
core/assets-raw/sprites/zones/pack.json
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
duplicatePadding: true,
|
||||||
|
combineSubdirectories: true,
|
||||||
|
flattenPaths: true,
|
||||||
|
maxWidth: 2048,
|
||||||
|
maxHeight: 2048,
|
||||||
|
fast: true
|
||||||
|
}
|
||||||
BIN
core/assets-raw/sprites/zones/zone-craters.png
Normal file
|
After Width: | Height: | Size: 9.7 KiB |
BIN
core/assets-raw/sprites/zones/zone-desertWastes.png
Normal file
|
After Width: | Height: | Size: 38 KiB |