Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3d0b02ee23 | ||
|
|
d7cfbfe6c8 | ||
|
|
dc00e22f13 | ||
|
|
bcde481304 | ||
|
|
5b1341e488 | ||
|
|
6ad70ceee3 | ||
|
|
9c4d2f5490 | ||
|
|
6c5eff1143 | ||
|
|
a893767d0f | ||
|
|
a4f240edc8 | ||
|
|
e0a94f694b | ||
|
|
8654f25a4f | ||
|
|
e877310d85 | ||
|
|
bb59f45ba6 | ||
|
|
3d4c2a2c20 | ||
|
|
e36667cd08 | ||
|
|
cebaa6949e | ||
|
|
019e22aff2 | ||
|
|
5129e2ea73 | ||
|
|
3b63f60462 | ||
|
|
5e29115c2e | ||
|
|
0b4b30286d | ||
|
|
a01f64080d | ||
|
|
d031351bc8 | ||
|
|
1d21d36253 | ||
|
|
8d4cd72b41 | ||
|
|
46ab6d3476 | ||
|
|
3fcf3cbf93 | ||
|
|
ada912c69b | ||
|
|
e204b89eaf | ||
|
|
e903798fc2 | ||
|
|
54497c43b6 | ||
|
|
99e54cc214 | ||
|
|
56ae47cd8d | ||
|
|
0fb336cf7b | ||
|
|
469b3c0a94 | ||
|
|
d90d88c68b | ||
|
|
dcc061af3e | ||
|
|
a2960f5c50 | ||
|
|
565f8a2b4d | ||
|
|
5cb50d57ec | ||
|
|
522e19d4bf | ||
|
|
0db7a78889 | ||
|
|
1ce3b40b4e | ||
|
|
e633528a7a | ||
|
|
6570b411d1 | ||
|
|
ac9e774795 | ||
|
|
8791747453 | ||
|
|
dda3afe9fa | ||
|
|
d4435f980c | ||
|
|
f29673a6e3 | ||
|
|
9816bab151 | ||
|
|
5884c0bcb3 | ||
|
|
96dc00beac | ||
|
|
febc1e53b6 | ||
|
|
3e18fb3ca0 | ||
|
|
28b9de2e7a | ||
|
|
9a41399178 | ||
|
|
db47b9a877 | ||
|
|
7cdd7a3487 | ||
|
|
833f646903 | ||
|
|
35a85860b1 | ||
|
|
00f24dfb79 | ||
|
|
8c6ae2576d | ||
|
|
5416ad33bd | ||
|
|
1e25ba2d8e | ||
|
|
8d08d25f5b | ||
|
|
802e7b12d0 | ||
|
|
9b57550f3d | ||
|
|
28c13c8e52 | ||
|
|
d8f9059989 | ||
|
|
ac9d37d038 | ||
|
|
6323c13704 | ||
|
|
2f7f16daff | ||
|
|
9059238aee | ||
|
|
2677c0e752 | ||
|
|
ba80770564 | ||
|
|
06ad35d934 | ||
|
|
864c4f6bc3 | ||
|
|
f5f0f02abe | ||
|
|
19979dec55 | ||
|
|
926e61b7cc | ||
|
|
15378d3267 | ||
|
|
33fcfda1a0 | ||
|
|
74d7b43d0f | ||
|
|
e392c8f0e6 | ||
|
|
f60ba8587f | ||
|
|
86a7f837cd | ||
|
|
9465497481 | ||
|
|
8c3f3ac304 | ||
|
|
88ba8f6f55 | ||
|
|
c64459dbf4 | ||
|
|
8b0bbffe27 | ||
|
|
94805259d7 | ||
|
|
e796d44f92 | ||
|
|
5e8686db77 | ||
|
|
ee835f6514 | ||
|
|
5de61aaed3 | ||
|
|
6613e4ec42 | ||
|
|
206314f4f4 | ||
|
|
8f12c3f1a8 | ||
|
|
4c224d0b9c | ||
|
|
30dd089c8b | ||
|
|
8d9ec206bf | ||
|
|
8319288776 | ||
|
|
60bf36613f | ||
|
|
a75994cbbf | ||
|
|
e1f7c7b03d | ||
|
|
bb7e2c7cee | ||
|
|
69eb6469f9 | ||
|
|
d2eb3be7f8 | ||
|
|
5aa76639d1 | ||
|
|
3bf72a1af6 | ||
|
|
b745d88299 | ||
|
|
3aedc07ad0 | ||
|
|
dbb164f4be | ||
|
|
b0103d1ce3 | ||
|
|
9c532047d3 | ||
|
|
0003a58210 | ||
|
|
34f2704dc7 | ||
|
|
0ddee379ca | ||
|
|
6dcbe4fabb | ||
|
|
5dbb9fdf3f | ||
|
|
914fa3079d | ||
|
|
2e958d8d8f | ||
|
|
7a5e61fd2e | ||
|
|
6a031d8f53 | ||
|
|
dc6f01c0d3 | ||
|
|
1cc8cbe8a8 | ||
|
|
01ae8bec85 | ||
|
|
258ab87f6b | ||
|
|
8ba2db6c58 | ||
|
|
a7599e85dc | ||
|
|
28389d698e | ||
|
|
c47a220721 | ||
|
|
69f7296baa | ||
|
|
855f56bb45 | ||
|
|
a79d072aaf | ||
|
|
467047a011 | ||
|
|
0288daa39d | ||
|
|
3f075068a9 | ||
|
|
278e7027f2 | ||
|
|
9d654c1f18 | ||
|
|
279187d13b | ||
|
|
360494f971 | ||
|
|
81931eb536 | ||
|
|
a2ef11eb0f | ||
|
|
b872252771 | ||
|
|
b2c388276f | ||
|
|
178928f866 | ||
|
|
7e548f9969 | ||
|
|
a60ce3c54c | ||
|
|
0f173bcc5a | ||
|
|
64dbe8312e | ||
|
|
7f443c71ae | ||
|
|
27276c025c | ||
|
|
e9d03c179c | ||
|
|
dec01c23a9 | ||
|
|
e0eb227ce5 | ||
|
|
20021c5b31 | ||
|
|
f8d6797fc2 | ||
|
|
25051980ce | ||
|
|
fb8becca99 | ||
|
|
25bd8a7eaa | ||
|
|
bbd2424a3f | ||
|
|
83eeeed319 | ||
|
|
c92e8161a1 | ||
|
|
258555c990 | ||
|
|
0f7799422e | ||
|
|
177b565d7c | ||
|
|
a62b336b6c | ||
|
|
3ea61c8b3a | ||
|
|
4c57f9f902 | ||
|
|
6d7941fba4 | ||
|
|
020c6388c2 | ||
|
|
53d35e8c77 | ||
|
|
01f205d352 | ||
|
|
a786167b04 | ||
|
|
1699ab48e8 | ||
|
|
b15c04a532 | ||
|
|
20d3740e75 | ||
|
|
80d57f8c0c | ||
|
|
1de367e89c | ||
|
|
8850a89e30 | ||
|
|
4f72011cf7 | ||
|
|
c569232e74 | ||
|
|
14c526d0c4 | ||
|
|
5c4ac6b702 | ||
|
|
d58cc18136 | ||
|
|
36c01fde94 | ||
|
|
d4d9d59fe4 | ||
|
|
8dbd0a6130 | ||
|
|
3746344cba | ||
|
|
d07fd1bbfe | ||
|
|
02f95c0ed4 | ||
|
|
c98fcbd795 | ||
|
|
d071877963 | ||
|
|
0267cb4006 | ||
|
|
bf571e595c | ||
|
|
c0cad70212 | ||
|
|
7bd6dbb4b4 | ||
|
|
6d932e3d04 | ||
|
|
e154b5179d | ||
|
|
52110d6008 | ||
|
|
103b08fd1d | ||
|
|
cb09d10e7f | ||
|
|
a041c1e60d | ||
|
|
586b4cf4bd | ||
|
|
d0ff149cca | ||
|
|
f8ddc8325c | ||
|
|
59ec09e82c | ||
|
|
2ae5c96690 | ||
|
|
fda9e6bb9c | ||
|
|
29bcb8e07c | ||
|
|
b70de81c2d | ||
|
|
5e89b2568f | ||
|
|
ac1d8215ff | ||
|
|
fefc734bfa | ||
|
|
7f8735842c | ||
|
|
a226983470 | ||
|
|
28526d0a12 | ||
|
|
913e005bae | ||
|
|
7bd9fd5bae | ||
|
|
8986b89d67 | ||
|
|
ef936214f0 | ||
|
|
18fce6b3e3 | ||
|
|
ecda4d74ab | ||
|
|
31124037b5 | ||
|
|
aaf95e0756 | ||
|
|
804e311875 | ||
|
|
61ad9bc47d | ||
|
|
2b23b7876a | ||
|
|
547d334f43 | ||
|
|
7432dc115e | ||
|
|
905defe8ce | ||
|
|
0a8ff0cde7 | ||
|
|
bd5f44030e | ||
|
|
79abb86262 | ||
|
|
fe6f98ec5a | ||
|
|
e39a856e54 | ||
|
|
64e5f8155d | ||
|
|
8328b11f6b | ||
|
|
15778b2ca5 | ||
|
|
b7842014c1 | ||
|
|
a804053904 | ||
|
|
2aee72b47b | ||
|
|
0cb8c600b7 | ||
|
|
aa5348f37e | ||
|
|
0736574a57 | ||
|
|
d56365ce63 | ||
|
|
c82d2f856a | ||
|
|
8432677826 | ||
|
|
0c0c6e5470 | ||
|
|
57019b6e20 | ||
|
|
12ab2249b4 | ||
|
|
22d0992d38 | ||
|
|
f8def04653 | ||
|
|
6349530fc5 | ||
|
|
ad83a7dcc3 | ||
|
|
cfc2239733 | ||
|
|
91552a3a2b | ||
|
|
4e3204bc6d | ||
|
|
a94998bd02 | ||
|
|
81c78eafa6 | ||
|
|
273523480f | ||
|
|
b27fefae88 | ||
|
|
aa00a1b8d1 | ||
|
|
ba62e0eefc | ||
|
|
cb16c75e11 | ||
|
|
3efed0ace3 | ||
|
|
879fb8194f | ||
|
|
049dd89470 | ||
|
|
1f59d4354a | ||
|
|
8dea45d9d5 | ||
|
|
21ba6e257c | ||
|
|
18ebda01a4 | ||
|
|
3acb843109 | ||
|
|
1768aea66f | ||
|
|
4b61f273d5 | ||
|
|
a1dbbbdafc | ||
|
|
dcb840f290 | ||
|
|
e6c4c66199 | ||
|
|
b76cd558aa | ||
|
|
85b077b5c5 | ||
|
|
c34d6e6606 | ||
|
|
a5fd0aebe6 | ||
|
|
aaec04d04a | ||
|
|
b4272e0387 | ||
|
|
77f9d6cb1d | ||
|
|
aaa82b34e4 | ||
|
|
7a6b1129d9 | ||
|
|
1f8918c773 | ||
|
|
e9fe724e59 | ||
|
|
80001246ef | ||
|
|
50461bb7c8 | ||
|
|
c7c7cfde74 | ||
|
|
dcc29c0c48 | ||
|
|
635e299464 | ||
|
|
502c4e51ae | ||
|
|
382fdcbb40 | ||
|
|
468e092422 | ||
|
|
6904d4693f | ||
|
|
3ef7ec3be5 | ||
|
|
70257cbbfa | ||
|
|
6ef31d0ec1 | ||
|
|
d3077bec58 | ||
|
|
a1095353fc | ||
|
|
66fab1b3df | ||
|
|
569d6d4272 | ||
|
|
07c19ce085 | ||
|
|
d86dd4f80b | ||
|
|
f0f89f0894 | ||
|
|
47af2e83f7 | ||
|
|
8ec87872c8 | ||
|
|
f30ea80b42 | ||
|
|
1dd6e66167 | ||
|
|
4e681b2dd1 | ||
|
|
58be00b3ce | ||
|
|
5604ac6b6a | ||
|
|
effdaefdf3 | ||
|
|
5775fad030 | ||
|
|
eabc6d79c3 | ||
|
|
5f4ca6e383 | ||
|
|
c05020e28e | ||
|
|
5206079e23 | ||
|
|
9b01140882 | ||
|
|
4dae27da98 | ||
|
|
f0cab65a6d | ||
|
|
699a47351b | ||
|
|
af004da699 | ||
|
|
b5ad885237 | ||
|
|
07bd0fec70 | ||
|
|
318e51d736 | ||
|
|
ae90db50fe | ||
|
|
64772c195e | ||
|
|
05ead63bdc | ||
|
|
6f5c64420d | ||
|
|
d9d9a00a24 | ||
|
|
c1de67032c | ||
|
|
890d49fdd7 | ||
|
|
ba96ea5a0c | ||
|
|
b481b784bb | ||
|
|
53b6e68a85 | ||
|
|
e3d16418a0 | ||
|
|
e41f560ecd | ||
|
|
d394d9a529 | ||
|
|
a73015fa6e | ||
|
|
87846864cc | ||
|
|
f3b976bdd1 | ||
|
|
3a06e319b0 | ||
|
|
fe31c404ff | ||
|
|
cc23378758 | ||
|
|
5cac949ea8 | ||
|
|
a35e897194 | ||
|
|
8e92edeae1 | ||
|
|
f289a0a9a8 | ||
|
|
65a7e89a8c | ||
|
|
43be3259c9 | ||
|
|
54a4c95a1b | ||
|
|
ddac5cbfbc | ||
|
|
22342d01a5 | ||
|
|
7cffaeb193 | ||
|
|
2534496543 | ||
|
|
fe9b11e771 | ||
|
|
032347840f | ||
|
|
2978bc6ac5 | ||
|
|
a3b0bb323f | ||
|
|
a6246d27d9 | ||
|
|
884b649b53 | ||
|
|
92a2f770b4 | ||
|
|
e88ce078df | ||
|
|
77f0dfb9b1 | ||
|
|
78d1accf07 | ||
|
|
2ec68a7f07 | ||
|
|
bbaa2a2c92 | ||
|
|
341bb67ef4 | ||
|
|
e377cb423b | ||
|
|
81e954c258 | ||
|
|
79d41ba7ac | ||
|
|
e740e4da87 | ||
|
|
b476c47194 | ||
|
|
b2d61a93d9 | ||
|
|
a045ec9d46 | ||
|
|
1daf8d2743 | ||
|
|
295824f440 | ||
|
|
22b59e0cf6 | ||
|
|
ecabdb82e6 | ||
|
|
924b1c1a67 | ||
|
|
0454c4c25a | ||
|
|
3a3b81941b | ||
|
|
0875c29da5 | ||
|
|
0d4cf9f6c4 | ||
|
|
6a525dcf59 | ||
|
|
01f6904f82 | ||
|
|
23bd9a989b | ||
|
|
acfa02475b | ||
|
|
9dba304011 | ||
|
|
69b0020d15 | ||
|
|
ce2896cb38 | ||
|
|
68fd09c222 | ||
|
|
c832a7b93f | ||
|
|
49e19ab34d | ||
|
|
c1c82b451d | ||
|
|
ea6f88b7f6 | ||
|
|
2a6ee6d65b | ||
|
|
583342b430 | ||
|
|
7289c1080c | ||
|
|
9ed4f2b7a3 | ||
|
|
7396f91a5e | ||
|
|
ccc926d812 | ||
|
|
bd39255ead | ||
|
|
add7b1a7d9 | ||
|
|
8e471f9939 | ||
|
|
c61568ef98 | ||
|
|
3260e45e71 | ||
|
|
ea61b560b8 | ||
|
|
f8ad7d485b | ||
|
|
229e624434 | ||
|
|
7a3fb9c759 | ||
|
|
9a7ea0d28c | ||
|
|
ee5e655668 | ||
|
|
58be055f57 | ||
|
|
38e1944503 | ||
|
|
992b402e9c | ||
|
|
81bf28e4ed | ||
|
|
f10734b083 | ||
|
|
bf8f565631 | ||
|
|
9bc1ff8fa2 | ||
|
|
56239b6bbf | ||
|
|
cedd2bfe57 | ||
|
|
7e187a57d8 | ||
|
|
572a30a2c5 | ||
|
|
f3235ef7e8 | ||
|
|
7448eb32cc | ||
|
|
33e8cc4711 | ||
|
|
6cdb016c2c | ||
|
|
ababb7f5ab | ||
|
|
9f2b66e09d | ||
|
|
8de267f6a9 | ||
|
|
ecf9a3cbc9 | ||
|
|
01300b97e2 | ||
|
|
787163fb06 | ||
|
|
3701a3c3d9 | ||
|
|
68c51bb1bc | ||
|
|
df147c700c | ||
|
|
f5fc4d99dd | ||
|
|
2a4aa9e550 | ||
|
|
0a489f1117 | ||
|
|
9cc7c061a3 | ||
|
|
a1e7274ec3 | ||
|
|
51d516a39e | ||
|
|
de7c38231c | ||
|
|
c352ef9382 | ||
|
|
e36b5551e9 | ||
|
|
57856c38d6 | ||
|
|
2a8e02339b | ||
|
|
57f94ca6a2 | ||
|
|
0eaca8b80a | ||
|
|
d2dbab57dc | ||
|
|
cb448a3494 | ||
|
|
3fa6eae05b | ||
|
|
52cc7d699a | ||
|
|
ec4eac3a7d | ||
|
|
fbcfb23676 | ||
|
|
dbb2371801 | ||
|
|
4d6dc9546f | ||
|
|
06b9d328f4 | ||
|
|
48c7daa4ab | ||
|
|
3c83b88127 | ||
|
|
3a63fa5475 | ||
|
|
882790d133 | ||
|
|
bcf72b894d | ||
|
|
9f723c39ef | ||
|
|
56fc40a64d | ||
|
|
091f591ffb | ||
|
|
4d88a8206a | ||
|
|
363bf7c552 | ||
|
|
7ff4e5879d | ||
|
|
0b7decbfdd | ||
|
|
be9ea33aa4 | ||
|
|
d4b2cad94e | ||
|
|
ac039ce7cd | ||
|
|
946e60937d | ||
|
|
6f6601d270 | ||
|
|
71016f0d7c | ||
|
|
c2c2551607 | ||
|
|
d7812ec030 | ||
|
|
f184b0700f | ||
|
|
07f0be8d8d | ||
|
|
dd45b43d7f | ||
|
|
9b505106e3 | ||
|
|
d552f37daf | ||
|
|
6a7ff13859 | ||
|
|
9e3af13efc | ||
|
|
92a968217c | ||
|
|
37b9df3202 | ||
|
|
7dc33111fc | ||
|
|
ab2f260a52 | ||
|
|
1aa4b8cb88 | ||
|
|
dfed36748c | ||
|
|
d35f736548 | ||
|
|
cfecdae970 | ||
|
|
59ade6cf09 | ||
|
|
642842888a | ||
|
|
3ae51edf3a | ||
|
|
d8ccb81015 | ||
|
|
0db6020231 | ||
|
|
738c0a5c9c | ||
|
|
a2f7d3e241 | ||
|
|
9b86ded164 | ||
|
|
6cbb645b10 | ||
|
|
066a1d7591 | ||
|
|
5f82d575ee | ||
|
|
302ae0a83c | ||
|
|
82c4c791cc | ||
|
|
3c0310120d | ||
|
|
21c106e9d5 | ||
|
|
2c8cd2f8dc | ||
|
|
380d9908b4 | ||
|
|
6abef7d645 | ||
|
|
98ac25ac29 | ||
|
|
93bec04c92 | ||
|
|
136559cddd | ||
|
|
3f63a6ed70 | ||
|
|
2fcb3c4420 | ||
|
|
baaeb229cf | ||
|
|
a3bda3a941 | ||
|
|
3d536aa28d | ||
|
|
454267455b | ||
|
|
8e9adeb4b4 | ||
|
|
1f18e7beed | ||
|
|
b5e8e54107 | ||
|
|
f41e426b69 | ||
|
|
6375862a71 | ||
|
|
be2a745d78 | ||
|
|
d89feb2c75 | ||
|
|
b4a20c8fcb | ||
|
|
73087a92f4 | ||
|
|
2b58bd5bd8 | ||
|
|
bce0101278 | ||
|
|
bba418c79d | ||
|
|
cb58eb82fc | ||
|
|
3aafffabc1 | ||
|
|
66b9cdf64c | ||
|
|
d31fbf3b6f | ||
|
|
dbee30a412 | ||
|
|
f3cc881930 | ||
|
|
3d9c9e639d | ||
|
|
d6969d2c74 | ||
|
|
b7e28a73ba | ||
|
|
1e8206757d | ||
|
|
a0e94577fc | ||
|
|
a2a0c2f791 | ||
|
|
63a0fde121 | ||
|
|
c06152de07 | ||
|
|
0b3ccbda20 | ||
|
|
97b7eb0768 | ||
|
|
b712301804 | ||
|
|
76ebe3ff41 | ||
|
|
d988bb1821 | ||
|
|
64f1fbe400 | ||
|
|
c2c837329c | ||
|
|
b6531efe08 | ||
|
|
2c97a4aefe | ||
|
|
f0ffebd58c | ||
|
|
05e407f064 | ||
|
|
6dd2eec1b6 | ||
|
|
df13436688 | ||
|
|
fa0d89b6df | ||
|
|
ab0f8defa4 | ||
|
|
6b3329845b | ||
|
|
fc07c5efa6 | ||
|
|
23188df276 | ||
|
|
5e66dfcc36 | ||
|
|
bc36c57f9f | ||
|
|
5efa7d551e | ||
|
|
8c6cda0d97 | ||
|
|
4fa165bc6a | ||
|
|
da6695ceee | ||
|
|
1043a5bb0d | ||
|
|
c7625278b5 | ||
|
|
b9ef88951e | ||
|
|
14fe35bba0 | ||
|
|
4a32706c5a | ||
|
|
cc92edfa58 | ||
|
|
071d0fbbf7 | ||
|
|
6ff44fddd0 | ||
|
|
8760e99c43 | ||
|
|
423f5f16bb | ||
|
|
1c8c702afd | ||
|
|
d2a739262d | ||
|
|
76d0285e3f | ||
|
|
cb9d3414f2 | ||
|
|
12f444750c | ||
|
|
5fdf7e3a12 | ||
|
|
60deb9205b | ||
|
|
677526cb16 | ||
|
|
359a392cca | ||
|
|
4d600f973a | ||
|
|
4a626bc920 | ||
|
|
3597860074 | ||
|
|
68d2c30c38 | ||
|
|
e210d9c08e | ||
|
|
c9b77e4e23 | ||
|
|
08690b9d9e | ||
|
|
d3eb9c9d99 | ||
|
|
a0ef3a0e44 | ||
|
|
87c5ad79f4 | ||
|
|
2e210e7adc | ||
|
|
c56f4783c0 | ||
|
|
a1d351aa37 |
@@ -2,6 +2,8 @@
|
||||
|
||||
/core/assets/mindustry-saves/
|
||||
/core/assets/mindustry-maps/
|
||||
/core/assets/bundles/output/
|
||||
/core/assets/.gifimages/
|
||||
/deploy/
|
||||
/desktop/packr-out/
|
||||
/desktop/packr-export/
|
||||
@@ -19,6 +21,8 @@
|
||||
/android/assets/mindustry-saves/
|
||||
/core/assets/gifexport/
|
||||
/core/assets/version.properties
|
||||
/core/assets/locales.json
|
||||
/ios/src/io/anuke/mindustry/gen/
|
||||
*.gif
|
||||
|
||||
version.properties
|
||||
|
||||
@@ -5,13 +5,14 @@ jdk:
|
||||
|
||||
android:
|
||||
components:
|
||||
- android-26
|
||||
- android-27
|
||||
|
||||
# Additional components
|
||||
- extra-google-google_play_services
|
||||
- extra-google-m2repository
|
||||
- extra-android-m2repository
|
||||
- addon-google_apis-google-26
|
||||
- addon-google_apis-google-27
|
||||
- build-tools-27.0.3
|
||||
|
||||
script:
|
||||
- ./gradlew desktop:dist
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||

