mirror of
https://github.com/AndorsTrailRelease/andors-trail.git
synced 2025-12-28 23:35:47 +01:00
Compare commits
627 Commits
import_exp
...
V0.8.8
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
457c98cc0d | ||
|
|
bb614278bb | ||
|
|
655d464677 | ||
|
|
1f63ae060f | ||
|
|
b7cc23cb32 | ||
|
|
53b75f1c80 | ||
|
|
429bb7d61d | ||
|
|
8070329915 | ||
|
|
e9138d9cbf | ||
|
|
209cf28224 | ||
|
|
5363d60ece | ||
|
|
5d273f7308 | ||
|
|
000c3e71e2 | ||
|
|
093c75da95 | ||
|
|
979d3c81db | ||
|
|
16c9378da4 | ||
|
|
bf62a3502f | ||
|
|
06d71caa1e | ||
|
|
aab900dc58 | ||
|
|
cdb02a8a7b | ||
|
|
01affa64b3 | ||
|
|
cc34decd0f | ||
|
|
d971825cbd | ||
|
|
cbc4992f10 | ||
|
|
89bac044f1 | ||
|
|
dc933ba225 | ||
|
|
a7ac2ed657 | ||
|
|
8453f0e5f5 | ||
|
|
17f3c75fdf | ||
|
|
4f5952f24c | ||
|
|
2bf6e4c3b7 | ||
|
|
90cb403196 | ||
|
|
d59b686d10 | ||
|
|
346187a80f | ||
|
|
f8b38d88aa | ||
|
|
ad4432a2df | ||
|
|
bf20d0dc6e | ||
|
|
d940229581 | ||
|
|
044c6fa4b1 | ||
|
|
d2b1e67bac | ||
|
|
7bb42e98b6 | ||
|
|
ea80cd11fe | ||
|
|
1f00f4a86c | ||
|
|
12350f3fdb | ||
|
|
c650e4aa75 | ||
|
|
94f81db7ba | ||
|
|
8c80615659 | ||
|
|
bc5e956cb3 | ||
|
|
fab9bdc298 | ||
|
|
1d90db1c1e | ||
|
|
9c3dd2e671 | ||
|
|
711285aab2 | ||
|
|
3d20a43a24 | ||
|
|
c3c491f72c | ||
|
|
489dfd55fb | ||
|
|
b84ffde283 | ||
|
|
5256868327 | ||
|
|
606e90e9bd | ||
|
|
c5b426af13 | ||
|
|
8ee1bf782c | ||
|
|
f4651a9bed | ||
|
|
c7a77f9c99 | ||
|
|
e42d2fcec8 | ||
|
|
2173fda575 | ||
|
|
dccb078060 | ||
|
|
9bc007349f | ||
|
|
435865f250 | ||
|
|
f7e64c5ab9 | ||
|
|
271a28887f | ||
|
|
e3955dac3a | ||
|
|
8971d671fe | ||
|
|
e03bc105b0 | ||
|
|
b5381d5d68 | ||
|
|
40eb5ca761 | ||
|
|
44298bf59d | ||
|
|
aab4771fcc | ||
|
|
b6dfb2eb7d | ||
|
|
1182bd84cd | ||
|
|
664f285e9a | ||
|
|
33717be65d | ||
|
|
eac69a5e67 | ||
|
|
9597363785 | ||
|
|
b7a06e04cb | ||
|
|
8984f35240 | ||
|
|
4a8f784fd5 | ||
|
|
7877fbdca7 | ||
|
|
2c67adcda2 | ||
|
|
1ff1835feb | ||
|
|
6b24efc014 | ||
|
|
894bf9ea8d | ||
|
|
dcbb525fb6 | ||
|
|
689f7820eb | ||
|
|
d47f26d038 | ||
|
|
3c5645156f | ||
|
|
edd79b4e4e | ||
|
|
8a95194465 | ||
|
|
80b55c1717 | ||
|
|
faca85e283 | ||
|
|
40d84d8c78 | ||
|
|
f0988afaa5 | ||
|
|
03b0ec16de | ||
|
|
3a31b3d00c | ||
|
|
50a697c85a | ||
|
|
af77d8e497 | ||
|
|
c6b80f1ff1 | ||
|
|
edbccb62e5 | ||
|
|
24a7578c67 | ||
|
|
200e44ad15 | ||
|
|
ac669f4aaa | ||
|
|
f73d993934 | ||
|
|
15657d08da | ||
|
|
b0829d7195 | ||
|
|
e31cee7fef | ||
|
|
ec2f4d74b2 | ||
|
|
773a9dbbe3 | ||
|
|
0de31eefd2 | ||
|
|
cd764d4c10 | ||
|
|
283418d43a | ||
|
|
e99da003d1 | ||
|
|
fc29346dee | ||
|
|
6ee86d8c56 | ||
|
|
5f91d084ed | ||
|
|
7989c84723 | ||
|
|
e280ad1423 | ||
|
|
35b762e891 | ||
|
|
b40eb7dc66 | ||
|
|
a3b74eb08a | ||
|
|
6b724c5e8d | ||
|
|
a407260c33 | ||
|
|
e0dc8e24b6 | ||
|
|
fcb21a1218 | ||
|
|
c54ade42d9 | ||
|
|
5460d52baf | ||
|
|
84c5242195 | ||
|
|
278e61cf7e | ||
|
|
7537309cd3 | ||
|
|
7dc2bcaa59 | ||
|
|
1e99c026cb | ||
|
|
ae23d99c7f | ||
|
|
a97f3cee64 | ||
|
|
c0e5f77d53 | ||
|
|
7c8e269b09 | ||
|
|
87bdd6036a | ||
|
|
4d222f7b06 | ||
|
|
9b8d0665a1 | ||
|
|
498600c6bd | ||
|
|
b2031e0f50 | ||
|
|
7536d14a34 | ||
|
|
10772abcb4 | ||
|
|
b5996767c1 | ||
|
|
1f7adadf78 | ||
|
|
810bcff78c | ||
|
|
e953d34d17 | ||
|
|
3b5fe2e622 | ||
|
|
9f46492f86 | ||
|
|
f1e69677be | ||
|
|
17e573a7a9 | ||
|
|
4cb6c26363 | ||
|
|
09974c67e4 | ||
|
|
51b0554668 | ||
|
|
3c3610d63c | ||
|
|
468ec1ee83 | ||
|
|
dcb6fcb3a6 | ||
|
|
9c080c4334 | ||
|
|
7b7fefb954 | ||
|
|
616e43ce8f | ||
|
|
318d070e05 | ||
|
|
4a7739a1bf | ||
|
|
e12250509e | ||
|
|
afb025fd91 | ||
|
|
8899cb5ea4 | ||
|
|
c6a7bc8c14 | ||
|
|
f2bb6d547b | ||
|
|
1fdcb23d04 | ||
|
|
131088ad22 | ||
|
|
5d3a51e8f2 | ||
|
|
d1cd8a8cef | ||
|
|
c2757dcbce | ||
|
|
274ef6a44f | ||
|
|
efff180339 | ||
|
|
8fb51c0647 | ||
|
|
7db9cf50ca | ||
|
|
8128707aa4 | ||
|
|
de7740ab14 | ||
|
|
31633be812 | ||
|
|
bcb5d36999 | ||
|
|
7d847dfde5 | ||
|
|
b703e774ae | ||
|
|
f6207be9d4 | ||
|
|
7c87c53421 | ||
|
|
a4ed3688a2 | ||
|
|
6ab8f5f836 | ||
|
|
f9c1724228 | ||
|
|
25c77fdf5e | ||
|
|
3bf9c6ae94 | ||
|
|
0e70b027f5 | ||
|
|
17b17187ff | ||
|
|
dc226ebe5d | ||
|
|
55f5edbb6a | ||
|
|
29d65fbf64 | ||
|
|
f3f35be0bf | ||
|
|
204c8e046c | ||
|
|
1a1710a6c2 | ||
|
|
1a2cc00184 | ||
|
|
b3b3f6ff98 | ||
|
|
7df8b0330c | ||
|
|
528dd2254e | ||
|
|
33fb7c83bf | ||
|
|
50ad382eed | ||
|
|
7d1c7cfd74 | ||
|
|
5b637099a1 | ||
|
|
0d6d725f87 | ||
|
|
a98c5d5416 | ||
|
|
3361973722 | ||
|
|
91bc6568ee | ||
|
|
2e583fbfcf | ||
|
|
50eab6ff38 | ||
|
|
d743550cc7 | ||
|
|
1c0efc8fa4 | ||
|
|
5ff38ea870 | ||
|
|
4c146f7896 | ||
|
|
4e5aa4314e | ||
|
|
5223951db4 | ||
|
|
ddcb355113 | ||
|
|
7a80e15628 | ||
|
|
34dc053011 | ||
|
|
0266449d67 | ||
|
|
ea3afcf99d | ||
|
|
c84418186c | ||
|
|
956990dbd5 | ||
|
|
08f6a2b289 | ||
|
|
741a4c02a0 | ||
|
|
dcff4939f4 | ||
|
|
506ce02697 | ||
|
|
95bd17b371 | ||
|
|
16ef7088a6 | ||
|
|
f70b0c8a41 | ||
|
|
d68d45d7c7 | ||
|
|
7af2844305 | ||
|
|
fd8c5166b6 | ||
|
|
2c931b6cd2 | ||
|
|
210069f8e9 | ||
|
|
2453897d31 | ||
|
|
dc0e758f64 | ||
|
|
ac3bf4a008 | ||
|
|
caf16299e7 | ||
|
|
cfa19ed9d9 | ||
|
|
6e5d82f340 | ||
|
|
98456b99e8 | ||
|
|
45c6e571cb | ||
|
|
e6c5545cd3 | ||
|
|
402c3ae538 | ||
|
|
f6018ab466 | ||
|
|
0ff738c85e | ||
|
|
4876e6696d | ||
|
|
167da0d70f | ||
|
|
2748aded3f | ||
|
|
103434baa0 | ||
|
|
c2da7bcbe2 | ||
|
|
c64cf99d88 | ||
|
|
de59d8de8d | ||
|
|
718886ba3a | ||
|
|
3789f1fd0a | ||
|
|
1e6df02e45 | ||
|
|
886a425aaf | ||
|
|
7e24d50c0c | ||
|
|
8f7d48c297 | ||
|
|
3cc81e2510 | ||
|
|
0f0be1c18e | ||
|
|
5f689e3d6c | ||
|
|
f04d3e40d4 | ||
|
|
68a74e07fa | ||
|
|
199cdbb787 | ||
|
|
375fcb37a2 | ||
|
|
bc1743dedf | ||
|
|
f7771f79c2 | ||
|
|
7ebce6b36b | ||
|
|
b4240eee3a | ||
|
|
514acc2b65 | ||
|
|
48bc854c8a | ||
|
|
07391dc6c7 | ||
|
|
7e905e84b7 | ||
|
|
200a45f0cb | ||
|
|
ebff0554f7 | ||
|
|
e54487d0b0 | ||
|
|
96a6e7ab20 | ||
|
|
95ff8ceb7e | ||
|
|
5aa4308e27 | ||
|
|
aa892be308 | ||
|
|
6971bcf9b5 | ||
|
|
0581e98b55 | ||
|
|
5c2e653cdf | ||
|
|
aa4cd722d2 | ||
|
|
10b2f37ed8 | ||
|
|
d7ae2a7082 | ||
|
|
c246a79726 | ||
|
|
8e4d75705e | ||
|
|
ffdaba2d8c | ||
|
|
97187071af | ||
|
|
dceab6b729 | ||
|
|
7771872947 | ||
|
|
cc123f76d6 | ||
|
|
a6ad03c534 | ||
|
|
45491871e6 | ||
|
|
8988f37896 | ||
|
|
09b4324873 | ||
|
|
a5a2764cb4 | ||
|
|
6de4d0c374 | ||
|
|
48c33d766b | ||
|
|
22493ee0e9 | ||
|
|
8afc3133c6 | ||
|
|
d0cfa29929 | ||
|
|
6a51d462d7 | ||
|
|
4f7cc4942c | ||
|
|
6631e01b64 | ||
|
|
133dffe330 | ||
|
|
6e5d17173f | ||
|
|
7463d15159 | ||
|
|
beff0f1b71 | ||
|
|
867ed36419 | ||
|
|
387c1e126f | ||
|
|
c9d7cda233 | ||
|
|
b75521da59 | ||
|
|
5f9ee8a410 | ||
|
|
296c3b453c | ||
|
|
6e2da63308 | ||
|
|
445cd9fe8e | ||
|
|
a0cc567694 | ||
|
|
70d084fba7 | ||
|
|
5236aa0bf9 | ||
|
|
0eccb511db | ||
|
|
88c17db72b | ||
|
|
098fb95653 | ||
|
|
21d6bb7b7d | ||
|
|
ce91c5c7c8 | ||
|
|
613ab9101e | ||
|
|
3fbc7cf65f | ||
|
|
dc18289d18 | ||
|
|
6473e231e4 | ||
|
|
33a61b7a57 | ||
|
|
c070a39f7c | ||
|
|
995ec0f697 | ||
|
|
6cba6872c9 | ||
|
|
8812f664e7 | ||
|
|
d9113b2dab | ||
|
|
ad0025ba03 | ||
|
|
984aa17cc0 | ||
|
|
4cad05ce6b | ||
|
|
197ab946be | ||
|
|
e4cdbc1840 | ||
|
|
04f00553ae | ||
|
|
0c02902ceb | ||
|
|
aba93fb15b | ||
|
|
1c8330b99a | ||
|
|
a8de7c2860 | ||
|
|
4ca8bbfc12 | ||
|
|
a5c004e4d4 | ||
|
|
e957e409e0 | ||
|
|
70d6340c11 | ||
|
|
bbbb69b175 | ||
|
|
4d5b7d8667 | ||
|
|
43da08f57d | ||
|
|
7b97367bdd | ||
|
|
e6fb647b99 | ||
|
|
5e4d7aba18 | ||
|
|
a96086b9af | ||
|
|
0566cf899c | ||
|
|
c8e87fb3d0 | ||
|
|
0a56a0ba86 | ||
|
|
026ccde2ff | ||
|
|
7813994b81 | ||
|
|
d3b070844f | ||
|
|
7a879f99b1 | ||
|
|
e810cdb3cb | ||
|
|
398be07c31 | ||
|
|
6db4c7bb3c | ||
|
|
c402824641 | ||
|
|
abc020e8f5 | ||
|
|
82caf260ce | ||
|
|
cbcf5ff8ca | ||
|
|
39d07bf8a8 | ||
|
|
93174f0d65 | ||
|
|
6afbeb9a2a | ||
|
|
a7cbd644f3 | ||
|
|
f674aff07c | ||
|
|
07b89a288c | ||
|
|
0264c418ca | ||
|
|
494b9c47cc | ||
|
|
6ff6c6dd6c | ||
|
|
00ab587265 | ||
|
|
67fa480805 | ||
|
|
91db56e7a7 | ||
|
|
36d52bedad | ||
|
|
c36b676720 | ||
|
|
5e0a999249 | ||
|
|
8fff4aff60 | ||
|
|
8c5344ff37 | ||
|
|
91e49b6c4a | ||
|
|
52cfb37b21 | ||
|
|
87886f08bb | ||
|
|
a31d7f9589 | ||
|
|
5600957f32 | ||
|
|
d6840a83c9 | ||
|
|
06fdd39648 | ||
|
|
b5763e7f76 | ||
|
|
75f01f20b9 | ||
|
|
dd366ab69e | ||
|
|
6ab443ec2c | ||
|
|
e0056cbf5c | ||
|
|
9f9397e1f3 | ||
|
|
d5a43cc7e1 | ||
|
|
408d8aa8b8 | ||
|
|
1e663069e8 | ||
|
|
dbcec1a199 | ||
|
|
04b4193548 | ||
|
|
058803184f | ||
|
|
5b5912c5bc | ||
|
|
759e632c07 | ||
|
|
6e311ecb64 | ||
|
|
b480fd9173 | ||
|
|
226459ddb8 | ||
|
|
92de033bc8 | ||
|
|
faf0dd061c | ||
|
|
9eaf9ea2ed | ||
|
|
00c4f77251 | ||
|
|
96ef9eedbb | ||
|
|
a5d94c03e2 | ||
|
|
9d15d380a3 | ||
|
|
bff780c837 | ||
|
|
0c493952c8 | ||
|
|
a1f6e1d29c | ||
|
|
fc71f43755 | ||
|
|
16afcf4886 | ||
|
|
b64a3c2109 | ||
|
|
5c0dc66183 | ||
|
|
3047f653bd | ||
|
|
393a478d13 | ||
|
|
560cb326f9 | ||
|
|
3fe2d7260f | ||
|
|
2cd4bc7ee5 | ||
|
|
19468b591d | ||
|
|
903117d32f | ||
|
|
f5bfc98c62 | ||
|
|
3274feb1e9 | ||
|
|
392b4d8577 | ||
|
|
92e4afde4b | ||
|
|
0c7724fe33 | ||
|
|
ca5be34fc2 | ||
|
|
28c3c7a0ec | ||
|
|
7f39cf1a6f | ||
|
|
365839571a | ||
|
|
5c3a04ca77 | ||
|
|
758a580063 | ||
|
|
ad5dbc9f9d | ||
|
|
4a86680928 | ||
|
|
ece63cf442 | ||
|
|
b487140a1b | ||
|
|
ad72bf8895 | ||
|
|
5919c429d2 | ||
|
|
1f365b170e | ||
|
|
0b6580e7c9 | ||
|
|
6efb2b3860 | ||
|
|
7ae084073f | ||
|
|
36df0b1732 | ||
|
|
b8fb100bd5 | ||
|
|
82b904d176 | ||
|
|
44723978e1 | ||
|
|
7c7b4829f6 | ||
|
|
050b027ff5 | ||
|
|
8fac65e268 | ||
|
|
111aca868c | ||
|
|
2171c16d47 | ||
|
|
acd4d84783 | ||
|
|
cc25cc97f1 | ||
|
|
93ecebc448 | ||
|
|
f5713a3eb2 | ||
|
|
90001bb4d6 | ||
|
|
357cab9b1e | ||
|
|
5ea272f286 | ||
|
|
0c876bd1c5 | ||
|
|
0ac2999694 | ||
|
|
49af3c4b6d | ||
|
|
2a54b31d31 | ||
|
|
64766ce50a | ||
|
|
311accfdd3 | ||
|
|
2b5bf2fa4a | ||
|
|
64342c96d7 | ||
|
|
f8649bb0a5 | ||
|
|
fde6608c26 | ||
|
|
3f339c14a2 | ||
|
|
922db05c4d | ||
|
|
b849de8b66 | ||
|
|
f798b29729 | ||
|
|
e58e7a2588 | ||
|
|
a1ef339831 | ||
|
|
2002d51f6b | ||
|
|
025283b70b | ||
|
|
577b1aa034 | ||
|
|
da637c0cc8 | ||
|
|
d026ff690a | ||
|
|
d14ed56669 | ||
|
|
64cfacb7ff | ||
|
|
98a800e070 | ||
|
|
35219c8e88 | ||
|
|
b636cad347 | ||
|
|
733328cd29 | ||
|
|
36db28f805 | ||
|
|
6d4c1c3c14 | ||
|
|
eadb95f8e8 | ||
|
|
014f67f270 | ||
|
|
cd8657adb4 | ||
|
|
c007fc4d1c | ||
|
|
7e6c864ba3 | ||
|
|
f2da8f767a | ||
|
|
bd856541d6 | ||
|
|
bdde2176d9 | ||
|
|
171893a2c1 | ||
|
|
c6c1d6d03d | ||
|
|
ec8b114782 | ||
|
|
aaecb8ae4a | ||
|
|
4e2e3b370c | ||
|
|
c14f8f84a0 | ||
|
|
13c8012710 | ||
|
|
3806d77b26 | ||
|
|
af94220715 | ||
|
|
af07c47832 | ||
|
|
322007e5ac | ||
|
|
af5cdb9d49 | ||
|
|
3ada8ceaa7 | ||
|
|
68fa0068dc | ||
|
|
7b5fc79375 | ||
|
|
5dfa750227 | ||
|
|
cbe0773310 | ||
|
|
72a19eeb80 | ||
|
|
a993cc5a08 | ||
|
|
83724ba408 | ||
|
|
a4cd8f7460 | ||
|
|
7a52bbb9f3 | ||
|
|
3552ff8a9f | ||
|
|
0e081f3319 | ||
|
|
1d94519e1c | ||
|
|
0bbc6adb4b | ||
|
|
b48ddd4999 | ||
|
|
be8dad981d | ||
|
|
f9708f48a4 | ||
|
|
155b01bdea | ||
|
|
19810b2099 | ||
|
|
c6886f7a3e | ||
|
|
3bea24f9cc | ||
|
|
4b8f5c4908 | ||
|
|
66d9618b1b | ||
|
|
488d6347d0 | ||
|
|
d39d0c9265 | ||
|
|
33fe96dada | ||
|
|
51fd0d0994 | ||
|
|
50833af145 | ||
|
|
ca7c2388aa | ||
|
|
8e7d6adca5 | ||
|
|
17edb96ff8 | ||
|
|
3f3869916c | ||
|
|
1d2fc7ade7 | ||
|
|
aa84e5a73d | ||
|
|
4ecf7d2dda | ||
|
|
dca1cb676c | ||
|
|
9a4f41eac2 | ||
|
|
23012b0d40 | ||
|
|
916134bd9b | ||
|
|
1d6777daae | ||
|
|
4793751ba8 | ||
|
|
185c0eaf7c | ||
|
|
4b50d13149 | ||
|
|
23b58c3e7c | ||
|
|
2d5ebc3b13 | ||
|
|
59e2e3035c | ||
|
|
6d5ddfdbfa | ||
|
|
f8ae18721f | ||
|
|
63bc7c3a4e | ||
|
|
8e72763314 | ||
|
|
9310d53362 | ||
|
|
a71dcc13a3 | ||
|
|
ea95f4ff87 | ||
|
|
f35167d112 | ||
|
|
9f935190f2 | ||
|
|
c11430cf6b | ||
|
|
8f97a27ab7 | ||
|
|
9e36f848dc | ||
|
|
b24d52b1da | ||
|
|
e2a9307560 | ||
|
|
e3ac804f61 | ||
|
|
fd504d2df5 | ||
|
|
0e615d3f11 | ||
|
|
47646457ab | ||
|
|
8e393b93d8 | ||
|
|
3289bd6fb1 | ||
|
|
23a331d655 | ||
|
|
112301c444 | ||
|
|
f50e4f1d38 | ||
|
|
d623c22b38 | ||
|
|
d11bf5b0aa | ||
|
|
e30f67e327 | ||
|
|
6946b1f2b3 | ||
|
|
96a1a5760a | ||
|
|
58b802e911 | ||
|
|
f9b095565b | ||
|
|
19817eb97d | ||
|
|
f46d2aedbf | ||
|
|
913b651953 | ||
|
|
5283eed28e | ||
|
|
deb824d50e | ||
|
|
6841d862e4 | ||
|
|
f94723b0cd | ||
|
|
ab41168736 | ||
|
|
2d73c4687a | ||
|
|
e454deb8b1 | ||
|
|
074891805a | ||
|
|
d2d32bc4ed | ||
|
|
22daeb0c33 | ||
|
|
db30253baf | ||
|
|
312cb7dec7 | ||
|
|
7befd27951 | ||
|
|
c1e3bfa7ed | ||
|
|
ddec991082 | ||
|
|
25e36dc535 | ||
|
|
83c579a929 | ||
|
|
0c694115ee | ||
|
|
bf9723b0c1 | ||
|
|
b81bacb1fe |
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/AndorsTrail/.idea/workspace.xml
|
||||
3
AndorsTrail/.gitignore
vendored
3
AndorsTrail/.gitignore
vendored
@@ -1,6 +1,3 @@
|
||||
# Android ignores
|
||||
app/src/main/res
|
||||
app/src/main/assets
|
||||
gen/
|
||||
bin/
|
||||
target/
|
||||
|
||||
Binary file not shown.
Binary file not shown.
6
AndorsTrail/.idea/compiler.xml
generated
6
AndorsTrail/.idea/compiler.xml
generated
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<bytecodeTargetLevel target="11" />
|
||||
</component>
|
||||
</project>
|
||||
20
AndorsTrail/.idea/gradle.xml
generated
20
AndorsTrail/.idea/gradle.xml
generated
@@ -1,20 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GradleMigrationSettings" migrationVersion="1" />
|
||||
<component name="GradleSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
<option name="testRunner" value="GRADLE" />
|
||||
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="gradleJvm" value="1.8" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
<option value="$PROJECT_DIR$/app" />
|
||||
</set>
|
||||
</option>
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
25
AndorsTrail/.idea/jarRepositories.xml
generated
25
AndorsTrail/.idea/jarRepositories.xml
generated
@@ -1,25 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RemoteRepositoriesConfiguration">
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Maven Central repository" />
|
||||
<option name="url" value="https://repo1.maven.org/maven2" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="jboss.community" />
|
||||
<option name="name" value="JBoss Community repository" />
|
||||
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="BintrayJCenter" />
|
||||
<option name="name" value="BintrayJCenter" />
|
||||
<option name="url" value="https://jcenter.bintray.com/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="Google" />
|
||||
<option name="name" value="Google" />
|
||||
<option name="url" value="https://dl.google.com/dl/android/maven2/" />
|
||||
</remote-repository>
|
||||
</component>
|
||||
</project>
|
||||
10
AndorsTrail/.idea/misc.xml
generated
10
AndorsTrail/.idea/misc.xml
generated
@@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" project-jdk-name="11" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
<option name="id" value="Android" />
|
||||
</component>
|
||||
</project>
|
||||
6
AndorsTrail/.idea/vcs.xml
generated
6
AndorsTrail/.idea/vcs.xml
generated
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
166
AndorsTrail/.idea/workspace.xml
generated
166
AndorsTrail/.idea/workspace.xml
generated
@@ -1,166 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="AutoImportSettings">
|
||||
<option name="autoReloadType" value="NONE" />
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="fb7bf33b-30cf-40b9-a238-3e2f6f604a8f" name="Changes" comment="" />
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||
</component>
|
||||
<component name="ExecutionTargetManager" SELECTED_TARGET="device_and_snapshot_combo_box_target[C:\Users\chris\.android\avd\Nexus_5_API_30.avd]" />
|
||||
<component name="ExternalProjectsData">
|
||||
<projectState path="$PROJECT_DIR$">
|
||||
<ProjectState />
|
||||
</projectState>
|
||||
</component>
|
||||
<component name="ExternalProjectsManager">
|
||||
<system id="GRADLE">
|
||||
<state>
|
||||
<projects_view>
|
||||
<tree_state>
|
||||
<expand>
|
||||
<path>
|
||||
<item name="" type="6a2764b6:ExternalProjectsStructure$RootNode" />
|
||||
<item name="AndorsTrail" type="f1a62948:ProjectNode" />
|
||||
</path>
|
||||
</expand>
|
||||
<select />
|
||||
</tree_state>
|
||||
</projects_view>
|
||||
</state>
|
||||
</system>
|
||||
</component>
|
||||
<component name="GenerateSignedApkSettings">
|
||||
<option name="KEY_STORE_PATH" value="C:\AT\sec\AndorsTrail.keystore" />
|
||||
<option name="KEY_ALIAS" value="andorstrail" />
|
||||
<option name="REMEMBER_PASSWORDS" value="true" />
|
||||
<option name="BUILD_TARGET_KEY" value="apk" />
|
||||
</component>
|
||||
<component name="Git.Settings">
|
||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$/.." />
|
||||
</component>
|
||||
<component name="ProjectId" id="2FG0LqADbxm6Q1t3yQ9BlX5APzJ" />
|
||||
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
|
||||
<component name="ProjectViewState">
|
||||
<option name="hideEmptyMiddlePackages" value="true" />
|
||||
<option name="showLibraryContents" value="true" />
|
||||
</component>
|
||||
<component name="PropertiesComponent">
|
||||
<property name="ApkExportedModule" value="AndorsTrail.app" />
|
||||
<property name="ExportApk.ApkPath" value="C:\AT\AndorsTrailRelease\andors-trail\AndorsTrail\app" />
|
||||
<property name="ExportApk.BuildVariants" value="release" />
|
||||
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
|
||||
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
|
||||
<property name="RunOnceActivity.cidr.known.project.marker" value="true" />
|
||||
<property name="android.sdk.path" value="$USER_HOME$/AppData/Local/Android/Sdk" />
|
||||
<property name="cidr.known.project.marker" value="true" />
|
||||
<property name="last_opened_file_path" value="$PROJECT_DIR$/../../../sec/AndorsTrail.keystore" />
|
||||
<property name="settings.editor.selected.configurable" value="device.file.explorer" />
|
||||
<property name="show.inlinked.gradle.project.popup" value="false" />
|
||||
</component>
|
||||
<component name="RunManager">
|
||||
<configuration name="<template>" type="Applet" default="true" selected="false">
|
||||
<option name="MAIN_CLASS_NAME" />
|
||||
<option name="HTML_FILE_NAME" />
|
||||
<option name="HTML_USED" value="false" />
|
||||
<option name="WIDTH" value="400" />
|
||||
<option name="HEIGHT" value="300" />
|
||||
<option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
|
||||
<option name="VM_PARAMETERS" />
|
||||
</configuration>
|
||||
<configuration name="<template>" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" default="true" selected="false">
|
||||
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
|
||||
</configuration>
|
||||
<configuration name="app" type="AndroidRunConfigurationType" factoryName="Android App">
|
||||
<module name="AndorsTrail.app" />
|
||||
<option name="DEPLOY" value="true" />
|
||||
<option name="DEPLOY_APK_FROM_BUNDLE" value="false" />
|
||||
<option name="DEPLOY_AS_INSTANT" value="false" />
|
||||
<option name="ARTIFACT_NAME" value="" />
|
||||
<option name="PM_INSTALL_OPTIONS" value="" />
|
||||
<option name="ALL_USERS" value="false" />
|
||||
<option name="ALWAYS_INSTALL_WITH_PM" value="false" />
|
||||
<option name="DYNAMIC_FEATURES_DISABLED_LIST" value="" />
|
||||
<option name="ACTIVITY_EXTRA_FLAGS" value="" />
|
||||
<option name="MODE" value="default_activity" />
|
||||
<option name="CLEAR_LOGCAT" value="false" />
|
||||
<option name="SHOW_LOGCAT_AUTOMATICALLY" value="false" />
|
||||
<option name="INSPECTION_WITHOUT_ACTIVITY_RESTART" value="false" />
|
||||
<option name="TARGET_SELECTION_MODE" value="DEVICE_AND_SNAPSHOT_COMBO_BOX" />
|
||||
<option name="SELECTED_CLOUD_MATRIX_CONFIGURATION_ID" value="-1" />
|
||||
<option name="SELECTED_CLOUD_MATRIX_PROJECT_ID" value="" />
|
||||
<option name="DEBUGGER_TYPE" value="Auto" />
|
||||
<Auto>
|
||||
<option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
|
||||
<option name="SHOW_STATIC_VARS" value="true" />
|
||||
<option name="WORKING_DIR" value="" />
|
||||
<option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
|
||||
<option name="SHOW_OPTIMIZED_WARNING" value="true" />
|
||||
</Auto>
|
||||
<Hybrid>
|
||||
<option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
|
||||
<option name="SHOW_STATIC_VARS" value="true" />
|
||||
<option name="WORKING_DIR" value="" />
|
||||
<option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
|
||||
<option name="SHOW_OPTIMIZED_WARNING" value="true" />
|
||||
</Hybrid>
|
||||
<Java />
|
||||
<Native>
|
||||
<option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
|
||||
<option name="SHOW_STATIC_VARS" value="true" />
|
||||
<option name="WORKING_DIR" value="" />
|
||||
<option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
|
||||
<option name="SHOW_OPTIMIZED_WARNING" value="true" />
|
||||
</Native>
|
||||
<Profilers>
|
||||
<option name="ADVANCED_PROFILING_ENABLED" value="false" />
|
||||
<option name="STARTUP_PROFILING_ENABLED" value="false" />
|
||||
<option name="STARTUP_CPU_PROFILING_ENABLED" value="false" />
|
||||
<option name="STARTUP_CPU_PROFILING_CONFIGURATION_NAME" value="Java/Kotlin Method Sample (legacy)" />
|
||||
<option name="STARTUP_NATIVE_MEMORY_PROFILING_ENABLED" value="false" />
|
||||
<option name="NATIVE_MEMORY_SAMPLE_RATE_BYTES" value="2048" />
|
||||
</Profilers>
|
||||
<option name="DEEP_LINK" value="" />
|
||||
<option name="ACTIVITY_CLASS" value="" />
|
||||
<option name="SEARCH_ACTIVITY_IN_GLOBAL_SCOPE" value="false" />
|
||||
<option name="SKIP_ACTIVITY_VALIDATION" value="false" />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
<configuration default="true" type="Application" factoryName="Application">
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration default="true" type="JUnit" factoryName="JUnit">
|
||||
<option name="TEST_OBJECT" value="class" />
|
||||
<option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration default="true" type="TestNG">
|
||||
<option name="TEST_OBJECT" value="CLASS" />
|
||||
<option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
|
||||
<properties />
|
||||
<listeners />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
||||
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
|
||||
<component name="TaskManager">
|
||||
<task active="true" id="Default" summary="Default task">
|
||||
<changelist id="fb7bf33b-30cf-40b9-a238-3e2f6f604a8f" name="Changes" comment="" />
|
||||
<created>1664103080085</created>
|
||||
<option name="number" value="Default" />
|
||||
<option name="presentableId" value="Default" />
|
||||
<updated>1664103080085</updated>
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
</project>
|
||||
@@ -1,23 +1,77 @@
|
||||
apply plugin: 'com.android.application'
|
||||
|
||||
android {
|
||||
compileSdkVersion 30
|
||||
compileSdkVersion 34
|
||||
buildToolsVersion "30.0.3"
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.gpl.rpg.AndorsTrail"
|
||||
minSdkVersion 14
|
||||
targetSdkVersion 30
|
||||
targetSdkVersion 34
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
manifestPlaceholders icon_name: 'icon', fileproviderPath: 'AndorsTrail'
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
|
||||
}
|
||||
debug {
|
||||
manifestPlaceholders icon_name: 'icon_beta', fileproviderPath: 'AndorsTrail.beta2'
|
||||
applicationIdSuffix 'beta2'
|
||||
signingConfig signingConfigs.debug
|
||||
}
|
||||
}
|
||||
namespace 'com.gpl.rpg.AndorsTrail'
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
res.srcDirs = ['build/gen-res', 'src/main/res']
|
||||
assets.srcDirs = ['build/gen-assets', 'src/main/assets']
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'com.android.support:support-v4:28.0.0'
|
||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||
}
|
||||
|
||||
task copyRes(type: Copy) {
|
||||
description "Copies the res folder to the modules res folder (& renames .tmx to .xml)"
|
||||
from "${rootDir}/res"
|
||||
into "${projectDir}/build/gen-res"
|
||||
rename "(.*)\\.tmx", "\$1.xml"
|
||||
}
|
||||
|
||||
task copyResValuesIn(type: Copy) {
|
||||
description "Exception Indonesian language code (Old IN was renamed to now ID)"
|
||||
from "${rootDir}/res/values-id/"
|
||||
into "${projectDir}/build/gen-res/values-in/"
|
||||
}
|
||||
|
||||
task copyTranslation(type: Copy) {
|
||||
description("Copies the translation files to the modules translations folder")
|
||||
from "${rootDir}/assets/translation"
|
||||
into "${projectDir}/build/gen-assets/translation"
|
||||
}
|
||||
|
||||
task cleanup(type: Delete) {
|
||||
description("Deletes the assets/translation and the res folder from the modules folder")
|
||||
delete "${projectDir}/build/gen-res", "${projectDir}/build/gen-assets/translation"
|
||||
}
|
||||
|
||||
afterEvaluate {
|
||||
project.tasks.copyRes.dependsOn project.tasks.copyResValuesIn
|
||||
|
||||
mergeDebugResources.dependsOn project.tasks.copyRes
|
||||
extractDeepLinksDebug.dependsOn project.tasks.copyRes
|
||||
mergeReleaseResources.dependsOn project.tasks.copyRes
|
||||
extractDeepLinksRelease.dependsOn project.tasks.copyRes
|
||||
|
||||
mergeDebugAssets.dependsOn project.tasks.copyTranslation
|
||||
mergeReleaseAssets.dependsOn project.tasks.copyTranslation
|
||||
extractDeepLinksDebug.dependsOn project.tasks.copyTranslation
|
||||
extractDeepLinksRelease.dependsOn project.tasks.copyTranslation
|
||||
|
||||
clean.dependsOn project.tasks.cleanup
|
||||
}
|
||||
|
||||
@@ -3,15 +3,11 @@
|
||||
<manifest
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.gpl.rpg.AndorsTrail"
|
||||
android:versionCode="65"
|
||||
android:versionName="0.8.1"
|
||||
android:versionCode="74"
|
||||
android:versionName="0.8.8"
|
||||
android:installLocation="auto"
|
||||
>
|
||||
<uses-sdk
|
||||
android:minSdkVersion="4"
|
||||
android:targetSdkVersion="30"
|
||||
/>
|
||||
|
||||
|
||||
<supports-screens
|
||||
android:smallScreens="true"
|
||||
android:normalScreens="true"
|
||||
@@ -27,7 +23,7 @@
|
||||
<application
|
||||
android:name="com.gpl.rpg.AndorsTrail.AndorsTrailApplication"
|
||||
android:label="@string/app_name"
|
||||
android:icon="@drawable/icon"
|
||||
android:icon="@drawable/${icon_name}"
|
||||
android:description="@string/app_description"
|
||||
android:allowBackup="true"
|
||||
android:theme="@style/AndorsTrailTheme_Blue"
|
||||
@@ -35,7 +31,8 @@
|
||||
android:hasFragileUserData="true"
|
||||
android:preserveLegacyExternalStorage="true"
|
||||
>
|
||||
<activity
|
||||
<activity
|
||||
android:exported="true"
|
||||
android:name="com.gpl.rpg.AndorsTrail.activity.StartScreenActivity"
|
||||
android:clearTaskOnLaunch="true"
|
||||
>
|
||||
@@ -66,8 +63,8 @@
|
||||
<activity android:name="com.gpl.rpg.AndorsTrail.activity.DisplayWorldMapActivity" />
|
||||
|
||||
<provider
|
||||
android:name="android.support.v4.content.FileProvider"
|
||||
android:authorities="com.gpl.rpg.AndorsTrail.fileprovider"
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
android:authorities="${applicationId}.fileprovider"
|
||||
android:grantUriPermissions="true"
|
||||
android:exported="false">
|
||||
<meta-data
|
||||
|
||||
@@ -28,11 +28,11 @@ public final class AndorsTrailApplication extends Application {
|
||||
public static final boolean DEVELOPMENT_FASTSPEED = false;
|
||||
public static final boolean DEVELOPMENT_VALIDATEDATA = false;
|
||||
public static final boolean DEVELOPMENT_DEBUGMESSAGES = false;
|
||||
public static final String CURRENT_VERSION_DISPLAY = "0.8.1";
|
||||
public static final String CURRENT_VERSION_DISPLAY = "0.8.8";
|
||||
public static final boolean IS_RELEASE_VERSION = !CURRENT_VERSION_DISPLAY.matches(".*[a-d].*");
|
||||
public static final boolean DEVELOPMENT_INCOMPATIBLE_SAVEGAMES = DEVELOPMENT_DEBUGRESOURCES || DEVELOPMENT_DEBUGBUTTONS || DEVELOPMENT_FASTSPEED || !IS_RELEASE_VERSION;
|
||||
public static final int DEVELOPMENT_INCOMPATIBLE_SAVEGAME_VERSION = 999;
|
||||
public static final int CURRENT_VERSION = DEVELOPMENT_INCOMPATIBLE_SAVEGAMES ? DEVELOPMENT_INCOMPATIBLE_SAVEGAME_VERSION : 65;
|
||||
public static final int CURRENT_VERSION = DEVELOPMENT_INCOMPATIBLE_SAVEGAMES ? DEVELOPMENT_INCOMPATIBLE_SAVEGAME_VERSION : 74;
|
||||
|
||||
private final AndorsTrailPreferences preferences = new AndorsTrailPreferences();
|
||||
private WorldContext world = new WorldContext();
|
||||
|
||||
@@ -78,7 +78,7 @@ public final class AndorsTrailPreferences {
|
||||
dest.dpadTransparency = Integer.parseInt(prefs.getString("dpadtransparency", Integer.toString(DPAD_TRANSPARENCY_50_PERCENT)));
|
||||
dest.dpadMinimizeable = prefs.getBoolean("dpadMinimizeable", true);
|
||||
dest.optimizedDrawing = prefs.getBoolean("optimized_drawing", false);
|
||||
dest.highQualityFilters = prefs.getBoolean("high_quality_filters", true);
|
||||
dest.highQualityFilters = prefs.getBoolean("high_quality_filters", false);
|
||||
dest.enableUiAnimations = prefs.getBoolean("enableUiAnimations", true);
|
||||
dest.displayOverwriteSavegame = Integer.parseInt(prefs.getString("display_overwrite_savegame", Integer.toString(CONFIRM_OVERWRITE_SAVEGAME_ALWAYS)));
|
||||
dest.quickslotsPosition = Integer.parseInt(prefs.getString("quickslots_placement", Integer.toString(QUICKSLOTS_POSITION_HORIZONTAL_CENTER_BOTTOM)));
|
||||
|
||||
@@ -15,7 +15,7 @@ import android.content.pm.PackageManager;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.Fragment;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.AdapterView;
|
||||
@@ -46,14 +46,15 @@ import com.gpl.rpg.AndorsTrail.model.item.Loot;
|
||||
import com.gpl.rpg.AndorsTrail.model.map.MapObject;
|
||||
import com.gpl.rpg.AndorsTrail.util.ThemeHelper;
|
||||
import com.gpl.rpg.AndorsTrail.view.CustomDialogFactory;
|
||||
import com.gpl.rpg.AndorsTrail.view.CustomDialogFactory.CustomDialog;
|
||||
import com.gpl.rpg.AndorsTrail.view.ItemContainerAdapter;
|
||||
|
||||
public final class Dialogs {
|
||||
|
||||
private static void showDialogAndPause(Dialog d, final ControllerContext context) {
|
||||
private static void showDialogAndPause(CustomDialog d, final ControllerContext context) {
|
||||
showDialogAndPause(d, context, null);
|
||||
}
|
||||
private static void showDialogAndPause(Dialog d, final ControllerContext context, final OnDismissListener onDismiss) {
|
||||
private static void showDialogAndPause(CustomDialog d, final ControllerContext context, final OnDismissListener onDismiss) {
|
||||
context.gameRoundController.pause();
|
||||
CustomDialogFactory.setDismissListener(d, new OnDismissListener() {
|
||||
@Override
|
||||
@@ -195,7 +196,7 @@ public final class Dialogs {
|
||||
// itemList.setPadding(20, 0, 20, 20);
|
||||
itemList.setAdapter(new ItemContainerAdapter(mainActivity, world.tileManager, combinedLoot.items, world.model.player));
|
||||
|
||||
final Dialog d = CustomDialogFactory.createDialog(mainActivity,
|
||||
final CustomDialog d = CustomDialogFactory.createDialog(mainActivity,
|
||||
mainActivity.getResources().getString(title),
|
||||
mainActivity.getResources().getDrawable(R.drawable.ui_icon_equipment),
|
||||
msg,
|
||||
@@ -249,7 +250,7 @@ public final class Dialogs {
|
||||
}
|
||||
|
||||
public static void showHeroDied(final MainActivity mainActivity, final ControllerContext controllers) {
|
||||
final Dialog d = CustomDialogFactory.createDialog(mainActivity,
|
||||
final CustomDialog d = CustomDialogFactory.createDialog(mainActivity,
|
||||
mainActivity.getResources().getString(R.string.dialog_game_over_title),
|
||||
mainActivity.getResources().getDrawable(R.drawable.ui_icon_combat),
|
||||
mainActivity.getResources().getString(R.string.dialog_game_over_text),
|
||||
@@ -286,7 +287,7 @@ public final class Dialogs {
|
||||
}
|
||||
|
||||
public static void showConfirmRest(final Activity currentActivity, final ControllerContext controllerContext, final MapObject area) {
|
||||
final Dialog d = CustomDialogFactory.createDialog(currentActivity,
|
||||
final CustomDialog d = CustomDialogFactory.createDialog(currentActivity,
|
||||
currentActivity.getResources().getString(R.string.dialog_rest_title),
|
||||
null,
|
||||
currentActivity.getResources().getString(R.string.dialog_rest_confirm_message),
|
||||
@@ -310,7 +311,7 @@ public final class Dialogs {
|
||||
// .setMessage(R.string.dialog_rest_message)
|
||||
// .setNeutralButton(android.R.string.ok, null)
|
||||
// .create();
|
||||
final Dialog d = CustomDialogFactory.createDialog(currentActivity,
|
||||
final CustomDialog d = CustomDialogFactory.createDialog(currentActivity,
|
||||
currentActivity.getResources().getString(R.string.dialog_rest_title),
|
||||
null,
|
||||
currentActivity.getResources().getString(R.string.dialog_rest_message),
|
||||
@@ -336,7 +337,7 @@ public final class Dialogs {
|
||||
text += currentActivity.getResources().getString(R.string.dialog_newversion_permission_information);
|
||||
}
|
||||
|
||||
final Dialog d = CustomDialogFactory.createDialog(currentActivity,
|
||||
final CustomDialog d = CustomDialogFactory.createDialog(currentActivity,
|
||||
currentActivity.getResources().getString(R.string.dialog_newversion_title),
|
||||
null,
|
||||
text,
|
||||
@@ -371,7 +372,7 @@ public final class Dialogs {
|
||||
}
|
||||
|
||||
if (!world.model.statistics.hasUnlimitedSaves()) {
|
||||
final Dialog d = CustomDialogFactory.createDialog(mainActivity,
|
||||
final CustomDialog d = CustomDialogFactory.createDialog(mainActivity,
|
||||
mainActivity.getResources().getString(R.string.menu_save_switch_character_title),
|
||||
null,
|
||||
mainActivity.getResources().getString(R.string.menu_save_switch_character),
|
||||
@@ -460,7 +461,7 @@ public final class Dialogs {
|
||||
itemList.setAdapter(new ArrayAdapter<String>(context, R.layout.combatlog_row, android.R.id.text1, combatLogMessages));
|
||||
view = itemList;
|
||||
|
||||
final Dialog d = CustomDialogFactory.createDialog(context,
|
||||
final CustomDialog d = CustomDialogFactory.createDialog(context,
|
||||
context.getResources().getString(R.string.combat_log_title),
|
||||
context.getResources().getDrawable(R.drawable.ui_icon_combat),
|
||||
null,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.gpl.rpg.AndorsTrail.activity;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.FragmentActivity;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import com.gpl.rpg.AndorsTrail.AndorsTrailApplication;
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ import com.gpl.rpg.AndorsTrail.controller.ItemController;
|
||||
import com.gpl.rpg.AndorsTrail.model.item.ItemType;
|
||||
import com.gpl.rpg.AndorsTrail.util.ThemeHelper;
|
||||
import com.gpl.rpg.AndorsTrail.view.CustomDialogFactory;
|
||||
import com.gpl.rpg.AndorsTrail.view.CustomDialogFactory.CustomDialog;
|
||||
|
||||
/**
|
||||
* @author ejwessel
|
||||
@@ -206,7 +207,7 @@ public final class BulkSelectionInterface extends AndorsTrailBaseActivity implem
|
||||
// })
|
||||
// .setNegativeButton(android.R.string.no, null)
|
||||
// .show();
|
||||
final Dialog d = CustomDialogFactory.createDialog(v.getContext(),
|
||||
final CustomDialog d = CustomDialogFactory.createDialog(v.getContext(),
|
||||
v.getContext().getResources().getString(R.string.bulkselection_sell_confirmation_title),
|
||||
v.getContext().getResources().getDrawable(android.R.drawable.ic_dialog_info),
|
||||
message,
|
||||
|
||||
@@ -277,6 +277,27 @@ public final class DebugInterface {
|
||||
controllerContext.movementController.placePlayerAsyncAt(MapObject.MapObjectType.newmap, "sullengard2", "south", 0, 0);
|
||||
}
|
||||
})
|
||||
,new DebugButton("gal", new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View arg0) {
|
||||
controllerContext.movementController.placePlayerAsyncAt(MapObject.MapObjectType.newmap, "galmore_19", "south", 0, 0);
|
||||
}
|
||||
})
|
||||
|
||||
,new DebugButton("apl", new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View arg0) {
|
||||
controllerContext.movementController.placePlayerAsyncAt(MapObject.MapObjectType.newmap, "sullengard_apple_farm_east", "house", 0, 0);
|
||||
}
|
||||
})
|
||||
|
||||
,new DebugButton("wch", new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View arg0) {
|
||||
controllerContext.movementController.placePlayerAsyncAt(MapObject.MapObjectType.newmap, "lake_shore_road_0", "west", 0, 0);
|
||||
}
|
||||
})
|
||||
|
||||
}));
|
||||
buttonList.addAll(tpButtons2);
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.gpl.rpg.AndorsTrail.activity;
|
||||
|
||||
import android.content.res.Resources;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.FragmentTabHost;
|
||||
import androidx.fragment.app.FragmentTabHost;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -20,11 +20,12 @@ import com.gpl.rpg.AndorsTrail.savegames.Savegames;
|
||||
import com.gpl.rpg.AndorsTrail.util.ThemeHelper;
|
||||
import com.gpl.rpg.AndorsTrail.view.CloudsAnimatorView;
|
||||
import com.gpl.rpg.AndorsTrail.view.CustomDialogFactory;
|
||||
import com.gpl.rpg.AndorsTrail.view.CustomDialogFactory.CustomDialog;
|
||||
|
||||
public final class LoadingActivity extends AndorsTrailBaseActivity implements OnResourcesLoadedListener, OnSceneLoadedListener {
|
||||
|
||||
private WorldSetup setup;
|
||||
private Dialog progressDialog;
|
||||
private CustomDialog progressDialog;
|
||||
private CloudsAnimatorView clouds_back, clouds_mid, clouds_front;
|
||||
boolean loaded = false;
|
||||
|
||||
@@ -165,7 +166,7 @@ public final class LoadingActivity extends AndorsTrailBaseActivity implements On
|
||||
}
|
||||
|
||||
private void showLoadingFailedDialog(int messageResourceID) {
|
||||
final Dialog d = CustomDialogFactory.createDialog(this, getResources().getString(R.string.dialog_loading_failed_title), null, getResources().getString(messageResourceID), null, true);
|
||||
final CustomDialog d = CustomDialogFactory.createDialog(this, getResources().getString(R.string.dialog_loading_failed_title), null, getResources().getString(messageResourceID), null, true);
|
||||
CustomDialogFactory.addDismissButton(d, android.R.string.ok);
|
||||
CustomDialogFactory.setDismissListener(d, new OnDismissListener() {
|
||||
@Override
|
||||
|
||||
@@ -43,6 +43,7 @@ import com.gpl.rpg.AndorsTrail.util.Coord;
|
||||
import com.gpl.rpg.AndorsTrail.util.ThemeHelper;
|
||||
import com.gpl.rpg.AndorsTrail.view.CombatView;
|
||||
import com.gpl.rpg.AndorsTrail.view.CustomDialogFactory;
|
||||
import com.gpl.rpg.AndorsTrail.view.CustomDialogFactory.CustomDialog;
|
||||
import com.gpl.rpg.AndorsTrail.view.DisplayActiveActorConditionIcons;
|
||||
import com.gpl.rpg.AndorsTrail.view.ItemContainerAdapter;
|
||||
import com.gpl.rpg.AndorsTrail.view.MainView;
|
||||
@@ -247,7 +248,7 @@ public final class MainActivity
|
||||
final ItemContainerAdapter inventoryListAdapter = new QuickslotsItemContainerAdapter(lv.getContext(), world.tileManager, world.model.player.inventory.usableItems(), world.model.player, wornTiles);
|
||||
lv.setAdapter(inventoryListAdapter);
|
||||
|
||||
final Dialog d = CustomDialogFactory.createDialog(v.getContext(),
|
||||
final CustomDialog d = CustomDialogFactory.createDialog(v.getContext(),
|
||||
v.getResources().getString(R.string.inventory_assign),
|
||||
v.getResources().getDrawable(R.drawable.ui_icon_equipment),
|
||||
v.getResources().getString(R.string.inventory_selectitem), view, false);
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.gpl.rpg.AndorsTrail.activity;
|
||||
|
||||
import android.content.res.Resources;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.FragmentTabHost;
|
||||
import androidx.fragment.app.FragmentTabHost;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
|
||||
@@ -11,6 +11,7 @@ import com.gpl.rpg.AndorsTrail.resource.tiles.TileManager;
|
||||
import com.gpl.rpg.AndorsTrail.util.ThemeHelper;
|
||||
import com.gpl.rpg.AndorsTrail.view.CloudsAnimatorView;
|
||||
import com.gpl.rpg.AndorsTrail.view.CustomDialogFactory;
|
||||
import com.gpl.rpg.AndorsTrail.view.CustomDialogFactory.CustomDialog;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Dialog;
|
||||
@@ -20,8 +21,8 @@ import android.content.pm.PackageManager;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.drawable.AnimationDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.support.v4.app.FragmentManager.OnBackStackChangedListener;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager.OnBackStackChangedListener;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewTreeObserver;
|
||||
@@ -114,7 +115,7 @@ public final class StartScreenActivity extends AndorsTrailBaseFragmentActivity i
|
||||
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
|
||||
if (grantResults.length > 0 && grantResults[0] != PackageManager.PERMISSION_GRANTED) {
|
||||
|
||||
final Dialog d = CustomDialogFactory.createDialog(this,
|
||||
final CustomDialog d = CustomDialogFactory.createDialog(this,
|
||||
getResources().getString(R.string.dialog_permission_information_title),
|
||||
getResources().getDrawable(android.R.drawable.ic_dialog_info),
|
||||
getResources().getString(R.string.dialog_permission_information),
|
||||
|
||||
@@ -5,7 +5,7 @@ import java.util.Arrays;
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.Fragment;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
|
||||
@@ -8,7 +8,7 @@ import java.util.Map;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.Fragment;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
@@ -5,7 +5,7 @@ import java.util.ArrayList;
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.Fragment;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
@@ -5,7 +5,7 @@ import java.util.ArrayList;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.Fragment;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
|
||||
@@ -4,7 +4,7 @@ import java.util.HashSet;
|
||||
|
||||
import android.content.res.Resources;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.Fragment;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
@@ -12,7 +12,7 @@ import android.content.SharedPreferences.Editor;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.Fragment;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
@@ -38,25 +38,26 @@ import com.gpl.rpg.AndorsTrail.util.AndroidStorage;
|
||||
import com.gpl.rpg.AndorsTrail.util.L;
|
||||
import com.gpl.rpg.AndorsTrail.util.ThemeHelper;
|
||||
import com.gpl.rpg.AndorsTrail.view.CustomDialogFactory;
|
||||
import com.gpl.rpg.AndorsTrail.view.CustomDialogFactory.CustomDialog;
|
||||
|
||||
public class StartScreenActivity_MainMenu extends Fragment {
|
||||
|
||||
private static final int INTENTREQUEST_PREFERENCES = 7;
|
||||
public static final int INTENTREQUEST_LOADGAME = 9;
|
||||
private static final int INTENTREQUEST_PREFERENCES = 7;
|
||||
public static final int INTENTREQUEST_LOADGAME = 9;
|
||||
|
||||
private boolean hasExistingGame = false;
|
||||
private Button startscreen_continue;
|
||||
private Button startscreen_newgame;
|
||||
private Button startscreen_load;
|
||||
private ViewGroup save_preview_holder;
|
||||
private ImageView save_preview_hero_icon;
|
||||
private TextView save_preview_hero_desc;
|
||||
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
updatePreferences(false);
|
||||
super.onCreateView(inflater, container, savedInstanceState);
|
||||
private boolean hasExistingGame = false;
|
||||
private Button startscreen_continue;
|
||||
private Button startscreen_newgame;
|
||||
private Button startscreen_load;
|
||||
private ViewGroup save_preview_holder;
|
||||
private ImageView save_preview_hero_icon;
|
||||
private TextView save_preview_hero_desc;
|
||||
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
updatePreferences(false);
|
||||
super.onCreateView(inflater, container, savedInstanceState);
|
||||
|
||||
|
||||
if (container != null) {
|
||||
@@ -64,11 +65,11 @@ public class StartScreenActivity_MainMenu extends Fragment {
|
||||
}
|
||||
|
||||
View root = inflater.inflate(R.layout.startscreen_mainmenu, container, false);
|
||||
|
||||
|
||||
save_preview_holder = (ViewGroup) root.findViewById(R.id.save_preview_holder);
|
||||
save_preview_hero_icon = (ImageView) root.findViewById(R.id.save_preview_hero_icon);
|
||||
save_preview_hero_desc = (TextView) root.findViewById(R.id.save_preview_hero_desc);
|
||||
|
||||
|
||||
|
||||
startscreen_continue = (Button) root.findViewById(R.id.startscreen_continue);
|
||||
startscreen_continue.setOnClickListener(new OnClickListener() {
|
||||
@@ -114,7 +115,7 @@ public class StartScreenActivity_MainMenu extends Fragment {
|
||||
AndorsTrailApplication app = AndorsTrailApplication.getApplicationFromActivity(getActivity());
|
||||
if (hasExistingGame && app != null && app.getWorld() != null && app.getWorld().model != null
|
||||
&& app.getWorld().model.statistics != null && !app.getWorld().model.statistics.hasUnlimitedSaves()) {
|
||||
final Dialog d = CustomDialogFactory.createDialog(getActivity(),
|
||||
final CustomDialog d = CustomDialogFactory.createDialog(getActivity(),
|
||||
getString(R.string.startscreen_load_game),
|
||||
getResources().getDrawable(android.R.drawable.ic_delete),
|
||||
getString(R.string.startscreen_load_game_confirm),
|
||||
@@ -134,7 +135,7 @@ public class StartScreenActivity_MainMenu extends Fragment {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
if (AndorsTrailApplication.DEVELOPMENT_FORCE_STARTNEWGAME) {
|
||||
if (AndorsTrailApplication.DEVELOPMENT_DEBUGRESOURCES) {
|
||||
@@ -152,14 +153,14 @@ public class StartScreenActivity_MainMenu extends Fragment {
|
||||
checkAndRequestPermissions(getActivity());
|
||||
migrateDataOnDemand(getActivity());
|
||||
}
|
||||
|
||||
|
||||
return root;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
|
||||
|
||||
String playerName;
|
||||
String displayInfo = null;
|
||||
int iconID = TileManager.CHAR_HERO;
|
||||
@@ -189,14 +190,10 @@ public class StartScreenActivity_MainMenu extends Fragment {
|
||||
setCurrentVersionForVersionCheck();
|
||||
checkAndRequestPermissions(getActivity());
|
||||
migrateDataOnDemand(getActivity());
|
||||
boolean hasSavegames = !Savegames.getUsedSavegameSlots(getActivity()).isEmpty();
|
||||
startscreen_load.setEnabled(hasSavegames);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
boolean hasSavegames = !Savegames.getUsedSavegameSlots(getActivity()).isEmpty();
|
||||
startscreen_load.setEnabled(hasSavegames);
|
||||
}
|
||||
|
||||
@TargetApi(29)
|
||||
@@ -204,23 +201,16 @@ public class StartScreenActivity_MainMenu extends Fragment {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||
if (activity.getApplicationContext().checkSelfPermission(Manifest.permission.READ_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED) {
|
||||
if (AndroidStorage.shouldMigrateToInternalStorage(activity.getApplicationContext())) {
|
||||
final Dialog d = CustomDialogFactory.createDialog(activity,
|
||||
final CustomDialog d = CustomDialogFactory.createDialog(activity,
|
||||
getString(R.string.startscreen_migration_title),
|
||||
activity.getResources().getDrawable(android.R.drawable.ic_dialog_alert),
|
||||
getString(R.string.startscreen_migration_text),
|
||||
null,
|
||||
true);
|
||||
CustomDialogFactory.addDismissButton(d, android.R.string.ok);
|
||||
d.setOnDismissListener(new DialogInterface.OnDismissListener() {
|
||||
@Override
|
||||
public void onDismiss(DialogInterface arg0) {
|
||||
boolean hasSavegames = !Savegames.getUsedSavegameSlots(getActivity()).isEmpty();
|
||||
startscreen_load.setEnabled(hasSavegames);
|
||||
}
|
||||
});
|
||||
CustomDialogFactory.show(d);
|
||||
if (!AndroidStorage.migrateToInternalStorage(activity.getApplicationContext())) {
|
||||
final Dialog errorDlg = CustomDialogFactory.createDialog(activity,
|
||||
final CustomDialog errorDlg = CustomDialogFactory.createDialog(activity,
|
||||
getString(R.string.startscreen_migration_title),
|
||||
activity.getResources().getDrawable(android.R.drawable.ic_dialog_alert),
|
||||
getString(R.string.startscreen_migration_failure),
|
||||
@@ -259,13 +249,13 @@ public class StartScreenActivity_MainMenu extends Fragment {
|
||||
super.onAttach(activity);
|
||||
listener = (OnNewGameRequestedListener) activity;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onDetach() {
|
||||
super.onDetach();
|
||||
listener = null;
|
||||
}
|
||||
|
||||
|
||||
private void setButtonState(final String playerName, final String displayInfo, int iconID, boolean isDead) {
|
||||
startscreen_continue.setEnabled(hasExistingGame && !isDead);
|
||||
startscreen_newgame.setEnabled(true);
|
||||
@@ -305,9 +295,9 @@ public class StartScreenActivity_MainMenu extends Fragment {
|
||||
// .create().show();
|
||||
//
|
||||
//
|
||||
final Dialog d = CustomDialogFactory.createDialog(getActivity(),
|
||||
getString(R.string.startscreen_newgame),
|
||||
getResources().getDrawable(android.R.drawable.ic_delete),
|
||||
final CustomDialog d = CustomDialogFactory.createDialog(getActivity(),
|
||||
getString(R.string.startscreen_newgame),
|
||||
getResources().getDrawable(android.R.drawable.ic_delete),
|
||||
getResources().getString(R.string.startscreen_newgame_confirm),
|
||||
null,
|
||||
true);
|
||||
@@ -318,9 +308,9 @@ public class StartScreenActivity_MainMenu extends Fragment {
|
||||
}
|
||||
});
|
||||
CustomDialogFactory.addDismissButton(d, android.R.string.cancel);
|
||||
|
||||
|
||||
CustomDialogFactory.show(d);
|
||||
|
||||
|
||||
}
|
||||
|
||||
private static final String versionCheck = "lastversion";
|
||||
@@ -337,64 +327,90 @@ public class StartScreenActivity_MainMenu extends Fragment {
|
||||
e.putInt(versionCheck, AndorsTrailApplication.CURRENT_VERSION);
|
||||
e.commit();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
switch (requestCode) {
|
||||
case INTENTREQUEST_LOADGAME:
|
||||
if (resultCode != Activity.RESULT_OK) break;
|
||||
final int slot = data.getIntExtra("slot", 1);
|
||||
continueGame(false, slot, null);
|
||||
break;
|
||||
case INTENTREQUEST_PREFERENCES:
|
||||
updatePreferences(true);
|
||||
break;
|
||||
|
||||
@Override
|
||||
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
switch (requestCode) {
|
||||
case INTENTREQUEST_LOADGAME:
|
||||
boolean unsuccessful = resultCode != Activity.RESULT_OK;
|
||||
if(data == null) break;
|
||||
|
||||
final boolean wasImportOrExport = data.getBooleanExtra("import_export", false);
|
||||
if (wasImportOrExport) {
|
||||
String message = getImportExportMessage(!unsuccessful, data);
|
||||
Toast.makeText(getActivity(), message, Toast.LENGTH_LONG).show();
|
||||
break;
|
||||
}
|
||||
if (unsuccessful) break;
|
||||
final int slot = data.getIntExtra("slot", 1);
|
||||
continueGame(false, slot, null);
|
||||
break;
|
||||
case INTENTREQUEST_PREFERENCES:
|
||||
updatePreferences(true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private String getImportExportMessage(boolean successful, Intent data) {
|
||||
String message = "";
|
||||
boolean isImportWorldmap = data.getBooleanExtra("import_worldmap", false);
|
||||
boolean isImportSaves = data.getBooleanExtra("import_savegames", false);
|
||||
boolean isExport = data.getBooleanExtra("export", false);
|
||||
|
||||
if(isImportWorldmap) {
|
||||
message = getString(successful ? R.string.loadsave_import_worldmap_successfull : R.string.loadsave_import_worldmap_unsuccessfull);
|
||||
} else if(isImportSaves) {
|
||||
message = getString(successful ? R.string.loadsave_import_save_successfull : R.string.loadsave_import_save_unsuccessfull);
|
||||
} else if(isExport) {
|
||||
message = getString(successful ? R.string.loadsave_export_successfull : R.string.loadsave_export_unsuccessfull);
|
||||
}
|
||||
|
||||
return message;
|
||||
}
|
||||
|
||||
|
||||
private void updatePreferences(boolean alreadyStartedLoadingResources) {
|
||||
AndorsTrailApplication app = AndorsTrailApplication.getApplicationFromActivity(getActivity());
|
||||
AndorsTrailPreferences preferences = app.getPreferences();
|
||||
preferences.read(getActivity());
|
||||
if (app.setLocale(getActivity())) {
|
||||
if (alreadyStartedLoadingResources) {
|
||||
// Changing the locale after having loaded the game requires resources to
|
||||
// be re-loaded. Therefore, we just exit here.
|
||||
Toast.makeText(getActivity(), R.string.change_locale_requires_restart, Toast.LENGTH_LONG).show();
|
||||
doFinish();
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (ThemeHelper.changeTheme(preferences.selectedTheme)) {
|
||||
// Changing the theme requires a restart to re-create all activities.
|
||||
Toast.makeText(getActivity(), R.string.change_theme_requires_restart, Toast.LENGTH_LONG).show();
|
||||
doFinish();
|
||||
return;
|
||||
}
|
||||
app.getWorld().tileManager.updatePreferences(preferences);
|
||||
}
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
private void doFinish() {
|
||||
//For Lollipop and above
|
||||
((AndorsTrailApplication)getActivity().getApplication()).discardWorld();
|
||||
getActivity().finish();
|
||||
}
|
||||
AndorsTrailApplication app = AndorsTrailApplication.getApplicationFromActivity(getActivity());
|
||||
AndorsTrailPreferences preferences = app.getPreferences();
|
||||
preferences.read(getActivity());
|
||||
if (app.setLocale(getActivity())) {
|
||||
if (alreadyStartedLoadingResources) {
|
||||
// Changing the locale after having loaded the game requires resources to
|
||||
// be re-loaded. Therefore, we just exit here.
|
||||
Toast.makeText(getActivity(), R.string.change_locale_requires_restart, Toast.LENGTH_LONG).show();
|
||||
doFinish();
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (ThemeHelper.changeTheme(preferences.selectedTheme)) {
|
||||
// Changing the theme requires a restart to re-create all activities.
|
||||
Toast.makeText(getActivity(), R.string.change_theme_requires_restart, Toast.LENGTH_LONG).show();
|
||||
doFinish();
|
||||
return;
|
||||
}
|
||||
app.getWorld().tileManager.updatePreferences(preferences);
|
||||
}
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
private void doFinish() {
|
||||
//For Lollipop and above
|
||||
((AndorsTrailApplication) getActivity().getApplication()).discardWorld();
|
||||
getActivity().finish();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public interface OnNewGameRequestedListener {
|
||||
public void onNewGameRequested();
|
||||
}
|
||||
|
||||
|
||||
private OnNewGameRequestedListener listener = null;
|
||||
|
||||
|
||||
private void createNewGame() {
|
||||
if (listener != null) {
|
||||
listener.onNewGameRequested();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.gpl.rpg.AndorsTrail.activity.fragment;
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.Fragment;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
|
||||
@@ -579,6 +579,13 @@ public final class CombatController implements VisualEffectCompletedCallback {
|
||||
private static final int n = 50;
|
||||
private static final int F = 40;
|
||||
private static final float two_divided_by_PI = (float) (2f / Math.PI);
|
||||
/**
|
||||
* @implNote
|
||||
* formula: 50 * (1 + (2 / pi) * atan((attackChance - blockChance - n) / F))
|
||||
* <br/>
|
||||
* n = {@value n}; F = {@value F}
|
||||
* @return [0..100] . 100 == always hit.
|
||||
*/
|
||||
private static int getAttackHitChance(final Actor attacker, final Actor target) {
|
||||
final int c = attacker.getAttackChance() - target.getBlockChance();
|
||||
// (2/pi)*atan(..) will vary from -1 to +1 .
|
||||
|
||||
@@ -7,7 +7,7 @@ import com.gpl.rpg.AndorsTrail.util.ConstRange;
|
||||
import com.gpl.rpg.AndorsTrail.util.Range;
|
||||
|
||||
public final class Constants {
|
||||
public static final int PERCENT_EXP_LOST_WHEN_DIED = 30;
|
||||
public static final int PERCENT_EXP_LOST_WHEN_DIED = 20;
|
||||
public static final int LEVELUP_EFFECT_HEALTH = 5;
|
||||
public static final int LEVELUP_EFFECT_ATK_CH = 5;
|
||||
public static final int LEVELUP_EFFECT_ATK_DMG = 1;
|
||||
@@ -51,6 +51,10 @@ public final class Constants {
|
||||
public static final String CHEAT_DETECTION_FOLDER = "dEAGyGE3YojqXjI3x4x7";
|
||||
public static final String PASSIVE_ACHIEVEMENT_CHECK_PHRASE = "passive_achievement_check";
|
||||
|
||||
public static final String SAVEGAME_FILE_MIME_TYPE = "application/octet-stream";
|
||||
public static final String WORLDMAP_FILE_MIME_TYPE = "image/png";
|
||||
public static final String NO_FILE_EXTENSION_MIME_TYPE = "application/no_file_extension_mime_type";
|
||||
|
||||
public static final Random rnd = new Random();
|
||||
public static int rollValue(final ConstRange r) { return rollValue(r.max, r.current); }
|
||||
public static int rollValue(final ConstRange r, int bias) { return rollValue((r.max + 1) * 100 -1, r.current * 100 + bias)/100; }
|
||||
|
||||
@@ -22,6 +22,7 @@ import com.gpl.rpg.AndorsTrail.model.conversation.Reply;
|
||||
import com.gpl.rpg.AndorsTrail.model.item.ItemTypeCollection;
|
||||
import com.gpl.rpg.AndorsTrail.model.item.Loot;
|
||||
import com.gpl.rpg.AndorsTrail.model.map.LayeredTileMap;
|
||||
import com.gpl.rpg.AndorsTrail.model.map.MapObject;
|
||||
import com.gpl.rpg.AndorsTrail.model.map.MonsterSpawnArea;
|
||||
import com.gpl.rpg.AndorsTrail.model.map.PredefinedMap;
|
||||
import com.gpl.rpg.AndorsTrail.model.quest.QuestLogEntry;
|
||||
@@ -124,6 +125,9 @@ public final class ConversationController {
|
||||
case changeMapFilter:
|
||||
changeMapFilter(res, effect.mapName, effect.effectID);
|
||||
break;
|
||||
case mapchange:
|
||||
mapchange(effect.mapName, effect.effectID);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -172,6 +176,13 @@ public final class ConversationController {
|
||||
}
|
||||
}
|
||||
|
||||
private void mapchange(String mapName, String place) {
|
||||
PredefinedMap map = findMapForScriptEffect(mapName);
|
||||
// controllers.mapController.activateMapObjectGroup(map, mapObjectGroupID);
|
||||
// controllerContext.movementController.placePlayerAsyncAt(MapObject.MapObjectType.newmap, effect.mapName, effect.effectID, 0, 0); //cbcbcb check
|
||||
controllers.movementController.placePlayerAsyncAt(MapObject.MapObjectType.newmap, mapName, place, 0, 0);
|
||||
}
|
||||
|
||||
private void addAlignmentReward(Player player, String faction, int delta) {
|
||||
player.addAlignment(faction, delta);
|
||||
MovementController.refreshMonsterAggressiveness(world.model.currentMaps.map, world.model.player);
|
||||
@@ -311,6 +322,18 @@ public final class ConversationController {
|
||||
case factionScoreEquals:
|
||||
result = player.getAlignment(requirement.requireID) == requirement.value;
|
||||
break;
|
||||
case date:
|
||||
result = world.model.worldData.getDate(requirement.requireID) >= requirement.value;
|
||||
break;
|
||||
case dateEquals:
|
||||
result = world.model.worldData.getDate(requirement.requireID) == requirement.value;
|
||||
break;
|
||||
case time:
|
||||
result = world.model.worldData.getTime(requirement.requireID) >= requirement.value;
|
||||
break;
|
||||
case timeEquals:
|
||||
result = world.model.worldData.getTime(requirement.requireID) == requirement.value;
|
||||
break;
|
||||
default:
|
||||
result = true;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.gpl.rpg.AndorsTrail.controller;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Build;
|
||||
import android.util.SparseIntArray;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
@@ -98,28 +99,36 @@ public final class InputController implements OnClickListener, OnLongClickListen
|
||||
|
||||
// Keys mapping to UP_LEFT
|
||||
key = KEY_MOVE_UP_LEFT;
|
||||
keyMap.put(KeyEvent.KEYCODE_DPAD_UP_LEFT, key);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
keyMap.put(KeyEvent.KEYCODE_DPAD_UP_LEFT, key);
|
||||
}
|
||||
keyMap.put(KeyEvent.KEYCODE_NUMPAD_7, key);
|
||||
keyMap.put(KeyEvent.KEYCODE_7, key);
|
||||
keyMap.put(KeyEvent.KEYCODE_MOVE_HOME, key);
|
||||
|
||||
// Keys mapping to UP_RIGHT
|
||||
key = KEY_MOVE_UP_RIGHT;
|
||||
keyMap.put(KeyEvent.KEYCODE_DPAD_UP_RIGHT, key);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
keyMap.put(KeyEvent.KEYCODE_DPAD_UP_RIGHT, key);
|
||||
}
|
||||
keyMap.put(KeyEvent.KEYCODE_NUMPAD_9, key);
|
||||
keyMap.put(KeyEvent.KEYCODE_9, key);
|
||||
keyMap.put(KeyEvent.KEYCODE_PAGE_UP, key);
|
||||
|
||||
// Keys mapping to DOWN_LEFT
|
||||
key = KEY_MOVE_DOWN_LEFT;
|
||||
keyMap.put(KeyEvent.KEYCODE_DPAD_DOWN_LEFT, key);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
keyMap.put(KeyEvent.KEYCODE_DPAD_DOWN_LEFT, key);
|
||||
}
|
||||
keyMap.put(KeyEvent.KEYCODE_NUMPAD_1, key);
|
||||
keyMap.put(KeyEvent.KEYCODE_1, key);
|
||||
keyMap.put(KeyEvent.KEYCODE_MOVE_END, key);
|
||||
|
||||
// Keys mapping to DOWN_RIGHT
|
||||
key = KEY_MOVE_DOWN_RIGHT;
|
||||
keyMap.put(KeyEvent.KEYCODE_DPAD_DOWN_RIGHT, key);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
keyMap.put(KeyEvent.KEYCODE_DPAD_DOWN_RIGHT, key);
|
||||
}
|
||||
keyMap.put(KeyEvent.KEYCODE_NUMPAD_3, key);
|
||||
keyMap.put(KeyEvent.KEYCODE_3, key);
|
||||
keyMap.put(KeyEvent.KEYCODE_PAGE_DOWN, key);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.gpl.rpg.AndorsTrail.controller;
|
||||
|
||||
import com.gpl.rpg.AndorsTrail.AndorsTrailApplication;
|
||||
import com.gpl.rpg.AndorsTrail.context.ControllerContext;
|
||||
import com.gpl.rpg.AndorsTrail.context.WorldContext;
|
||||
import com.gpl.rpg.AndorsTrail.controller.listeners.CombatActionListeners;
|
||||
@@ -17,6 +18,7 @@ import com.gpl.rpg.AndorsTrail.model.item.ItemCategory;
|
||||
import com.gpl.rpg.AndorsTrail.model.item.ItemType;
|
||||
import com.gpl.rpg.AndorsTrail.model.item.ItemTypeCollection;
|
||||
import com.gpl.rpg.AndorsTrail.util.ConstRange;
|
||||
import com.gpl.rpg.AndorsTrail.util.L;
|
||||
|
||||
public final class SkillController {
|
||||
private final ControllerContext controllers;
|
||||
@@ -58,6 +60,9 @@ public final class SkillController {
|
||||
|
||||
public static int getDropChanceRollBias(DropItem item, Player player) {
|
||||
if (player == null) return 0;
|
||||
if(item.itemType == null && AndorsTrailApplication.DEVELOPMENT_DEBUGMESSAGES){
|
||||
L.log("Item type missing: " + item + " " + player.id);
|
||||
}
|
||||
|
||||
if (ItemTypeCollection.isGoldItemType(item.itemType.id)) {
|
||||
return getRollBias(item, player, SkillID.coinfinder, SkillCollection.PER_SKILLPOINT_INCREASE_COINFINDER_CHANCE_PERCENT);
|
||||
|
||||
@@ -19,6 +19,7 @@ import com.gpl.rpg.AndorsTrail.model.actor.MonsterType;
|
||||
import com.gpl.rpg.AndorsTrail.model.item.ItemType;
|
||||
import com.gpl.rpg.AndorsTrail.model.map.PredefinedMap;
|
||||
import com.gpl.rpg.AndorsTrail.model.quest.Quest;
|
||||
import com.gpl.rpg.AndorsTrail.util.HashMapHelper;
|
||||
|
||||
public final class GameStatistics {
|
||||
private int deaths = 0;
|
||||
@@ -36,10 +37,10 @@ public final class GameStatistics {
|
||||
|
||||
public void addMonsterKill(MonsterType monsterType) {
|
||||
// Track monster kills by type ID, for savegame file
|
||||
killedMonstersByTypeID.put(monsterType.id, killedMonstersByTypeID.getOrDefault((monsterType.id), 0) + 1);
|
||||
killedMonstersByTypeID.put(monsterType.id, getNumberOfKillsForMonsterType(monsterType.id) + 1);
|
||||
|
||||
// Also track by name, for statistics display (multiple IDs w/same name don't matter to player)
|
||||
killedMonstersByName.put(monsterType.name, killedMonstersByName.getOrDefault(monsterType.name, 0) + 1);
|
||||
killedMonstersByName.put(monsterType.name, getNumberOfKillsForMonsterName(monsterType.name) + 1);
|
||||
}
|
||||
|
||||
public void addPlayerDeath(int lostExp) {
|
||||
@@ -50,8 +51,7 @@ public final class GameStatistics {
|
||||
}
|
||||
public void addItemUsage(ItemType type) {
|
||||
final String n = type.id;
|
||||
if (!usedItems.containsKey(n)) usedItems.put(n, 1);
|
||||
else usedItems.put(n, usedItems.get(n) + 1);
|
||||
usedItems.put(n, HashMapHelper.getOrDefault(usedItems, n,0) + 1);
|
||||
}
|
||||
|
||||
public int getDeaths() {
|
||||
@@ -73,15 +73,11 @@ public final class GameStatistics {
|
||||
public boolean isDead() { return !hasUnlimitedLives() && getLivesLeft() < 1; }
|
||||
|
||||
public int getNumberOfKillsForMonsterType(String monsterTypeID) {
|
||||
Integer v = killedMonstersByTypeID.get(monsterTypeID);
|
||||
if (v == null) return 0;
|
||||
return v;
|
||||
return HashMapHelper.getOrDefault(killedMonstersByTypeID, monsterTypeID, 0);
|
||||
}
|
||||
|
||||
public int getNumberOfKillsForMonsterName(String monsterName) {
|
||||
Integer v = killedMonstersByName.get(monsterName);
|
||||
if (v == null) return 0;
|
||||
return v;
|
||||
return HashMapHelper.getOrDefault(killedMonstersByName, monsterName, 0);
|
||||
}
|
||||
|
||||
public String getTop5MostCommonlyKilledMonsters(WorldContext world, Resources res) {
|
||||
@@ -144,20 +140,15 @@ public final class GameStatistics {
|
||||
}
|
||||
|
||||
public int getNumberOfUsedItems() {
|
||||
int result = 0;
|
||||
for (int v : usedItems.values()) result += v;
|
||||
return result;
|
||||
return HashMapHelper.sumIntegerValues(usedItems);
|
||||
}
|
||||
|
||||
public int getNumberOfTimesItemHasBeenUsed(String itemId) {
|
||||
if (!usedItems.containsKey(itemId)) return 0;
|
||||
return usedItems.get(itemId);
|
||||
return HashMapHelper.getOrDefault(usedItems, itemId, 0);
|
||||
}
|
||||
|
||||
public int getNumberOfKilledMonsters() {
|
||||
int result = 0;
|
||||
for (int v : killedMonstersByTypeID.values()) result += v;
|
||||
return result;
|
||||
return HashMapHelper.sumIntegerValues(killedMonstersByTypeID);
|
||||
}
|
||||
|
||||
private static final Comparator<Entry<String, Integer>> descendingValueComparator = new Comparator<Entry<String, Integer>>() {
|
||||
@@ -186,7 +177,7 @@ public final class GameStatistics {
|
||||
// Also track by name, for statistics display (multiple IDs w/same name don't matter to player)
|
||||
MonsterType t = world.monsterTypes.getMonsterType(id);
|
||||
|
||||
if (t != null) killedMonstersByName.put(t.name, killedMonstersByName.getOrDefault(t.name, 0) + value);
|
||||
if (t != null) killedMonstersByName.put(t.name, getNumberOfKillsForMonsterName(t.name) + value);
|
||||
}
|
||||
|
||||
if (fileversion <= 17) return;
|
||||
|
||||
@@ -6,6 +6,8 @@ import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import java.util.Calendar;
|
||||
|
||||
public final class WorldData {
|
||||
private long worldTime = 0; // Measured in number of game rounds
|
||||
private final HashMap<String, Long> timers = new HashMap<String, Long>();
|
||||
@@ -36,6 +38,62 @@ public final class WorldData {
|
||||
return v + duration <= worldTime;
|
||||
}
|
||||
|
||||
public int getDate(String format) {
|
||||
Calendar now = Calendar.getInstance();
|
||||
int ret;
|
||||
switch (format) {
|
||||
case "YYYYMMDD":
|
||||
ret = now.get(Calendar.YEAR)*10000 + (now.get(Calendar.MONTH) + 1)*100 + now.get(Calendar.DAY_OF_MONTH);
|
||||
break;
|
||||
case "YYYYMM":
|
||||
ret = now.get(Calendar.YEAR)*100 + (now.get(Calendar.MONTH) + 1);
|
||||
break;
|
||||
case "YYYY":
|
||||
ret = now.get(Calendar.YEAR);
|
||||
break;
|
||||
case "MMDD":
|
||||
ret = (now.get(Calendar.MONTH) + 1)*100 + now.get(Calendar.DAY_OF_MONTH);
|
||||
break;
|
||||
case "MM":
|
||||
ret = (now.get(Calendar.MONTH) + 1);
|
||||
break;
|
||||
case "DD":
|
||||
ret = now.get(Calendar.DAY_OF_MONTH);
|
||||
break;
|
||||
default:
|
||||
ret = 99999999; //never true
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
public int getTime(String format) {
|
||||
Calendar now = Calendar.getInstance();
|
||||
int ret;
|
||||
switch (format) {
|
||||
case "HHMMSS":
|
||||
ret = now.get(Calendar.HOUR_OF_DAY)*10000 + now.get(Calendar.MINUTE)*100 + now.get(Calendar.SECOND);
|
||||
break;
|
||||
case "HHMM":
|
||||
ret = now.get(Calendar.HOUR_OF_DAY)*100 + now.get(Calendar.MINUTE);
|
||||
break;
|
||||
case "HH":
|
||||
ret = now.get(Calendar.HOUR_OF_DAY);
|
||||
break;
|
||||
case "MMSS":
|
||||
ret = now.get(Calendar.MINUTE)*100 + now.get(Calendar.SECOND);
|
||||
break;
|
||||
case "MM":
|
||||
ret = now.get(Calendar.MINUTE);
|
||||
break;
|
||||
case "SS":
|
||||
ret = now.get(Calendar.SECOND);
|
||||
break;
|
||||
default:
|
||||
ret = 99999999; //never true
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
// ====== PARCELABLE ===================================================================
|
||||
|
||||
public WorldData(DataInputStream src, int fileversion) throws IOException {
|
||||
|
||||
@@ -83,7 +83,7 @@ public final class SkillCollection {
|
||||
public static final int PER_SKILLPOINT_INCREASE_COINFINDER_CHANCE_PERCENT = 30;
|
||||
public static final int PER_SKILLPOINT_INCREASE_MAGICFINDER_CHANCE_PERCENT = 50;
|
||||
public static final int PER_SKILLPOINT_INCREASE_COINFINDER_QUANTITY_PERCENT = 50;
|
||||
public static final int PER_SKILLPOINT_INCREASE_MORE_EXP_PERCENT = 5;
|
||||
public static final int PER_SKILLPOINT_INCREASE_MORE_EXP_PERCENT = 10;
|
||||
public static final int PER_SKILLPOINT_INCREASE_CLEAVE_AP = 3;
|
||||
public static final int PER_SKILLPOINT_INCREASE_EATER_HEALTH = 1;
|
||||
public static final int PER_SKILLPOINT_INCREASE_FORTITUDE_HEALTH = 1;
|
||||
|
||||
@@ -111,7 +111,7 @@ public final class Player extends Actor {
|
||||
baseTraits.criticalSkill = 0;
|
||||
baseTraits.criticalMultiplier = 1;
|
||||
baseTraits.damagePotential.set(1, 1);
|
||||
baseTraits.blockChance = 0;
|
||||
baseTraits.blockChance = 9;
|
||||
baseTraits.damageResistance = 0;
|
||||
baseTraits.useItemCost = 5;
|
||||
baseTraits.reequipCost = 5;
|
||||
|
||||
@@ -17,7 +17,7 @@ import com.gpl.rpg.AndorsTrail.util.Range;
|
||||
public final class MonsterSpawnArea {
|
||||
public final CoordRect area;
|
||||
public final Range quantity;
|
||||
private final Range spawnChance;
|
||||
private final Range respawnspeed;
|
||||
public final String areaID;
|
||||
public final String[] monsterTypeIDs;
|
||||
public final List<Monster> monsters = new CopyOnWriteArrayList<Monster>();
|
||||
@@ -30,7 +30,7 @@ public final class MonsterSpawnArea {
|
||||
public MonsterSpawnArea(
|
||||
CoordRect area
|
||||
, Range quantity
|
||||
, Range spawnChance
|
||||
, Range respawnspeed
|
||||
, String areaID
|
||||
, String[] monsterTypeIDs
|
||||
, boolean isUnique
|
||||
@@ -40,7 +40,7 @@ public final class MonsterSpawnArea {
|
||||
) {
|
||||
this.area = area;
|
||||
this.quantity = quantity;
|
||||
this.spawnChance = spawnChance;
|
||||
this.respawnspeed = respawnspeed;
|
||||
this.areaID = areaID;
|
||||
this.monsterTypeIDs = monsterTypeIDs;
|
||||
this.isUnique = isUnique;
|
||||
@@ -101,7 +101,7 @@ public final class MonsterSpawnArea {
|
||||
}
|
||||
|
||||
public boolean rollShouldSpawn() {
|
||||
return Constants.rollResult(spawnChance);
|
||||
return Constants.rollResult(respawnspeed);
|
||||
}
|
||||
|
||||
public void removeAllMonsters() {
|
||||
|
||||
@@ -115,7 +115,7 @@ public final class TMXMapTranslator {
|
||||
boolean isActiveForNewGame = true;
|
||||
boolean ignoreAreas = false;
|
||||
int maxQuantity = 1;
|
||||
int spawnChance = 10;
|
||||
int respawnspeed = 10;
|
||||
String spawnGroup = object.name;
|
||||
for (TMXProperty p : object.properties) {
|
||||
if (AndorsTrailApplication.DEVELOPMENT_VALIDATEDATA) {
|
||||
@@ -126,8 +126,8 @@ public final class TMXMapTranslator {
|
||||
}
|
||||
if (p.name.equalsIgnoreCase("quantity")) {
|
||||
maxQuantity = Integer.parseInt(p.value);
|
||||
} else if (p.name.equalsIgnoreCase("spawnchance")) {
|
||||
spawnChance = Integer.parseInt(p.value);
|
||||
} else if (p.name.equalsIgnoreCase("respawnspeed")) {
|
||||
respawnspeed = Integer.parseInt(p.value);
|
||||
} else if (p.name.equalsIgnoreCase("active")) {
|
||||
isActiveForNewGame = Boolean.parseBoolean(p.value);
|
||||
} else if (p.name.equalsIgnoreCase("ignoreAreas")) {
|
||||
@@ -155,7 +155,7 @@ public final class TMXMapTranslator {
|
||||
MonsterSpawnArea area = new MonsterSpawnArea(
|
||||
position
|
||||
,new Range(maxQuantity, 0)
|
||||
,new Range(1000, spawnChance)
|
||||
,new Range(1000, respawnspeed)
|
||||
,object.name
|
||||
,monsterTypeIDs
|
||||
,isUnique
|
||||
@@ -405,6 +405,11 @@ public final class TMXMapTranslator {
|
||||
int tileID = tileCache.getTileID(tile.tilesetName, tile.localId);
|
||||
result.tiles[dx][dy] = tileID;
|
||||
usedTileIDs.add(tileID);
|
||||
if(AndorsTrailApplication.DEVELOPMENT_VALIDATEDATA){
|
||||
if(tileID == 0){
|
||||
L.log("Tileid 0 in "+ tile.tilesetName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
||||
@@ -21,6 +21,10 @@ public final class Requirement {
|
||||
,random
|
||||
,factionScoreEquals
|
||||
,wearRemove
|
||||
,date
|
||||
,dateEquals
|
||||
,time
|
||||
,timeEquals
|
||||
}
|
||||
|
||||
public final RequirementType requireType;
|
||||
@@ -83,6 +87,10 @@ public final class Requirement {
|
||||
case skillLevel:
|
||||
return requireID != null && value >= 0;
|
||||
case spentGold:
|
||||
case date:
|
||||
case dateEquals:
|
||||
case time:
|
||||
case timeEquals:
|
||||
return value >= 0;
|
||||
case random:
|
||||
return chance != null;
|
||||
|
||||
@@ -18,6 +18,7 @@ public final class ScriptEffect {
|
||||
, deactivateMapObjectGroup
|
||||
, removeQuestProgress
|
||||
, changeMapFilter
|
||||
, mapchange
|
||||
}
|
||||
|
||||
public final ScriptEffectType type;
|
||||
|
||||
@@ -137,7 +137,8 @@ public final class ResourceLoader {
|
||||
final ItemTypeParser itemTypeParser = new ItemTypeParser(loader, world.actorConditionsTypes, world.itemCategories, translationLoader);
|
||||
final TypedArray itemsToLoad = r.obtainTypedArray(itemsResourceId);
|
||||
for (int i = 0; i < itemsToLoad.length(); ++i) {
|
||||
world.itemTypes.initialize(itemTypeParser, readStringFromRaw(r, itemsToLoad, i));
|
||||
String s = readStringFromRaw(r, itemsToLoad, i);
|
||||
world.itemTypes.initialize(itemTypeParser, s);
|
||||
}
|
||||
itemsToLoad.recycle();
|
||||
if (AndorsTrailApplication.DEVELOPMENT_DEBUGMESSAGES) timingCheckpoint("ItemTypeParser");
|
||||
@@ -250,6 +251,7 @@ public final class ResourceLoader {
|
||||
|
||||
private static void prepareTilesets(DynamicTileLoader loader, int mTileSize) {
|
||||
final Size sz1x1 = new Size(1, 1);
|
||||
final Size sz1x2 = new Size(1, 2);
|
||||
final Size sz2x1 = new Size(2, 1);
|
||||
final Size sz2x2 = new Size(2, 2);
|
||||
final Size sz2x3 = new Size(2, 3);
|
||||
@@ -258,6 +260,7 @@ public final class ResourceLoader {
|
||||
final Size sz6x1 = new Size(6, 1);
|
||||
final Size sz7x1 = new Size(7, 1);
|
||||
final Size sz8x3 = new Size(8, 3);
|
||||
final Size sz16x8 = new Size(16, 8);
|
||||
final Size sz20x12 = new Size(20, 12);
|
||||
final Size mapTileSize = new Size(16, 8);
|
||||
final Size sz8x8 = new Size(8, 8);
|
||||
@@ -299,15 +302,19 @@ public final class ResourceLoader {
|
||||
loader.prepareTileset(R.drawable.items_necklaces_1, "items_necklaces_1", new Size(10, 3), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_weapons_2, "items_weapons_2", new Size(7, 1), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_weapons_3, "items_weapons_3", new Size(13, 5), sz1x1, mTileSize);
|
||||
|
||||
loader.prepareTileset(R.drawable.items_armours_2, "items_armours_2", sz7x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_armours_3, "items_armours_3", new Size(10, 4), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_rings_1, "items_rings_1", new Size(10, 3), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_japozero, "items_japozero", new Size(16, 37), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_rijackson_1, "items_rijackson_1", new Size(5, 4), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_g03_package_omi1, "items_g03_package_omi1", sz1x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_consumables_omi1, "items_consumables_omi1", sz1x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_feygard1, "items_feygard1", new Size(6, 2), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_g03_package_omi1, "items_g03_package_omi1", sz1x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_japozero, "items_japozero", new Size(16, 37), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_newb, "items_newb", new Size(32, 27), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_omi2, "items_omi2", new Size(6, 5), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_omgeeky, "items_omgeeky", new Size(10, 3), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_phoenix01, "items_phoenix01", sz16x8, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_rijackson_1, "items_rijackson_1", new Size(5, 4), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.items_rings_1, "items_rings_1", new Size(10, 3), sz1x1, mTileSize);
|
||||
/*INSERT_ITEMS_TILESETS_HERE*/
|
||||
|
||||
loader.prepareTileset(R.drawable.monsters_armor1, "monsters_armor1", sz1x1, sz1x1, mTileSize);
|
||||
@@ -333,6 +340,10 @@ public final class ResourceLoader {
|
||||
loader.prepareTileset(R.drawable.monsters_men, "monsters_men", new Size(9, 1), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_men2, "monsters_men2", new Size(10, 1), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_misc, "monsters_misc", new Size(13, 1), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_newb_1, "monsters_newb_1", new Size(40, 34), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_newb_2, "monsters_newb_2", new Size(16, 2), sz1x2, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_newb_3, "monsters_newb_3", new Size(20, 4), sz2x2, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_newb_4, "monsters_newb_4", new Size(4, 2), sz2x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_rats, "monsters_rats", new Size(5, 1), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_redshrike1, "monsters_redshrike1", sz7x1, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_rltiles1, "monsters_rltiles1", new Size(20, 8), sz1x1, mTileSize);
|
||||
@@ -367,9 +378,12 @@ public final class ResourceLoader {
|
||||
loader.prepareTileset(R.drawable.monsters_gisons, "monsters_gisons", new Size(8, 2), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_bosses_2x2, "monsters_bosses_2x2", sz1x1, sz2x2, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_omi2, "monsters_omi2", sz8x3, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_phoenix01, "monsters_phoenix01", sz16x8, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.monsters_cats, "monsters_cats", new Size(10, 2), sz1x1, mTileSize);
|
||||
/*INSERT_NPCS_TILESETS_HERE*/
|
||||
|
||||
loader.prepareTileset(R.drawable.map_bed_1, "map_bed_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_boats_1, "map_boats_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_border_1, "map_border_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_bridge_1, "map_bridge_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_bridge_2, "map_bridge_2", mapTileSize, sz1x1, mTileSize);
|
||||
@@ -378,6 +392,7 @@ public final class ResourceLoader {
|
||||
loader.prepareTileset(R.drawable.map_cavewall_2, "map_cavewall_2", new Size(18, 6), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_cavewall_3, "map_cavewall_3", new Size(18, 6), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_cavewall_4, "map_cavewall_4", new Size(18, 6), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_cavewall_5, "map_cavewall_5", new Size(6, 6), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_chair_table_1, "map_chair_table_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_chair_table_2, "map_chair_table_2", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_crate_1, "map_crate_1", mapTileSize, sz1x1, mTileSize);
|
||||
@@ -385,6 +400,7 @@ public final class ResourceLoader {
|
||||
loader.prepareTileset(R.drawable.map_curtain_1, "map_curtain_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_entrance_1, "map_entrance_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_entrance_2, "map_entrance_2", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_entrance_3, "map_entrance_3", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_fence_1, "map_fence_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_fence_2, "map_fence_2", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_fence_3, "map_fence_3", mapTileSize, sz1x1, mTileSize);
|
||||
@@ -397,6 +413,8 @@ public final class ResourceLoader {
|
||||
loader.prepareTileset(R.drawable.map_ground_6, "map_ground_6", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_ground_7, "map_ground_7", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_ground_8, "map_ground_8", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_ground_9, "map_ground_9", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_guynmart, "map_guynmart", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_house_1, "map_house_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_house_2, "map_house_2", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_indoor_1, "map_indoor_1", mapTileSize, sz1x1, mTileSize);
|
||||
@@ -405,36 +423,43 @@ public final class ResourceLoader {
|
||||
loader.prepareTileset(R.drawable.map_outdoor_1, "map_outdoor_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_pillar_1, "map_pillar_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_pillar_2, "map_pillar_2", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_pillar_3, "map_pillar_3", new Size(16, 10), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_plant_1, "map_plant_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_plant_2, "map_plant_2", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_plant_3, "map_plant_3", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_plateau, "map_plateau", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_plateau_2, "map_plateau_2", new Size(8, 8), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_ratdom, "map_ratdom", new Size(18, 6), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_rock_1, "map_rock_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_rock_2, "map_rock_2", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_rock_3, "map_rock_3", new Size(6, 5), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_roof_1, "map_roof_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_roof_2, "map_roof_2", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_roof_3, "map_roof_3", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_roof_4, "map_roof_4", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_roof_5, "map_roof_5", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_shop_1, "map_shop_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_sign_ladder_1, "map_sign_ladder_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_sign_ladder_omi2, "map_sign_ladder_omi2", new Size(8, 4), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_table_1, "map_table_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_table_2, "map_table_2", new Size(14, 8), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_temple_1, "map_temple_1", new Size(23, 16), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_trail_1, "map_trail_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_transition_1, "map_transition_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_transition_2, "map_transition_2", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_transition_3, "map_transition_3", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_transition_4, "map_transition_4", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_transition_5, "map_transition_5", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_transition_6, "map_transition_6", new Size(18, 8), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_tree_1, "map_tree_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_tree_2, "map_tree_2", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_tree_3, "map_tree_3", new Size(32, 17), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_wall_1, "map_wall_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_wall_2, "map_wall_2", new Size(15, 8), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_wall_3, "map_wall_3", new Size(15, 8), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_wall_4, "map_wall_4", new Size(15, 8), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_window_1, "map_window_1", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_window_2, "map_window_2", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_guynmart, "map_guynmart", mapTileSize, sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_cavewall_5, "map_cavewall_5", new Size(6, 6), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_rock_3, "map_rock_3", new Size(6, 5), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_sign_ladder_omi2, "map_sign_ladder_omi2", new Size(8, 4), sz1x1, mTileSize);
|
||||
loader.prepareTileset(R.drawable.map_transition_6, "map_transition_6", new Size(18, 8), sz1x1, mTileSize);
|
||||
/*INSERT_MAP_TILESETS_HERE*/
|
||||
|
||||
loader.prepareTileset(R.drawable.effect_blood4, "effect_blood4", new Size(7, 2), sz1x1, mTileSize);
|
||||
|
||||
@@ -39,6 +39,12 @@ public final class DropListParser extends JsonCollectionParserFor<DropList> {
|
||||
if (items == null) {
|
||||
L.log("OPTIMIZE: Droplist \"" + droplistID + "\" has no dropped items.");
|
||||
}
|
||||
for (int i = 0; i < items.length; i++) {
|
||||
DropItem item = items[i];
|
||||
if (item.itemType == null) {
|
||||
L.log("Item at index " + i + " in droplist " + droplistID + " was null");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new Pair<String, DropList>(droplistID, new DropList(items));
|
||||
|
||||
@@ -12,6 +12,8 @@ import android.graphics.Bitmap;
|
||||
import android.util.SparseArray;
|
||||
import android.util.SparseIntArray;
|
||||
|
||||
import com.gpl.rpg.AndorsTrail.AndorsTrailApplication;
|
||||
import com.gpl.rpg.AndorsTrail.util.L;
|
||||
import com.gpl.rpg.AndorsTrail.util.LruCache;
|
||||
|
||||
public final class TileCache {
|
||||
@@ -39,7 +41,12 @@ public final class TileCache {
|
||||
tileIDsPerLocalID.put(localID, tileID);
|
||||
}
|
||||
public int getTileID(String tileSetName, int localID) {
|
||||
return tileIDsPerTilesetAndLocalID.get(tileSetName).get(localID);
|
||||
|
||||
SparseIntArray sparseIntArray = tileIDsPerTilesetAndLocalID.get(tileSetName);
|
||||
if(AndorsTrailApplication.DEVELOPMENT_DEBUGMESSAGES && sparseIntArray == null){
|
||||
L.log("Could not get tile " + tileSetName + " " + localID);
|
||||
}
|
||||
return sparseIntArray.get(localID);
|
||||
}
|
||||
|
||||
private static final class ResourceFileTile {
|
||||
@@ -67,6 +74,9 @@ public final class TileCache {
|
||||
HashMap<ResourceFileTileset, SparseArray<ResourceFileTile>> tilesToLoadPerSourceFile = new HashMap<ResourceFileTileset, SparseArray<ResourceFileTile>>();
|
||||
for(int tileID : iconIDs) {
|
||||
ResourceFileTile tile = resourceTiles[tileID];
|
||||
if(tile == null && AndorsTrailApplication.DEVELOPMENT_DEBUGMESSAGES){
|
||||
L.log("could not find resourceTiles for id: " + tileID);
|
||||
}
|
||||
SparseArray<ResourceFileTile> tiles = tilesToLoadPerSourceFile.get(tile.tileset);
|
||||
if (tiles == null) {
|
||||
tiles = new SparseArray<TileCache.ResourceFileTile>();
|
||||
|
||||
@@ -18,6 +18,7 @@ import android.os.AsyncTask;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.gpl.rpg.AndorsTrail.AndorsTrailApplication;
|
||||
import com.gpl.rpg.AndorsTrail.AndorsTrailPreferences;
|
||||
import com.gpl.rpg.AndorsTrail.R;
|
||||
import com.gpl.rpg.AndorsTrail.context.WorldContext;
|
||||
@@ -33,6 +34,7 @@ import com.gpl.rpg.AndorsTrail.model.map.MapObject;
|
||||
import com.gpl.rpg.AndorsTrail.model.map.MonsterSpawnArea;
|
||||
import com.gpl.rpg.AndorsTrail.model.map.PredefinedMap;
|
||||
import com.gpl.rpg.AndorsTrail.model.map.TMXMapTranslator;
|
||||
import com.gpl.rpg.AndorsTrail.util.L;
|
||||
import com.gpl.rpg.AndorsTrail.util.ThemeHelper;
|
||||
|
||||
public final class TileManager {
|
||||
@@ -374,6 +376,10 @@ public final class TileManager {
|
||||
cachedTileIDs = getTileIDsFor(adjacentMap, adjacentMapTiles, world);
|
||||
tileIDsPerMap.put(mapName, cachedTileIDs);
|
||||
}
|
||||
|
||||
if(AndorsTrailApplication.DEVELOPMENT_DEBUGMESSAGES){
|
||||
L.log("TileIDsFor " + mapName + "\n" + cachedTileIDs);
|
||||
}
|
||||
dest.addAll(cachedTileIDs);
|
||||
}
|
||||
public void cacheAdjacentMaps(final Resources res, final WorldContext world, final PredefinedMap nextMap) {
|
||||
@@ -391,6 +397,9 @@ public final class TileManager {
|
||||
|
||||
HashSet<Integer> tileIDs = new HashSet<Integer>();
|
||||
for (String mapName : adjacentMapNames) {
|
||||
if(AndorsTrailApplication.DEVELOPMENT_DEBUGMESSAGES){
|
||||
L.log("addTileIDsFor " + mapName);
|
||||
}
|
||||
addTileIDsFor(tileIDs, mapName, res, world);
|
||||
}
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ public final class Savegames {
|
||||
|
||||
private static void writeBackup(Context androidContext, byte[] savegame, String playerId) throws IOException {
|
||||
File cheatDetectionFolder = AndroidStorage.getStorageDirectory(androidContext, Constants.CHEAT_DETECTION_FOLDER);
|
||||
if (!cheatDetectionFolder.exists()) cheatDetectionFolder.mkdir();
|
||||
ensureDirExists(cheatDetectionFolder);
|
||||
File backupFile = new File(cheatDetectionFolder, playerId + "X");
|
||||
FileOutputStream fileOutputStream = new FileOutputStream(backupFile);
|
||||
fileOutputStream.write(savegame);
|
||||
@@ -127,34 +127,33 @@ public final class Savegames {
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean triedToCheat(Context androidContext, FileHeader fh) throws IOException {
|
||||
long savedVersionToCheck = 0;
|
||||
File cheatDetectionFolder = AndroidStorage.getStorageDirectory(androidContext, Constants.CHEAT_DETECTION_FOLDER);
|
||||
if (!cheatDetectionFolder.exists()) cheatDetectionFolder.mkdir();
|
||||
File cheatDetectionFile = new File(cheatDetectionFolder, fh.playerId);
|
||||
if (cheatDetectionFile.exists()) {
|
||||
FileInputStream fileInputStream = new FileInputStream(cheatDetectionFile);
|
||||
DataInputStream dataInputStream = new DataInputStream(fileInputStream);
|
||||
final CheatDetection cheatDetection = new CheatDetection(dataInputStream);
|
||||
savedVersionToCheck = cheatDetection.savedVersion;
|
||||
dataInputStream.close();
|
||||
fileInputStream.close();
|
||||
}
|
||||
private static boolean triedToCheat(Context androidContext, FileHeader fh) throws IOException {
|
||||
long savedVersionToCheck = 0;
|
||||
File cheatDetectionFolder = AndroidStorage.getStorageDirectory(androidContext, Constants.CHEAT_DETECTION_FOLDER);
|
||||
ensureDirExists(cheatDetectionFolder);
|
||||
File cheatDetectionFile = new File(cheatDetectionFolder, fh.playerId);
|
||||
if (cheatDetectionFile.exists()) {
|
||||
FileInputStream fileInputStream = new FileInputStream(cheatDetectionFile);
|
||||
DataInputStream dataInputStream = new DataInputStream(fileInputStream);
|
||||
final CheatDetection cheatDetection = new CheatDetection(dataInputStream);
|
||||
savedVersionToCheck = cheatDetection.savedVersion;
|
||||
dataInputStream.close();
|
||||
fileInputStream.close();
|
||||
}
|
||||
|
||||
if (savedVersionToCheck == DENY_LOADING_BECAUSE_GAME_IS_CURRENTLY_PLAYED) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (androidContext.getFileStreamPath(fh.playerId).exists()) {
|
||||
FileInputStream fileInputStream = androidContext.openFileInput(fh.playerId);
|
||||
DataInputStream dataInputStream = new DataInputStream(fileInputStream);
|
||||
final CheatDetection cheatDetection = new CheatDetection(dataInputStream);
|
||||
if (cheatDetection.savedVersion == DENY_LOADING_BECAUSE_GAME_IS_CURRENTLY_PLAYED) {
|
||||
savedVersionToCheck = DENY_LOADING_BECAUSE_GAME_IS_CURRENTLY_PLAYED;
|
||||
}
|
||||
else if (cheatDetection.savedVersion > savedVersionToCheck) {
|
||||
savedVersionToCheck = cheatDetection.savedVersion;
|
||||
}
|
||||
if (androidContext.getFileStreamPath(fh.playerId).exists()) {
|
||||
FileInputStream fileInputStream = androidContext.openFileInput(fh.playerId);
|
||||
DataInputStream dataInputStream = new DataInputStream(fileInputStream);
|
||||
final CheatDetection cheatDetection = new CheatDetection(dataInputStream);
|
||||
if (cheatDetection.savedVersion == DENY_LOADING_BECAUSE_GAME_IS_CURRENTLY_PLAYED) {
|
||||
savedVersionToCheck = DENY_LOADING_BECAUSE_GAME_IS_CURRENTLY_PLAYED;
|
||||
} else if (cheatDetection.savedVersion > savedVersionToCheck) {
|
||||
savedVersionToCheck = cheatDetection.savedVersion;
|
||||
}
|
||||
|
||||
if (AndorsTrailApplication.DEVELOPMENT_DEBUGMESSAGES) {
|
||||
L.log("Internal cheatcheck file savedVersion: " + cheatDetection.savedVersion);
|
||||
@@ -167,31 +166,48 @@ public final class Savegames {
|
||||
return (savedVersionToCheck == DENY_LOADING_BECAUSE_GAME_IS_CURRENTLY_PLAYED || fh.savedVersion < savedVersionToCheck);
|
||||
}
|
||||
|
||||
private static FileOutputStream getOutputFile(Context androidContext, int slot) throws IOException {
|
||||
if (slot == SLOT_QUICKSAVE) {
|
||||
return androidContext.openFileOutput(Constants.FILENAME_SAVEGAME_QUICKSAVE, Context.MODE_PRIVATE);
|
||||
} else {
|
||||
ensureSavegameDirectoryExists(androidContext);
|
||||
return new FileOutputStream(getSlotFile(slot, androidContext));
|
||||
}
|
||||
}
|
||||
private static void ensureSavegameDirectoryExists(Context context) {
|
||||
File dir = AndroidStorage.getStorageDirectory(context, Constants.FILENAME_SAVEGAME_DIRECTORY);
|
||||
if (!dir.exists()) dir.mkdir();
|
||||
}
|
||||
private static FileInputStream getInputFile(Context androidContext, int slot) throws IOException {
|
||||
if (slot == SLOT_QUICKSAVE) {
|
||||
return androidContext.openFileInput(Constants.FILENAME_SAVEGAME_QUICKSAVE);
|
||||
} else {
|
||||
return new FileInputStream(getSlotFile(slot, androidContext));
|
||||
}
|
||||
}
|
||||
private static FileOutputStream getOutputFile(Context androidContext, int slot) throws IOException {
|
||||
if (slot == SLOT_QUICKSAVE) {
|
||||
return androidContext.openFileOutput(Constants.FILENAME_SAVEGAME_QUICKSAVE, Context.MODE_PRIVATE);
|
||||
} else {
|
||||
ensureSavegameDirectoryExists(androidContext);
|
||||
return new FileOutputStream(getSlotFile(slot, androidContext));
|
||||
}
|
||||
}
|
||||
|
||||
public static File getSlotFile(int slot, Context context) {
|
||||
File root = AndroidStorage.getStorageDirectory(context, Constants.FILENAME_SAVEGAME_DIRECTORY);
|
||||
return new File(root, Constants.FILENAME_SAVEGAME_FILENAME_PREFIX + slot);
|
||||
}
|
||||
private static void ensureSavegameDirectoryExists(Context context) {
|
||||
File dir = AndroidStorage.getStorageDirectory(context, Constants.FILENAME_SAVEGAME_DIRECTORY);
|
||||
ensureDirExists(dir);
|
||||
}
|
||||
|
||||
public static boolean ensureDirExists(File dir) {
|
||||
if (!dir.exists()) {
|
||||
boolean worked = dir.mkdir();
|
||||
return worked;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private static FileInputStream getInputFile(Context androidContext, int slot) throws IOException {
|
||||
if (slot == SLOT_QUICKSAVE) {
|
||||
return androidContext.openFileInput(Constants.FILENAME_SAVEGAME_QUICKSAVE);
|
||||
} else {
|
||||
return new FileInputStream(getSlotFile(slot, androidContext));
|
||||
}
|
||||
}
|
||||
|
||||
public static File getSlotFile(int slot, Context context) {
|
||||
File root = AndroidStorage.getStorageDirectory(context, Constants.FILENAME_SAVEGAME_DIRECTORY);
|
||||
return getSlotFile(slot, root);
|
||||
}
|
||||
|
||||
public static File getSlotFile(int slot, File directory) {
|
||||
return new File(directory, getSlotFileName(slot));
|
||||
}
|
||||
|
||||
public static String getSlotFileName(int slot) {
|
||||
return Constants.FILENAME_SAVEGAME_FILENAME_PREFIX + slot;
|
||||
}
|
||||
|
||||
|
||||
public static void saveWorld(WorldContext world, OutputStream outStream, String displayInfo) throws IOException {
|
||||
@@ -207,10 +223,11 @@ public final class Savegames {
|
||||
dest.close();
|
||||
}
|
||||
|
||||
public static LoadSavegameResult loadWorld(Resources res, WorldContext world, ControllerContext controllers, InputStream inState, FileHeader fh) throws IOException {
|
||||
DataInputStream src = new DataInputStream(inState);
|
||||
final FileHeader header = new FileHeader(src, fh.skipIcon);
|
||||
if (header.fileversion > AndorsTrailApplication.CURRENT_VERSION) return LoadSavegameResult.savegameIsFromAFutureVersion;
|
||||
public static LoadSavegameResult loadWorld(Resources res, WorldContext world, ControllerContext controllers, InputStream inState, FileHeader fh) throws IOException {
|
||||
DataInputStream src = new DataInputStream(inState);
|
||||
final FileHeader header = new FileHeader(src, fh.skipIcon);
|
||||
if (header.fileversion > AndorsTrailApplication.CURRENT_VERSION)
|
||||
return LoadSavegameResult.savegameIsFromAFutureVersion;
|
||||
|
||||
world.maps.readFromParcel(src, world, controllers, header.fileversion);
|
||||
world.model = new ModelContainer(src, world, controllers, header.fileversion);
|
||||
@@ -249,15 +266,15 @@ public final class Savegames {
|
||||
}
|
||||
}
|
||||
|
||||
private static void writeCheatCheck(Context androidContext, long savedVersion, String playerId) throws IOException {
|
||||
File cheatDetectionFolder = AndroidStorage.getStorageDirectory(androidContext, Constants.CHEAT_DETECTION_FOLDER);
|
||||
if (!cheatDetectionFolder.exists()) cheatDetectionFolder.mkdir();
|
||||
File cheatDetectionFile = new File(cheatDetectionFolder, playerId);
|
||||
FileOutputStream fileOutputStream = new FileOutputStream(cheatDetectionFile);
|
||||
DataOutputStream dataOutputStream = new DataOutputStream(fileOutputStream);
|
||||
CheatDetection.writeToParcel(dataOutputStream, savedVersion);
|
||||
dataOutputStream.close();
|
||||
fileOutputStream.close();
|
||||
private static void writeCheatCheck(Context androidContext, long savedVersion, String playerId) throws IOException {
|
||||
File cheatDetectionFolder = AndroidStorage.getStorageDirectory(androidContext, Constants.CHEAT_DETECTION_FOLDER);
|
||||
ensureDirExists(cheatDetectionFolder);
|
||||
File cheatDetectionFile = new File(cheatDetectionFolder, playerId);
|
||||
FileOutputStream fileOutputStream = new FileOutputStream(cheatDetectionFile);
|
||||
DataOutputStream dataOutputStream = new DataOutputStream(fileOutputStream);
|
||||
CheatDetection.writeToParcel(dataOutputStream, savedVersion);
|
||||
dataOutputStream.close();
|
||||
fileOutputStream.close();
|
||||
|
||||
fileOutputStream = androidContext.openFileOutput(playerId, Context.MODE_PRIVATE);
|
||||
dataOutputStream = new DataOutputStream(fileOutputStream);
|
||||
@@ -268,26 +285,26 @@ public final class Savegames {
|
||||
|
||||
private static final Pattern savegameFilenamePattern = Pattern.compile(Constants.FILENAME_SAVEGAME_FILENAME_PREFIX + "(\\d+)");
|
||||
|
||||
public static List<Integer> getUsedSavegameSlots(Context context) {
|
||||
try {
|
||||
final List<Integer> result = new ArrayList<Integer>();
|
||||
AndroidStorage.getStorageDirectory(context, Constants.FILENAME_SAVEGAME_DIRECTORY).listFiles(new FilenameFilter() {
|
||||
@Override
|
||||
public boolean accept(File f, String filename) {
|
||||
Matcher m = savegameFilenamePattern.matcher(filename);
|
||||
if (m != null && m.matches()) {
|
||||
result.add(Integer.parseInt(m.group(1)));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
Collections.sort(result);
|
||||
return result;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
public static List<Integer> getUsedSavegameSlots(Context context) {
|
||||
try {
|
||||
final List<Integer> result = new ArrayList<Integer>();
|
||||
AndroidStorage.getStorageDirectory(context, Constants.FILENAME_SAVEGAME_DIRECTORY).listFiles(new FilenameFilter() {
|
||||
@Override
|
||||
public boolean accept(File f, String filename) {
|
||||
Matcher m = savegameFilenamePattern.matcher(filename);
|
||||
if (m != null && m.matches()) {
|
||||
result.add(Integer.parseInt(m.group(1)));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
Collections.sort(result);
|
||||
return result;
|
||||
} catch (Exception e) {
|
||||
return new ArrayList<Integer>();
|
||||
}
|
||||
}
|
||||
|
||||
private static final class CheatDetection {
|
||||
public final int fileversion;
|
||||
@@ -307,17 +324,16 @@ public final class Savegames {
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static final class FileHeader {
|
||||
public final int fileversion;
|
||||
public final String playerName;
|
||||
public final String displayInfo;
|
||||
public final int iconID;
|
||||
public boolean skipIcon = false;
|
||||
public final boolean isDead;
|
||||
public final boolean hasUnlimitedSaves;
|
||||
public final String playerId;
|
||||
public final long savedVersion;
|
||||
public static final class FileHeader {
|
||||
public final int fileversion;
|
||||
public final String playerName;
|
||||
public final String displayInfo;
|
||||
public final int iconID;
|
||||
public boolean skipIcon = false;
|
||||
public final boolean isDead;
|
||||
public final boolean hasUnlimitedSaves;
|
||||
public final String playerId;
|
||||
public final long savedVersion;
|
||||
|
||||
public String describe() {
|
||||
return (fileversion == AndorsTrailApplication.DEVELOPMENT_INCOMPATIBLE_SAVEGAME_VERSION ? "(D) " : "") + playerName + ", " + displayInfo;
|
||||
@@ -326,17 +342,18 @@ public final class Savegames {
|
||||
|
||||
// ====== PARCELABLE ===================================================================
|
||||
|
||||
public FileHeader(DataInputStream src, boolean skipIcon) throws IOException {
|
||||
int fileversion = src.readInt();
|
||||
if (fileversion == 11) fileversion = 5; // Fileversion 5 had no version identifier, but the first byte was 11.
|
||||
this.fileversion = fileversion;
|
||||
if (fileversion >= 14) { // Before fileversion 14 (0.6.7), we had no file header.
|
||||
this.playerName = src.readUTF();
|
||||
this.displayInfo = src.readUTF();
|
||||
} else {
|
||||
this.playerName = null;
|
||||
this.displayInfo = null;
|
||||
}
|
||||
public FileHeader(DataInputStream src, boolean skipIcon) throws IOException {
|
||||
int fileversion = src.readInt();
|
||||
if (fileversion == 11)
|
||||
fileversion = 5; // Fileversion 5 had no version identifier, but the first byte was 11.
|
||||
this.fileversion = fileversion;
|
||||
if (fileversion >= 14) { // Before fileversion 14 (0.6.7), we had no file header.
|
||||
this.playerName = src.readUTF();
|
||||
this.displayInfo = src.readUTF();
|
||||
} else {
|
||||
this.playerName = null;
|
||||
this.displayInfo = null;
|
||||
}
|
||||
|
||||
if (fileversion >= 43) {
|
||||
int id = src.readInt();
|
||||
|
||||
@@ -1,42 +1,58 @@
|
||||
package com.gpl.rpg.AndorsTrail.util;
|
||||
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Environment;
|
||||
import android.support.v4.content.FileProvider;
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.core.content.FileProvider;
|
||||
import androidx.documentfile.provider.DocumentFile;
|
||||
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
|
||||
import com.gpl.rpg.AndorsTrail.R;
|
||||
import com.gpl.rpg.AndorsTrail.controller.Constants;
|
||||
import com.gpl.rpg.AndorsTrail.util.BackgroundWorker.BackgroundWorkerCallback;
|
||||
import com.gpl.rpg.AndorsTrail.view.CustomDialogFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.util.concurrent.CancellationException;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipInputStream;
|
||||
import java.util.zip.ZipOutputStream;
|
||||
|
||||
public final class AndroidStorage {
|
||||
public static File getStorageDirectory(Context context, String name) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.FROYO && Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||
return context.getExternalFilesDir(name);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
File root = Environment.getExternalStorageDirectory();
|
||||
return new File(root, name);
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean shouldMigrateToInternalStorage(Context context) {
|
||||
boolean ret = false;
|
||||
File externalSaveGameDirectory = new File(Environment.getExternalStorageDirectory(), Constants.FILENAME_SAVEGAME_DIRECTORY);
|
||||
File externalSaveGameDirectory = new File(Environment.getExternalStorageDirectory(),
|
||||
Constants.FILENAME_SAVEGAME_DIRECTORY);
|
||||
File internalSaveGameDirectory = getStorageDirectory(context, Constants.FILENAME_SAVEGAME_DIRECTORY);
|
||||
|
||||
if (externalSaveGameDirectory.exists()
|
||||
&& externalSaveGameDirectory.isDirectory()
|
||||
&& externalSaveGameDirectory.listFiles().length > 0
|
||||
&& (
|
||||
!internalSaveGameDirectory.exists()
|
||||
|| internalSaveGameDirectory.isDirectory() && internalSaveGameDirectory.listFiles().length < 2)
|
||||
) {
|
||||
&& externalSaveGameDirectory.isDirectory()
|
||||
&& externalSaveGameDirectory.listFiles().length > 0
|
||||
&& (!internalSaveGameDirectory.exists()
|
||||
|| internalSaveGameDirectory.isDirectory()
|
||||
&& internalSaveGameDirectory.listFiles().length < 2)) {
|
||||
ret = true;
|
||||
}
|
||||
return ret;
|
||||
@@ -45,11 +61,11 @@ public final class AndroidStorage {
|
||||
public static boolean migrateToInternalStorage(Context context) {
|
||||
try {
|
||||
copy(new File(Environment.getExternalStorageDirectory(), Constants.CHEAT_DETECTION_FOLDER),
|
||||
getStorageDirectory(context, Constants.CHEAT_DETECTION_FOLDER));
|
||||
getStorageDirectory(context, Constants.CHEAT_DETECTION_FOLDER));
|
||||
copy(new File(Environment.getExternalStorageDirectory(), Constants.FILENAME_SAVEGAME_DIRECTORY),
|
||||
getStorageDirectory(context, Constants.FILENAME_SAVEGAME_DIRECTORY));
|
||||
getStorageDirectory(context, Constants.FILENAME_SAVEGAME_DIRECTORY));
|
||||
} catch (IOException e) {
|
||||
L.log("Error migrating data: " + e.toString());
|
||||
L.log("Error migrating data: " + e);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -76,33 +92,381 @@ public final class AndroidStorage {
|
||||
}
|
||||
}
|
||||
|
||||
private static void copyFile(File source, File target) throws IOException {
|
||||
InputStream in = null;
|
||||
OutputStream out = null;
|
||||
try {
|
||||
in = new FileInputStream(source);
|
||||
out = new FileOutputStream(target);
|
||||
byte[] buf = new byte[1024];
|
||||
int length;
|
||||
while ((length = in.read(buf)) > 0) {
|
||||
out.write(buf, 0, length);
|
||||
public static void copyFile(File source, File target) throws IOException {
|
||||
try (InputStream in = new FileInputStream(source); OutputStream out = new FileOutputStream(target)) {
|
||||
copyStream(in, out);
|
||||
}
|
||||
}
|
||||
|
||||
public static void copyStream(InputStream in, OutputStream out) throws IOException {
|
||||
byte[] buf = new byte[1024];
|
||||
int length;
|
||||
while ((length = in.read(buf)) > 0) {
|
||||
out.write(buf, 0, length);
|
||||
}
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.P)
|
||||
public static void createZipDocumentFileFromFilesAsync(File[] files,
|
||||
Context context,
|
||||
DocumentFile targetDirectory,
|
||||
String fileName,
|
||||
String loadingMessage,
|
||||
Consumer<Boolean> callback) {
|
||||
|
||||
BackgroundWorker<Boolean> worker = new BackgroundWorker<>();
|
||||
CustomDialogFactory.CustomDialog progressDialog = getLoadingDialog(context, loadingMessage);
|
||||
progressDialog.setOnCancelListener(dialog -> worker.cancel());
|
||||
ContentResolver resolver = context.getContentResolver();
|
||||
Handler handler = Handler.createAsync(Looper.getMainLooper());
|
||||
|
||||
|
||||
worker.setTask(workerCallback -> {
|
||||
try {
|
||||
workerCallback.onInitialize();
|
||||
|
||||
//region create zip file
|
||||
File zip = File.createTempFile("temp_worldmap", ".zip");
|
||||
try (OutputStream out = new FileOutputStream(zip)) {
|
||||
ZipOutputStream zipOut = new ZipOutputStream(out);
|
||||
for (int i = 0; i < files.length; i++) {
|
||||
File file = files[i];
|
||||
try (FileInputStream fis = new FileInputStream(file)) {
|
||||
workerCallback.onProgress((float) i / files.length);
|
||||
zipOut.putNextEntry(new ZipEntry(file.getName()));
|
||||
copyStream(fis, zipOut);
|
||||
zipOut.closeEntry();
|
||||
}
|
||||
}
|
||||
zipOut.close();
|
||||
}
|
||||
//endregion
|
||||
|
||||
DocumentFile worldmapZip = DocumentFile.fromFile(zip);
|
||||
DocumentFile worldmapTarget = targetDirectory.createFile("application/zip", fileName);
|
||||
if (worldmapTarget != null && worldmapTarget.exists()) {
|
||||
AndroidStorage.copyDocumentFile(worldmapZip, resolver, worldmapTarget);
|
||||
workerCallback.onComplete(true);
|
||||
} else {
|
||||
throw new FileNotFoundException("Could not create File");
|
||||
}
|
||||
} catch (NullPointerException e) {
|
||||
if (worker.isCancelled()) {
|
||||
workerCallback.onFailure(new CancellationException("Cancelled"));
|
||||
} else {
|
||||
workerCallback.onFailure(e);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
workerCallback.onFailure(e);
|
||||
}
|
||||
} finally {
|
||||
if (in != null) {
|
||||
in.close();
|
||||
});
|
||||
|
||||
worker.setCallback(getDefaultBackgroundWorkerCallback(handler, progressDialog, callback));
|
||||
worker.run();
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static void unzipToDirectory(File zipFile,
|
||||
File targetDirectory,
|
||||
boolean overwriteNotSkip) throws IOException {
|
||||
|
||||
try (ZipInputStream zis = new ZipInputStream(new FileInputStream(zipFile))) {
|
||||
unzipStreamToDirectory(targetDirectory, overwriteNotSkip, zis);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.P)
|
||||
public static void unzipDocumentFileToDirectoryAsync(DocumentFile zipFile,
|
||||
Context context,
|
||||
File targetDirectory,
|
||||
boolean overwriteNotSkip,
|
||||
String loadingMessage,
|
||||
Consumer<Boolean> callback) {
|
||||
|
||||
BackgroundWorker<Boolean> worker = new BackgroundWorker<>();
|
||||
CustomDialogFactory.CustomDialog progressDialog = getLoadingDialog(context, loadingMessage);
|
||||
progressDialog.setOnCancelListener(dialog -> worker.cancel());
|
||||
ContentResolver resolver = context.getContentResolver();
|
||||
Handler handler = Handler.createAsync(Looper.getMainLooper());
|
||||
|
||||
worker.setTask(workerCallback -> {
|
||||
try {
|
||||
workerCallback.onInitialize();
|
||||
workerCallback.onProgress(-1);//set dummy progress since we don't know the
|
||||
// progress of the unzip
|
||||
unzipDocumentFileToDirectory(zipFile, resolver, targetDirectory, overwriteNotSkip);
|
||||
workerCallback.onComplete(true);
|
||||
} catch (IOException e) {
|
||||
workerCallback.onFailure(e);
|
||||
}
|
||||
if (out != null) {
|
||||
out.close();
|
||||
});
|
||||
|
||||
worker.setCallback(getDefaultBackgroundWorkerCallback(handler, progressDialog, callback));
|
||||
worker.run();
|
||||
|
||||
}
|
||||
|
||||
public static void unzipDocumentFileToDirectory(DocumentFile zipFile,
|
||||
ContentResolver resolver,
|
||||
File targetDirectory,
|
||||
boolean overwriteNotSkip) throws IOException {
|
||||
try (ZipInputStream zis = new ZipInputStream(resolver.openInputStream(zipFile.getUri()))) {
|
||||
unzipStreamToDirectory(targetDirectory, overwriteNotSkip, zis);
|
||||
}
|
||||
}
|
||||
|
||||
private static void unzipStreamToDirectory(File targetDirectory,
|
||||
boolean overwriteNotSkip,
|
||||
ZipInputStream zis) throws IOException {
|
||||
ZipEntry entry;
|
||||
while ((entry = zis.getNextEntry()) != null) {
|
||||
File file = new File(targetDirectory, entry.getName());
|
||||
|
||||
if (entry.isDirectory()) {
|
||||
file.mkdirs();
|
||||
} else {
|
||||
file.getParentFile().mkdirs();
|
||||
if (file.exists() && !overwriteNotSkip) {
|
||||
continue;
|
||||
}
|
||||
|
||||
try (FileOutputStream fos = new FileOutputStream(file)) {
|
||||
copyStream(zis, fos);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void copyDocumentFileToNewOrExistingFile(DocumentFile sourceFile,
|
||||
ContentResolver resolver,
|
||||
DocumentFile targetFolder) throws IOException {
|
||||
copyDocumentFileToNewOrExistingFile(sourceFile,
|
||||
resolver,
|
||||
targetFolder,
|
||||
Constants.NO_FILE_EXTENSION_MIME_TYPE);
|
||||
}
|
||||
|
||||
|
||||
public static void copyDocumentFileToNewOrExistingFile(DocumentFile sourceFile,
|
||||
ContentResolver resolver,
|
||||
DocumentFile targetFolder,
|
||||
String mimeType) throws IOException {
|
||||
String fileName = sourceFile.getName();
|
||||
DocumentFile file = targetFolder.findFile(fileName);
|
||||
if (file == null) {
|
||||
file = targetFolder.createFile(mimeType, fileName);
|
||||
}
|
||||
if (file == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
AndroidStorage.copyDocumentFile(sourceFile, resolver, file);
|
||||
}
|
||||
|
||||
public static void copyDocumentFile(DocumentFile sourceFile,
|
||||
ContentResolver resolver,
|
||||
DocumentFile targetFile) throws IOException {
|
||||
try (OutputStream outputStream = resolver.openOutputStream(targetFile.getUri());
|
||||
InputStream inputStream = resolver.openInputStream(sourceFile.getUri())) {
|
||||
copyStream(inputStream, outputStream);
|
||||
}
|
||||
}
|
||||
|
||||
public static String getUrlForFile(Context context, File worldmap) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.FROYO && Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||
Uri uri = FileProvider.getUriForFile(context, "com.gpl.rpg.AndorsTrail.fileprovider", worldmap);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||
String applicationId = context.getPackageName();
|
||||
Uri uri = FileProvider.getUriForFile(context, applicationId + ".fileprovider", worldmap);
|
||||
return uri.toString();
|
||||
} else {
|
||||
return "file://" + worldmap.getAbsolutePath();
|
||||
}
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
||||
public static Intent getNewOpenDirectoryIntent() {
|
||||
return new Intent(Intent.ACTION_OPEN_DOCUMENT_TREE);
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
||||
public static Intent getNewSelectMultipleSavegameFilesIntent() {
|
||||
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
|
||||
intent.addCategory(Intent.CATEGORY_OPENABLE);
|
||||
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
|
||||
intent.setType(Constants.SAVEGAME_FILE_MIME_TYPE);
|
||||
return intent;
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
||||
public static Intent getNewSelectZipIntent() {
|
||||
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
|
||||
intent.addCategory(Intent.CATEGORY_OPENABLE);
|
||||
intent.setType("application/zip");
|
||||
return intent;
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.P)
|
||||
public static void copyDocumentFilesFromToAsync(DocumentFile[] sources,
|
||||
Context context,
|
||||
DocumentFile[] targets,
|
||||
String loadingMessage,
|
||||
Consumer<Boolean> callback) {
|
||||
if (sources.length != targets.length) {
|
||||
throw new IllegalArgumentException("Both arrays, target & source have to have the same size");
|
||||
}
|
||||
|
||||
BackgroundWorker<Boolean> worker = new BackgroundWorker<>();
|
||||
|
||||
CustomDialogFactory.CustomDialog progressDialog = getLoadingDialog(context, loadingMessage);
|
||||
progressDialog.setOnCancelListener(dialog -> worker.cancel());
|
||||
|
||||
ContentResolver resolver = context.getContentResolver();
|
||||
Handler handler = Handler.createAsync(Looper.getMainLooper());
|
||||
|
||||
worker.setTask(workerCallback -> {
|
||||
try {
|
||||
workerCallback.onInitialize();
|
||||
for (int i = 0; i < sources.length; i++) {
|
||||
if (worker.isCancelled()) {
|
||||
workerCallback.onFailure(new CancellationException("Cancelled"));
|
||||
return;
|
||||
}
|
||||
DocumentFile source = sources[i];
|
||||
DocumentFile target = targets[i];
|
||||
|
||||
if (source == null || target == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
copyDocumentFile(source, resolver, target);
|
||||
float progress = i / (float) sources.length;
|
||||
workerCallback.onProgress(progress);
|
||||
}
|
||||
workerCallback.onComplete(true);
|
||||
} catch (NullPointerException e) {
|
||||
if (worker.isCancelled()) {
|
||||
workerCallback.onFailure(new CancellationException("Cancelled"));
|
||||
return;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
workerCallback.onFailure(e);
|
||||
}
|
||||
});
|
||||
worker.setCallback(getDefaultBackgroundWorkerCallback(handler, progressDialog, callback));
|
||||
worker.run();
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.P)
|
||||
public static void copyDocumentFilesToDirAsync(DocumentFile[] files,
|
||||
Context context,
|
||||
DocumentFile targetDirectory,
|
||||
String loadingMessage,
|
||||
Consumer<Boolean> callback) {
|
||||
BackgroundWorker<Boolean> worker = new BackgroundWorker<>();
|
||||
CustomDialogFactory.CustomDialog progressDialog = getLoadingDialog(context, loadingMessage);
|
||||
progressDialog.setOnCancelListener(dialog -> worker.cancel());
|
||||
ContentResolver resolver = context.getContentResolver();
|
||||
Handler handler = Handler.createAsync(Looper.getMainLooper());
|
||||
|
||||
worker.setTask(workerCallback -> {
|
||||
try {
|
||||
workerCallback.onInitialize();
|
||||
for (int i = 0; i < files.length; i++) {
|
||||
if (worker.isCancelled()) {
|
||||
workerCallback.onFailure(new CancellationException("Cancelled"));
|
||||
return;
|
||||
}
|
||||
DocumentFile file = files[i];
|
||||
if (file == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
copyDocumentFileToNewOrExistingFile(file, resolver, targetDirectory);
|
||||
float progress = i / (float) files.length;
|
||||
workerCallback.onProgress(progress);
|
||||
}
|
||||
workerCallback.onComplete(true);
|
||||
} catch (NullPointerException e) {
|
||||
if (worker.isCancelled()) {
|
||||
workerCallback.onFailure(new CancellationException("Cancelled"));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
workerCallback.onFailure(e);
|
||||
}
|
||||
});
|
||||
worker.setCallback(getDefaultBackgroundWorkerCallback(handler, progressDialog, callback));
|
||||
worker.run();
|
||||
}
|
||||
|
||||
private static BackgroundWorkerCallback<Boolean> getDefaultBackgroundWorkerCallback(Handler handler,
|
||||
CustomDialogFactory.CustomDialog progressDialog,
|
||||
Consumer<Boolean> callback) {
|
||||
return new BackgroundWorkerCallback<Boolean>() {
|
||||
private int progress = -1;
|
||||
|
||||
@Override
|
||||
public void onInitialize() {
|
||||
handler.post(() -> {
|
||||
CustomDialogFactory.show(progressDialog);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onProgress(float progress) {
|
||||
handler.post(() -> {
|
||||
int intProgress = (int) (progress * 100);
|
||||
if (this.progress == intProgress) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.progress = intProgress;
|
||||
|
||||
if (progress == -1) {
|
||||
CustomDialogFactory.setDesc(progressDialog, null);
|
||||
return;
|
||||
}
|
||||
|
||||
CustomDialogFactory.setDesc(progressDialog, intProgress + "%");
|
||||
});
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.N)
|
||||
@Override
|
||||
public void onFailure(Exception e) {
|
||||
this.onComplete(false);
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.N)
|
||||
@Override
|
||||
public void onComplete(Boolean result) {
|
||||
handler.post(() -> {
|
||||
progressDialog.dismiss();
|
||||
callback.accept(result);
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private static CustomDialogFactory.CustomDialog getLoadingDialog(Context context) {
|
||||
return getLoadingDialog(context, null);
|
||||
}
|
||||
|
||||
private static CustomDialogFactory.CustomDialog getLoadingDialog(Context context, String message) {
|
||||
if (message == null) {
|
||||
message = context.getResources().getString(R.string.dialog_loading_message);
|
||||
}
|
||||
|
||||
CustomDialogFactory.CustomDialog dialog = CustomDialogFactory.createDialog(context,
|
||||
message,
|
||||
context.getResources()
|
||||
.getDrawable(R.drawable.loading_anim),
|
||||
null,
|
||||
null,
|
||||
true,
|
||||
false);
|
||||
CustomDialogFactory.addCancelButton(dialog, android.R.string.no);
|
||||
return dialog;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.gpl.rpg.AndorsTrail.util;
|
||||
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
public final class BackgroundWorker<T> {
|
||||
boolean cancelled = false;
|
||||
worker<T> task;
|
||||
BackgroundWorkerCallback<T> callback;
|
||||
|
||||
public void setTask(worker<T> task) {
|
||||
this.task = task;
|
||||
}
|
||||
|
||||
public void setCallback(BackgroundWorkerCallback<T> callback) {
|
||||
this.callback = callback;
|
||||
}
|
||||
|
||||
public void cancel() {
|
||||
cancelled = true;
|
||||
}
|
||||
|
||||
interface worker<T> {
|
||||
void doWork(BackgroundWorkerCallback<T> callback);
|
||||
}
|
||||
|
||||
interface BackgroundWorkerCallback<T> {
|
||||
void onInitialize();
|
||||
|
||||
default void onProgress(float progress) {
|
||||
}
|
||||
|
||||
void onFailure(Exception e);
|
||||
|
||||
void onComplete(T result);
|
||||
}
|
||||
|
||||
public void run() {
|
||||
Executors.newSingleThreadExecutor().execute(() -> {
|
||||
task.doWork(callback);
|
||||
});
|
||||
}
|
||||
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.gpl.rpg.AndorsTrail.util;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public final class HashMapHelper {
|
||||
public static <K,V> V getOrDefault(HashMap<K,V> map, K key, V defaultValue) {
|
||||
V v = map.get(key);
|
||||
return v == null ? defaultValue : v;
|
||||
}
|
||||
public static <K> Integer sumIntegerValues(HashMap<K,Integer> map) {
|
||||
int sum = 0;
|
||||
for (Integer v : map.values()) sum += v;
|
||||
return sum;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.gpl.rpg.AndorsTrail.view;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface.OnDismissListener;
|
||||
import android.content.DialogInterface.OnCancelListener;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.drawable.AnimationDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
@@ -22,25 +22,33 @@ import com.gpl.rpg.AndorsTrail.R;
|
||||
import com.gpl.rpg.AndorsTrail.util.ThemeHelper;
|
||||
|
||||
public class CustomDialogFactory {
|
||||
|
||||
public static class CustomDialog extends Dialog {
|
||||
|
||||
public static class CustomDialog extends android.app.Dialog {
|
||||
public CustomDialog(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
boolean verticalButtons = false;
|
||||
}
|
||||
|
||||
public static CustomDialog createDialog(final Context context, String title, Drawable icon, String desc, View content, boolean hasButtons) {
|
||||
|
||||
public static CustomDialog createDialog(final Context context, String title, Drawable icon,
|
||||
String desc, View content, boolean hasButtons, boolean canDismiss) {
|
||||
return createDialog(context, title, icon, desc, content, hasButtons, canDismiss, false);
|
||||
}
|
||||
|
||||
public static CustomDialog createDialog(final Context context, String title, Drawable icon,
|
||||
String desc, View content, boolean hasButtons) {
|
||||
return createDialog(context, title, icon, desc, content, hasButtons, true);
|
||||
}
|
||||
|
||||
public static CustomDialog createDialog(final Context context, String title, Drawable icon, String desc, View content, boolean hasButtons, final boolean canDismiss) {
|
||||
|
||||
public static CustomDialog createDialog(final Context context, String title, Drawable icon,
|
||||
String desc, View content, boolean hasButtons,
|
||||
final boolean canDismiss, final boolean verticalButtons) {
|
||||
final CustomDialog dialog = new CustomDialog(new ContextThemeWrapper(context, ThemeHelper.getDialogTheme())) {
|
||||
@Override
|
||||
public boolean onTouchEvent(MotionEvent event) {
|
||||
Rect r = new Rect();
|
||||
this.getWindow().getDecorView().findViewById(R.id.dialog_hitrect).getHitRect(r);
|
||||
|
||||
|
||||
if (r.contains((int)event.getX(), (int)event.getY())) {
|
||||
return super.onTouchEvent(event);
|
||||
} else {
|
||||
@@ -51,7 +59,7 @@ public class CustomDialogFactory {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onWindowFocusChanged(boolean hasFocus) {
|
||||
super.onWindowFocusChanged(hasFocus);
|
||||
@@ -63,7 +71,8 @@ public class CustomDialogFactory {
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
dialog.verticalButtons = verticalButtons;
|
||||
|
||||
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
dialog.setContentView(R.layout.custom_dialog_title_icon);
|
||||
dialog.getWindow().setBackgroundDrawableResource(android.R.color.transparent);
|
||||
@@ -72,23 +81,37 @@ public class CustomDialogFactory {
|
||||
} else {
|
||||
dialog.getWindow().setFlags(0, WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
||||
}
|
||||
|
||||
|
||||
setTitle(dialog, title, icon);
|
||||
|
||||
|
||||
setDesc(dialog, desc);
|
||||
|
||||
|
||||
setContent(dialog, content);
|
||||
|
||||
ViewGroup buttonsHolder = (ViewGroup) dialog.findViewById(R.id.dialog_button_container);
|
||||
|
||||
ViewGroup buttonsHolder = getButtonContainer(dialog);
|
||||
ViewGroup unusedButtonsHolder = getUnusedButtonContainer(dialog);
|
||||
|
||||
unusedButtonsHolder.setVisibility(View.GONE);
|
||||
if (hasButtons) {
|
||||
buttonsHolder.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
buttonsHolder.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
|
||||
return dialog;
|
||||
}
|
||||
|
||||
|
||||
public static CustomDialog createErrorDialog(final Context context, String title, String description) {
|
||||
final CustomDialog d = createDialog(context,
|
||||
title,
|
||||
context.getResources().getDrawable(android.R.drawable.ic_dialog_alert),
|
||||
description,
|
||||
null,
|
||||
true);
|
||||
CustomDialogFactory.addDismissButton(d, android.R.string.ok);
|
||||
return d;
|
||||
}
|
||||
|
||||
public static CustomDialog setTitle(final CustomDialog dialog, String title, Drawable icon) {
|
||||
TextView titleView = (TextView) dialog.findViewById(R.id.dialog_title);
|
||||
if (title != null || icon != null) {
|
||||
@@ -100,7 +123,7 @@ public class CustomDialogFactory {
|
||||
}
|
||||
return dialog;
|
||||
}
|
||||
|
||||
|
||||
public static CustomDialog setDesc(final CustomDialog dialog, String desc) {
|
||||
TextView descView = (TextView) dialog.findViewById(R.id.dialog_description);
|
||||
ViewGroup descHolder = (ViewGroup) dialog.findViewById(R.id.dialog_description_container);
|
||||
@@ -113,7 +136,7 @@ public class CustomDialogFactory {
|
||||
}
|
||||
return dialog;
|
||||
}
|
||||
|
||||
|
||||
public static CustomDialog setContent(final CustomDialog dialog, View content) {
|
||||
ViewGroup contentHolder = (ViewGroup) dialog.findViewById(R.id.dialog_content_container);
|
||||
if (content != null) {
|
||||
@@ -124,54 +147,101 @@ public class CustomDialogFactory {
|
||||
}
|
||||
return dialog;
|
||||
}
|
||||
|
||||
public static Dialog addButton(final Dialog dialog, int textId, final OnClickListener listener) {
|
||||
|
||||
Button template = (Button) dialog.findViewById(R.id.dialog_template_button);
|
||||
|
||||
public static CustomDialog addButton(final CustomDialog dialog, String text, final OnClickListener listener) {
|
||||
return addButton(dialog, -1, text, listener);
|
||||
}
|
||||
public static CustomDialog addButton(final CustomDialog dialog, int textId, final OnClickListener listener) {
|
||||
return addButton(dialog, textId, null, listener);
|
||||
}
|
||||
public static CustomDialog addButton(final CustomDialog dialog, int textId, String text, final OnClickListener listener) {
|
||||
Button template = getButtonTemplate(dialog);
|
||||
LayoutParams params = template.getLayoutParams();
|
||||
ViewGroup buttonsHolder = (ViewGroup) dialog.findViewById(R.id.dialog_button_container);
|
||||
|
||||
ViewGroup buttonsHolder = getButtonContainer(dialog);
|
||||
|
||||
Button b = new Button(dialog.getContext());
|
||||
b.setLayoutParams(params);
|
||||
//Old android versions need this "reminder"
|
||||
b.setBackgroundDrawable(ThemeHelper.getThemeDrawable(dialog.getContext(), R.attr.ui_theme_textbutton_drawable));
|
||||
b.setTextColor(ThemeHelper.getThemeColor(dialog.getContext(), R.attr.ui_theme_dialogue_light_color));
|
||||
|
||||
b.setText(textId);
|
||||
|
||||
if(textId != -1) {
|
||||
b.setText(textId);
|
||||
} else {
|
||||
b.setText(text);
|
||||
}
|
||||
|
||||
b.setOnClickListener(new OnClickListener() {
|
||||
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
listener.onClick(v);
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
buttonsHolder.addView(b, params);
|
||||
return dialog;
|
||||
}
|
||||
|
||||
public static Dialog addDismissButton(final Dialog dialog, int textId) {
|
||||
|
||||
public static CustomDialog addDismissButton(final CustomDialog dialog, int textId) {
|
||||
return CustomDialogFactory.addButton(dialog, textId, new OnClickListener() {
|
||||
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static Dialog setDismissListener(Dialog dialog, OnDismissListener listener) {
|
||||
public static CustomDialog addCancelButton(final CustomDialog dialog, int textId) {
|
||||
return CustomDialogFactory.addButton(dialog, textId, new OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
dialog.cancel();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static CustomDialog setDismissListener(CustomDialog dialog, OnDismissListener listener) {
|
||||
dialog.setOnDismissListener(listener);
|
||||
|
||||
|
||||
return dialog;
|
||||
}
|
||||
|
||||
public static void show(Dialog dialog) {
|
||||
|
||||
|
||||
public static CustomDialog setCancelListener(CustomDialog dialog, OnCancelListener listener) {
|
||||
dialog.setOnCancelListener(listener);
|
||||
return dialog;
|
||||
}
|
||||
|
||||
public static void show(CustomDialog dialog) {
|
||||
|
||||
dialog.findViewById(R.id.dialog_template_button).setVisibility(View.GONE);
|
||||
dialog.findViewById(R.id.dialog_template_button_vertical).setVisibility(View.GONE);
|
||||
dialog.show();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
private static ViewGroup getUnusedButtonContainer(CustomDialog dialog) {
|
||||
if (dialog.verticalButtons)
|
||||
return (ViewGroup) dialog.findViewById(R.id.dialog_button_container);
|
||||
else
|
||||
return (ViewGroup) dialog.findViewById(R.id.dialog_button_container_vertical);
|
||||
}
|
||||
|
||||
private static ViewGroup getButtonContainer(CustomDialog dialog) {
|
||||
if (dialog.verticalButtons)
|
||||
return (ViewGroup) dialog.findViewById(R.id.dialog_button_container_vertical);
|
||||
else
|
||||
return (ViewGroup) dialog.findViewById(R.id.dialog_button_container);
|
||||
}
|
||||
|
||||
private static Button getButtonTemplate(CustomDialog dialog) {
|
||||
if (dialog.verticalButtons)
|
||||
return (Button) dialog.findViewById(R.id.dialog_template_button_vertical);
|
||||
else
|
||||
return (Button) dialog.findViewById(R.id.dialog_template_button);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,13 +9,15 @@ import android.widget.ArrayAdapter;
|
||||
import android.widget.Button;
|
||||
import android.widget.ListView;
|
||||
|
||||
import com.gpl.rpg.AndorsTrail.view.CustomDialogFactory.CustomDialog;
|
||||
|
||||
/**
|
||||
* Simply instantiate this class, implement abstract methods in an anonymous type, and tada, your Button is a Spinner!
|
||||
*/
|
||||
public abstract class SpinnerEmulator {
|
||||
|
||||
private Button spinnerButton;
|
||||
private Dialog spinnerDialog = null;
|
||||
private CustomDialog spinnerDialog = null;
|
||||
private ListView choicesList;
|
||||
private Context context;
|
||||
|
||||
|
||||
@@ -61,13 +61,9 @@ public final class TraitsInfoView {
|
||||
tv.setText(Integer.toString(attackCost));
|
||||
|
||||
row = (TableRow) group.findViewById(R.id.traitsinfo_attack_chance_row);
|
||||
if (attackChance == 0) {
|
||||
row.setVisibility(View.GONE);
|
||||
} else {
|
||||
row.setVisibility(View.VISIBLE);
|
||||
tv = (TextView) group.findViewById(R.id.traitsinfo_attack_chance);
|
||||
tv.setText(Integer.toString(attackChance));
|
||||
}
|
||||
tv = (TextView) group.findViewById(R.id.traitsinfo_attack_chance);
|
||||
tv.setText(Integer.toString(attackChance));
|
||||
|
||||
|
||||
row = (TableRow) group.findViewById(R.id.traitsinfo_attack_damage_row);
|
||||
if (damagePotential != null && damagePotential.max != 0) {
|
||||
|
||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
BIN
AndorsTrail/assets/translation/da.mo
Normal file
BIN
AndorsTrail/assets/translation/da.mo
Normal file
Binary file not shown.
68740
AndorsTrail/assets/translation/da.po
Normal file
68740
AndorsTrail/assets/translation/da.po
Normal file
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user