|
||||
|
||||
[](https://travis-ci.org/Anuken/Mindustry)
|
||||
[](https://waffle.io/Anuken/Mindustry)
|
||||
|
||||
\
|
||||
A pixelated sandbox tower defense game made using [LibGDX](https://libgdx.badlogicgames.com/). Winner of the [GDL Metal Monstrosity Jam](https://itch.io/jam/gdl---metal-monstrosity-jam).
|
||||
|
||||
_[Issue tracker](https://waffle.io/Anuken/Mindustry)_
|
||||
_[Trello Board](https://trello.com/b/aE2tcUwF/mindustry-40-plans)_
|
||||
_[Wiki](http://mindustry.wikia.com/wiki/Mindustry_Wiki)_
|
||||
_[Discord](https://discord.gg/r8BkXNd)_
|
||||
@@ -32,7 +30,7 @@ _Building:_ `./gradlew desktop:dist`
|
||||
---
|
||||
|
||||
Gradle may take up to several minutes to download files. Be patient. <br>
|
||||
After building, the output .JAR file should be in 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.`
|
||||
|
||||
### Downloads
|
||||
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
## 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/).
|
||||
|
||||
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,
|
||||
head over to the translation bundle folder and check the [list of bundles](https://github.com/Anuken/Mindustry/tree/master/core/assets/bundles) that have already been created.
|
||||
You're looking for a file called "`bundle_`(insert locale code here)`.properties`". If you don't find one, create one manually (more info below).
|
||||
|
||||
#### Editing an existing translation
|
||||
|
||||
If a translation bundle already exists, that means someone has already started working on a translation. To edit it or translate text, simply click the file and press the edit (pencil) button in the top right. Once you're done editing, press the green "propose file change" button at the bottom, then "create pull request" (twice).
|
||||
Once this is done, all you need to do is wait for me to approve your changes.
|
||||
|
||||
#### Creating a new translation bundle
|
||||
|
||||
If a translation bundle for your language *doesn't* exist, you need to create one yourself.
|
||||
In the folder with all the bundles in it, click the *'create new file'* button, and name it `bundle_(locale code here).properties`.
|
||||
Then, copy-paste the entire contents of the [English translation bundle](https://raw.githubusercontent.com/Anuken/Mindustry/master/core/assets/bundles/bundle.properties) into the file, and translate all the necessary text to your language.
|
||||
Once you are done, press the *propose new file* button at the bottom, then 'create pull request' twice.
|
||||
|
||||
#### Useful Information
|
||||
|
||||
- When you see text surrounded by square brackets, such as `[RED]`, `[]` or `[accent]`, this indicates a color code. Don't translate it.
|
||||
- `{0}` means an argument that will be replaced when the text is displayed. For example, `Wave: {0}` will replace the `{0}` with whatever wave you are in.
|
||||
- Empty lines are fine, and it doesn't matter in what order you place the text.
|
||||
- `\n` means "new line". If you want to split text into multiple lines, use `\n` to do it.
|
||||
|
||||
#### Testing your translation bundle
|
||||
|
||||
There are two ways to test the translation bundle:
|
||||
1) Assuming you have the PC version downloaded, download your bundle file, name it `bundle.properties`, then place it in the same folder as the Mindustry desktop executable and run it. *You should get a popup message in-game confirming that you have loaded an external translation.*
|
||||
2) For advanced users: simply download your fork of mindustry and compile/run the game.
|
||||
|
||||
**And that's it.**
|
||||
|
||||
*(...of course, that's never really it. Bother me on Discord when something inevitably goes wrong.)*
|
||||
@@ -20,8 +20,8 @@
|
||||
<activity
|
||||
android:name="io.anuke.mindustry.AndroidLauncher"
|
||||
android:label="@string/app_name"
|
||||
android:screenOrientation="sensor"
|
||||
android:configChanges="keyboard|keyboardHidden|orientation|screenSize">
|
||||
android:screenOrientation="user"
|
||||
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|screenLayout">
|
||||
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
@@ -24,7 +24,6 @@ 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-ai:$aiVersion"
|
||||
implementation "com.badlogicgames.gdx:gdx-controllers-android:$gdxVersion"
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ import android.provider.Settings.Secure;
|
||||
import android.telephony.TelephonyManager;
|
||||
import android.util.Log;
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.backends.android.AndroidApplication;
|
||||
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration;
|
||||
import com.badlogic.gdx.files.FileHandle;
|
||||
import com.badlogic.gdx.utils.Base64Coder;
|
||||
@@ -25,8 +24,8 @@ 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.io.Saves.SaveSlot;
|
||||
import io.anuke.mindustry.net.Net;
|
||||
import io.anuke.mindustry.ui.dialogs.FileChooser;
|
||||
import io.anuke.ucore.function.Consumer;
|
||||
@@ -48,238 +47,206 @@ import java.util.Locale;
|
||||
|
||||
import static io.anuke.mindustry.Vars.*;
|
||||
|
||||
public class AndroidLauncher extends AndroidApplication{
|
||||
public static final int PERMISSION_REQUEST_CODE = 1;
|
||||
public class AndroidLauncher extends PatchedAndroidApplication{
|
||||
public static final int PERMISSION_REQUEST_CODE = 1;
|
||||
boolean doubleScaleTablets = true;
|
||||
FileChooser chooser;
|
||||
|
||||
boolean doubleScaleTablets = true;
|
||||
FileChooser chooser;
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState){
|
||||
super.onCreate(savedInstanceState);
|
||||
AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
|
||||
config.useImmersiveMode = true;
|
||||
Platform.instance = new Platform(){
|
||||
DateFormat format = SimpleDateFormat.getDateTimeInstance();
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState){
|
||||
super.onCreate(savedInstanceState);
|
||||
@Override
|
||||
public String format(Date date){
|
||||
return format.format(date);
|
||||
}
|
||||
|
||||
AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
|
||||
config.useImmersiveMode = true;
|
||||
@Override
|
||||
public String format(int number){
|
||||
return NumberFormat.getIntegerInstance().format(number);
|
||||
}
|
||||
|
||||
Platform.instance = new Platform(){
|
||||
DateFormat format = SimpleDateFormat.getDateTimeInstance();
|
||||
@Override
|
||||
public void addDialog(TextField field, int length){
|
||||
TextFieldDialogListener.add(field, 0, length);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasDiscord() {
|
||||
return isPackageInstalled("com.discord");
|
||||
}
|
||||
@Override
|
||||
public String getLocaleName(Locale locale){
|
||||
return locale.getDisplayName(locale);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String format(Date date){
|
||||
return format.format(date);
|
||||
}
|
||||
@Override
|
||||
public void openDonations(){
|
||||
showDonations();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String format(int number){
|
||||
return NumberFormat.getIntegerInstance().format(number);
|
||||
}
|
||||
@Override
|
||||
public ThreadProvider getThreadProvider(){
|
||||
return new DefaultThreadImpl();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addDialog(TextField field, int length){
|
||||
TextFieldDialogListener.add(field, 0, length);
|
||||
}
|
||||
@Override
|
||||
public boolean isDebug(){
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLocaleName(Locale locale){
|
||||
return locale.getDisplayName(locale);
|
||||
}
|
||||
@Override
|
||||
public String getUUID(){
|
||||
try{
|
||||
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){
|
||||
data[i / 2] = (byte) ((Character.digit(s.charAt(i), 16) << 4)
|
||||
+ Character.digit(s.charAt(i + 1), 16));
|
||||
}
|
||||
String result = new String(Base64Coder.encode(data));
|
||||
if(result.equals("AAAAAAAAAOA=")) throw new RuntimeException("Bad UUID.");
|
||||
return result;
|
||||
}catch(Exception e){
|
||||
return super.getUUID();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openDonations() {
|
||||
showDonations();
|
||||
}
|
||||
@Override
|
||||
public void shareFile(FileHandle file){
|
||||
}
|
||||
|
||||
@Override
|
||||
public ThreadProvider getThreadProvider() {
|
||||
return new DefaultThreadImpl();
|
||||
}
|
||||
@Override
|
||||
public void showFileChooser(String text, String content, Consumer<FileHandle> cons, boolean open, String filetype){
|
||||
chooser = new FileChooser(text, file -> file.extension().equalsIgnoreCase(filetype), open, cons);
|
||||
if(Build.VERSION.SDK_INT < Build.VERSION_CODES.M || (checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED &&
|
||||
checkSelfPermission(Manifest.permission.READ_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED)){
|
||||
chooser.show();
|
||||
chooser = null;
|
||||
}else{
|
||||
ArrayList<String> perms = new ArrayList<>();
|
||||
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[perms.size()]), PERMISSION_REQUEST_CODE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDebug() {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public void beginForceLandscape(){
|
||||
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUUID() {
|
||||
try {
|
||||
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) {
|
||||
data[i / 2] = (byte) ((Character.digit(s.charAt(i), 16) << 4)
|
||||
+ Character.digit(s.charAt(i + 1), 16));
|
||||
}
|
||||
|
||||
String result = new String(Base64Coder.encode(data));
|
||||
|
||||
if(result.equals("AAAAAAAAAOA=")) throw new RuntimeException("Bad UUID.");
|
||||
|
||||
return result;
|
||||
}catch (Exception e){
|
||||
return super.getUUID();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void shareFile(FileHandle file){
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showFileChooser(String text, String content, Consumer<FileHandle> cons, boolean open, String filetype) {
|
||||
chooser = new FileChooser(text, file -> file.extension().equalsIgnoreCase(filetype), open, cons);
|
||||
|
||||
if(Build.VERSION.SDK_INT < Build.VERSION_CODES.M || (checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED &&
|
||||
checkSelfPermission(Manifest.permission.READ_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED)){
|
||||
chooser.show();
|
||||
chooser = null;
|
||||
}else {
|
||||
ArrayList<String> perms = new ArrayList<>();
|
||||
|
||||
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[perms.size()]), PERMISSION_REQUEST_CODE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beginForceLandscape() {
|
||||
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endForceLandscape() {
|
||||
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDonate(){
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
try {
|
||||
ProviderInstaller.installIfNeeded(this);
|
||||
} catch (GooglePlayServicesRepairableException e) {
|
||||
GoogleApiAvailability apiAvailability = GoogleApiAvailability.getInstance();
|
||||
apiAvailability.getErrorDialog(this, e.getConnectionStatusCode(), 0).show();
|
||||
} catch (GooglePlayServicesNotAvailableException e) {
|
||||
Log.e("SecurityException", "Google Play Services not available.");
|
||||
}
|
||||
|
||||
if(doubleScaleTablets && isTablet(this.getContext())){
|
||||
Unit.dp.addition = 0.5f;
|
||||
}
|
||||
|
||||
config.hideStatusBar = true;
|
||||
@Override
|
||||
public void endForceLandscape(){
|
||||
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDonate(){
|
||||
return true;
|
||||
}
|
||||
};
|
||||
try{
|
||||
ProviderInstaller.installIfNeeded(this);
|
||||
}catch(GooglePlayServicesRepairableException e){
|
||||
GoogleApiAvailability apiAvailability = GoogleApiAvailability.getInstance();
|
||||
apiAvailability.getErrorDialog(this, e.getConnectionStatusCode(), 0).show();
|
||||
}catch(GooglePlayServicesNotAvailableException e){
|
||||
Log.e("SecurityException", "Google Play Services not available.");
|
||||
}
|
||||
if(doubleScaleTablets && isTablet(this.getContext())){
|
||||
Unit.dp.addition = 0.5f;
|
||||
}
|
||||
config.hideStatusBar = true;
|
||||
Net.setClientProvider(new KryoClient());
|
||||
Net.setServerProvider(new KryoServer());
|
||||
|
||||
initialize(new Mindustry(), config);
|
||||
checkFiles(getIntent());
|
||||
}
|
||||
|
||||
checkFiles(getIntent());
|
||||
}
|
||||
@Override
|
||||
public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults){
|
||||
if(requestCode == PERMISSION_REQUEST_CODE){
|
||||
for(int i : grantResults){
|
||||
if(i != PackageManager.PERMISSION_GRANTED) return;
|
||||
}
|
||||
if(chooser != null){
|
||||
chooser.show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) {
|
||||
if(requestCode == PERMISSION_REQUEST_CODE){
|
||||
for(int i : grantResults){
|
||||
if(i != PackageManager.PERMISSION_GRANTED) return;
|
||||
}
|
||||
private void checkFiles(Intent intent){
|
||||
try{
|
||||
Uri uri = intent.getData();
|
||||
if(uri != null){
|
||||
File myFile = null;
|
||||
String scheme = uri.getScheme();
|
||||
if(scheme.equals("file")){
|
||||
String fileName = uri.getEncodedPath();
|
||||
myFile = new File(fileName);
|
||||
}else if(!scheme.equals("content")){
|
||||
//error
|
||||
return;
|
||||
}
|
||||
boolean save = uri.getPath().endsWith(saveExtension);
|
||||
boolean map = uri.getPath().endsWith(mapExtension);
|
||||
InputStream inStream;
|
||||
if(myFile != null) inStream = new FileInputStream(myFile);
|
||||
else inStream = getContentResolver().openInputStream(uri);
|
||||
Gdx.app.postRunnable(() -> {
|
||||
if(save){ //open save
|
||||
System.out.println("Opening save.");
|
||||
FileHandle file = Gdx.files.local("temp-save." + saveExtension);
|
||||
file.write(inStream, false);
|
||||
if(SaveIO.isSaveValid(file)){
|
||||
try{
|
||||
SaveSlot slot = control.getSaves().importSave(file);
|
||||
ui.load.runLoadSave(slot);
|
||||
}catch(IOException e){
|
||||
ui.showError(Bundles.format("text.save.import.fail", Strings.parseException(e, false)));
|
||||
}
|
||||
}else{
|
||||
ui.showError("$text.save.import.invalid");
|
||||
}
|
||||
}else if(map){ //open map
|
||||
Gdx.app.postRunnable(() -> {
|
||||
System.out.println("Opening map.");
|
||||
if(!ui.editor.isShown()){
|
||||
ui.editor.show();
|
||||
}
|
||||
ui.editor.beginEditMap(inStream);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}catch(IOException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
if(chooser != null){
|
||||
chooser.show();
|
||||
}
|
||||
}
|
||||
}
|
||||
private boolean isPackageInstalled(String packagename){
|
||||
try{
|
||||
getPackageManager().getPackageInfo(packagename, 0);
|
||||
return true;
|
||||
}catch(Exception e){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private void checkFiles(Intent intent){
|
||||
try {
|
||||
Uri uri = intent.getData();
|
||||
if (uri != null) {
|
||||
File myFile = null;
|
||||
String scheme = uri.getScheme();
|
||||
if (scheme.equals("file")) {
|
||||
String fileName = uri.getEncodedPath();
|
||||
myFile = new File(fileName);
|
||||
} else if (!scheme.equals("content")) {
|
||||
//error
|
||||
return;
|
||||
}
|
||||
private boolean isTablet(Context context){
|
||||
TelephonyManager manager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
|
||||
return manager.getPhoneType() == TelephonyManager.PHONE_TYPE_NONE;
|
||||
}
|
||||
|
||||
boolean save = uri.getPath().endsWith(saveExtension);
|
||||
boolean map = uri.getPath().endsWith(mapExtension);
|
||||
|
||||
InputStream inStream;
|
||||
if (myFile != null) inStream = new FileInputStream(myFile);
|
||||
else inStream = getContentResolver().openInputStream(uri);
|
||||
|
||||
Gdx.app.postRunnable(() -> {
|
||||
|
||||
if(save){ //open save
|
||||
System.out.println("Opening save.");
|
||||
FileHandle file = Gdx.files.local("temp-save." + saveExtension);
|
||||
file.write(inStream, false);
|
||||
|
||||
if(SaveIO.isSaveValid(file)){
|
||||
try{
|
||||
SaveSlot slot = control.getSaves().importSave(file);
|
||||
ui.load.runLoadSave(slot);
|
||||
}catch (IOException e){
|
||||
ui.showError(Bundles.format("text.save.import.fail", Strings.parseException(e, false)));
|
||||
}
|
||||
}else{
|
||||
ui.showError("$text.save.import.invalid");
|
||||
}
|
||||
|
||||
}else if(map){ //open map
|
||||
Gdx.app.postRunnable(() -> {
|
||||
System.out.println("Opening map.");
|
||||
if (!ui.editor.isShown()) {
|
||||
ui.editor.show();
|
||||
}
|
||||
|
||||
ui.editor.beginEditMap(inStream);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}catch (IOException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isPackageInstalled(String packagename) {
|
||||
try {
|
||||
getPackageManager().getPackageInfo(packagename, 0);
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isTablet(Context context) {
|
||||
TelephonyManager manager = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
|
||||
return manager.getPhoneType() == TelephonyManager.PHONE_TYPE_NONE;
|
||||
}
|
||||
|
||||
private void showDonations(){
|
||||
Intent intent = new Intent(this, DonationsActivity.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
private void showDonations(){
|
||||
Intent intent = new Intent(this, DonationsActivity.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,20 +11,20 @@ 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;
|
||||
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(){
|
||||
this.activity = (Activity) Gdx.app;
|
||||
load();
|
||||
}
|
||||
|
||||
public AndroidTextFieldDialog show() {
|
||||
public AndroidTextFieldDialog show(){
|
||||
|
||||
activity.runOnUiThread(() -> {
|
||||
activity.runOnUiThread(() -> {
|
||||
AlertDialog dialog = builder.create();
|
||||
|
||||
dialog.getWindow().setSoftInputMode(LayoutParams.SOFT_INPUT_STATE_VISIBLE);
|
||||
@@ -33,12 +33,12 @@ public class AndroidTextFieldDialog{
|
||||
|
||||
});
|
||||
|
||||
return this;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
private AndroidTextFieldDialog load() {
|
||||
private AndroidTextFieldDialog load(){
|
||||
|
||||
activity.runOnUiThread(() -> {
|
||||
activity.runOnUiThread(() -> {
|
||||
|
||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(activity);
|
||||
LayoutInflater li = LayoutInflater.from(activity);
|
||||
@@ -55,64 +55,65 @@ public class AndroidTextFieldDialog{
|
||||
isBuild = true;
|
||||
});
|
||||
|
||||
// Wait till TextPrompt is built.
|
||||
while (!isBuild) {
|
||||
try {
|
||||
Thread.sleep(10);
|
||||
} catch (InterruptedException e) { }
|
||||
}
|
||||
// Wait till TextPrompt is built.
|
||||
while(!isBuild){
|
||||
try{
|
||||
Thread.sleep(10);
|
||||
}catch(InterruptedException e){
|
||||
}
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
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 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 setText(CharSequence value){
|
||||
userInput.append(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public AndroidTextFieldDialog setCancelButtonLabel(CharSequence label) {
|
||||
builder.setNegativeButton(label, (dialog, id) -> dialog.cancel());
|
||||
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()) {
|
||||
public AndroidTextFieldDialog setConfirmButtonLabel(CharSequence label){
|
||||
builder.setPositiveButton(label, (dialog, id) -> {
|
||||
if(listener != null && !userInput.getText().toString().isEmpty()){
|
||||
listener.confirm(userInput.getText().toString());
|
||||
}
|
||||
|
||||
});
|
||||
return this;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public AndroidTextFieldDialog setTextPromptListener(TextPromptListener listener) {
|
||||
this.listener = listener;
|
||||
return this;
|
||||
}
|
||||
public AndroidTextFieldDialog setTextPromptListener(TextPromptListener listener){
|
||||
this.listener = listener;
|
||||
return this;
|
||||
}
|
||||
|
||||
public AndroidTextFieldDialog setInputType(int type) {
|
||||
userInput.setInputType(type);
|
||||
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);
|
||||
}
|
||||
public AndroidTextFieldDialog setMaxLength(int length){
|
||||
userInput.setFilters(new InputFilter[]{new InputFilter.LengthFilter(length)});
|
||||
return this;
|
||||
}
|
||||
|
||||
public interface TextPromptListener{
|
||||
void confirm(String text);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,12 +8,9 @@ import android.support.v4.app.FragmentManager;
|
||||
import android.support.v4.app.FragmentTransaction;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
|
||||
import org.sufficientlysecure.donations.DonationsFragment;
|
||||
|
||||
public class DonationsActivity extends FragmentActivity {
|
||||
DonationsFragment donationsFragment;
|
||||
|
||||
public class DonationsActivity extends FragmentActivity{
|
||||
/**
|
||||
* Google
|
||||
*/
|
||||
@@ -21,13 +18,14 @@ public class DonationsActivity extends FragmentActivity {
|
||||
private static final String[] GOOGLE_CATALOG = new String[]{
|
||||
"mindustry.donation.1", "mindustry.donation.2", "mindustry.donation.5",
|
||||
"mindustry.donation.10", "mindustry.donation.15",
|
||||
"mindustry.donation.25", "mindustry.donation.50" };
|
||||
"mindustry.donation.25", "mindustry.donation.50"};
|
||||
DonationsFragment donationsFragment;
|
||||
|
||||
/**
|
||||
* Called when the activity is first created.
|
||||
*/
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
public void onCreate(Bundle savedInstanceState){
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
setTheme(R.style.GdxTheme);
|
||||
@@ -35,7 +33,7 @@ public class DonationsActivity extends FragmentActivity {
|
||||
setContentView(R.layout.donations_activity);
|
||||
|
||||
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
|
||||
if (BuildConfig.DONATIONS_GOOGLE) {
|
||||
if(BuildConfig.DONATIONS_GOOGLE){
|
||||
donationsFragment = DonationsFragment.newInstance(BuildConfig.DEBUG, true, GOOGLE_PUBKEY, GOOGLE_CATALOG,
|
||||
getResources().getStringArray(R.array.donation_google_catalog_values), false, null, null,
|
||||
null, false, null, null, false, null);
|
||||
@@ -48,9 +46,10 @@ public class DonationsActivity extends FragmentActivity {
|
||||
|
||||
public void onStart(){
|
||||
super.onStart();
|
||||
Button b = ((Button)findViewById(org.sufficientlysecure.donations.R.id.donations__google_android_market_donate_button));
|
||||
b.setOnClickListener(new View.OnClickListener() {
|
||||
@Override public void onClick(View view) {
|
||||
Button b = ((Button) findViewById(org.sufficientlysecure.donations.R.id.donations__google_android_market_donate_button));
|
||||
b.setOnClickListener(new View.OnClickListener(){
|
||||
@Override
|
||||
public void onClick(View view){
|
||||
donationsFragment.donateGoogleOnClick(donationsFragment.getView());
|
||||
b.setEnabled(false);
|
||||
}
|
||||
@@ -58,20 +57,19 @@ public class DonationsActivity extends FragmentActivity {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Needed for Google Play In-app Billing. It uses startIntentSenderForResult(). The result is not propagated to
|
||||
* the Fragment like in startActivityForResult(). Thus we need to propagate manually to our Fragment.
|
||||
*/
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data){
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
Button b = ((Button)findViewById(org.sufficientlysecure.donations.R.id.donations__google_android_market_donate_button));
|
||||
Button b = ((Button) findViewById(org.sufficientlysecure.donations.R.id.donations__google_android_market_donate_button));
|
||||
b.setEnabled(true);
|
||||
|
||||
FragmentManager fragmentManager = getSupportFragmentManager();
|
||||
Fragment fragment = fragmentManager.findFragmentByTag("donationsFragment");
|
||||
if (fragment != null) {
|
||||
if(fragment != null){
|
||||
fragment.onActivityResult(requestCode, resultCode, data);
|
||||
//TODO donation event, set settings?
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package io.anuke.mindustry;
|
||||
|
||||
import com.badlogic.gdx.backends.android.AndroidApplication;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
public class PatchedAndroidApplication extends AndroidApplication {
|
||||
private final ExecutorService exec = Executors.newSingleThreadExecutor();
|
||||
|
||||
@Override
|
||||
protected void onPause () {
|
||||
if(useImmersiveMode) {
|
||||
exec.submit(() -> {
|
||||
try {Thread.sleep(100);} catch (InterruptedException ignored) {}
|
||||
graphics.onDrawFrame(null);
|
||||
});
|
||||
}
|
||||
super.onPause();
|
||||
}
|
||||
}
|
||||
@@ -11,57 +11,57 @@ 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;
|
||||
private TextField field;
|
||||
private int type;
|
||||
private int 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;
|
||||
}
|
||||
});
|
||||
}
|
||||
//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){
|
||||
add(field, 0, 16);
|
||||
}
|
||||
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;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//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){
|
||||
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();
|
||||
public void clicked(final InputEvent event, float x, float y){
|
||||
|
||||
dialog.setTextPromptListener(text -> {
|
||||
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);
|
||||
}
|
||||
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();
|
||||
dialog.setConfirmButtonLabel("OK").setText(field.getText());
|
||||
dialog.setCancelButtonLabel("Cancel");
|
||||
dialog.setMaxLength(max);
|
||||
dialog.show();
|
||||
event.cancel();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,59 +9,31 @@ import java.lang.annotation.Target;
|
||||
* Goal: To create a system to send events to the server from the client and vice versa, without creating a new packet type each time.<br>
|
||||
* These events may optionally also trigger on the caller client/server as well.<br>
|
||||
*/
|
||||
public class Annotations {
|
||||
public class Annotations{
|
||||
|
||||
/**Marks a method as invokable remotely across a server/client connection.*/
|
||||
@Target(ElementType.METHOD)
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
public @interface Remote {
|
||||
/**Specifies the locations from which this method can be invoked.*/
|
||||
Loc targets() default Loc.server;
|
||||
/**Specifies which methods are generated. Only affects server-to-client methods.*/
|
||||
Variant variants() default Variant.all;
|
||||
/**The local locations where this method is called locally, when invoked.*/
|
||||
Loc called() default Loc.none;
|
||||
/**Whether to forward this packet to all other clients upon recieval. Server only.*/
|
||||
boolean forward() default false;
|
||||
/**Whether the packet for this method is sent with UDP instead of TCP.
|
||||
* UDP is faster, but is prone to packet loss and duplication.*/
|
||||
boolean unreliable() default false;
|
||||
/**The simple class name where this method is placed.*/
|
||||
String in() default "Call";
|
||||
public enum PacketPriority{
|
||||
/** Gets put in a queue and processed if not connected. */
|
||||
normal,
|
||||
/** Gets handled immediately, regardless of connection status. */
|
||||
high,
|
||||
/** Does not get handled unless client is connected. */
|
||||
low
|
||||
}
|
||||
|
||||
/**Specifies that this method will be used to write classes of the type returned by {@link #value()}.<br>
|
||||
* This method must return void and have two parameters, the first being of type {@link java.nio.ByteBuffer} and the second
|
||||
* being the type returned by {@link #value()}.*/
|
||||
@Target(ElementType.METHOD)
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
public @interface WriteClass {
|
||||
Class<?> value();
|
||||
}
|
||||
|
||||
/**Specifies that this method will be used to read classes of the type returned by {@link #value()}. <br>
|
||||
* This method must return the type returned by {@link #value()},
|
||||
* and have one parameter, being of type {@link java.nio.ByteBuffer}.*/
|
||||
@Target(ElementType.METHOD)
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
public @interface ReadClass {
|
||||
Class<?> value();
|
||||
}
|
||||
|
||||
/**A set of two booleans, one specifying server and one specifying client.*/
|
||||
public enum Loc {
|
||||
/**Method can only be invoked on the client from the server.*/
|
||||
/** A set of two booleans, one specifying server and one specifying client. */
|
||||
public enum Loc{
|
||||
/** Method can only be invoked on the client from the server. */
|
||||
server(true, false),
|
||||
/**Method can only be invoked on the server from the client.*/
|
||||
/** Method can only be invoked on the server from the client. */
|
||||
client(false, true),
|
||||
/**Method can be invoked from anywhere*/
|
||||
/** Method can be invoked from anywhere */
|
||||
both(true, true),
|
||||
/**Neither server no client.*/
|
||||
/** Neither server nor client. */
|
||||
none(false, false);
|
||||
|
||||
/**If true, this method can be invoked ON clients FROM servers.*/
|
||||
/** If true, this method can be invoked ON clients FROM servers. */
|
||||
public final boolean isServer;
|
||||
/**If true, this method can be invoked ON servers FROM clients.*/
|
||||
/** If true, this method can be invoked ON servers FROM clients. */
|
||||
public final boolean isClient;
|
||||
|
||||
Loc(boolean server, boolean client){
|
||||
@@ -70,12 +42,12 @@ public class Annotations {
|
||||
}
|
||||
}
|
||||
|
||||
public enum Variant {
|
||||
/**Method can only be invoked targeting one player.*/
|
||||
public enum Variant{
|
||||
/** Method can only be invoked targeting one player. */
|
||||
one(true, false),
|
||||
/**Method can only be invoked targeting all players.*/
|
||||
/** Method can only be invoked targeting all players. */
|
||||
all(false, true),
|
||||
/**Method targets both one player and all players.*/
|
||||
/** Method targets both one player and all players. */
|
||||
both(true, true);
|
||||
|
||||
public final boolean isOne, isAll;
|
||||
@@ -85,4 +57,52 @@ public class Annotations {
|
||||
this.isAll = isAll;
|
||||
}
|
||||
}
|
||||
|
||||
/** Marks a method as invokable remotely across a server/client connection. */
|
||||
@Target(ElementType.METHOD)
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
public @interface Remote{
|
||||
/** Specifies the locations from which this method can be invoked. */
|
||||
Loc targets() default Loc.server;
|
||||
|
||||
/** Specifies which methods are generated. Only affects server-to-client methods. */
|
||||
Variant variants() default Variant.all;
|
||||
|
||||
/** The local locations where this method is called locally, when invoked. */
|
||||
Loc called() default Loc.none;
|
||||
|
||||
/** Whether to forward this packet to all other clients upon recieval. Client only. */
|
||||
boolean forward() default false;
|
||||
|
||||
/**
|
||||
* Whether the packet for this method is sent with UDP instead of TCP.
|
||||
* UDP is faster, but is prone to packet loss and duplication.
|
||||
*/
|
||||
boolean unreliable() default false;
|
||||
|
||||
/** Priority of this event. */
|
||||
PacketPriority priority() default PacketPriority.normal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies that this method will be used to write classes of the type returned by {@link #value()}.<br>
|
||||
* This method must return void and have two parameters, the first being of type {@link java.nio.ByteBuffer} and the second
|
||||
* being the type returned by {@link #value()}.
|
||||
*/
|
||||
@Target(ElementType.METHOD)
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
public @interface WriteClass{
|
||||
Class<?> value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies that this method will be used to read classes of the type returned by {@link #value()}. <br>
|
||||
* This method must return the type returned by {@link #value()},
|
||||
* and have one parameter, being of type {@link java.nio.ByteBuffer}.
|
||||
*/
|
||||
@Target(ElementType.METHOD)
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
public @interface ReadClass{
|
||||
Class<?> value();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,14 +2,14 @@ package io.anuke.annotations;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**Represents a class witha list method entries to include in it.*/
|
||||
public class ClassEntry {
|
||||
/**All methods in this generated class.*/
|
||||
/** Represents a class witha list method entries to include in it. */
|
||||
public class ClassEntry{
|
||||
/** All methods in this generated class. */
|
||||
public final ArrayList<MethodEntry> methods = new ArrayList<>();
|
||||
/**Simple class name.*/
|
||||
/** Simple class name. */
|
||||
public final String name;
|
||||
|
||||
public ClassEntry(String name) {
|
||||
public ClassEntry(String name){
|
||||
this.name = name;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,12 +10,16 @@ import javax.tools.Diagnostic.Kind;
|
||||
import java.util.HashMap;
|
||||
import java.util.Set;
|
||||
|
||||
/**This class finds reader and writer methods annotated by the {@link io.anuke.annotations.Annotations.WriteClass}
|
||||
* and {@link io.anuke.annotations.Annotations.ReadClass} annotations.*/
|
||||
public class IOFinder {
|
||||
/**
|
||||
* This class finds reader and writer methods annotated by the {@link io.anuke.annotations.Annotations.WriteClass}
|
||||
* and {@link io.anuke.annotations.Annotations.ReadClass} annotations.
|
||||
*/
|
||||
public class IOFinder{
|
||||
|
||||
/**Finds all class serializers for all types and returns them. Logs errors when necessary.
|
||||
* Maps fully qualified class names to their serializers.*/
|
||||
/**
|
||||
* Finds all class serializers for all types and returns them. Logs errors when necessary.
|
||||
* Maps fully qualified class names to their serializers.
|
||||
*/
|
||||
public HashMap<String, ClassSerializer> findSerializers(RoundEnvironment env){
|
||||
HashMap<String, ClassSerializer> result = new HashMap<>();
|
||||
|
||||
@@ -51,33 +55,33 @@ public class IOFinder {
|
||||
}
|
||||
|
||||
private String getValue(WriteClass write){
|
||||
try {
|
||||
try{
|
||||
Class<?> type = write.value();
|
||||
return type.getName();
|
||||
}catch (MirroredTypeException e){
|
||||
}catch(MirroredTypeException e){
|
||||
return e.getTypeMirror().toString();
|
||||
}
|
||||
}
|
||||
|
||||
private String getValue(ReadClass read){
|
||||
try {
|
||||
try{
|
||||
Class<?> type = read.value();
|
||||
return type.getName();
|
||||
}catch (MirroredTypeException e){
|
||||
}catch(MirroredTypeException e){
|
||||
return e.getTypeMirror().toString();
|
||||
}
|
||||
}
|
||||
|
||||
/**Information about read/write methods for a specific class type.*/
|
||||
/** Information about read/write methods for a specific class type. */
|
||||
public static class ClassSerializer{
|
||||
/**Fully qualified method name of the reader.*/
|
||||
/** Fully qualified method name of the reader. */
|
||||
public final String readMethod;
|
||||
/**Fully qualified method name of the writer.*/
|
||||
/** Fully qualified method name of the writer. */
|
||||
public final String writeMethod;
|
||||
/**Fully qualified class type name.*/
|
||||
/** Fully qualified class type name. */
|
||||
public final String classType;
|
||||
|
||||
public ClassSerializer(String readMethod, String writeMethod, String classType) {
|
||||
public ClassSerializer(String readMethod, String writeMethod, String classType){
|
||||
this.readMethod = readMethod;
|
||||
this.writeMethod = writeMethod;
|
||||
this.classType = classType;
|
||||
|
||||
@@ -1,34 +1,39 @@
|
||||
package io.anuke.annotations;
|
||||
|
||||
import io.anuke.annotations.Annotations.Loc;
|
||||
import io.anuke.annotations.Annotations.PacketPriority;
|
||||
import io.anuke.annotations.Annotations.Variant;
|
||||
|
||||
import javax.lang.model.element.ExecutableElement;
|
||||
|
||||
/**Class that repesents a remote method to be constructed and put into a class.*/
|
||||
public class MethodEntry {
|
||||
/**Simple target class name.*/
|
||||
/** Class that repesents a remote method to be constructed and put into a class. */
|
||||
public class MethodEntry{
|
||||
/** Simple target class name. */
|
||||
public final String className;
|
||||
/**Fully qualified target method to call.*/
|
||||
/** Fully qualified target method to call. */
|
||||
public final String targetMethod;
|
||||
/**Whether this method can be called on a client/server.*/
|
||||
/** Whether this method can be called on a client/server. */
|
||||
public final Loc where;
|
||||
/**Whether an additional 'one' and 'all' method variant is generated. At least one of these must be true.
|
||||
* Only applicable to client (server-invoked) methods.*/
|
||||
/**
|
||||
* Whether an additional 'one' and 'all' method variant is generated. At least one of these must be true.
|
||||
* Only applicable to client (server-invoked) methods.
|
||||
*/
|
||||
public final Variant target;
|
||||
/**Whether this method is called locally as well as remotely.*/
|
||||
/** Whether this method is called locally as well as remotely. */
|
||||
public final Loc local;
|
||||
/**Whether this method is unreliable and uses UDP.*/
|
||||
/** Whether this method is unreliable and uses UDP. */
|
||||
public final boolean unreliable;
|
||||
/**Whether to forward this method call to all other clients when a client invokes it. Server only.*/
|
||||
/** Whether to forward this method call to all other clients when a client invokes it. Server only. */
|
||||
public final boolean forward;
|
||||
/**Unique method ID.*/
|
||||
/** Unique method ID. */
|
||||
public final int id;
|
||||
/**The element method associated with this entry.*/
|
||||
/** The element method associated with this entry. */
|
||||
public final ExecutableElement element;
|
||||
/** The assigned packet priority. Only used in clients. */
|
||||
public final PacketPriority priority;
|
||||
|
||||
public MethodEntry(String className, String targetMethod, Loc where, Variant target,
|
||||
Loc local, boolean unreliable, boolean forward, int id, ExecutableElement element) {
|
||||
Loc local, boolean unreliable, boolean forward, int id, ExecutableElement element, PacketPriority priority){
|
||||
this.className = className;
|
||||
this.forward = forward;
|
||||
this.targetMethod = targetMethod;
|
||||
@@ -38,10 +43,11 @@ public class MethodEntry {
|
||||
this.id = id;
|
||||
this.element = element;
|
||||
this.unreliable = unreliable;
|
||||
this.priority = priority;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
public int hashCode(){
|
||||
return targetMethod.hashCode();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,25 +18,27 @@ import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
/**The annotation processor for generating remote method call code.*/
|
||||
/** The annotation processor for generating remote method call code. */
|
||||
@SupportedSourceVersion(SourceVersion.RELEASE_8)
|
||||
@SupportedAnnotationTypes({
|
||||
"io.anuke.annotations.Annotations.Remote",
|
||||
"io.anuke.annotations.Annotations.WriteClass",
|
||||
"io.anuke.annotations.Annotations.ReadClass",
|
||||
"io.anuke.annotations.Annotations.Remote",
|
||||
"io.anuke.annotations.Annotations.WriteClass",
|
||||
"io.anuke.annotations.Annotations.ReadClass",
|
||||
})
|
||||
public class RemoteMethodAnnotationProcessor extends AbstractProcessor {
|
||||
/**Maximum size of each event packet.*/
|
||||
public class RemoteMethodAnnotationProcessor extends AbstractProcessor{
|
||||
/** Maximum size of each event packet. */
|
||||
public static final int maxPacketSize = 4096;
|
||||
/**Name of the base package to put all the generated classes.*/
|
||||
/** Name of the base package to put all the generated classes. */
|
||||
private static final String packageName = "io.anuke.mindustry.gen";
|
||||
|
||||
/**Name of class that handles reading and invoking packets on the server.*/
|
||||
/** Name of class that handles reading and invoking packets on the server. */
|
||||
private static final String readServerName = "RemoteReadServer";
|
||||
/**Name of class that handles reading and invoking packets on the client.*/
|
||||
/** Name of class that handles reading and invoking packets on the client. */
|
||||
private static final String readClientName = "RemoteReadClient";
|
||||
/**Simple class name of generated class name.*/
|
||||
private static final String callLocation = "Call";
|
||||
|
||||
/**Processing round number.*/
|
||||
/** Processing round number. */
|
||||
private int round;
|
||||
|
||||
//class serializers
|
||||
@@ -51,7 +53,7 @@ public class RemoteMethodAnnotationProcessor extends AbstractProcessor {
|
||||
private ArrayList<ClassEntry> classes;
|
||||
|
||||
@Override
|
||||
public synchronized void init(ProcessingEnvironment processingEnv) {
|
||||
public synchronized void init(ProcessingEnvironment processingEnv){
|
||||
super.init(processingEnv);
|
||||
//put all relevant utils into utils class
|
||||
Utils.typeUtils = processingEnv.getTypeUtils();
|
||||
@@ -61,15 +63,15 @@ public class RemoteMethodAnnotationProcessor extends AbstractProcessor {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
|
||||
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv){
|
||||
if(round > 1) return false; //only process 2 rounds
|
||||
|
||||
round ++;
|
||||
round++;
|
||||
|
||||
try {
|
||||
try{
|
||||
|
||||
//round 1: find all annotations, generate *writers*
|
||||
if(round == 1) {
|
||||
if(round == 1){
|
||||
//get serializers
|
||||
serializers = new IOFinder().findSerializers(roundEnv);
|
||||
|
||||
@@ -88,33 +90,33 @@ public class RemoteMethodAnnotationProcessor extends AbstractProcessor {
|
||||
orderedElements.sort(Comparator.comparing(Object::toString));
|
||||
|
||||
//create methods
|
||||
for (Element element : orderedElements) {
|
||||
for(Element element : orderedElements){
|
||||
Remote annotation = element.getAnnotation(Remote.class);
|
||||
|
||||
//check for static
|
||||
if (!element.getModifiers().contains(Modifier.STATIC) || !element.getModifiers().contains(Modifier.PUBLIC)) {
|
||||
if(!element.getModifiers().contains(Modifier.STATIC) || !element.getModifiers().contains(Modifier.PUBLIC)){
|
||||
Utils.messager.printMessage(Kind.ERROR, "All @Remote methods must be public and static: ", element);
|
||||
}
|
||||
|
||||
//can't generate none methods
|
||||
if (annotation.targets() == Loc.none) {
|
||||
if(annotation.targets() == Loc.none){
|
||||
Utils.messager.printMessage(Kind.ERROR, "A @Remote method's targets() cannot be equal to 'none':", element);
|
||||
}
|
||||
|
||||
//get and create class entry if needed
|
||||
if (!classMap.containsKey(annotation.in())) {
|
||||
ClassEntry clas = new ClassEntry(annotation.in());
|
||||
classMap.put(annotation.in(), clas);
|
||||
if(!classMap.containsKey(callLocation)){
|
||||
ClassEntry clas = new ClassEntry(callLocation);
|
||||
classMap.put(callLocation, clas);
|
||||
classes.add(clas);
|
||||
|
||||
Utils.messager.printMessage(Kind.NOTE, "Generating class '" + clas.name + "'.");
|
||||
}
|
||||
|
||||
ClassEntry entry = classMap.get(annotation.in());
|
||||
ClassEntry entry = classMap.get(callLocation);
|
||||
|
||||
//create and add entry
|
||||
MethodEntry method = new MethodEntry(entry.name, Utils.getMethodName(element), annotation.targets(), annotation.variants(),
|
||||
annotation.called(), annotation.unreliable(), annotation.forward(), lastMethodID++, (ExecutableElement) element);
|
||||
annotation.called(), annotation.unreliable(), annotation.forward(), lastMethodID++, (ExecutableElement) element, annotation.priority());
|
||||
|
||||
entry.methods.add(method);
|
||||
methods.add(method);
|
||||
@@ -127,7 +129,7 @@ public class RemoteMethodAnnotationProcessor extends AbstractProcessor {
|
||||
writegen.generateFor(classes, packageName);
|
||||
|
||||
return true;
|
||||
}else if(round == 2) { //round 2: generate all *readers*
|
||||
}else if(round == 2){ //round 2: generate all *readers*
|
||||
RemoteReadGenerator readgen = new RemoteReadGenerator(serializers);
|
||||
|
||||
//generate server readers
|
||||
@@ -147,7 +149,7 @@ public class RemoteMethodAnnotationProcessor extends AbstractProcessor {
|
||||
return true;
|
||||
}
|
||||
|
||||
}catch (Exception e){
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
@@ -14,22 +14,25 @@ import java.nio.ByteBuffer;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**Generates code for reading remote invoke packets on the client and server.*/
|
||||
public class RemoteReadGenerator {
|
||||
/** Generates code for reading remote invoke packets on the client and server. */
|
||||
public class RemoteReadGenerator{
|
||||
private final HashMap<String, ClassSerializer> serializers;
|
||||
|
||||
/**Creates a read generator that uses the supplied serializer setup.*/
|
||||
public RemoteReadGenerator(HashMap<String, ClassSerializer> serializers) {
|
||||
/** Creates a read generator that uses the supplied serializer setup. */
|
||||
public RemoteReadGenerator(HashMap<String, ClassSerializer> serializers){
|
||||
this.serializers = serializers;
|
||||
}
|
||||
|
||||
/**Generates a class for reading remote invoke packets.
|
||||
/**
|
||||
* Generates a class for reading remote invoke packets.
|
||||
*
|
||||
* @param entries List of methods to use/
|
||||
* @param className Simple target class name.
|
||||
* @param packageName Full target package name.
|
||||
* @param needsPlayer Whether this read method requires a reference to the player sender.*/
|
||||
* @param needsPlayer Whether this read method requires a reference to the player sender.
|
||||
*/
|
||||
public void generateFor(List<MethodEntry> entries, String className, String packageName, boolean needsPlayer)
|
||||
throws IllegalAccessException, InvocationTargetException, InstantiationException, NoSuchMethodException, IOException {
|
||||
throws IllegalAccessException, InvocationTargetException, InstantiationException, NoSuchMethodException, IOException{
|
||||
|
||||
TypeSpec.Builder classBuilder = TypeSpec.classBuilder(className).addModifiers(Modifier.PUBLIC);
|
||||
|
||||
@@ -69,10 +72,10 @@ public class RemoteReadGenerator {
|
||||
StringBuilder varResult = new StringBuilder();
|
||||
|
||||
//go through each parameter
|
||||
for(int i = 0; i < entry.element.getParameters().size(); i ++){
|
||||
for(int i = 0; i < entry.element.getParameters().size(); i++){
|
||||
VariableElement var = entry.element.getParameters().get(i);
|
||||
|
||||
if(!needsPlayer || i != 0) { //if client, skip first parameter since it's always of type player and doesn't need to be read
|
||||
if(!needsPlayer || i != 0){ //if client, skip first parameter since it's always of type player and doesn't need to be read
|
||||
//full type name of parameter
|
||||
String typeName = var.asType().toString();
|
||||
//name of parameter
|
||||
@@ -81,17 +84,17 @@ public class RemoteReadGenerator {
|
||||
String capName = typeName.equals("byte") ? "" : Character.toUpperCase(typeName.charAt(0)) + typeName.substring(1);
|
||||
|
||||
//write primitives automatically
|
||||
if (Utils.isPrimitive(typeName)) {
|
||||
if (typeName.equals("boolean")) {
|
||||
if(Utils.isPrimitive(typeName)){
|
||||
if(typeName.equals("boolean")){
|
||||
readBlock.addStatement("boolean " + varName + " = buffer.get() == 1");
|
||||
} else {
|
||||
}else{
|
||||
readBlock.addStatement(typeName + " " + varName + " = buffer.get" + capName + "()");
|
||||
}
|
||||
} else {
|
||||
}else{
|
||||
//else, try and find a serializer
|
||||
ClassSerializer ser = serializers.get(typeName);
|
||||
|
||||
if (ser == null) { //make sure a serializer exists!
|
||||
if(ser == null){ //make sure a serializer exists!
|
||||
Utils.messager.printMessage(Kind.ERROR, "No @ReadClass method to read class type: '" + typeName + "'", var);
|
||||
return;
|
||||
}
|
||||
@@ -117,11 +120,11 @@ public class RemoteReadGenerator {
|
||||
if(entry.forward && entry.where.isServer && needsPlayer){
|
||||
//call forwarded method
|
||||
readBlock.addStatement(packageName + "." + entry.className + "." + entry.element.getSimpleName() +
|
||||
"__forward(player.clientid" + (varResult.length() == 0 ? "" : ", ") + varResult.toString() + ")");
|
||||
"__forward(player.con.id" + (varResult.length() == 0 ? "" : ", ") + varResult.toString() + ")");
|
||||
}
|
||||
|
||||
readBlock.nextControlFlow("catch (java.lang.Exception e)");
|
||||
readBlock.addStatement("throw new java.lang.RuntimeException(\"Failed to to read remote method '"+entry.element.getSimpleName() +"'!\", e)");
|
||||
readBlock.addStatement("throw new java.lang.RuntimeException(\"Failed to to read remote method '" + entry.element.getSimpleName() + "'!\", e)");
|
||||
readBlock.endControlFlow();
|
||||
}
|
||||
|
||||
|
||||
@@ -14,17 +14,17 @@ import java.nio.ByteBuffer;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**Generates code for writing remote invoke packets on the client and server.*/
|
||||
public class RemoteWriteGenerator {
|
||||
/** Generates code for writing remote invoke packets on the client and server. */
|
||||
public class RemoteWriteGenerator{
|
||||
private final HashMap<String, ClassSerializer> serializers;
|
||||
|
||||
/**Creates a write generator that uses the supplied serializer setup.*/
|
||||
public RemoteWriteGenerator(HashMap<String, ClassSerializer> serializers) {
|
||||
/** Creates a write generator that uses the supplied serializer setup. */
|
||||
public RemoteWriteGenerator(HashMap<String, ClassSerializer> serializers){
|
||||
this.serializers = serializers;
|
||||
}
|
||||
|
||||
/**Generates all classes in this list.*/
|
||||
public void generateFor(List<ClassEntry> entries, String packageName) throws IOException {
|
||||
/** Generates all classes in this list. */
|
||||
public void generateFor(List<ClassEntry> entries, String packageName) throws IOException{
|
||||
|
||||
for(ClassEntry entry : entries){
|
||||
//create builder
|
||||
@@ -58,7 +58,7 @@ public class RemoteWriteGenerator {
|
||||
}
|
||||
}
|
||||
|
||||
/**Creates a specific variant for a method entry.*/
|
||||
/** Creates a specific variant for a method entry. */
|
||||
private void writeMethodVariant(TypeSpec.Builder classBuilder, MethodEntry methodEntry, boolean toAll, boolean forwarded){
|
||||
ExecutableElement elem = methodEntry.element;
|
||||
|
||||
@@ -99,7 +99,7 @@ public class RemoteWriteGenerator {
|
||||
if(!forwarded && methodEntry.local != Loc.none){
|
||||
//add in local checks
|
||||
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.net.Net.active())");
|
||||
}
|
||||
|
||||
//concatenate parameters
|
||||
@@ -109,16 +109,16 @@ public class RemoteWriteGenerator {
|
||||
//special case: calling local-only methods uses the local player
|
||||
if(index == 0 && methodEntry.where == Loc.client){
|
||||
results.append("io.anuke.mindustry.Vars.players[0]");
|
||||
}else {
|
||||
}else{
|
||||
results.append(var.getSimpleName());
|
||||
}
|
||||
if(index != elem.getParameters().size() - 1) results.append(", ");
|
||||
index ++;
|
||||
index++;
|
||||
}
|
||||
|
||||
//add the statement to call it
|
||||
method.addStatement("$N." + elem.getSimpleName() + "(" + results.toString() + ")",
|
||||
((TypeElement)elem.getEnclosingElement()).getQualifiedName().toString());
|
||||
((TypeElement) elem.getEnclosingElement()).getQualifiedName().toString());
|
||||
|
||||
if(methodEntry.local != Loc.both){
|
||||
method.endControlFlow();
|
||||
@@ -126,18 +126,20 @@ public class RemoteWriteGenerator {
|
||||
}
|
||||
|
||||
//start control flow to check if it's actually client/server so no netcode is called
|
||||
method.beginControlFlow("if("+getCheckString(methodEntry.where)+")");
|
||||
method.beginControlFlow("if(" + getCheckString(methodEntry.where) + ")");
|
||||
|
||||
//add statement to create packet from pool
|
||||
method.addStatement("$1N packet = $2N.obtain($1N.class)", "io.anuke.mindustry.net.Packets.InvokePacket", "com.badlogic.gdx.utils.Pools");
|
||||
method.addStatement("$1N packet = $2N.obtain($1N.class)", "io.anuke.mindustry.net.Packets.InvokePacket", "io.anuke.ucore.util.Pooling");
|
||||
//assign buffer
|
||||
method.addStatement("packet.writeBuffer = TEMP_BUFFER");
|
||||
//assign priority
|
||||
method.addStatement("packet.priority = (byte)" + methodEntry.priority.ordinal());
|
||||
//assign method ID
|
||||
method.addStatement("packet.type = (byte)" + methodEntry.id);
|
||||
//rewind buffer
|
||||
method.addStatement("TEMP_BUFFER.position(0)");
|
||||
|
||||
for(int i = 0; i < elem.getParameters().size(); i ++){
|
||||
for(int i = 0; i < elem.getParameters().size(); i++){
|
||||
//first argument is skipped as it is always the player caller
|
||||
if((!methodEntry.where.isServer/* || methodEntry.mode == Loc.both*/) && i == 0){
|
||||
continue;
|
||||
@@ -162,7 +164,7 @@ public class RemoteWriteGenerator {
|
||||
method.beginControlFlow("if(io.anuke.mindustry.net.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
|
||||
if(typeName.equals("boolean")){ //booleans are special
|
||||
method.addStatement("TEMP_BUFFER.put(" + varName + " ? (byte)1 : 0)");
|
||||
}else{
|
||||
@@ -179,7 +181,7 @@ public class RemoteWriteGenerator {
|
||||
}
|
||||
|
||||
//add statement for writing it
|
||||
method.addStatement(ser.writeMethod + "(TEMP_BUFFER, " + varName +")");
|
||||
method.addStatement(ser.writeMethod + "(TEMP_BUFFER, " + varName + ")");
|
||||
}
|
||||
|
||||
if(writePlayerSkipCheck){ //write end check
|
||||
@@ -195,7 +197,7 @@ public class RemoteWriteGenerator {
|
||||
if(forwarded){ //forward packet
|
||||
if(!methodEntry.local.isClient){ //if the client doesn't get it called locally, forward it back after validation
|
||||
sendString = "send(";
|
||||
}else {
|
||||
}else{
|
||||
sendString = "sendExcept(exceptSenderID, ";
|
||||
}
|
||||
}else if(toAll){ //send to all players / to server
|
||||
@@ -205,8 +207,8 @@ public class RemoteWriteGenerator {
|
||||
}
|
||||
|
||||
//send the actual packet
|
||||
method.addStatement("io.anuke.mindustry.net.Net." + sendString + "packet, "+
|
||||
(methodEntry.unreliable ? "io.anuke.mindustry.net.Net.SendMode.udp" : "io.anuke.mindustry.net.Net.SendMode.tcp")+")");
|
||||
method.addStatement("io.anuke.mindustry.net.Net." + sendString + "packet, " +
|
||||
(methodEntry.unreliable ? "io.anuke.mindustry.net.Net.SendMode.udp" : "io.anuke.mindustry.net.Net.SendMode.tcp") + ")");
|
||||
|
||||
|
||||
//end check for server/client
|
||||
@@ -218,7 +220,7 @@ public class RemoteWriteGenerator {
|
||||
|
||||
private String getCheckString(Loc loc){
|
||||
return loc.isClient && loc.isServer ? "io.anuke.mindustry.net.Net.server() || io.anuke.mindustry.net.Net.client()" :
|
||||
loc.isClient ? "io.anuke.mindustry.net.Net.client()" :
|
||||
loc.isServer ? "io.anuke.mindustry.net.Net.server()" : "false";
|
||||
loc.isClient ? "io.anuke.mindustry.net.Net.client()" :
|
||||
loc.isServer ? "io.anuke.mindustry.net.Net.server()" : "false";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,14 +7,14 @@ import javax.lang.model.element.TypeElement;
|
||||
import javax.lang.model.util.Elements;
|
||||
import javax.lang.model.util.Types;
|
||||
|
||||
public class Utils {
|
||||
public class Utils{
|
||||
public static Types typeUtils;
|
||||
public static Elements elementUtils;
|
||||
public static Filer filer;
|
||||
public static Messager messager;
|
||||
|
||||
public static String getMethodName(Element element){
|
||||
return ((TypeElement)element.getEnclosingElement()).getQualifiedName().toString() + "." + element.getSimpleName();
|
||||
return ((TypeElement) element.getEnclosingElement()).getQualifiedName().toString() + "." + element.getSimpleName();
|
||||
}
|
||||
|
||||
public static boolean isPrimitive(String type){
|
||||
|
||||
@@ -9,7 +9,7 @@ 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.1.0'
|
||||
classpath 'com.android.tools.build:gradle:3.1.3'
|
||||
classpath "com.badlogicgames.gdx:gdx-tools:1.9.8"
|
||||
}
|
||||
}
|
||||
@@ -26,8 +26,7 @@ allprojects {
|
||||
appName = 'Mindustry'
|
||||
gdxVersion = '1.9.8'
|
||||
roboVMVersion = '2.3.0'
|
||||
aiVersion = '1.8.1'
|
||||
uCoreVersion = 'bc1c2e0848'
|
||||
uCoreVersion = '64ec4a15148b27749ca7b505dea9743add9902f2'
|
||||
|
||||
getVersionString = {
|
||||
String buildVersion = getBuildVersion()
|
||||
@@ -43,8 +42,19 @@ allprojects {
|
||||
return project.ext.mainClassName.substring(0, project.ext.mainClassName.indexOf("desktop") - 1)
|
||||
}
|
||||
|
||||
generateLocales = {
|
||||
def output = '["en",'
|
||||
def bundles = new File(project(':core').projectDir, 'assets/bundles/')
|
||||
bundles.listFiles().each { other ->
|
||||
if(other.name == "bundle.properties") return;
|
||||
output += '"' + other.name.substring("bundle".length() + 1, other.name.lastIndexOf('.')) + '",'
|
||||
}
|
||||
output = (output.substring(0, output.size() - 1) + "]")
|
||||
new File(project(':core').projectDir, 'assets/locales.json').text = output;
|
||||
}
|
||||
|
||||
writeVersion = {
|
||||
def pfile = new File('core/assets/version.properties')
|
||||
def pfile = new File(project(':core').projectDir, 'assets/version.properties')
|
||||
def props = new Properties()
|
||||
|
||||
try{
|
||||
@@ -86,7 +96,6 @@ project(":desktop") {
|
||||
compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
|
||||
compile "com.badlogicgames.gdx:gdx-controllers-lwjgl3:$gdxVersion"
|
||||
compile 'com.github.MinnDevelopment:java-discord-rpc:v2.0.0'
|
||||
compile 'com.yuvimasory:orange-extensions:1.3.0'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,13 +111,10 @@ project(":html") {
|
||||
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-ai:$aiVersion: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"
|
||||
compile "com.sksamuel.gwt:gwt-websockets:1.0.4"
|
||||
compile "com.sksamuel.gwt:gwt-websockets:1.0.4:sources"
|
||||
}
|
||||
|
||||
compileJava.options.compilerArgs = [
|
||||
@@ -120,6 +126,23 @@ project(":ios") {
|
||||
apply plugin: "java"
|
||||
apply plugin: "robovm"
|
||||
|
||||
task copyGen{
|
||||
copy{
|
||||
from ("core/build/classes/java/main/io/anuke/mindustry/gen/"){
|
||||
include "**/*.java"
|
||||
}
|
||||
|
||||
into "ios/src/io/anuke/mindustry/gen"
|
||||
}
|
||||
|
||||
doFirst{
|
||||
delete{
|
||||
delete "ios/src/io/anuke/mindustry/gen/"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
build.dependsOn(copyGen)
|
||||
|
||||
dependencies {
|
||||
compile project(":core")
|
||||
@@ -135,16 +158,16 @@ project(":ios") {
|
||||
project(":core") {
|
||||
apply plugin: "java"
|
||||
|
||||
task finish {
|
||||
generateLocales()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly project(":annotations")
|
||||
build.finalizedBy(finish)
|
||||
|
||||
boolean comp = System.properties["release"] == null || System.properties["release"] == "false"
|
||||
|
||||
if(!comp){
|
||||
println("NOTICE: Compiling release build.")
|
||||
}else{
|
||||
println("Compiling DEBUG build.")
|
||||
}
|
||||
def comp = System.properties["release"] == null || System.properties["release"] == "false"
|
||||
if(!comp) println("Note: Compiling release build.")
|
||||
|
||||
if(new File(projectDir.parent, '../uCore').exists() && comp){
|
||||
compile project(":uCore")
|
||||
@@ -168,6 +191,12 @@ project(":core") {
|
||||
project(":server") {
|
||||
apply plugin: "java"
|
||||
|
||||
configurations {
|
||||
if(findProject(":android") != null){
|
||||
compile.exclude module: android
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly project(":annotations")
|
||||
|
||||
@@ -200,10 +229,14 @@ project(":kryonet") {
|
||||
dependencies {
|
||||
compile project(":core")
|
||||
compile 'com.github.crykn:kryonet:2.22.1'
|
||||
compile "org.java-websocket:Java-WebSocket:1.3.7"
|
||||
compile 'com.github.Anuken:WaifUPnP:05eb46bc577fd7674596946ba288c96c0cedd893'
|
||||
}
|
||||
}
|
||||
|
||||
project(":reporter"){
|
||||
apply plugin: "java"
|
||||
}
|
||||
|
||||
tasks.eclipse.doLast {
|
||||
delete ".project"
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 59 KiB |
|
After Width: | Height: | Size: 111 B |
|
After Width: | Height: | Size: 217 B |
|
Before Width: | Height: | Size: 160 B After Width: | Height: | Size: 83 B |
|
Before Width: | Height: | Size: 177 B After Width: | Height: | Size: 93 B |
|
Before Width: | Height: | Size: 178 B After Width: | Height: | Size: 95 B |
|
Before Width: | Height: | Size: 227 B After Width: | Height: | Size: 119 B |
|
Before Width: | Height: | Size: 197 B |
|
After Width: | Height: | Size: 98 B |
|
After Width: | Height: | Size: 98 B |
|
After Width: | Height: | Size: 98 B |
|
After Width: | Height: | Size: 97 B |
|
After Width: | Height: | Size: 116 B |
|
After Width: | Height: | Size: 117 B |
|
After Width: | Height: | Size: 119 B |
|
After Width: | Height: | Size: 117 B |
|
After Width: | Height: | Size: 113 B |
|
After Width: | Height: | Size: 108 B |
|
After Width: | Height: | Size: 104 B |
|
After Width: | Height: | Size: 106 B |
|
After Width: | Height: | Size: 109 B |
|
After Width: | Height: | Size: 107 B |
|
After Width: | Height: | Size: 110 B |
|
After Width: | Height: | Size: 110 B |
|
After Width: | Height: | Size: 109 B |
|
After Width: | Height: | Size: 108 B |
|
After Width: | Height: | Size: 105 B |
|
After Width: | Height: | Size: 109 B |
|
After Width: | Height: | Size: 105 B |
|
After Width: | Height: | Size: 105 B |
|
After Width: | Height: | Size: 105 B |
|
After Width: | Height: | Size: 103 B |
|
After Width: | Height: | Size: 127 B |
|
After Width: | Height: | Size: 127 B |
|
After Width: | Height: | Size: 133 B |
|
After Width: | Height: | Size: 129 B |
|
After Width: | Height: | Size: 120 B |
|
After Width: | Height: | Size: 114 B |
|
After Width: | Height: | Size: 110 B |
|
After Width: | Height: | Size: 113 B |
|
After Width: | Height: | Size: 108 B |
|
After Width: | Height: | Size: 107 B |
|
After Width: | Height: | Size: 110 B |
|
After Width: | Height: | Size: 110 B |
|
After Width: | Height: | Size: 111 B |
|
After Width: | Height: | Size: 111 B |
|
After Width: | Height: | Size: 110 B |
|
After Width: | Height: | Size: 113 B |
|
After Width: | Height: | Size: 163 B |
|
Before Width: | Height: | Size: 257 B After Width: | Height: | Size: 115 B |
|
Before Width: | Height: | Size: 682 B After Width: | Height: | Size: 389 B |
|
Before Width: | Height: | Size: 580 B After Width: | Height: | Size: 273 B |
|
Before Width: | Height: | Size: 296 B |
|
Before Width: | Height: | Size: 233 B After Width: | Height: | Size: 114 B |
|
Before Width: | Height: | Size: 179 B After Width: | Height: | Size: 83 B |
|
Before Width: | Height: | Size: 189 B After Width: | Height: | Size: 84 B |
|
Before Width: | Height: | Size: 172 B After Width: | Height: | Size: 75 B |
|
Before Width: | Height: | Size: 301 B After Width: | Height: | Size: 132 B |
|
Before Width: | Height: | Size: 226 B After Width: | Height: | Size: 113 B |
|
Before Width: | Height: | Size: 248 B After Width: | Height: | Size: 110 B |
|
Before Width: | Height: | Size: 234 B |
|
Before Width: | Height: | Size: 210 B |
|
Before Width: | Height: | Size: 346 B After Width: | Height: | Size: 216 B |
|
Before Width: | Height: | Size: 492 B After Width: | Height: | Size: 271 B |
|
Before Width: | Height: | Size: 219 B After Width: | Height: | Size: 119 B |
|
Before Width: | Height: | Size: 298 B After Width: | Height: | Size: 168 B |
|
Before Width: | Height: | Size: 289 B After Width: | Height: | Size: 155 B |
|
Before Width: | Height: | Size: 574 B After Width: | Height: | Size: 294 B |
|
Before Width: | Height: | Size: 174 B |
|
Before Width: | Height: | Size: 196 B |
|
Before Width: | Height: | Size: 233 B |
|
Before Width: | Height: | Size: 261 B After Width: | Height: | Size: 136 B |
|
Before Width: | Height: | Size: 286 B After Width: | Height: | Size: 143 B |
|
Before Width: | Height: | Size: 327 B After Width: | Height: | Size: 170 B |
|
After Width: | Height: | Size: 135 B |
|
After Width: | Height: | Size: 120 B |
|
After Width: | Height: | Size: 177 B |
|
Before Width: | Height: | Size: 239 B After Width: | Height: | Size: 120 B |
|
Before Width: | Height: | Size: 341 B After Width: | Height: | Size: 175 B |
|
Before Width: | Height: | Size: 379 B After Width: | Height: | Size: 170 B |