Compare commits
4160 Commits
0.2.201107
...
0.4.13
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d44fceac7e | ||
|
|
980d095e32 | ||
|
|
8b8d17b22b | ||
|
|
5009d31a33 | ||
|
|
f3c16ab373 | ||
|
|
3a2bfd4548 | ||
|
|
a64d887275 | ||
|
|
d565ce9539 | ||
|
|
457d42c599 | ||
|
|
1fadf7f21e | ||
|
|
c2d23ff9cc | ||
|
|
bcf38a2ad1 | ||
|
|
5556ba168f | ||
|
|
ee6cad1546 | ||
|
|
0ba1cf8203 | ||
|
|
7238df4c59 | ||
|
|
c4b5561b3f | ||
|
|
25dfd1bbf5 | ||
|
|
be9024a397 | ||
|
|
a670ecfde4 | ||
|
|
def274a583 | ||
|
|
a8e238ed06 | ||
|
|
2b04ab874d | ||
|
|
738fbc66d0 | ||
|
|
f0b325254f | ||
|
|
6c0c27f662 | ||
|
|
1c408c4f1d | ||
|
|
18cfd89a86 | ||
|
|
a953ff4dfc | ||
|
|
6b39bc6865 | ||
|
|
46e4970918 | ||
|
|
35cc90b086 | ||
|
|
e0a961da52 | ||
|
|
247dda5005 | ||
|
|
ba5e4d7217 | ||
|
|
ad49c96ecf | ||
|
|
f75e6417ad | ||
|
|
a8dbcbc2f2 | ||
|
|
5447bb4e83 | ||
|
|
5ffb752d3a | ||
|
|
0d1243ce0b | ||
|
|
a2f12bf054 | ||
|
|
5622fb2cee | ||
|
|
63b12f1f04 | ||
|
|
5c3c965c1a | ||
|
|
8560ece02e | ||
|
|
bd0b469d3d | ||
|
|
49cf66d785 | ||
|
|
bcf47bc67c | ||
|
|
3183d5a403 | ||
|
|
3295f3c401 | ||
|
|
7a6e4dc54a | ||
|
|
cf77e0333d | ||
|
|
abe6c072d6 | ||
|
|
060e56b24c | ||
|
|
868a1a5c13 | ||
|
|
47225346be | ||
|
|
a890c66bc0 | ||
|
|
ec796b8e81 | ||
|
|
a5e5aa5be9 | ||
|
|
c4287a0d68 | ||
|
|
ebe7b31538 | ||
|
|
42cf5e972d | ||
|
|
bf991bde45 | ||
|
|
67997af67f | ||
|
|
79e2647556 | ||
|
|
c39a85a88d | ||
|
|
7919318be7 | ||
|
|
cfed682d04 | ||
|
|
e29b61ecd4 | ||
|
|
7217fd32eb | ||
|
|
05fe9ab2d4 | ||
|
|
eb3aac20c8 | ||
|
|
f97c2702a2 | ||
|
|
ca63f7f10d | ||
|
|
88a6b9f52d | ||
|
|
9bc0241e44 | ||
|
|
f336d3ffb6 | ||
|
|
c30a2d6854 | ||
|
|
454a290370 | ||
|
|
ffd0ef16c4 | ||
|
|
fa1096ec49 | ||
|
|
4e6971e593 | ||
|
|
a8c5841140 | ||
|
|
288302a1f0 | ||
|
|
5bde7798e9 | ||
|
|
aab7c83d02 | ||
|
|
2eb329cc63 | ||
|
|
5dc9df8bbe | ||
|
|
3b50b2766a | ||
|
|
1e0e85f82e | ||
|
|
4eacce5e2f | ||
|
|
8b472fdc05 | ||
|
|
d569c91f48 | ||
|
|
60350699c7 | ||
|
|
5b0c719171 | ||
|
|
254dbe7abd | ||
|
|
a57d83b46a | ||
|
|
403e6e6c9c | ||
|
|
8994913259 | ||
|
|
fa7fe510d9 | ||
|
|
5ebb4237e2 | ||
|
|
7bbb9b066a | ||
|
|
4046f3e302 | ||
|
|
e47f390e0d | ||
|
|
1076bbd03e | ||
|
|
74d8fdbd95 | ||
|
|
c5c609ce3d | ||
|
|
dd2e08e117 | ||
|
|
162af5fe32 | ||
|
|
5b9c8dfbd2 | ||
|
|
8d03301138 | ||
|
|
9c76f379ac | ||
|
|
2c359da836 | ||
|
|
b4f166fb45 | ||
|
|
5c7b7caec9 | ||
|
|
f4667dfd26 | ||
|
|
a2f35da6b6 | ||
|
|
fa53bb77d9 | ||
|
|
4872f1cfd1 | ||
|
|
3ff5e458b6 | ||
|
|
bf7174f3f9 | ||
|
|
f9dbec6edf | ||
|
|
655fc6010f | ||
|
|
b30e8d8ec6 | ||
|
|
8ac0cf500f | ||
|
|
515e7028ac | ||
|
|
5006ce8260 | ||
|
|
6f07f79c2f | ||
|
|
b411b6f36f | ||
|
|
66ea356e68 | ||
|
|
c3dead719a | ||
|
|
1a1774a105 | ||
|
|
8eb272cea3 | ||
|
|
e6f0178e83 | ||
|
|
cb8978fb1d | ||
|
|
4ece2b9e32 | ||
|
|
13e100e1d8 | ||
|
|
b51738177e | ||
|
|
39439cbd3d | ||
|
|
b0784ba871 | ||
|
|
e234d8b378 | ||
|
|
ba15c98e4d | ||
|
|
d92d376148 | ||
|
|
a93838707a | ||
|
|
d786a272c0 | ||
|
|
64dc053209 | ||
|
|
c53520aa31 | ||
|
|
96989e0a6a | ||
|
|
87b9cdab07 | ||
|
|
7b171ea2be | ||
|
|
0a0378fece | ||
|
|
8a85e5e58d | ||
|
|
75d2cfef5c | ||
|
|
2e44873ac9 | ||
|
|
b2160bcecd | ||
|
|
c0dafa1c10 | ||
|
|
d75009a758 | ||
|
|
9e3e6dc5ec | ||
|
|
370a33686a | ||
|
|
842579eb8c | ||
|
|
29b0dc89e6 | ||
|
|
85f3d575ec | ||
|
|
91f95fd4df | ||
|
|
29dda9f356 | ||
|
|
4e28c8d3c8 | ||
|
|
0d65ee878c | ||
|
|
1455267c9e | ||
|
|
0a90fedabc | ||
|
|
b160f8dfe7 | ||
|
|
420125debd | ||
|
|
36163d9653 | ||
|
|
ffd16e3fec | ||
|
|
3376d2e114 | ||
|
|
3d43df99f1 | ||
|
|
b13809f0c0 | ||
|
|
c6766b275f | ||
|
|
3a89e25fe0 | ||
|
|
2c1fd29884 | ||
|
|
bc55ef337c | ||
|
|
6f8bdda90e | ||
|
|
17ba584fe2 | ||
|
|
0b76e85a71 | ||
|
|
660fa516bf | ||
|
|
622918d8a8 | ||
|
|
53efe2ef42 | ||
|
|
a31d08be55 | ||
|
|
14f4cd0ef9 | ||
|
|
70da8a940b | ||
|
|
d7190df07e | ||
|
|
dd91b3d6fb | ||
|
|
40226e5274 | ||
|
|
3b65a6a36c | ||
|
|
e45ecad3ab | ||
|
|
2da1503780 | ||
|
|
ea1b17b88f | ||
|
|
43dab2ffc8 | ||
|
|
6dcf549ba9 | ||
|
|
a1a2ac7954 | ||
|
|
7a90b31b30 | ||
|
|
7b7f8b7225 | ||
|
|
c977fbd928 | ||
|
|
3ae8b92be6 | ||
|
|
bbf6f4fc25 | ||
|
|
3b4408aa6c | ||
|
|
38482d2656 | ||
|
|
bb5f830d16 | ||
|
|
ecdfbfc8dc | ||
|
|
ee38bcd307 | ||
|
|
43fcfbfe05 | ||
|
|
d105bf27dd | ||
|
|
60f31ad523 | ||
|
|
b6387b4e0f | ||
|
|
572990dcd3 | ||
|
|
aa13baa30a | ||
|
|
e50aa4ed06 | ||
|
|
502e40a649 | ||
|
|
0b187ede4b | ||
|
|
c849d32a10 | ||
|
|
05f4e9ee08 | ||
|
|
e481745433 | ||
|
|
8383a61eac | ||
|
|
74d8b341bc | ||
|
|
ba3ff5ef39 | ||
|
|
b8a8be9c86 | ||
|
|
e479337c1a | ||
|
|
6df6b2a0e0 | ||
|
|
617a3d426f | ||
|
|
06a2eee692 | ||
|
|
b4dfaa3a7a | ||
|
|
addf3ee165 | ||
|
|
522acf920f | ||
|
|
0f15488eae | ||
|
|
c0335f7d13 | ||
|
|
990a96578f | ||
|
|
21878c9d5c | ||
|
|
f16ebbfecf | ||
|
|
6b7fb591cb | ||
|
|
774e5d17c4 | ||
|
|
3dba6d1f90 | ||
|
|
39869aaa25 | ||
|
|
e13d2bafc6 | ||
|
|
9facb40738 | ||
|
|
2853b40de1 | ||
|
|
da34a2b33e | ||
|
|
603297cc35 | ||
|
|
43702ec6ac | ||
|
|
6c5a6967ec | ||
|
|
497299afd6 | ||
|
|
d2ca662569 | ||
|
|
5b03857c62 | ||
|
|
23984ef7f0 | ||
|
|
20aa78cffb | ||
|
|
46684beec1 | ||
|
|
4c9a8a91c4 | ||
|
|
c0edb8e313 | ||
|
|
3ffb5f5761 | ||
|
|
28b2476b11 | ||
|
|
c00b6812b1 | ||
|
|
11a96e4901 | ||
|
|
fb36c471d7 | ||
|
|
8f9af57314 | ||
|
|
6c06330daf | ||
|
|
05ab9973f9 | ||
|
|
3a8c788880 | ||
|
|
f26421228b | ||
|
|
c297a75a7d | ||
|
|
8dbf683313 | ||
|
|
19cbb6b37b | ||
|
|
18c2f16c13 | ||
|
|
5d1d7c17ea | ||
|
|
eaef678e0b | ||
|
|
c5b4e54174 | ||
|
|
86a963caca | ||
|
|
99cf53c908 | ||
|
|
33a633a631 | ||
|
|
be18bd6a8c | ||
|
|
178f536f08 | ||
|
|
b70e67df8c | ||
|
|
ecc514f11b | ||
|
|
75622c30be | ||
|
|
b4c3ff6eab | ||
|
|
02805af36e | ||
|
|
82e35edff5 | ||
|
|
181f7baa45 | ||
|
|
58eae43322 | ||
|
|
5a1975a4e3 | ||
|
|
2b99d904f6 | ||
|
|
d59e6ad004 | ||
|
|
ff740a4179 | ||
|
|
f1ccfd3c3d | ||
|
|
0310123bc9 | ||
|
|
f091bbd563 | ||
|
|
2dba29ebf2 | ||
|
|
33c11415bf | ||
|
|
0e64fc45b9 | ||
|
|
77e4a467f0 | ||
|
|
e17c6ba2cd | ||
|
|
b246812455 | ||
|
|
656575b59d | ||
|
|
d720fd5644 | ||
|
|
3a8e7341ec | ||
|
|
3f5c2dea4d | ||
|
|
2b44e75442 | ||
|
|
633af58a05 | ||
|
|
b785577f03 | ||
|
|
b45df9d6a7 | ||
|
|
1be2d32fd5 | ||
|
|
dfd790930c | ||
|
|
2923eafaca | ||
|
|
3ee854cf25 | ||
|
|
4b0f5fcbf5 | ||
|
|
9345ba7b6a | ||
|
|
5fa4fed097 | ||
|
|
9af7f38e3f | ||
|
|
8f38f8255c | ||
|
|
5b237b4d94 | ||
|
|
5704fb36d2 | ||
|
|
9e1e4b6284 | ||
|
|
aef1b41b02 | ||
|
|
6626a3f72f | ||
|
|
37ca3212ee | ||
|
|
b6475f5448 | ||
|
|
9179081776 | ||
|
|
4ea5a96fff | ||
|
|
558d715bf6 | ||
|
|
415167b228 | ||
|
|
cd1d625ab2 | ||
|
|
732eb72a0c | ||
|
|
068d561a3c | ||
|
|
27e3a353d8 | ||
|
|
4f851faa91 | ||
|
|
7220ca906d | ||
|
|
45a77c8bf1 | ||
|
|
1fb3d1156c | ||
|
|
400c6087b6 | ||
|
|
1c7c349264 | ||
|
|
e3764410d3 | ||
|
|
ab04b7fe94 | ||
|
|
ac6efa2539 | ||
|
|
ccc09abc2d | ||
|
|
eec01bc2fa | ||
|
|
17a173f474 | ||
|
|
3be9787e64 | ||
|
|
e0eec201a1 | ||
|
|
972d17baea | ||
|
|
436cb468e9 | ||
|
|
943c6e523e | ||
|
|
c197e03922 | ||
|
|
d36067fda5 | ||
|
|
46a2c1f167 | ||
|
|
a443a13a9d | ||
|
|
3d4244cc75 | ||
|
|
687d969c9c | ||
|
|
386d695330 | ||
|
|
f1a41e4f77 | ||
|
|
a615da6b12 | ||
|
|
0c792db05c | ||
|
|
e0889c6c03 | ||
|
|
5f0b36b8b7 | ||
|
|
d4d561fbcd | ||
|
|
3576f4fab7 | ||
|
|
406d9ba87b | ||
|
|
f0a1379e5a | ||
|
|
821d0025da | ||
|
|
4abb96fb54 | ||
|
|
b318c4712c | ||
|
|
479f38973e | ||
|
|
0c634a9719 | ||
|
|
d02300a749 | ||
|
|
ad789be45b | ||
|
|
a09e4427d6 | ||
|
|
b2a89c04b2 | ||
|
|
39fd4da7a0 | ||
|
|
8c688bfd07 | ||
|
|
a5f942c3c0 | ||
|
|
75cbd80e5b | ||
|
|
ce8a9ed94b | ||
|
|
0a413265cb | ||
|
|
c758fd73ff | ||
|
|
d2fc98e4a6 | ||
|
|
0df736173e | ||
|
|
5132908f4b | ||
|
|
3c6e112c28 | ||
|
|
392ac41c99 | ||
|
|
f81759792e | ||
|
|
43aab618e5 | ||
|
|
8804c47e59 | ||
|
|
ed3ebd633d | ||
|
|
4235f671c1 | ||
|
|
334e70455b | ||
|
|
fedbbc8883 | ||
|
|
1cb404522f | ||
|
|
470de10de3 | ||
|
|
aa340fd857 | ||
|
|
92f20696eb | ||
|
|
58d62ad045 | ||
|
|
74eb14cc80 | ||
|
|
9527984dbc | ||
|
|
113bdd3ec0 | ||
|
|
ddf96c7a17 | ||
|
|
6d61375cc7 | ||
|
|
b4247dff2e | ||
|
|
699e066bea | ||
|
|
337e79c656 | ||
|
|
d1d5618bb8 | ||
|
|
1fe4256462 | ||
|
|
ab77bf98ee | ||
|
|
7c121726dc | ||
|
|
db32e6c5aa | ||
|
|
862d4ea328 | ||
|
|
ed10005d38 | ||
|
|
6a48844eba | ||
|
|
ff924ef0dc | ||
|
|
bf06b68c96 | ||
|
|
5ee0d8ac81 | ||
|
|
e1475bdc89 | ||
|
|
34101015b2 | ||
|
|
e3d69f2920 | ||
|
|
dfe00abc5a | ||
|
|
3444dec2db | ||
|
|
b21230b329 | ||
|
|
2430b2e998 | ||
|
|
3ef0b4e637 | ||
|
|
5659434d32 | ||
|
|
30075467b8 | ||
|
|
3d53c90d4b | ||
|
|
e680d49774 | ||
|
|
393722a9e3 | ||
|
|
93fcab952b | ||
|
|
284fefb0c3 | ||
|
|
b711d9040f | ||
|
|
d1681872bf | ||
|
|
4fbcfac6cf | ||
|
|
2641fcc4bb | ||
|
|
7851c4f7a2 | ||
|
|
9fbc3a8ca3 | ||
|
|
732d7b9a7c | ||
|
|
9fc2b93d9f | ||
|
|
a423202756 | ||
|
|
11372ac646 | ||
|
|
37a6297025 | ||
|
|
6cf7c89236 | ||
|
|
15d9cd3a6f | ||
|
|
c31c87adb5 | ||
|
|
5b5c498011 | ||
|
|
0ae75f2a4e | ||
|
|
0e5e49736c | ||
|
|
d6638b4300 | ||
|
|
008d7e0467 | ||
|
|
61f2d0ca34 | ||
|
|
761b127060 | ||
|
|
3993093f51 | ||
|
|
7679396ebb | ||
|
|
837a2e1e5f | ||
|
|
709f4a50f7 | ||
|
|
03e0dd33a8 | ||
|
|
1e4fb80d46 | ||
|
|
26153bab7d | ||
|
|
d03c2999da | ||
|
|
2676d289d9 | ||
|
|
538036d004 | ||
|
|
467fc0ddc9 | ||
|
|
8f2e9bfbc2 | ||
|
|
22730bbc0c | ||
|
|
8ca08a850f | ||
|
|
2f0107f4a7 | ||
|
|
94b3950958 | ||
|
|
ca5df44edb | ||
|
|
7685969274 | ||
|
|
814e55597d | ||
|
|
bfc4652c66 | ||
|
|
dbe5a446c3 | ||
|
|
c552d293fa | ||
|
|
34c5a5b377 | ||
|
|
699d42efc6 | ||
|
|
ceac41ed6e | ||
|
|
5f8e48c63b | ||
|
|
16b961b2eb | ||
|
|
d63df4ecb1 | ||
|
|
e7736ffdd6 | ||
|
|
b560294050 | ||
|
|
aaf26b3a44 | ||
|
|
b2801d8127 | ||
|
|
e4f7c92cff | ||
|
|
2bc0165652 | ||
|
|
89217faec5 | ||
|
|
155116852a | ||
|
|
aa085bf222 | ||
|
|
783e15f389 | ||
|
|
1488542968 | ||
|
|
de6d5ce2cd | ||
|
|
0e93eefb8f | ||
|
|
083c8c734e | ||
|
|
74d34da6cb | ||
|
|
9f3fc7201b | ||
|
|
126f36c2e6 | ||
|
|
4e63c977c7 | ||
|
|
7c19933a8c | ||
|
|
afb19f3a1f | ||
|
|
3067d78216 | ||
|
|
6ce0985f47 | ||
|
|
140245a76f | ||
|
|
29e46d6b29 | ||
|
|
b2b6bbf3e8 | ||
|
|
adfcdc5484 | ||
|
|
d4e210ee95 | ||
|
|
e74b8da54e | ||
|
|
3ae16f1c17 | ||
|
|
57d86cf574 | ||
|
|
969413b9fa | ||
|
|
c788b17322 | ||
|
|
d463000595 | ||
|
|
267c9f4cb4 | ||
|
|
d75a0a7394 | ||
|
|
86e9408c9f | ||
|
|
40e248b9f9 | ||
|
|
f6e4c5d9cf | ||
|
|
9da99efca2 | ||
|
|
ced6d20295 | ||
|
|
a603a76787 | ||
|
|
5698e2baf8 | ||
|
|
ffdf8dedb7 | ||
|
|
e9eda2b0d0 | ||
|
|
708337dfc2 | ||
|
|
c7454d4732 | ||
|
|
b65c7ab4a4 | ||
|
|
40c2c18a3f | ||
|
|
c00eed90d3 | ||
|
|
6c09b34edc | ||
|
|
daa1c30b35 | ||
|
|
3d505b2b5f | ||
|
|
9749d9fee6 | ||
|
|
0d1eedcccc | ||
|
|
aa474e4501 | ||
|
|
82482ecd9d | ||
|
|
36e8ba9ce2 | ||
|
|
365e4ae0fa | ||
|
|
b214cde5b4 | ||
|
|
9e67579315 | ||
|
|
eb7482fd73 | ||
|
|
cd684497c2 | ||
|
|
06f328207f | ||
|
|
2066655aae | ||
|
|
7e088fdfe3 | ||
|
|
bbed01ab62 | ||
|
|
40bf1d7b5f | ||
|
|
7f8f9785d7 | ||
|
|
1b2f64473e | ||
|
|
038d3a31df | ||
|
|
7e56637ed0 | ||
|
|
64ff966bae | ||
|
|
056e8f7839 | ||
|
|
aefe80769b | ||
|
|
773aa8c57b | ||
|
|
1a175c6982 | ||
|
|
d4a6dedc88 | ||
|
|
7b7cd0ecac | ||
|
|
3b1ac5b889 | ||
|
|
fdb9140825 | ||
|
|
0f556d0c7f | ||
|
|
2b189d4507 | ||
|
|
338e66af5f | ||
|
|
14f7df980b | ||
|
|
d65a90a86b | ||
|
|
b4acac706d | ||
|
|
577701cabd | ||
|
|
3b6480c5b0 | ||
|
|
51057a56f5 | ||
|
|
38cf080a9c | ||
|
|
cd4324e5a8 | ||
|
|
47d9b4d9aa | ||
|
|
c5defe7a11 | ||
|
|
a0affa496d | ||
|
|
009149a073 | ||
|
|
5a5854ea9d | ||
|
|
c09d026f05 | ||
|
|
3998a1f8f9 | ||
|
|
aa31e3c7f3 | ||
|
|
cf4045ff0f | ||
|
|
81930b1729 | ||
|
|
b3aeba684b | ||
|
|
38e6280552 | ||
|
|
109f0ffeab | ||
|
|
e357577cb2 | ||
|
|
627c747470 | ||
|
|
e6ad2ace10 | ||
|
|
804d65a8ec | ||
|
|
5a0ed780f5 | ||
|
|
8941ea0cc9 | ||
|
|
9a9fcfc9a3 | ||
|
|
4d744cf87a | ||
|
|
49f84b76bc | ||
|
|
27d4e89d32 | ||
|
|
b019221c30 | ||
|
|
0a299fd4e5 | ||
|
|
2079462e62 | ||
|
|
81b9c023c4 | ||
|
|
fd70f4f2f0 | ||
|
|
3c91ad8fc2 | ||
|
|
24315db6ef | ||
|
|
54487b3e70 | ||
|
|
718bcafd51 | ||
|
|
c58d49977d | ||
|
|
f8d5af7536 | ||
|
|
98d80e2012 | ||
|
|
f1fd0f7e14 | ||
|
|
7c8793cbea | ||
|
|
ed04e8e9e4 | ||
|
|
efa977518a | ||
|
|
8aebc31a17 | ||
|
|
a3e2b3e404 | ||
|
|
3b6b9435c5 | ||
|
|
5eb0eda626 | ||
|
|
346652a809 | ||
|
|
7880ff74b6 | ||
|
|
7c5accf605 | ||
|
|
d44cb547f2 | ||
|
|
af7f369d28 | ||
|
|
2630f45fdf | ||
|
|
c7a7803780 | ||
|
|
d302629392 | ||
|
|
e102cbd840 | ||
|
|
146f77fdb7 | ||
|
|
92d1985802 | ||
|
|
14cc2c23d7 | ||
|
|
a19ec3328c | ||
|
|
4a6582c13c | ||
|
|
c3a23ebc28 | ||
|
|
b2f3ffe308 | ||
|
|
66efaaa983 | ||
|
|
704453ff12 | ||
|
|
a9355284b5 | ||
|
|
8252e1ecd0 | ||
|
|
10b208f5c1 | ||
|
|
c8f60bd224 | ||
|
|
98b37e3e0d | ||
|
|
f824866686 | ||
|
|
d25ff8fd25 | ||
|
|
cfca5f99e6 | ||
|
|
caf8d2a9d1 | ||
|
|
bb59a8543d | ||
|
|
da8199799d | ||
|
|
368496b612 | ||
|
|
dd2bb950be | ||
|
|
a704c04f00 | ||
|
|
15c037614f | ||
|
|
a0535d286b | ||
|
|
0904884ad4 | ||
|
|
1367e8ffff | ||
|
|
9e2a9b55e1 | ||
|
|
84c367bb46 | ||
|
|
8bbf106379 | ||
|
|
efeb372e95 | ||
|
|
bec5d3ab22 | ||
|
|
9a0dd47057 | ||
|
|
929e0b0ad8 | ||
|
|
5e075c3344 | ||
|
|
b56f1175a2 | ||
|
|
1b4aaa5f50 | ||
|
|
b4cdbc997f | ||
|
|
d902bd31c4 | ||
|
|
0118c111e8 | ||
|
|
43f102271d | ||
|
|
48fa893abd | ||
|
|
285655a878 | ||
|
|
38561023b4 | ||
|
|
4d15d63134 | ||
|
|
a8ec7876a6 | ||
|
|
ad690c46b1 | ||
|
|
80a7408e4d | ||
|
|
eeea454bff | ||
|
|
ca217d0416 | ||
|
|
47aca6f6d1 | ||
|
|
5b55deb1eb | ||
|
|
ed7c9c4cb8 | ||
|
|
2c4a5e1861 | ||
|
|
800d192702 | ||
|
|
f8bd1f3563 | ||
|
|
0ea843bbdb | ||
|
|
a555e2d9b0 | ||
|
|
aafbbcd537 | ||
|
|
a9f81b729b | ||
|
|
1702c34b64 | ||
|
|
70354ac20b | ||
|
|
408d9b72f0 | ||
|
|
a28055f8fd | ||
|
|
a6dd619938 | ||
|
|
5bcfe7ea6a | ||
|
|
db481e7232 | ||
|
|
60d745126f | ||
|
|
d4786d8d5d | ||
|
|
9b89f7aad7 | ||
|
|
38bd9e93a2 | ||
|
|
e36681101e | ||
|
|
976d0b2caa | ||
|
|
44e4f5ab6e | ||
|
|
6e9f287844 | ||
|
|
839c4a99cd | ||
|
|
7b17b9059e | ||
|
|
e80a044818 | ||
|
|
29514918f8 | ||
|
|
db3466dbe8 | ||
|
|
805c8e51e5 | ||
|
|
2f0a8f1c3e | ||
|
|
a39c136e69 | ||
|
|
2959d6b3da | ||
|
|
5481e38d0b | ||
|
|
e5b636712c | ||
|
|
46821f1156 | ||
|
|
5e58a95491 | ||
|
|
5aeeb219e3 | ||
|
|
9736548720 | ||
|
|
0330cec7ec | ||
|
|
77e20a0c21 | ||
|
|
c9669e90bb | ||
|
|
9f52149a11 | ||
|
|
eb6b6ff333 | ||
|
|
516f1bcd16 | ||
|
|
5cf911ffe1 | ||
|
|
148fffb0f2 | ||
|
|
bd0d786590 | ||
|
|
227e4807b4 | ||
|
|
e19dab2622 | ||
|
|
57f2fa57cd | ||
|
|
a4a6cc8eb1 | ||
|
|
0fd1ee0380 | ||
|
|
5d08ada224 | ||
|
|
c0066a75cd | ||
|
|
714a4f8507 | ||
|
|
b0efb8f3b2 | ||
|
|
c367f7301a | ||
|
|
a77c85fa6d | ||
|
|
c28a90dafb | ||
|
|
aed70cb0b6 | ||
|
|
2d9b311e7b | ||
|
|
25235a4324 | ||
|
|
b7c0e4b333 | ||
|
|
3b16103ca6 | ||
|
|
8089d89a51 | ||
|
|
30334b6b22 | ||
|
|
de3888ca09 | ||
|
|
3c8e372119 | ||
|
|
2ab97a7821 | ||
|
|
63867b1a37 | ||
|
|
e201620ee1 | ||
|
|
d576235409 | ||
|
|
7ad17a25f4 | ||
|
|
a3db918f78 | ||
|
|
d8cf64a202 | ||
|
|
56a89fd265 | ||
|
|
4a57ef12a1 | ||
|
|
50ce63b190 | ||
|
|
04d4a00393 | ||
|
|
2504da28af | ||
|
|
ef140eb7b0 | ||
|
|
2b8ed9e80c | ||
|
|
42f3515c0e | ||
|
|
0f1d33933d | ||
|
|
efdb9da619 | ||
|
|
083d19b3fc | ||
|
|
ef0a4e3614 | ||
|
|
beb6b3e593 | ||
|
|
2d849b0a19 | ||
|
|
7289d61e99 | ||
|
|
00bca11f59 | ||
|
|
3bdf3df223 | ||
|
|
091594e26e | ||
|
|
bdcf03ae36 | ||
|
|
a92c083011 | ||
|
|
cd4d213ae0 | ||
|
|
663e42ca3f | ||
|
|
21ee434832 | ||
|
|
bf5d6e670a | ||
|
|
64cdbae6df | ||
|
|
6fdb32361a | ||
|
|
8eb9cebdd0 | ||
|
|
ef8ed5d127 | ||
|
|
7233a1228e | ||
|
|
060ae29eaf | ||
|
|
3c3887bb19 | ||
|
|
d91559b8f0 | ||
|
|
800d912b6f | ||
|
|
0db73bd83e | ||
|
|
35149a10e3 | ||
|
|
aaec558f85 | ||
|
|
7452d5399b | ||
|
|
938a3f2976 | ||
|
|
a3d7203be5 | ||
|
|
3d29be24e0 | ||
|
|
2414580754 | ||
|
|
53bc56dc3c | ||
|
|
9b0d77a549 | ||
|
|
b589353d89 | ||
|
|
cfec470b51 | ||
|
|
c6df2bc42c | ||
|
|
f12118c38b | ||
|
|
0974337804 | ||
|
|
ca89e63b27 | ||
|
|
5e2753c712 | ||
|
|
ff3cfb746e | ||
|
|
a79a116ac8 | ||
|
|
62feade05d | ||
|
|
4150e533b3 | ||
|
|
101baf620c | ||
|
|
3993102e88 | ||
|
|
5038b9aaec | ||
|
|
9eb492229b | ||
|
|
cc3ab5efa5 | ||
|
|
3c637b4baf | ||
|
|
acb3519502 | ||
|
|
ab55da589c | ||
|
|
86cfbc21da | ||
|
|
91c00d29a5 | ||
|
|
863379a4c6 | ||
|
|
c5faa64405 | ||
|
|
570c2042b1 | ||
|
|
61dfa912f5 | ||
|
|
900fa26965 | ||
|
|
8c98f497d9 | ||
|
|
8334100fe1 | ||
|
|
ae2721f2c8 | ||
|
|
08d259cf41 | ||
|
|
b67f37f27e | ||
|
|
3ea5ed4ffe | ||
|
|
3f83ca29d3 | ||
|
|
7a7614afbf | ||
|
|
33eed6eb84 | ||
|
|
8621e6de5d | ||
|
|
03beb597c2 | ||
|
|
4287480608 | ||
|
|
c927763dce | ||
|
|
eee2f6a35d | ||
|
|
565959db86 | ||
|
|
7b93408884 | ||
|
|
0c37d48082 | ||
|
|
249749dd8c | ||
|
|
0483f91f30 | ||
|
|
7109e8f9fd | ||
|
|
2b10520999 | ||
|
|
173e1f6014 | ||
|
|
1e8e700ee6 | ||
|
|
0d55f43977 | ||
|
|
7dbb3916cb | ||
|
|
815876e709 | ||
|
|
f5211bbd59 | ||
|
|
67063ed59f | ||
|
|
082256a9f8 | ||
|
|
3b902fd574 | ||
|
|
8661b3587b | ||
|
|
8fe1d3fc2e | ||
|
|
df0ca45ee2 | ||
|
|
c0b193a261 | ||
|
|
a0ac471c1a | ||
|
|
06207ac550 | ||
|
|
dcbf1b3ce5 | ||
|
|
17dde5ddd0 | ||
|
|
6ba5d7771f | ||
|
|
b5e11e0e9a | ||
|
|
784a452ed5 | ||
|
|
ce4ed65a39 | ||
|
|
035e6bfc18 | ||
|
|
c4624639e6 | ||
|
|
581efea60e | ||
|
|
733d3182bd | ||
|
|
94a5a86493 | ||
|
|
e4e4324a30 | ||
|
|
e1f5c37bbc | ||
|
|
8af9d8b6ac | ||
|
|
19ccc27d37 | ||
|
|
093b1b47d9 | ||
|
|
10e0cf8b2c | ||
|
|
83830e8682 | ||
|
|
8066743a83 | ||
|
|
2c9bbe2736 | ||
|
|
cf8213ea82 | ||
|
|
cec141adc1 | ||
|
|
6ba50aa8f9 | ||
|
|
9f65fd6819 | ||
|
|
4e5d17f666 | ||
|
|
00fc0babe0 | ||
|
|
2b8180a417 | ||
|
|
c151099b79 | ||
|
|
d3dc88fe6b | ||
|
|
b0c4fd6d3f | ||
|
|
f114fc74d6 | ||
|
|
fb80a7c111 | ||
|
|
c07f15e910 | ||
|
|
16baed0467 | ||
|
|
dcc48976ce | ||
|
|
4cf8042b7c | ||
|
|
a89f37bb65 | ||
|
|
daefd0ab36 | ||
|
|
cfba55ba0a | ||
|
|
fb2bc956b1 | ||
|
|
88c28414f4 | ||
|
|
d50878d608 | ||
|
|
f2c18511a4 | ||
|
|
2f8fbdb9f5 | ||
|
|
5229a229a6 | ||
|
|
c5f6f9f77a | ||
|
|
a1ea017b51 | ||
|
|
941d000fc6 | ||
|
|
29b413b376 | ||
|
|
7490368984 | ||
|
|
2a7c6d27b3 | ||
|
|
0183c05ee0 | ||
|
|
4f23778e53 | ||
|
|
d0be823807 | ||
|
|
2fd3d52020 | ||
|
|
638f3a8454 | ||
|
|
c5f6656f99 | ||
|
|
5c55738276 | ||
|
|
bc2b8e9eef | ||
|
|
5ffddc94c0 | ||
|
|
535c473103 | ||
|
|
500f691426 | ||
|
|
2f134ce24f | ||
|
|
390c0cd691 | ||
|
|
60feb4ad25 | ||
|
|
f3abaec83b | ||
|
|
d75f0b0360 | ||
|
|
4fcf9fb66a | ||
|
|
04a1a446cf | ||
|
|
5062b99cb0 | ||
|
|
2b119e1e19 | ||
|
|
2fd14e1bd5 | ||
|
|
0e78aa296e | ||
|
|
5da6896d51 | ||
|
|
a648120d54 | ||
|
|
f7f7fec497 | ||
|
|
c16b1e2639 | ||
|
|
f6912f4241 | ||
|
|
d7b3046cf6 | ||
|
|
f0cd59034c | ||
|
|
0a5373d400 | ||
|
|
fcb1ea903f | ||
|
|
68c799bf99 | ||
|
|
78103e622c | ||
|
|
e402aa8984 | ||
|
|
93aab0362c | ||
|
|
691b18c41b | ||
|
|
d4f42938a5 | ||
|
|
360660947b | ||
|
|
16781da4f9 | ||
|
|
175b7a28e5 | ||
|
|
39162de15a | ||
|
|
d1d6a97b1c | ||
|
|
dceb9f7d60 | ||
|
|
25945dc539 | ||
|
|
a3e019c4f6 | ||
|
|
c30346ea30 | ||
|
|
2b1a151226 | ||
|
|
edb125837c | ||
|
|
6a43b3af09 | ||
|
|
77137a92cf | ||
|
|
264d740c9d | ||
|
|
571ba5d9c5 | ||
|
|
9f9279008c | ||
|
|
ec5188a49a | ||
|
|
dbae8a8854 | ||
|
|
8df8554fce | ||
|
|
9aaf67ebe0 | ||
|
|
1c9f05d792 | ||
|
|
26cf98ccfc | ||
|
|
5413ed1195 | ||
|
|
9878e8de4f | ||
|
|
a1db83e93f | ||
|
|
0dcc4b251f | ||
|
|
0164483310 | ||
|
|
21464639b3 | ||
|
|
d6cc0d8223 | ||
|
|
cb2d467665 | ||
|
|
f7f24d1470 | ||
|
|
6c52de88fb | ||
|
|
f7d65091f8 | ||
|
|
d406ac994b | ||
|
|
ea404979e1 | ||
|
|
fcdb1a8fc2 | ||
|
|
d39887dadd | ||
|
|
c4e393deea | ||
|
|
d2b5ba83b0 | ||
|
|
b9bc8dadb2 | ||
|
|
b1965ac209 | ||
|
|
da0f1e5497 | ||
|
|
a6ba042cf7 | ||
|
|
6afdb22ba7 | ||
|
|
9d69436052 | ||
|
|
0ee5a2197d | ||
|
|
feb3070299 | ||
|
|
55e4c35eaf | ||
|
|
da2ffebc41 | ||
|
|
5a9e696fa1 | ||
|
|
f0a8f655c0 | ||
|
|
8831703428 | ||
|
|
8d3a68f343 | ||
|
|
5b8855e83c | ||
|
|
92815ad54b | ||
|
|
874109c520 | ||
|
|
b57478b93b | ||
|
|
c3ad08708f | ||
|
|
fc9521874c | ||
|
|
7616537bc0 | ||
|
|
f25cc0dbae | ||
|
|
45ebaa3524 | ||
|
|
0adadba218 | ||
|
|
a1e9732407 | ||
|
|
987e565eeb | ||
|
|
10a47b7fee | ||
|
|
18c583ee0b | ||
|
|
9b551d5cbc | ||
|
|
cc8d7b8640 | ||
|
|
1c21e391ed | ||
|
|
92981b2fee | ||
|
|
d0be27415e | ||
|
|
05e7f71b33 | ||
|
|
90b6de173e | ||
|
|
c40e993ce4 | ||
|
|
96fcca4ea0 | ||
|
|
817e3a6c64 | ||
|
|
43bf4324d5 | ||
|
|
8040806f22 | ||
|
|
209c0dd1af | ||
|
|
dfd15fd1d9 | ||
|
|
429ecb2b94 | ||
|
|
9e811a92e7 | ||
|
|
db25f75337 | ||
|
|
f0ae2da89e | ||
|
|
6b4307791a | ||
|
|
03f3f958ed | ||
|
|
6c9bbb0360 | ||
|
|
dd4c21c180 | ||
|
|
813c088c1c | ||
|
|
1cb6ea6346 | ||
|
|
7c6da2f384 | ||
|
|
6396712ec4 | ||
|
|
9bb6648f26 | ||
|
|
4a3592ff9a | ||
|
|
bc28ca0636 | ||
|
|
6ddf458504 | ||
|
|
b994a7af13 | ||
|
|
d274cbfce6 | ||
|
|
b49e5cfc70 | ||
|
|
73bf791fe1 | ||
|
|
737cce5f2b | ||
|
|
7e34621b1d | ||
|
|
171bbd7959 | ||
|
|
31a8a8022a | ||
|
|
fd5eaae2ba | ||
|
|
d221917170 | ||
|
|
9029a34cc6 | ||
|
|
ae375cc322 | ||
|
|
e5652cb75c | ||
|
|
b11e1db809 | ||
|
|
076c5ee223 | ||
|
|
fe8ef1be59 | ||
|
|
0066bd77d2 | ||
|
|
d1ccc64e1e | ||
|
|
26495da94a | ||
|
|
8a44df8cba | ||
|
|
914f850d31 | ||
|
|
7b548cd2b5 | ||
|
|
b98e8d6da8 | ||
|
|
741df993ff | ||
|
|
28438bba27 | ||
|
|
173beeee65 | ||
|
|
b9cb196d49 | ||
|
|
0920f55eb4 | ||
|
|
37d3c3d328 | ||
|
|
01ce57ade5 | ||
|
|
5baf379f40 | ||
|
|
f48f686930 | ||
|
|
e9c9b66ae9 | ||
|
|
8b3135a643 | ||
|
|
cd0df0d5e7 | ||
|
|
b37bff72f1 | ||
|
|
47abe25fe7 | ||
|
|
db5aff832b | ||
|
|
61ed56f916 | ||
|
|
b75e7148c2 | ||
|
|
121e8cc2a1 | ||
|
|
15c7460eda | ||
|
|
5ca5630a11 | ||
|
|
56195dc2e4 | ||
|
|
9a685a4f2e | ||
|
|
b5a6bf2068 | ||
|
|
3e7e65885a | ||
|
|
fb35cfb2dc | ||
|
|
f6321e277b | ||
|
|
2c16a11527 | ||
|
|
d790acaaa7 | ||
|
|
c061bdd37f | ||
|
|
6bc4cad0ed | ||
|
|
2ae5d3f3ab | ||
|
|
cd64a92a8c | ||
|
|
b97c9c6577 | ||
|
|
a020d1b653 | ||
|
|
2b7a1ca572 | ||
|
|
44a1d0c192 | ||
|
|
406ed5efac | ||
|
|
d6e28c19b5 | ||
|
|
e9d62950e3 | ||
|
|
821b26884a | ||
|
|
4432e98261 | ||
|
|
adfba207a6 | ||
|
|
c9cab6bcab | ||
|
|
8da3136183 | ||
|
|
8852333eb3 | ||
|
|
86a3c8ce56 | ||
|
|
18bfa1c785 | ||
|
|
86a0f5603b | ||
|
|
58e6d25e03 | ||
|
|
206f076422 | ||
|
|
2f170a63c6 | ||
|
|
b8ba6318d6 | ||
|
|
0791eac2cc | ||
|
|
62ea342ad1 | ||
|
|
944e79d7a6 | ||
|
|
8948907431 | ||
|
|
b2102bfe49 | ||
|
|
f3eefeb794 | ||
|
|
9e4e7072da | ||
|
|
3fa4f782d9 | ||
|
|
e5b4748bb4 | ||
|
|
fb2183b61d | ||
|
|
8ab2971e0b | ||
|
|
d7364d65ac | ||
|
|
e66bb9b864 | ||
|
|
3ce6888c1c | ||
|
|
e09293b483 | ||
|
|
3e267a6ece | ||
|
|
f33d31693e | ||
|
|
996ea60642 | ||
|
|
26f4a5c110 | ||
|
|
7940a4264a | ||
|
|
55c646c5c2 | ||
|
|
b19dd922ec | ||
|
|
e4d570eafc | ||
|
|
c58b9d8da3 | ||
|
|
dec8c43de3 | ||
|
|
d7d8aa1039 | ||
|
|
8e9d896f2d | ||
|
|
247a1ebf23 | ||
|
|
944ffe9e53 | ||
|
|
7993696fc4 | ||
|
|
08f7ac5704 | ||
|
|
d9df592da8 | ||
|
|
2a5c88bde1 | ||
|
|
a4c987b339 | ||
|
|
c24e0753fc | ||
|
|
4caa00cc99 | ||
|
|
bf91d623c8 | ||
|
|
0a57b5b553 | ||
|
|
ccf3985b7a | ||
|
|
5f1f1151d3 | ||
|
|
f6e01adab7 | ||
|
|
fa427d641b | ||
|
|
6c5f79fee9 | ||
|
|
e9e9e42573 | ||
|
|
5e54bf1472 | ||
|
|
587167e940 | ||
|
|
15f3713e2f | ||
|
|
d7bcde6db4 | ||
|
|
6929206bc2 | ||
|
|
17345404ba | ||
|
|
5884236046 | ||
|
|
5357a17bac | ||
|
|
8979a3dd99 | ||
|
|
3bf05f020c | ||
|
|
9dc8901e32 | ||
|
|
70074800a2 | ||
|
|
33ca115ae4 | ||
|
|
f0db6c4423 | ||
|
|
625489dff4 | ||
|
|
61088b16c9 | ||
|
|
d38f6ebb9b | ||
|
|
7d72ac6a69 | ||
|
|
07f444ed85 | ||
|
|
aebbcbf398 | ||
|
|
9a016a6294 | ||
|
|
65b8b524c0 | ||
|
|
903d343b08 | ||
|
|
24a631ee2a | ||
|
|
eec456be63 | ||
|
|
3feece1f28 | ||
|
|
2d90aca4ab | ||
|
|
7df83c2c67 | ||
|
|
e69d660784 | ||
|
|
5ca336ea92 | ||
|
|
c9ba92c4ad | ||
|
|
a2e1b0fc7f | ||
|
|
8b3ed78e53 | ||
|
|
e14c4cdd4c | ||
|
|
96f285f71e | ||
|
|
2e19af9919 | ||
|
|
b459f53ac3 | ||
|
|
d020e0771d | ||
|
|
9b44bbd0a6 | ||
|
|
eadde1e741 | ||
|
|
6bd15247f9 | ||
|
|
37b7f094e3 | ||
|
|
5f9962e1cc | ||
|
|
2fee2baf98 | ||
|
|
95be18a3c1 | ||
|
|
b8343cd11c | ||
|
|
3d6d66b181 | ||
|
|
567dea29ee | ||
|
|
bfaba2c12a | ||
|
|
9afeb97fc6 | ||
|
|
b4c2e79ea4 | ||
|
|
b2dfde8c8c | ||
|
|
1c01ed5f13 | ||
|
|
7f99904eb1 | ||
|
|
c39992e429 | ||
|
|
1cc40c0a7c | ||
|
|
ff36071d93 | ||
|
|
ea6c3835de | ||
|
|
c410e9182d | ||
|
|
ee7af21e41 | ||
|
|
ebf7ea5019 | ||
|
|
1367895ae2 | ||
|
|
3c5df42a17 | ||
|
|
897c218b96 | ||
|
|
c91f8b1d25 | ||
|
|
6ee0db6fec | ||
|
|
f383766dbf | ||
|
|
ed2c8ba9c5 | ||
|
|
13517fb726 | ||
|
|
24face5249 | ||
|
|
09ba047c01 | ||
|
|
27538ecef5 | ||
|
|
d1ee708db2 | ||
|
|
a578f34db5 | ||
|
|
089fc010ab | ||
|
|
e491f8cd48 | ||
|
|
7e6db1b803 | ||
|
|
50127510e7 | ||
|
|
d9de29fa50 | ||
|
|
5fb8778e28 | ||
|
|
f6fc39e69a | ||
|
|
b3a2ef1a91 | ||
|
|
8ad83767cf | ||
|
|
d5de0cbf71 | ||
|
|
fcfd53aed1 | ||
|
|
334ec4bb1b | ||
|
|
35ec3855f6 | ||
|
|
56bf867874 | ||
|
|
496cb115b1 | ||
|
|
5d06bdf8ac | ||
|
|
2625323f25 | ||
|
|
9056c163a7 | ||
|
|
d4245e6cac | ||
|
|
a0097c6bfa | ||
|
|
f8522d50e7 | ||
|
|
2b9beead38 | ||
|
|
c86b78c9b7 | ||
|
|
e81454fb38 | ||
|
|
ef8cdd890c | ||
|
|
2dd69a85e7 | ||
|
|
3a9cf21664 | ||
|
|
1c7cc2665b | ||
|
|
8af44f8163 | ||
|
|
9a39848ba9 | ||
|
|
99f565e8f2 | ||
|
|
04fbf47744 | ||
|
|
65a4630f31 | ||
|
|
2a09b7e84f | ||
|
|
ce9f1e1d3c | ||
|
|
c380563a12 | ||
|
|
c0e4551249 | ||
|
|
cb3b42efe4 | ||
|
|
a0f78659f3 | ||
|
|
9f46cb6745 | ||
|
|
9d57413af0 | ||
|
|
6c98fd6658 | ||
|
|
9ffa88b558 | ||
|
|
7b3602bab3 | ||
|
|
5b3bbde1ef | ||
|
|
c39e46c00d | ||
|
|
c78aa7cf24 | ||
|
|
d7986da58c | ||
|
|
003634e049 | ||
|
|
763a511ca5 | ||
|
|
9675d9e9cb | ||
|
|
c6a9eae3ae | ||
|
|
e17d29ccd6 | ||
|
|
282f53ddb7 | ||
|
|
1cea2f1b49 | ||
|
|
f70e0556fc | ||
|
|
a7d49da217 | ||
|
|
32ab6c2a32 | ||
|
|
75ddf4d221 | ||
|
|
c5f00c38da | ||
|
|
34904a0744 | ||
|
|
d76b8c6e7c | ||
|
|
5bd2aea663 | ||
|
|
e7706593c6 | ||
|
|
832d7973c8 | ||
|
|
ab75b1b923 | ||
|
|
31f9912e9e | ||
|
|
7fba341dbb | ||
|
|
f0a9e7ddc8 | ||
|
|
882e12f8ab | ||
|
|
660e636887 | ||
|
|
c1e297a90a | ||
|
|
b743dcb942 | ||
|
|
3939ab6c9d | ||
|
|
6b37529bd6 | ||
|
|
6922807fd5 | ||
|
|
f969a91c0a | ||
|
|
18fe277d94 | ||
|
|
94dba66c16 | ||
|
|
73e5bc9c01 | ||
|
|
09970b7b6d | ||
|
|
d9f6f9e7a8 | ||
|
|
87b4bce594 | ||
|
|
c3984569c0 | ||
|
|
34d872628d | ||
|
|
c8a99404e8 | ||
|
|
6c37e89f08 | ||
|
|
167df02e3d | ||
|
|
5c6cf630de | ||
|
|
b16cbba21a | ||
|
|
90f0859128 | ||
|
|
f76b9d724b | ||
|
|
c8aed03ace | ||
|
|
c4359ff65c | ||
|
|
1cd512913e | ||
|
|
fef2729fd0 | ||
|
|
e17f140be0 | ||
|
|
d3ee617f37 | ||
|
|
c80d67f48e | ||
|
|
6f511b1d05 | ||
|
|
09e8bbea03 | ||
|
|
cfb26629bf | ||
|
|
9370f5657a | ||
|
|
4b44d359f5 | ||
|
|
b5acec0a3c | ||
|
|
c03d7dc8a7 | ||
|
|
088b18da3d | ||
|
|
65016c880c | ||
|
|
0d6e4ef5f3 | ||
|
|
f2b93b7bae | ||
|
|
6ab3b4c838 | ||
|
|
db4ea4658c | ||
|
|
1838a3fd69 | ||
|
|
8d31534710 | ||
|
|
3a6d6e4751 | ||
|
|
cd14259bd9 | ||
|
|
c5324015bc | ||
|
|
f2a1900345 | ||
|
|
e3bdd7b2ed | ||
|
|
885e93df44 | ||
|
|
9b142157b0 | ||
|
|
41bc24477b | ||
|
|
9ec281c712 | ||
|
|
127f354e7a | ||
|
|
e7ef4f07cb | ||
|
|
555dc86343 | ||
|
|
f20267862f | ||
|
|
da3c5c743f | ||
|
|
5b1bd2fb47 | ||
|
|
fec1fa51e0 | ||
|
|
a0dd2d89f3 | ||
|
|
8745935a06 | ||
|
|
0d93119040 | ||
|
|
eda9214f81 | ||
|
|
a230e1e736 | ||
|
|
ea0df3e4cb | ||
|
|
c00ed9dac3 | ||
|
|
4977b736e3 | ||
|
|
0279f32db7 | ||
|
|
674be38fc2 | ||
|
|
db60ae0459 | ||
|
|
a2003b0d55 | ||
|
|
54ffe2e5de | ||
|
|
118e2ae865 | ||
|
|
d436502fa4 | ||
|
|
dcafad2f73 | ||
|
|
b04872d96b | ||
|
|
8b02a015eb | ||
|
|
c0ab09af74 | ||
|
|
a1db9242ec | ||
|
|
e149d1ad9a | ||
|
|
7cdbb805d9 | ||
|
|
960d731587 | ||
|
|
8bb8602c25 | ||
|
|
fefec8cdc4 | ||
|
|
6090e95cdc | ||
|
|
edcad09dee | ||
|
|
d22621efc1 | ||
|
|
a88c685f02 | ||
|
|
142e2d3b74 | ||
|
|
556bdc260a | ||
|
|
28854495b1 | ||
|
|
af01a9577e | ||
|
|
65d1cb8321 | ||
|
|
564e11fc2f | ||
|
|
5bd9c236d5 | ||
|
|
936c6f577a | ||
|
|
5fefc4bbf6 | ||
|
|
0dc1aec509 | ||
|
|
f3d83a4516 | ||
|
|
31fe72dbac | ||
|
|
f8b7555558 | ||
|
|
23be6450a1 | ||
|
|
93729b09d5 | ||
|
|
362ef5f6ce | ||
|
|
d753d352f1 | ||
|
|
875f1327a4 | ||
|
|
e4d1970abf | ||
|
|
03297acbf4 | ||
|
|
18577f2527 | ||
|
|
7cac34c807 | ||
|
|
2bc2ce3bd1 | ||
|
|
c9b64206f9 | ||
|
|
859287b027 | ||
|
|
5ce3f8f7b7 | ||
|
|
0643cef09a | ||
|
|
16a028dd6b | ||
|
|
28d6326bd4 | ||
|
|
db98ef6b45 | ||
|
|
a4e2198e41 | ||
|
|
062de11b4c | ||
|
|
8e15179e7d | ||
|
|
3e52dd5c68 | ||
|
|
baee91bf78 | ||
|
|
1b840e8ef9 | ||
|
|
6f568c1db2 | ||
|
|
9a3b7715e2 | ||
|
|
18fd913e69 | ||
|
|
d4be81155e | ||
|
|
f6232d71b6 | ||
|
|
3da56696b5 | ||
|
|
3ba0359285 | ||
|
|
e73ca31b6e | ||
|
|
c1fe628b57 | ||
|
|
0bf5b140c7 | ||
|
|
ab6dda4230 | ||
|
|
272909359a | ||
|
|
330a35a522 | ||
|
|
85db6cb753 | ||
|
|
fac837b00e | ||
|
|
e02151d855 | ||
|
|
c276e023a4 | ||
|
|
6430962479 | ||
|
|
85cf811890 | ||
|
|
fcde24cfd3 | ||
|
|
4269ff1323 | ||
|
|
3cde5225d5 | ||
|
|
0b7cde0b2c | ||
|
|
0f0be6e592 | ||
|
|
5541821062 | ||
|
|
d9d06ad920 | ||
|
|
4585fba98b | ||
|
|
c163859057 | ||
|
|
3570f3e396 | ||
|
|
c873164878 | ||
|
|
31ec14afe2 | ||
|
|
ded5f8b1a6 | ||
|
|
89f7dc1efd | ||
|
|
a0683b811c | ||
|
|
2a01050a0c | ||
|
|
57710520dc | ||
|
|
83bafbe08b | ||
|
|
f4f98c9550 | ||
|
|
3670f5a37b | ||
|
|
6715c422ae | ||
|
|
bc0bbffa14 | ||
|
|
85fe75d1cb | ||
|
|
7f743178db | ||
|
|
c6c5edd73a | ||
|
|
7859e57f6c | ||
|
|
2d16ebf57c | ||
|
|
3f376a092e | ||
|
|
2927a327ca | ||
|
|
5a34f40d80 | ||
|
|
a439343844 | ||
|
|
458045d49f | ||
|
|
fbef701bcd | ||
|
|
857a49e081 | ||
|
|
ea0def381d | ||
|
|
284fc0b885 | ||
|
|
e7c2e61b19 | ||
|
|
6a3fa9df12 | ||
|
|
86a6cca3cf | ||
|
|
e258675eab | ||
|
|
21f1bec724 | ||
|
|
3f0ee5d680 | ||
|
|
9b978db0c2 | ||
|
|
6e352e3cbf | ||
|
|
76d4396fa1 | ||
|
|
cd7e8372f3 | ||
|
|
1b5b6fe692 | ||
|
|
057858ddda | ||
|
|
3875a77bf8 | ||
|
|
4585e855a7 | ||
|
|
1146db9956 | ||
|
|
bafc4ac6a1 | ||
|
|
21c96249fa | ||
|
|
66b24cc9ff | ||
|
|
b11b48ec07 | ||
|
|
64c0e40605 | ||
|
|
1b4908bf56 | ||
|
|
4896d4b829 | ||
|
|
f42f01758c | ||
|
|
a5287b6777 | ||
|
|
84bbe1ec6e | ||
|
|
5434d87da2 | ||
|
|
574ed6a363 | ||
|
|
8966c16ad2 | ||
|
|
2b1eff7725 | ||
|
|
a4c5f10ecf | ||
|
|
a358c040f2 | ||
|
|
676f34a02b | ||
|
|
a3586cd18d | ||
|
|
a9df87ede0 | ||
|
|
bd8ddf1a52 | ||
|
|
6f6f289db4 | ||
|
|
51e6feb17c | ||
|
|
84b94eb198 | ||
|
|
e21b29f422 | ||
|
|
3bbd280336 | ||
|
|
9edb91da57 | ||
|
|
8b0b857eaa | ||
|
|
10fdbf7375 | ||
|
|
c3eb7fe316 | ||
|
|
6f661f77a6 | ||
|
|
0fd5c61c00 | ||
|
|
c46574f30f | ||
|
|
9551f651cb | ||
|
|
811ea6cfc0 | ||
|
|
78f7f9eca8 | ||
|
|
c62bab010f | ||
|
|
3e728e722a | ||
|
|
92aa38bdfc | ||
|
|
6833e04bc5 | ||
|
|
d76957ee22 | ||
|
|
86c616a545 | ||
|
|
10eea107ed | ||
|
|
cb7bb736c7 | ||
|
|
160e2b7b7d | ||
|
|
b8c3221d55 | ||
|
|
4d22977509 | ||
|
|
91923806a9 | ||
|
|
1ad81c1ce3 | ||
|
|
25b1cca415 | ||
|
|
767b2e7b17 | ||
|
|
2902a29c2d | ||
|
|
829426c714 | ||
|
|
8e1d78e9de | ||
|
|
4b31a38ae9 | ||
|
|
bf9f50bc0e | ||
|
|
3aa28bc7a2 | ||
|
|
a5377251e2 | ||
|
|
a58b47d0f6 | ||
|
|
7ae0b90ff7 | ||
|
|
a50db0e824 | ||
|
|
e1f9ba435f | ||
|
|
ba8fa0bd42 | ||
|
|
1ed90c90c3 | ||
|
|
49cec3f782 | ||
|
|
38d112033b | ||
|
|
54dbd78f90 | ||
|
|
c9ac9992c7 | ||
|
|
3946d2a504 | ||
|
|
5fd92d67d5 | ||
|
|
c120ea57c9 | ||
|
|
848f80b2e5 | ||
|
|
e9e9fd7c3f | ||
|
|
9772322613 | ||
|
|
7a4c1e7327 | ||
|
|
15c316765d | ||
|
|
c3708b456e | ||
|
|
83853ccd41 | ||
|
|
e275b7099a | ||
|
|
0d990bd189 | ||
|
|
b03135548b | ||
|
|
0a903e69fb | ||
|
|
0404bbf671 | ||
|
|
0ea3e6dbe2 | ||
|
|
67bf7130ce | ||
|
|
d9ef072305 | ||
|
|
33de69a173 | ||
|
|
76036abdb0 | ||
|
|
4ccaa6d0af | ||
|
|
dfd1f87762 | ||
|
|
6c4a8766ab | ||
|
|
dae03382bf | ||
|
|
50b0e9f7a4 | ||
|
|
206565d965 | ||
|
|
3cc45fd8ad | ||
|
|
83cc882335 | ||
|
|
bbae8eb751 | ||
|
|
a0dce51af6 | ||
|
|
96f753a108 | ||
|
|
e15681080e | ||
|
|
35f88ac67c | ||
|
|
22dbbf0a6f | ||
|
|
000da6b25d | ||
|
|
e51ad5337f | ||
|
|
15be2659ea | ||
|
|
d9de9f23d9 | ||
|
|
2330267d22 | ||
|
|
60113bde74 | ||
|
|
1309e52198 | ||
|
|
5004f31575 | ||
|
|
6cbd1b8bf7 | ||
|
|
6fa3892a71 | ||
|
|
04e9a9d541 | ||
|
|
f3439c40d8 | ||
|
|
20e3d550fa | ||
|
|
de0cdbc01c | ||
|
|
e605d70256 | ||
|
|
4696c59a5f | ||
|
|
4594ba6522 | ||
|
|
06baf05c64 | ||
|
|
d879a539cd | ||
|
|
752e11e114 | ||
|
|
9a927476ca | ||
|
|
ff7d7080e3 | ||
|
|
769b2d7c05 | ||
|
|
5be786c804 | ||
|
|
747bc40840 | ||
|
|
d19a69cd0d | ||
|
|
d02ce1cf4d | ||
|
|
2e66aca357 | ||
|
|
b08d7558de | ||
|
|
ff25218374 | ||
|
|
7433d65d3e | ||
|
|
1fd9a11e30 | ||
|
|
4f246f0e22 | ||
|
|
f87c1c2410 | ||
|
|
122875c30c | ||
|
|
068dd796f5 | ||
|
|
16bd368374 | ||
|
|
83f1d9ae6b | ||
|
|
374e68d205 | ||
|
|
fb150e0504 | ||
|
|
c439bdd4e5 | ||
|
|
d661cb320d | ||
|
|
78f1fcf450 | ||
|
|
28c21ed566 | ||
|
|
d7b0fcb2f0 | ||
|
|
e5b1447d72 | ||
|
|
dfc268d88b | ||
|
|
8c3cf606a6 | ||
|
|
c28810f6df | ||
|
|
012551f16f | ||
|
|
4d165f5ea5 | ||
|
|
71cc575ea0 | ||
|
|
e023e7228e | ||
|
|
80981f80f3 | ||
|
|
ab601e8710 | ||
|
|
ee0b8da844 | ||
|
|
6f851c9692 | ||
|
|
e52d811110 | ||
|
|
5323d800cc | ||
|
|
98e4e2b373 | ||
|
|
b38afc9311 | ||
|
|
0c8bf7cf94 | ||
|
|
0930911efa | ||
|
|
86ef7147b6 | ||
|
|
a55c073ce9 | ||
|
|
21789ccc5f | ||
|
|
b2d9205796 | ||
|
|
eadc943159 | ||
|
|
dc407e219f | ||
|
|
d419e4cbb6 | ||
|
|
aa172bdda4 | ||
|
|
a439aea9ba | ||
|
|
367b5382a3 | ||
|
|
a92fc3563c | ||
|
|
533785ec9a | ||
|
|
3985c01ad7 | ||
|
|
cca4f09ba1 | ||
|
|
e396fb2984 | ||
|
|
90e7832408 | ||
|
|
35606cfb67 | ||
|
|
371b39a09a | ||
|
|
3f519eb729 | ||
|
|
9a750450ed | ||
|
|
5094a39f05 | ||
|
|
a935d81053 | ||
|
|
bb54e2cf1d | ||
|
|
22a59b3912 | ||
|
|
0f9440fa61 | ||
|
|
d75b1718f8 | ||
|
|
a92e90f684 | ||
|
|
b401e58c0d | ||
|
|
0aeecf3f7f | ||
|
|
b6bb3ffec4 | ||
|
|
7bd30b59ee | ||
|
|
1afd359550 | ||
|
|
1d856b734b | ||
|
|
3d63492f50 | ||
|
|
8ad052881c | ||
|
|
d886f34003 | ||
|
|
8903c68460 | ||
|
|
6f44492238 | ||
|
|
2e89209cf1 | ||
|
|
e46c527733 | ||
|
|
1a96987d0f | ||
|
|
7be18657b1 | ||
|
|
cf0786dc9d | ||
|
|
4a8a50a2a2 | ||
|
|
0fd29b7e09 | ||
|
|
4c2687775f | ||
|
|
50ea8601d5 | ||
|
|
68bbdf1b2c | ||
|
|
5fbc39a76c | ||
|
|
25edae00ea | ||
|
|
0b78889289 | ||
|
|
06a5eceb81 | ||
|
|
2636c92075 | ||
|
|
d11c76b9f2 | ||
|
|
0d35350b69 | ||
|
|
2bf9abade2 | ||
|
|
69a59f1e41 | ||
|
|
b1c82f332c | ||
|
|
fba2650e39 | ||
|
|
1cbba877ff | ||
|
|
53ab2f8def | ||
|
|
bd6d4666ab | ||
|
|
2f10cfb226 | ||
|
|
8bc68645cb | ||
|
|
6e17503208 | ||
|
|
382357d61c | ||
|
|
a924409bd1 | ||
|
|
e232f7311f | ||
|
|
12504a18ec | ||
|
|
b3591019ad | ||
|
|
34e0a0ca0f | ||
|
|
4e5760a541 | ||
|
|
19742d8d98 | ||
|
|
f86cdf0960 | ||
|
|
ee9f4f11a3 | ||
|
|
919ffd9d36 | ||
|
|
406bed1164 | ||
|
|
d0ddcecbe5 | ||
|
|
25304b53a1 | ||
|
|
14e562e92b | ||
|
|
b3ad0f1ed4 | ||
|
|
5f3806c93c | ||
|
|
5598f3c81b | ||
|
|
afb27329fc | ||
|
|
2170c9958a | ||
|
|
2134316c80 | ||
|
|
a9c0961e0c | ||
|
|
731392866f | ||
|
|
5dce44ec5e | ||
|
|
f0edd88dff | ||
|
|
8bc7ea61b9 | ||
|
|
372d638ec1 | ||
|
|
4ea0e4f606 | ||
|
|
fb6a789991 | ||
|
|
9e6bdc377f | ||
|
|
27947d85f7 | ||
|
|
f7ee5da4c1 | ||
|
|
c0398224ef | ||
|
|
9bccd75e34 | ||
|
|
c9eb17aba3 | ||
|
|
cfe6eaa66b | ||
|
|
62bc5331aa | ||
|
|
4c704fe306 | ||
|
|
d308352dbd | ||
|
|
3c4734d69a | ||
|
|
da9fe64851 | ||
|
|
4feea0ac68 | ||
|
|
681e136d5f | ||
|
|
e0f9f15d1d | ||
|
|
214da7bef9 | ||
|
|
dd5c451e03 | ||
|
|
d820a6bfd8 | ||
|
|
10a38a3005 | ||
|
|
c6e3797c1a | ||
|
|
168fa2ffe0 | ||
|
|
6fb4a78d71 | ||
|
|
217b66e5d2 | ||
|
|
95e4a93b1b | ||
|
|
3725179736 | ||
|
|
1f3402e7a1 | ||
|
|
49a75b1894 | ||
|
|
321ac66558 | ||
|
|
d423a8fc20 | ||
|
|
f1e4a671dc | ||
|
|
1cc1c56234 | ||
|
|
7e44c2ace1 | ||
|
|
58841ef12f | ||
|
|
71a8769bb5 | ||
|
|
6de16bb438 | ||
|
|
6291fd1cbb | ||
|
|
4a2203413f | ||
|
|
0be633a61d | ||
|
|
2963f631e3 | ||
|
|
df3a5a2abf | ||
|
|
211b372e26 | ||
|
|
8489980039 | ||
|
|
7935044820 | ||
|
|
e8b9467905 | ||
|
|
7860097eda | ||
|
|
5b518ed2fe | ||
|
|
af490330e7 | ||
|
|
1ad9365d34 | ||
|
|
e61b1773c9 | ||
|
|
1ecf51a13f | ||
|
|
71a6ffa762 | ||
|
|
5d0f19fd7d | ||
|
|
a0ef75d32d | ||
|
|
fd6e7cef92 | ||
|
|
d01d9217dd | ||
|
|
1751fdf937 | ||
|
|
7766420cf4 | ||
|
|
e69764a6f3 | ||
|
|
525483c500 | ||
|
|
18bf767014 | ||
|
|
cfaa9b3be5 | ||
|
|
902d5927f0 | ||
|
|
82e1ab7b2b | ||
|
|
d470842e8e | ||
|
|
439079cad8 | ||
|
|
fead7a27ca | ||
|
|
4679455c3f | ||
|
|
d05b15df77 | ||
|
|
151617c552 | ||
|
|
5a0cadab0c | ||
|
|
c9449c6fb7 | ||
|
|
833183ddb4 | ||
|
|
f4ef91debf | ||
|
|
e74dfaf868 | ||
|
|
4260b99df2 | ||
|
|
9ebed5e497 | ||
|
|
342629a3bf | ||
|
|
ca58c2464a | ||
|
|
9f2b08ddf0 | ||
|
|
ba335958d6 | ||
|
|
78ea818aaf | ||
|
|
deaa8dc287 | ||
|
|
ade70fe4b9 | ||
|
|
4242782dc2 | ||
|
|
8548bb75b6 | ||
|
|
72b9b0fe3a | ||
|
|
392689e7ba | ||
|
|
09a50d0458 | ||
|
|
787b43b218 | ||
|
|
3ee8098708 | ||
|
|
4095e8f383 | ||
|
|
a2380bf76f | ||
|
|
75a139e62c | ||
|
|
1e4e64f831 | ||
|
|
b94f18298d | ||
|
|
d52185c43e | ||
|
|
5e312dc40d | ||
|
|
d8337034b5 | ||
|
|
7921fe2cd1 | ||
|
|
a97c085e9e | ||
|
|
58beca005c | ||
|
|
4e1f50035e | ||
|
|
6228d634fb | ||
|
|
fc72d7fbb6 | ||
|
|
fc571ad46d | ||
|
|
d718b0b34e | ||
|
|
c8930850e3 | ||
|
|
c06caa14c3 | ||
|
|
56b9377c1c | ||
|
|
0d60bc55e4 | ||
|
|
35c5ccfad3 | ||
|
|
2ed3067bbe | ||
|
|
218f82f798 | ||
|
|
8b9bf47166 | ||
|
|
7294f28c3a | ||
|
|
779165144e | ||
|
|
7fbc8152bf | ||
|
|
7b13d119ed | ||
|
|
ba65e2ae6c | ||
|
|
53bf62bb83 | ||
|
|
61f240946a | ||
|
|
14eab22d81 | ||
|
|
96c34d369e | ||
|
|
2336d21efd | ||
|
|
314e4dd4a6 | ||
|
|
44eb01695a | ||
|
|
0b0919e81c | ||
|
|
714a8cef38 | ||
|
|
be4670fecf | ||
|
|
2af5864534 | ||
|
|
3fd84edb61 | ||
|
|
383153419b | ||
|
|
fe1fe1b1e4 | ||
|
|
e6687be493 | ||
|
|
8831669505 | ||
|
|
742614180c | ||
|
|
bc5db9b027 | ||
|
|
c50c9a10f1 | ||
|
|
45589fae58 | ||
|
|
5e433fa913 | ||
|
|
0b77588e87 | ||
|
|
06cdce1e12 | ||
|
|
0e89bca173 | ||
|
|
c6cb97e693 | ||
|
|
251e3e01c7 | ||
|
|
ff7c380d0e | ||
|
|
4fb4efd8ed | ||
|
|
174285f298 | ||
|
|
037e84d377 | ||
|
|
3aedfac968 | ||
|
|
e65d8ad655 | ||
|
|
215e37aac3 | ||
|
|
a59f85c1a0 | ||
|
|
8e2467c393 | ||
|
|
3629a90c2e | ||
|
|
a0f5b70568 | ||
|
|
0b4b9e7f3a | ||
|
|
a38f8d9900 | ||
|
|
4f3bc05a5b | ||
|
|
b3db44f801 | ||
|
|
4e2b394ae8 | ||
|
|
e7ba4777fe | ||
|
|
60225be7fa | ||
|
|
07fb257c04 | ||
|
|
8beb0f19d1 | ||
|
|
32001d1e2b | ||
|
|
e3827fbc23 | ||
|
|
5160be91ae | ||
|
|
d6c052038f | ||
|
|
8a1658ec3e | ||
|
|
baf5614880 | ||
|
|
868f35e27a | ||
|
|
5c7ecdb7c5 | ||
|
|
80a2acaa86 | ||
|
|
47a0a5c746 | ||
|
|
7a9f365ba4 | ||
|
|
0850d3fcf8 | ||
|
|
46d1d70e4c | ||
|
|
8cae659786 | ||
|
|
413f0d0353 | ||
|
|
cba90d4441 | ||
|
|
d19c8b815d | ||
|
|
ab145c8827 | ||
|
|
ecb024af64 | ||
|
|
4e5a45952a | ||
|
|
112dbba7c4 | ||
|
|
9733dd5b5e | ||
|
|
a70993d6d2 | ||
|
|
0a2de78da4 | ||
|
|
288948edf7 | ||
|
|
a0771d0940 | ||
|
|
38bc38cd88 | ||
|
|
494fa0c81a | ||
|
|
7dbbbfc665 | ||
|
|
ac7a44792c | ||
|
|
fc6725f14e | ||
|
|
320a00e7c6 | ||
|
|
6027c8d259 | ||
|
|
52beafff53 | ||
|
|
e8f201cefa | ||
|
|
1c7c5d571d | ||
|
|
e3b7c8e0cc | ||
|
|
c8bd2ae11c | ||
|
|
e1a13608d8 | ||
|
|
eedb29346e | ||
|
|
39d03148e5 | ||
|
|
f419f66546 | ||
|
|
fca4610f11 | ||
|
|
ce955f37ba | ||
|
|
c813a3cc53 | ||
|
|
0b5f18754c | ||
|
|
a75afb85ca | ||
|
|
9dcd21911a | ||
|
|
9bd5f612f7 | ||
|
|
6bc3a43d52 | ||
|
|
88d43af276 | ||
|
|
7e73b7cae9 | ||
|
|
b3001bcd6e | ||
|
|
07715b1b6a | ||
|
|
39ab22070e | ||
|
|
ae8ff4b8e2 | ||
|
|
d22baa88ed | ||
|
|
65874c25db | ||
|
|
06266abd6e | ||
|
|
55ecde665d | ||
|
|
307c57dcc4 | ||
|
|
18d7bc7fa1 | ||
|
|
3607fae75a | ||
|
|
922a30ee47 | ||
|
|
92833a07d1 | ||
|
|
a013f762c4 | ||
|
|
3f6f327cb9 | ||
|
|
b850f0f038 | ||
|
|
a225efaec5 | ||
|
|
ad4c065344 | ||
|
|
89533f0811 | ||
|
|
8f1d5d34a6 | ||
|
|
b1ef850877 | ||
|
|
967121a34b | ||
|
|
fe4ce03d52 | ||
|
|
8161ab573f | ||
|
|
caf0b67e47 | ||
|
|
90b095aa54 | ||
|
|
4bbb78a99b | ||
|
|
dd6d1afd8e | ||
|
|
131eb56f52 | ||
|
|
37ca8854f7 | ||
|
|
067888d549 | ||
|
|
848c3fe51a | ||
|
|
21a4adcd27 | ||
|
|
0003fc8215 | ||
|
|
9126823c7e | ||
|
|
3f13dc790c | ||
|
|
280946ba83 | ||
|
|
9e100bc42b | ||
|
|
6b3169e4d0 | ||
|
|
2e292b67a0 | ||
|
|
18882a4d26 | ||
|
|
8aa930f28e | ||
|
|
2c0b51795e | ||
|
|
d6ac3d8d9a | ||
|
|
e47f6fdfe9 | ||
|
|
30d6d4c733 | ||
|
|
f764297be2 | ||
|
|
75b8c13b00 | ||
|
|
f960c3be31 | ||
|
|
309c5f3641 | ||
|
|
130464c268 | ||
|
|
4d77781ce7 | ||
|
|
c1b829077a | ||
|
|
b1a74df26d | ||
|
|
3af90db5b5 | ||
|
|
58f3cd3eb5 | ||
|
|
b1ebd9f79c | ||
|
|
c2cdaceed0 | ||
|
|
469d0b120e | ||
|
|
81c8b404e7 | ||
|
|
9b6f1d647c | ||
|
|
53066024f6 | ||
|
|
e65ac4d626 | ||
|
|
26165453d2 | ||
|
|
f18b4872ea | ||
|
|
261f559339 | ||
|
|
d74c377337 | ||
|
|
c8ed61b281 | ||
|
|
816ffa99ba | ||
|
|
0b20768a24 | ||
|
|
56093b6614 | ||
|
|
0a8519a26f | ||
|
|
eccd1fdbed | ||
|
|
b5918760fb | ||
|
|
4405310184 | ||
|
|
0413f8ad9d | ||
|
|
93dfc3ec70 | ||
|
|
3e4f1462bc | ||
|
|
40b2f36eb8 | ||
|
|
7a58c1d4ca | ||
|
|
21d6b39fd7 | ||
|
|
2cdf0ff4ab | ||
|
|
773471750d | ||
|
|
6b3e553dd5 | ||
|
|
bfa608b85e | ||
|
|
7cb5217255 | ||
|
|
4f6bec19bc | ||
|
|
649dca4d16 | ||
|
|
601ab85226 | ||
|
|
e988df0fbd | ||
|
|
b89c79e905 | ||
|
|
9fe74a34ea | ||
|
|
64befefcfc | ||
|
|
6f9d384311 | ||
|
|
29e9d09c68 | ||
|
|
c25102a4f7 | ||
|
|
c893958bb1 | ||
|
|
db9c86d6c1 | ||
|
|
1dfc2e02b3 | ||
|
|
ec039a3d12 | ||
|
|
77acdfed43 | ||
|
|
926a47f35b | ||
|
|
df2f4168e5 | ||
|
|
fe560d81e7 | ||
|
|
64627817fc | ||
|
|
a61aa6690b | ||
|
|
7721948a2f | ||
|
|
6b2c46c431 | ||
|
|
83f1d7cd9e | ||
|
|
13f7049d84 | ||
|
|
503e61cf2b | ||
|
|
efc75db764 | ||
|
|
f62ddf9022 | ||
|
|
96fe1de832 | ||
|
|
730d316efe | ||
|
|
e464f19356 | ||
|
|
ab43377577 | ||
|
|
865f380c91 | ||
|
|
3abbe7efd1 | ||
|
|
7f6e9e9540 | ||
|
|
4a9fe1a1d5 | ||
|
|
e57dc4ef18 | ||
|
|
c67f72890c | ||
|
|
5e80df46b8 | ||
|
|
c135e9c7d4 | ||
|
|
1ba1fb42a4 | ||
|
|
127c488355 | ||
|
|
981c6c9bf2 | ||
|
|
d00e8bd31a | ||
|
|
55a97f4605 | ||
|
|
3e2efdf18a | ||
|
|
bc66f46323 | ||
|
|
cc92e45b78 | ||
|
|
b2253e5b42 | ||
|
|
dcd0b63f64 | ||
|
|
b2577b1f27 | ||
|
|
93474c4218 | ||
|
|
f577facf79 | ||
|
|
45fcc9de29 | ||
|
|
b24f7a4d13 | ||
|
|
6074163bf3 | ||
|
|
b76ec317c9 | ||
|
|
714ecc5e27 | ||
|
|
9397b5de08 | ||
|
|
1369503aba | ||
|
|
fedf644635 | ||
|
|
f9b5771274 | ||
|
|
8512cd967d | ||
|
|
94eb370710 | ||
|
|
587e7b299b | ||
|
|
d5ca3b721e | ||
|
|
27f5ff950e | ||
|
|
4a95c37e14 | ||
|
|
5d9ab86adf | ||
|
|
e0564d5de0 | ||
|
|
be96fa2fb8 | ||
|
|
726dcaacb6 | ||
|
|
70190624c6 | ||
|
|
71e5a466a6 | ||
|
|
822723c246 | ||
|
|
bda62bd3bf | ||
|
|
efc9329033 | ||
|
|
2c09e8a84c | ||
|
|
9575b0a2a8 | ||
|
|
6911a7d279 | ||
|
|
5068cb40ce | ||
|
|
e5781b5e34 | ||
|
|
782d06be46 | ||
|
|
81c863ac4d | ||
|
|
d859ad7ed7 | ||
|
|
ee1155fe6d | ||
|
|
3b1c3ac678 | ||
|
|
3332f606ed | ||
|
|
f00cee75c1 | ||
|
|
0913287578 | ||
|
|
7b41f54411 | ||
|
|
03ab6aa24c | ||
|
|
9a559eb8cf | ||
|
|
58f036ad1d | ||
|
|
098692ef26 | ||
|
|
a888b232fe | ||
|
|
b88aa81da7 | ||
|
|
8d5b400d09 | ||
|
|
969d2b3eb1 | ||
|
|
a031a15487 | ||
|
|
777ac58f85 | ||
|
|
be4cc306a5 | ||
|
|
0deb68d81c | ||
|
|
b75505e6b2 | ||
|
|
ee8067f7cf | ||
|
|
2cf76f6f1b | ||
|
|
80874391b8 | ||
|
|
2708482f1b | ||
|
|
084be3599a | ||
|
|
b28734c82c | ||
|
|
d07000ed1d | ||
|
|
647f1cbfe5 | ||
|
|
2b0d1710a5 | ||
|
|
97cddd1b96 | ||
|
|
f1f2004cb9 | ||
|
|
289c4a7776 | ||
|
|
97790c7711 | ||
|
|
149b51967d | ||
|
|
898a4e441f | ||
|
|
a4183994a4 | ||
|
|
c824abd7b2 | ||
|
|
d7395cd2ab | ||
|
|
8767c78169 | ||
|
|
0fb9567f13 | ||
|
|
43a388ec53 | ||
|
|
d3f0ce6224 | ||
|
|
d83602d98e | ||
|
|
c33b993397 | ||
|
|
88ffb3f73b | ||
|
|
386108f982 | ||
|
|
ddd2b18321 | ||
|
|
bc3072b35e | ||
|
|
e9a4e98cb9 | ||
|
|
53da8bd1c8 | ||
|
|
625a4c2e66 | ||
|
|
e703c5b81f | ||
|
|
33dd267fd9 | ||
|
|
a699bdb7a1 | ||
|
|
770305e28d | ||
|
|
36747794ab | ||
|
|
c03c296dc7 | ||
|
|
4a9b8aae5e | ||
|
|
3d4d0cb574 | ||
|
|
9894167bbf | ||
|
|
7c37b1891a | ||
|
|
418c2e7a44 | ||
|
|
4117ab473b | ||
|
|
93d36e88f9 | ||
|
|
b11834605b | ||
|
|
58ded5cd27 | ||
|
|
bc6f3e4e00 | ||
|
|
37e6d1356b | ||
|
|
daddd37706 | ||
|
|
14ba94ad6a | ||
|
|
03868ff8e1 | ||
|
|
527deb947c | ||
|
|
c45c530f74 | ||
|
|
47f60aebcd | ||
|
|
852f768a75 | ||
|
|
9e6376bd95 | ||
|
|
e385af7cc0 | ||
|
|
220c4f1142 | ||
|
|
0a376c1d50 | ||
|
|
b83e9225b7 | ||
|
|
ca8c1b6134 | ||
|
|
a71bfb4b60 | ||
|
|
e60eb32050 | ||
|
|
666aae3593 | ||
|
|
49f6e347f0 | ||
|
|
1f42479e0c | ||
|
|
9e0bb94460 | ||
|
|
ce901f4c4c | ||
|
|
7cd5eb4c77 | ||
|
|
17cfb1850d | ||
|
|
e7f5cdf9d4 | ||
|
|
dda2071cc0 | ||
|
|
6e4fdf37ba | ||
|
|
7d002b60ff | ||
|
|
04c3b17c78 | ||
|
|
58fd39de35 | ||
|
|
9449026839 | ||
|
|
e7247c1a66 | ||
|
|
0d26bb36af | ||
|
|
10502b59bc | ||
|
|
abe74ea5ea | ||
|
|
98182f6097 | ||
|
|
cd27c8ef5d | ||
|
|
2bdff11d54 | ||
|
|
7a32698312 | ||
|
|
5743ef4e64 | ||
|
|
3b684d306c | ||
|
|
e1146396bc | ||
|
|
7c0e707cf1 | ||
|
|
feb7de91ec | ||
|
|
4468ea84e6 | ||
|
|
96e2931c5c | ||
|
|
5961106f9f | ||
|
|
fbf76184f0 | ||
|
|
8ec3fc35c6 | ||
|
|
d50b2ede92 | ||
|
|
453d79e3a2 | ||
|
|
046534e14b | ||
|
|
120f02e20b | ||
|
|
becd8c03fd | ||
|
|
69367aa799 | ||
|
|
97f0bb0342 | ||
|
|
1586cdac53 | ||
|
|
1bae82e6c4 | ||
|
|
2fb0e547a0 | ||
|
|
1a5dcfd0c8 | ||
|
|
e38d65f8d1 | ||
|
|
33052abf42 | ||
|
|
b0e6806077 | ||
|
|
76b86c0368 | ||
|
|
c5a8448c41 | ||
|
|
2a0badf2d5 | ||
|
|
6b8435cf8c | ||
|
|
c1bf6f9f7a | ||
|
|
f85c1165c2 | ||
|
|
37acadc2af | ||
|
|
82709549ff | ||
|
|
6e96bc98de | ||
|
|
60aaf65b10 | ||
|
|
7d83fefd7f | ||
|
|
2bb559be82 | ||
|
|
d27f57e48f | ||
|
|
e59d971e7b | ||
|
|
025f4d28c1 | ||
|
|
0ed34e6780 | ||
|
|
9ff8012655 | ||
|
|
7d036e3ab2 | ||
|
|
8f57246620 | ||
|
|
2985dc4fc8 | ||
|
|
dd0b8c3de5 | ||
|
|
7dd07cc7c5 | ||
|
|
8d4b768297 | ||
|
|
35ed5198fe | ||
|
|
624461c6c6 | ||
|
|
319662c0ed | ||
|
|
5b597a6bfa | ||
|
|
68fb68a83b | ||
|
|
a2e5706661 | ||
|
|
7d3b3890b5 | ||
|
|
96387ee88a | ||
|
|
23590a8383 | ||
|
|
923a97b108 | ||
|
|
c517215bcf | ||
|
|
414f0275cf | ||
|
|
04414a963c | ||
|
|
02d8df94a8 | ||
|
|
a0566270d9 | ||
|
|
0d83bdc3aa | ||
|
|
062a140b9c | ||
|
|
3e9ed6c1c7 | ||
|
|
3983019fd8 | ||
|
|
3ec3aca78d | ||
|
|
1aa50b1362 | ||
|
|
e17ae475cf | ||
|
|
6cf581e360 | ||
|
|
177ca4f4d5 | ||
|
|
16c11eb4a3 | ||
|
|
df49b93877 | ||
|
|
5e7e0347cd | ||
|
|
7d9329ecfe | ||
|
|
3640c8c051 | ||
|
|
02cbb58107 | ||
|
|
5b854f95d2 | ||
|
|
b0f39da131 | ||
|
|
dc54af7a89 | ||
|
|
d01b74d00a | ||
|
|
a782a88913 | ||
|
|
8800896824 | ||
|
|
880d9e53c3 | ||
|
|
26cad481d0 | ||
|
|
8d13967aa3 | ||
|
|
650d706d35 | ||
|
|
0e07a7157f | ||
|
|
423d69bd40 | ||
|
|
6767ed74f8 | ||
|
|
57cbb8bfd8 | ||
|
|
f70378f7f5 | ||
|
|
e1ff5b1361 | ||
|
|
ab57fdac44 | ||
|
|
dacc8cdb3a | ||
|
|
ca7043e52d | ||
|
|
6f8d40ef5d | ||
|
|
2318d19bb4 | ||
|
|
f98d0433f9 | ||
|
|
34b185e955 | ||
|
|
b6dcadeb79 | ||
|
|
c2250d95c4 | ||
|
|
adc52f3f3c | ||
|
|
0a568a6037 | ||
|
|
0747c285cd | ||
|
|
306d1ab866 | ||
|
|
9b5bb5c755 | ||
|
|
450e7ef0c5 | ||
|
|
8f0d29f931 | ||
|
|
d6026a5fee | ||
|
|
939397dd6e | ||
|
|
d207d359d1 | ||
|
|
5f88cd98ad | ||
|
|
7f51b2da28 | ||
|
|
c00c8832c6 | ||
|
|
5a9fd8f433 | ||
|
|
fc5d2074b9 | ||
|
|
10c03e1a9d | ||
|
|
67228160ae | ||
|
|
165498cecf | ||
|
|
e3badd7062 | ||
|
|
6823ce99a7 | ||
|
|
1f1ad9fd23 | ||
|
|
f5ab056b38 | ||
|
|
16c031be77 | ||
|
|
350596b94f | ||
|
|
66750dc88e | ||
|
|
d10223254a | ||
|
|
eb90c3d92d | ||
|
|
6a1670dbc3 | ||
|
|
e204bedf1d | ||
|
|
650e932ddf | ||
|
|
b7def0fcf4 | ||
|
|
e6bf6950eb | ||
|
|
17bbf4d3f6 | ||
|
|
57f5dc5dcf | ||
|
|
aa77ee66c5 | ||
|
|
b9512cab1b | ||
|
|
dd8593f2d6 | ||
|
|
5af8acfa6e | ||
|
|
ba78194636 | ||
|
|
bdbdeab005 | ||
|
|
038529c763 | ||
|
|
55097e1985 | ||
|
|
c61a2ef44f | ||
|
|
5917e86297 | ||
|
|
75a8312f4e | ||
|
|
48b999a8dd | ||
|
|
3823878305 | ||
|
|
fceb465fc9 | ||
|
|
72abd5a88e | ||
|
|
066b0314b1 | ||
|
|
22e186b4aa | ||
|
|
372acf7b8e | ||
|
|
5b16271bd6 | ||
|
|
8de315738b | ||
|
|
13504b6adc | ||
|
|
f43b90da38 | ||
|
|
1f11cd09d5 | ||
|
|
82e9faf2a9 | ||
|
|
7caa28a6aa | ||
|
|
0183bdad04 | ||
|
|
d31f07bd4b | ||
|
|
979ca23f1e | ||
|
|
9b5f182642 | ||
|
|
f00d136ab1 | ||
|
|
28c50c16cd | ||
|
|
5bd50a2d90 | ||
|
|
60e6284f30 | ||
|
|
67c59645ec | ||
|
|
5ec5b1cbd6 | ||
|
|
76217939e0 | ||
|
|
206ec36c8e | ||
|
|
3b7a445cd7 | ||
|
|
b9d8e59bbf | ||
|
|
6d0ea26c2d | ||
|
|
92c7bd02fb | ||
|
|
497ff1ecd6 | ||
|
|
22b0039ad4 | ||
|
|
b90e431fc7 | ||
|
|
9bd76f2972 | ||
|
|
f0d70d4e86 | ||
|
|
6b9906687b | ||
|
|
bc2e9dbaf2 | ||
|
|
4d73d99ebc | ||
|
|
a3ad84feef | ||
|
|
f9a8efb992 | ||
|
|
42eb8c8e3b | ||
|
|
7f240aea1e | ||
|
|
c19fc00b04 | ||
|
|
ee07c3f7cf | ||
|
|
724b0a0162 | ||
|
|
ef6b8bee07 | ||
|
|
b29834ab02 | ||
|
|
89b88917a8 | ||
|
|
93fc957036 | ||
|
|
164318bd97 | ||
|
|
fc61c8809b | ||
|
|
365c169b43 | ||
|
|
214a8b4597 | ||
|
|
d2ff536a3b | ||
|
|
8d920dd09b | ||
|
|
c88d89d26e | ||
|
|
4035bf3259 | ||
|
|
65cb318cd9 | ||
|
|
30b9a4d6b4 | ||
|
|
df3c925b3c | ||
|
|
86b906d015 | ||
|
|
b1019a88ba | ||
|
|
8e69b9cb26 | ||
|
|
9f1ae4084d | ||
|
|
2c362badd4 | ||
|
|
6b1420a58a | ||
|
|
1cda39d5bb | ||
|
|
32552fede5 | ||
|
|
6c3829c2b5 | ||
|
|
ea044adf1a | ||
|
|
47f38d2316 | ||
|
|
f944ff233d | ||
|
|
a27857e938 | ||
|
|
0cda2d5193 | ||
|
|
65fa26e93e | ||
|
|
5d4f2f1528 | ||
|
|
f8d0b7d651 | ||
|
|
7895376821 | ||
|
|
aca501df8c | ||
|
|
06ec9e2e1a | ||
|
|
f9e28285ac | ||
|
|
90a8aa1444 | ||
|
|
9a39548367 | ||
|
|
db5df028b3 | ||
|
|
7a8094a9c0 | ||
|
|
10b12cc86e | ||
|
|
9b2044351f | ||
|
|
86b33c4922 | ||
|
|
97260d09a8 | ||
|
|
c4e1a01349 | ||
|
|
f148ae58c3 | ||
|
|
bd55b9cc0f | ||
|
|
77dbad72f7 | ||
|
|
75fe948bf7 | ||
|
|
a73905401a | ||
|
|
8e5b33d359 | ||
|
|
4ba6387980 | ||
|
|
b19726db6c | ||
|
|
c48c6d188c | ||
|
|
f6e0e1f5d7 | ||
|
|
20031a1008 | ||
|
|
a933cb31d4 | ||
|
|
2868676693 | ||
|
|
366724f6bf | ||
|
|
c59a9720fd | ||
|
|
2dde1d70ec | ||
|
|
1d248cce30 | ||
|
|
c33654c21a | ||
|
|
5721ff3837 | ||
|
|
e215c9a84f | ||
|
|
e5cdf486aa | ||
|
|
820d8a920b | ||
|
|
0f6af98d09 | ||
|
|
6424c5b698 | ||
|
|
eed6e04ed1 | ||
|
|
9ebf1fd3b7 | ||
|
|
fb12a82d65 | ||
|
|
c8cdc80fd6 | ||
|
|
33cb3d713c | ||
|
|
0addefad05 | ||
|
|
3bb89bb155 | ||
|
|
9d6caa4e5f | ||
|
|
12472a44d4 | ||
|
|
cbbb6447bf | ||
|
|
154a8bb466 | ||
|
|
d1be82d97c | ||
|
|
8e2a3c7279 | ||
|
|
ebe2f704d1 | ||
|
|
63c27766ef | ||
|
|
6912f65cd7 | ||
|
|
28f5b55643 | ||
|
|
c1fee78e85 | ||
|
|
d6f0bf9eef | ||
|
|
bcc0ca93d4 | ||
|
|
eb2a8fe8b8 | ||
|
|
13358c29b8 | ||
|
|
aaee2786a7 | ||
|
|
9d69b38583 | ||
|
|
69ba485415 | ||
|
|
91e88196c7 | ||
|
|
035933f806 | ||
|
|
1163fdfa11 | ||
|
|
0a27e81704 | ||
|
|
c4af909ac8 | ||
|
|
f099861245 | ||
|
|
f214940c96 | ||
|
|
26a0efae23 | ||
|
|
e237c1d07d | ||
|
|
33be32f278 | ||
|
|
297186b834 | ||
|
|
5696ee8421 | ||
|
|
d8a0efa6af | ||
|
|
b52dfbe510 | ||
|
|
b87cd8c58b | ||
|
|
318669327e | ||
|
|
278d93a3ee | ||
|
|
b55fb4f2f6 | ||
|
|
1cd8351054 | ||
|
|
631a835e07 | ||
|
|
45cf32afc5 | ||
|
|
cde3d38766 | ||
|
|
d5029958b9 | ||
|
|
bddd5f2b98 | ||
|
|
96898c1794 | ||
|
|
11afcbff69 | ||
|
|
736b386554 | ||
|
|
a785522194 | ||
|
|
8e50e256e6 | ||
|
|
9b3287b865 | ||
|
|
14657bd29a | ||
|
|
6af8a34d91 | ||
|
|
6f93c01af9 | ||
|
|
12e9f3d010 | ||
|
|
c691d619c2 | ||
|
|
61f5ca6b16 | ||
|
|
443bbe6a78 | ||
|
|
183c81b5ec | ||
|
|
076f13cc01 | ||
|
|
8eb717d4d0 | ||
|
|
8aa190606e | ||
|
|
0437abbffb | ||
|
|
0b1d09ff4f | ||
|
|
8b75736c6f | ||
|
|
099d7ff2ad | ||
|
|
46d431e7c3 | ||
|
|
615fd498bc | ||
|
|
bc879a1453 | ||
|
|
82fd83fd12 | ||
|
|
b50da63852 | ||
|
|
5bc14e2fe4 | ||
|
|
d2b1210376 | ||
|
|
a27cdf16f4 | ||
|
|
5a13c49492 | ||
|
|
8493979d86 | ||
|
|
2c472a66d1 | ||
|
|
69bd803a32 | ||
|
|
b7de864f2e | ||
|
|
da9707950e | ||
|
|
36f03a7f4a | ||
|
|
5d18dc358b | ||
|
|
b40e599866 | ||
|
|
45029117f5 | ||
|
|
578ece8dd0 | ||
|
|
896e1a30b0 | ||
|
|
0f1d2c127c | ||
|
|
d880a5ec0c | ||
|
|
145e301269 | ||
|
|
c4172934e5 | ||
|
|
40dac4cde4 | ||
|
|
05b58501f2 | ||
|
|
29c17c14f1 | ||
|
|
f4ed37ec6f | ||
|
|
e9006f904c | ||
|
|
e301bc2d77 | ||
|
|
3578e1d4a7 | ||
|
|
aa46e5c5e7 | ||
|
|
9786202b08 | ||
|
|
52ba413185 | ||
|
|
1d13d106dd | ||
|
|
ab06fca4be | ||
|
|
fd9e226b79 | ||
|
|
7d2f0d7b1b | ||
|
|
870f7bcc93 | ||
|
|
543fc6702f | ||
|
|
5080b63435 | ||
|
|
8bb36f4650 | ||
|
|
a47b829040 | ||
|
|
07632b7d69 | ||
|
|
ec54e35757 | ||
|
|
68e36226b3 | ||
|
|
15b86a6b9b | ||
|
|
eeb0900291 | ||
|
|
804a7875a2 | ||
|
|
041585a78e | ||
|
|
cd1f604ffe | ||
|
|
566f7f638a | ||
|
|
3e07c5bf82 | ||
|
|
ca16119adb | ||
|
|
d0b9b10ee0 | ||
|
|
98fd364672 | ||
|
|
151fad1f2b | ||
|
|
27373919f4 | ||
|
|
22e6fb7056 | ||
|
|
e3258b78e2 | ||
|
|
bee170570d | ||
|
|
ba73e75ef9 | ||
|
|
f4b7e1a570 | ||
|
|
fa50341a71 | ||
|
|
fa76057e7f | ||
|
|
bb454b1846 | ||
|
|
778d9b0cd6 | ||
|
|
84ace27872 | ||
|
|
c1d8eeb70a | ||
|
|
6cf87e1d23 | ||
|
|
8a93581c8a | ||
|
|
6c8fa83ecd | ||
|
|
ab45133ab4 | ||
|
|
7b6d642300 | ||
|
|
96a286dcf5 | ||
|
|
420de7ad5e | ||
|
|
8ccdd3bdb4 | ||
|
|
23913f26cd | ||
|
|
9714612999 | ||
|
|
69cdcea9fc | ||
|
|
30ec69c7d3 | ||
|
|
f720c67f3e | ||
|
|
655bb526f4 | ||
|
|
5c26972cdd | ||
|
|
117f208826 | ||
|
|
5f798d944e | ||
|
|
6b927229f5 | ||
|
|
ffad18e424 | ||
|
|
e0eaed5fdb | ||
|
|
5bd638d4a5 | ||
|
|
eca1c96412 | ||
|
|
2f5686ca48 | ||
|
|
4fa4340b95 | ||
|
|
197542c7ec | ||
|
|
ab507f83e2 | ||
|
|
d67004a3be | ||
|
|
c8acc373c1 | ||
|
|
3d1c481f0b | ||
|
|
756db8174a | ||
|
|
fa67b46c04 | ||
|
|
4d656963e4 | ||
|
|
9259d028ac | ||
|
|
52fcb0b4b9 | ||
|
|
d7d759b43f | ||
|
|
ba3fd63e29 | ||
|
|
948b5a8be7 | ||
|
|
e42eeec8f6 | ||
|
|
118285e6ba | ||
|
|
ba4d93027f | ||
|
|
fb0c431864 | ||
|
|
9c8ba42750 | ||
|
|
f9675bd2b4 | ||
|
|
cb40b3517a | ||
|
|
0a020dbcc8 | ||
|
|
ac97a7f70e | ||
|
|
e02b95741b | ||
|
|
bbd990f2cc | ||
|
|
a0b5605db8 | ||
|
|
3ba9b26310 | ||
|
|
6c43ec2d2b | ||
|
|
9b9eb23b6d | ||
|
|
8b16e5f27d | ||
|
|
5292476841 | ||
|
|
1db0334787 | ||
|
|
6e2ba111af | ||
|
|
5f1d3ad754 | ||
|
|
46f471c89f | ||
|
|
0dd9c14ff8 | ||
|
|
0709918bd8 | ||
|
|
8e5167d726 | ||
|
|
8c3ffa3907 | ||
|
|
8540871ebc | ||
|
|
23837e4352 | ||
|
|
3cab24fbcf | ||
|
|
755df5f659 | ||
|
|
936411e4d1 | ||
|
|
21317be493 | ||
|
|
41c00e87d4 | ||
|
|
2863a3291a | ||
|
|
8adad36a66 | ||
|
|
b701f8a878 | ||
|
|
63e73f29cc | ||
|
|
7fcf153ada | ||
|
|
0443d36abf | ||
|
|
df2ad89518 | ||
|
|
10dc2b30fb | ||
|
|
f9087d14a3 | ||
|
|
25cf3757b2 | ||
|
|
72ef6f637e | ||
|
|
9cadaf824b | ||
|
|
1cc1b93e65 | ||
|
|
c4f400acd0 | ||
|
|
ac628c9b0a | ||
|
|
926830e0df | ||
|
|
9696ed31a4 | ||
|
|
c8895dd43b | ||
|
|
5dd1d354f8 | ||
|
|
a0da6bcf43 | ||
|
|
1b63f8d6b9 | ||
|
|
60932d2bd7 | ||
|
|
ee2d9d973a | ||
|
|
0e6f7a21c6 | ||
|
|
cc47ff7c4c | ||
|
|
e1a495ee30 | ||
|
|
6495007924 | ||
|
|
d53a6cd851 | ||
|
|
b6c12d2aa3 | ||
|
|
7a14171be4 | ||
|
|
5194505407 | ||
|
|
3e7957512b | ||
|
|
c0bd96d9b3 | ||
|
|
0f7728f84d | ||
|
|
c129b3852b | ||
|
|
3b43c69df4 | ||
|
|
b17d3e7ad7 | ||
|
|
6a16075912 | ||
|
|
43ebec2be1 | ||
|
|
f60227f112 | ||
|
|
f3630e95d6 | ||
|
|
8887105ffd | ||
|
|
1d7408a7b8 | ||
|
|
0b1ab41a95 | ||
|
|
b717b6505b | ||
|
|
b29d609b0b | ||
|
|
8a3c777c40 | ||
|
|
548da26ddc | ||
|
|
8e0ac70c4d | ||
|
|
1ed559bd24 | ||
|
|
e3b831e975 | ||
|
|
d05e3adbc7 | ||
|
|
a9a475ad50 | ||
|
|
d38b465b7c | ||
|
|
fd7ec2da91 | ||
|
|
c9ed379e39 | ||
|
|
e64feefc61 | ||
|
|
3e754382af | ||
|
|
7ef0a13250 | ||
|
|
0de3fb786d | ||
|
|
1d44a98f2f | ||
|
|
98ff4eb4ee | ||
|
|
a9d8df83d2 | ||
|
|
508b7b5e51 | ||
|
|
f7dc72f8aa | ||
|
|
0190f9b077 | ||
|
|
0c91a0d59d | ||
|
|
a26a66a8c4 | ||
|
|
100345f1e4 | ||
|
|
4535166a3b | ||
|
|
0346e68deb | ||
|
|
db62c227c8 | ||
|
|
983e45ae92 | ||
|
|
0a18dda158 | ||
|
|
9eaf93d41d | ||
|
|
2ac20982e0 | ||
|
|
96eac87d47 | ||
|
|
0cf1ed544c | ||
|
|
558e284e25 | ||
|
|
5c31445117 | ||
|
|
717ae67995 | ||
|
|
e8331f0c1d | ||
|
|
c009aa3a22 | ||
|
|
9af9d8f5d0 | ||
|
|
2c027b03db | ||
|
|
aef1332e42 | ||
|
|
16fc8b5fc2 | ||
|
|
fd845f27f5 | ||
|
|
ea62ee4b61 | ||
|
|
cd6becd442 | ||
|
|
829f262c79 | ||
|
|
246520b5cb | ||
|
|
38bb649582 | ||
|
|
82855a04ec | ||
|
|
6dfefaf229 | ||
|
|
d44f8a854b | ||
|
|
acf3a43095 | ||
|
|
4cc98d7add | ||
|
|
506203345b | ||
|
|
c259f7c8bd | ||
|
|
c62a121cca | ||
|
|
136eb32389 | ||
|
|
e3ddbe8c6b | ||
|
|
d085139057 | ||
|
|
28e7443f9b | ||
|
|
e79ad21aeb | ||
|
|
0b61253931 | ||
|
|
a2738dec59 | ||
|
|
1788709e2d | ||
|
|
47d30d12cb | ||
|
|
43df78102c | ||
|
|
cc10eec6c6 | ||
|
|
15bf9a7026 | ||
|
|
2795f44f03 | ||
|
|
b0ba05c9ac | ||
|
|
71c6845a94 | ||
|
|
4b97023251 | ||
|
|
369046bbb4 | ||
|
|
38580fbee7 | ||
|
|
08e1d40d6e | ||
|
|
80f35467d8 | ||
|
|
1b19020bf4 | ||
|
|
61e58ee9b7 | ||
|
|
f21af8da9c | ||
|
|
dece3a3600 | ||
|
|
16ad10e62f | ||
|
|
02fb912a95 | ||
|
|
48790c0751 | ||
|
|
c57e5083e8 | ||
|
|
c9a2058361 | ||
|
|
7039dfafd6 | ||
|
|
22ae83a589 | ||
|
|
1575448b1a | ||
|
|
9f031a6759 | ||
|
|
d0ea6f9920 | ||
|
|
1bc37d576c | ||
|
|
d159591b9a | ||
|
|
57550b2b3d | ||
|
|
d15d6c4e6b | ||
|
|
6b598f61a6 | ||
|
|
9e21204f8b | ||
|
|
e6b86fa304 | ||
|
|
268e50dfbd | ||
|
|
07ccc15fc2 | ||
|
|
2b500d72e5 | ||
|
|
cd0014b24f | ||
|
|
b3786d84c5 | ||
|
|
fd1135c7af | ||
|
|
f0678979b1 | ||
|
|
f4a7e11bce | ||
|
|
6a0388bb4b | ||
|
|
7ba72f2763 | ||
|
|
f7147d9c0a | ||
|
|
523a5fd2e5 | ||
|
|
ff85e2343c | ||
|
|
e74668ef7f | ||
|
|
22502f80db | ||
|
|
4b2cc38aba | ||
|
|
a8eb68142e | ||
|
|
81554fbf72 | ||
|
|
a435cfcd82 | ||
|
|
7631918a12 | ||
|
|
e070f1e525 | ||
|
|
430d6e1cca | ||
|
|
3a0562bebc | ||
|
|
c3658e7c79 | ||
|
|
b0f81c3253 | ||
|
|
31c171fc1e | ||
|
|
e9c123b1b9 | ||
|
|
037b259197 | ||
|
|
a569961e0f | ||
|
|
7eabde6aee | ||
|
|
ed772da0cc | ||
|
|
f48882213e | ||
|
|
1cd2076d42 | ||
|
|
816b9c8d71 | ||
|
|
3bea1a944e | ||
|
|
3e419ffb38 | ||
|
|
a149c6ecde | ||
|
|
3f18e9a2da | ||
|
|
4b0494062e | ||
|
|
a09d86dd3c | ||
|
|
3ccb0f691b | ||
|
|
1709fd854a | ||
|
|
7bf446f671 | ||
|
|
e4bc76f55c | ||
|
|
81c5e5200b | ||
|
|
9c3830dd35 | ||
|
|
bf8cfce50e | ||
|
|
b235e4d290 | ||
|
|
b8cf6dee3e | ||
|
|
35df1ee253 | ||
|
|
353f9fd43c | ||
|
|
3899f83da8 | ||
|
|
5f3c70061d | ||
|
|
aba7134301 | ||
|
|
d7447cdf9e | ||
|
|
ff8d2bbc36 | ||
|
|
70c98c9972 | ||
|
|
45f32838b9 | ||
|
|
7d6e80a423 | ||
|
|
f3ec1452cd | ||
|
|
29f03756bd | ||
|
|
fe8c5546f0 | ||
|
|
c4315a7afa | ||
|
|
704782c95b | ||
|
|
67059e1932 | ||
|
|
e2ea711136 | ||
|
|
74aa598769 | ||
|
|
747ff7daf8 | ||
|
|
1f670fc688 | ||
|
|
388906ac70 | ||
|
|
49d9745dc4 | ||
|
|
7c15d793ac | ||
|
|
d90cb3511c | ||
|
|
5100272dc3 | ||
|
|
afda9810f1 | ||
|
|
22df8b81b3 | ||
|
|
7a427c9070 | ||
|
|
a35e4bdbda | ||
|
|
0aeb5adb8f | ||
|
|
9c5cc217bf | ||
|
|
24603d7ad3 | ||
|
|
1eac6ff8ff | ||
|
|
8742b3dab2 | ||
|
|
93cdc9b9dc | ||
|
|
8ed74a3429 | ||
|
|
07a5e59ae7 | ||
|
|
f8c2f1cf54 | ||
|
|
b1f043d010 | ||
|
|
251c0c8508 | ||
|
|
3214daca4c | ||
|
|
e4485f5412 | ||
|
|
4eaaa0ec53 | ||
|
|
42323014ea | ||
|
|
c59d139eeb | ||
|
|
2b4d21160f | ||
|
|
e29a5b11e4 | ||
|
|
b58ee690a3 | ||
|
|
d8edd3d0c8 | ||
|
|
1b078efd5f | ||
|
|
e8e73d37fb | ||
|
|
2eec788544 | ||
|
|
dca28b9e12 | ||
|
|
e879c92596 | ||
|
|
7281c68b27 | ||
|
|
d228f1b658 | ||
|
|
2e60593c5b | ||
|
|
531fe10f51 | ||
|
|
454b07455a | ||
|
|
a4dc6f2c76 | ||
|
|
5608f12f9b | ||
|
|
18d8e3acec | ||
|
|
578fc5bb44 | ||
|
|
e8660cfd8e | ||
|
|
6a57eabb14 | ||
|
|
a67540807a | ||
|
|
20c377ca65 | ||
|
|
5436f1c7d5 | ||
|
|
4107390337 | ||
|
|
e74da72b82 | ||
|
|
24953ba974 | ||
|
|
22a5a1fa43 | ||
|
|
7bac62ee7f | ||
|
|
fcda11c6b0 | ||
|
|
66e1cb324c | ||
|
|
a869d23451 | ||
|
|
41f4941b74 | ||
|
|
b22168d3da | ||
|
|
b9b56bac6b | ||
|
|
fa670fa4b5 | ||
|
|
b131a0cf0c | ||
|
|
d7cef8d762 | ||
|
|
4483fc7df3 | ||
|
|
2cd5addc0c | ||
|
|
5bf06efb2a | ||
|
|
5196e309b8 | ||
|
|
bee1adc651 | ||
|
|
f0e7da8a63 | ||
|
|
5bd32eca0f | ||
|
|
491287c0af | ||
|
|
8ecfd88d92 | ||
|
|
b54178bbbd | ||
|
|
67547f74fc | ||
|
|
56ba193c77 | ||
|
|
d5594e431c | ||
|
|
7bfa2d4da6 | ||
|
|
4cf00f5698 | ||
|
|
a18326e97a | ||
|
|
36c9463467 | ||
|
|
13159c1a48 | ||
|
|
0fbef74f31 | ||
|
|
52122c342d | ||
|
|
96ee73f790 | ||
|
|
dc70f50b59 | ||
|
|
e297c73913 | ||
|
|
280e1a2512 | ||
|
|
1518b8f753 | ||
|
|
5403b1cf6d | ||
|
|
29110d5428 | ||
|
|
462003363f | ||
|
|
b494324ec3 | ||
|
|
4cee9a86ac | ||
|
|
7cad0a2dcd | ||
|
|
ed1ff06867 | ||
|
|
80a64341f0 | ||
|
|
bbf3eebb1a | ||
|
|
6b20ea0752 | ||
|
|
3241ad3ae8 | ||
|
|
9e7ccedba4 | ||
|
|
b9ffb5f30d | ||
|
|
9d456ca87a | ||
|
|
18350ad37f | ||
|
|
0983f65da7 | ||
|
|
42bbd5c9ae | ||
|
|
92ae11bd3b | ||
|
|
443f45eca1 | ||
|
|
a9ddbb4beb | ||
|
|
f8c3743991 | ||
|
|
072c265c30 | ||
|
|
440e9cdbef | ||
|
|
ace005bf7c | ||
|
|
75821c6889 | ||
|
|
d376148ca1 | ||
|
|
582ca33507 | ||
|
|
a6ca7eb29d | ||
|
|
02c035c548 | ||
|
|
418041d906 | ||
|
|
a3a400992e | ||
|
|
68625b047f | ||
|
|
9a1df7bf38 | ||
|
|
81b9cfdfa4 | ||
|
|
ae7aa65069 | ||
|
|
9e0f969b8b | ||
|
|
14a8fa4d68 | ||
|
|
07e5c9bd5f | ||
|
|
49c2ca0216 | ||
|
|
04172e3dd0 | ||
|
|
2c56a9f588 | ||
|
|
20e025b3d8 | ||
|
|
10591d2080 | ||
|
|
af29c0ade5 | ||
|
|
4c876ac62e | ||
|
|
66bf7b0b01 | ||
|
|
17d51a1609 | ||
|
|
0a59605e05 | ||
|
|
202658678d | ||
|
|
4f01db256f | ||
|
|
c04f4a7d73 | ||
|
|
f5e46ba7fc | ||
|
|
8609af54fc | ||
|
|
9a4ef87859 | ||
|
|
a57f4c23d8 | ||
|
|
d629f4d2fb | ||
|
|
6f20a73782 | ||
|
|
8cb7badd63 | ||
|
|
0f3c2f6541 | ||
|
|
56496ad5d8 | ||
|
|
e15dca2a9f | ||
|
|
a32706bc26 | ||
|
|
bdcca4767c | ||
|
|
38f4dbfb51 | ||
|
|
a374b1a6a3 | ||
|
|
0ff94978f5 | ||
|
|
fa24e6b995 | ||
|
|
37b64ff616 | ||
|
|
a2fd8d1db1 | ||
|
|
684b004751 | ||
|
|
cbe11fc7aa | ||
|
|
d01387a82f | ||
|
|
862d76b617 | ||
|
|
bd9912213f | ||
|
|
814ada538a | ||
|
|
53f7eef052 | ||
|
|
405347769a | ||
|
|
5b31d32da8 | ||
|
|
dcef5183f7 | ||
|
|
728d01ef4b | ||
|
|
0557df8d06 | ||
|
|
3a9753b85f | ||
|
|
8e6ac5c263 | ||
|
|
188b303991 | ||
|
|
836595313c | ||
|
|
6779036d25 | ||
|
|
4fb6c07535 | ||
|
|
f01c988094 | ||
|
|
677456d319 | ||
|
|
f022af66da | ||
|
|
98c40f5ee6 | ||
|
|
db0928add3 | ||
|
|
a9a923e4da | ||
|
|
1cac1de3b2 | ||
|
|
524c78a8d6 | ||
|
|
e71262463f | ||
|
|
26666bb36f | ||
|
|
f801e16b78 | ||
|
|
4bf5065a9c | ||
|
|
04085cad3c | ||
|
|
c8997e48c0 | ||
|
|
77621568fd | ||
|
|
601d1936c9 | ||
|
|
06e93f8d95 | ||
|
|
74780134f2 | ||
|
|
93219e3b9d | ||
|
|
77120a021d | ||
|
|
6c14025b2d | ||
|
|
e53794868e | ||
|
|
8c2f3bb378 | ||
|
|
0ac2ce7dea | ||
|
|
c301e3c82a | ||
|
|
9dd78a8a45 | ||
|
|
ede1674d6a | ||
|
|
c3f2b24a9a | ||
|
|
b91bba1ab2 | ||
|
|
fbc22f91d5 | ||
|
|
424b36d469 | ||
|
|
8070f9485b | ||
|
|
c353709f7e | ||
|
|
c13691a8e6 | ||
|
|
2671b9af1b | ||
|
|
7d0ad0f521 | ||
|
|
9bd75d5668 | ||
|
|
fde676a43a | ||
|
|
2469ce6067 | ||
|
|
ef0ec31554 | ||
|
|
da4f51332f | ||
|
|
194258b479 | ||
|
|
fa416e7116 | ||
|
|
71b2e0e002 | ||
|
|
7d1ac4d1f6 | ||
|
|
2f2ef80ec2 | ||
|
|
c0530921ff | ||
|
|
94f1ab4da3 | ||
|
|
3f75b748cf | ||
|
|
8181b68531 | ||
|
|
2de91f11fb | ||
|
|
50621ffe85 | ||
|
|
db4911f956 | ||
|
|
2a325de7aa | ||
|
|
b9cc0a7976 | ||
|
|
97b693052c | ||
|
|
19ed3bb193 | ||
|
|
895b970a10 | ||
|
|
1f56d71f19 | ||
|
|
1ff20da5b6 | ||
|
|
5ef78cd815 | ||
|
|
9101b680c0 | ||
|
|
d24c56fd4b | ||
|
|
77d09552ae | ||
|
|
dbaccff476 | ||
|
|
dc6cf5cdee | ||
|
|
fb3ac49335 | ||
|
|
c54a40df06 | ||
|
|
9c4f68e174 | ||
|
|
4ee4dfdc13 | ||
|
|
2e0c0e9d89 | ||
|
|
db5db587be | ||
|
|
569fca5308 | ||
|
|
b409803527 | ||
|
|
99d257ae8b | ||
|
|
2f2b7915ea | ||
|
|
c1cfcb1577 | ||
|
|
2e90ed07ac | ||
|
|
58bed83d03 | ||
|
|
54917e3062 | ||
|
|
81385682c8 | ||
|
|
807a0d313b | ||
|
|
f9a66c5d46 | ||
|
|
60add387e3 | ||
|
|
ca0fd4173c | ||
|
|
4aa0f040fb | ||
|
|
5957fed9a7 | ||
|
|
6298878bfa | ||
|
|
899004207d | ||
|
|
2b200d481f | ||
|
|
8551ddc839 | ||
|
|
eea3277b81 | ||
|
|
11b86f8d8a | ||
|
|
71a3c2fcd1 | ||
|
|
4ff36696ea | ||
|
|
800d3b4ee7 | ||
|
|
a0b2c7ba25 | ||
|
|
64232f0aec | ||
|
|
591527d878 | ||
|
|
82073025cc | ||
|
|
2c9bb06516 | ||
|
|
18c4a90101 | ||
|
|
5a8ee4889d | ||
|
|
ea1fdf3201 | ||
|
|
2e61008fd9 | ||
|
|
eafde7186f | ||
|
|
a72dc388c3 | ||
|
|
618314985d | ||
|
|
d1d83d7e7f | ||
|
|
bcaab74f1f | ||
|
|
1b670a293b | ||
|
|
45f78bdf40 | ||
|
|
54eca4e736 | ||
|
|
3da05a09b5 | ||
|
|
f79082a46d | ||
|
|
e71d75ed9a | ||
|
|
a4a35f659b | ||
|
|
9eba6a349f | ||
|
|
6a1b6d0344 | ||
|
|
7f7fb9750d | ||
|
|
df190b8f87 | ||
|
|
af33b3b338 | ||
|
|
a87d19cd7e | ||
|
|
611fe41588 | ||
|
|
8b6cce18cb | ||
|
|
d330430336 | ||
|
|
37b2bc3c0c | ||
|
|
f49914dd17 | ||
|
|
f1d9880006 | ||
|
|
6ec447a1aa | ||
|
|
b485fac33e | ||
|
|
98404ad8ea | ||
|
|
e1f5227304 | ||
|
|
2de8f915f8 | ||
|
|
967f25461b | ||
|
|
0053651814 | ||
|
|
7d36833bd4 | ||
|
|
1bbfd0b6d2 | ||
|
|
4547ace59a | ||
|
|
d74659254b | ||
|
|
55d310b05a | ||
|
|
15da308c2a | ||
|
|
e80bc6ef58 | ||
|
|
d81e783665 | ||
|
|
030b63c3d2 | ||
|
|
f3dba05143 | ||
|
|
1020707918 | ||
|
|
c89d1cf072 | ||
|
|
9c5e422d3a | ||
|
|
5e00141005 | ||
|
|
fa70413c82 | ||
|
|
06d2bc7fbd | ||
|
|
1ae9e0afa1 | ||
|
|
f9da2c9507 | ||
|
|
989aba1966 | ||
|
|
6b7d6c27ee | ||
|
|
8db89b8136 | ||
|
|
8c01ad8a9d | ||
|
|
f60a5ec08f | ||
|
|
501b8fe743 | ||
|
|
e9cdb938fe | ||
|
|
f1cb91cd93 | ||
|
|
910186905f | ||
|
|
07ed57476f | ||
|
|
0b21618a05 | ||
|
|
b49a7c140e | ||
|
|
562ac3bce9 | ||
|
|
f21291211c | ||
|
|
d834d6e074 | ||
|
|
11716825fc | ||
|
|
0309021359 | ||
|
|
14a71590c3 | ||
|
|
a5f6d65c37 | ||
|
|
79326e6287 | ||
|
|
c8ec711503 | ||
|
|
0f8b91bfba | ||
|
|
b7fd3c8669 | ||
|
|
b3f4cbe157 | ||
|
|
d0491ce8b6 | ||
|
|
806f10524f | ||
|
|
50110e00e8 | ||
|
|
3a89c40e26 | ||
|
|
ff678d1607 | ||
|
|
abab3db23d | ||
|
|
496451c164 | ||
|
|
993821a924 | ||
|
|
ad5ac22442 | ||
|
|
94b25685c5 | ||
|
|
88cdd3a363 | ||
|
|
e15de8b70d | ||
|
|
61016962ee | ||
|
|
a1eb2836c0 | ||
|
|
64af6d3afe | ||
|
|
365f7a5bfe | ||
|
|
796009ef21 | ||
|
|
b85b4ede82 | ||
|
|
2cb96d9d68 | ||
|
|
78bf92175a | ||
|
|
0c3d39357b | ||
|
|
0e8bd531c2 | ||
|
|
ac69a3561a | ||
|
|
24b1008d56 | ||
|
|
a4340c330a | ||
|
|
2e8e9ee7f5 | ||
|
|
cb05a28745 | ||
|
|
a387c9b95d | ||
|
|
0a426f3592 | ||
|
|
00bc9a8678 | ||
|
|
c241902b40 | ||
|
|
4799a8f761 | ||
|
|
02b334a679 | ||
|
|
b4dd5d3bd7 | ||
|
|
1efdc36b22 | ||
|
|
157a4cf18c | ||
|
|
f22c73f501 | ||
|
|
c920df748b | ||
|
|
a58d725569 | ||
|
|
6a76c226e1 | ||
|
|
569156b013 | ||
|
|
6d4bc012f0 | ||
|
|
2f5c28aaf1 | ||
|
|
4f2c1e36a1 | ||
|
|
bc743ca7ce | ||
|
|
f9d7e399b2 | ||
|
|
3e6f824e6c | ||
|
|
6286c555d4 | ||
|
|
4630281318 | ||
|
|
cd0019acd2 | ||
|
|
e82a76e438 | ||
|
|
ab57fbe4ca | ||
|
|
56f55ab1af | ||
|
|
2445cbbbdc | ||
|
|
48131bf988 | ||
|
|
2b9596fe9b | ||
|
|
0e1f448b61 | ||
|
|
ff82b95800 | ||
|
|
49b7055cb3 | ||
|
|
cb88f7b6d4 | ||
|
|
9425fb8192 | ||
|
|
e48ccd7943 | ||
|
|
6be5441176 | ||
|
|
d5ba7ebaf0 | ||
|
|
270a482740 | ||
|
|
e0b4890794 | ||
|
|
247e8b6e5d | ||
|
|
b760e2ba23 | ||
|
|
103173fc9b | ||
|
|
70ed371d0c | ||
|
|
81d3485109 | ||
|
|
7b7b68cdab | ||
|
|
135a65e200 | ||
|
|
123529e5eb | ||
|
|
e81989a0d8 | ||
|
|
1c15f53318 | ||
|
|
7937813c98 | ||
|
|
ad4040d982 | ||
|
|
69579306dd | ||
|
|
bd21f00f0a | ||
|
|
012bcbcb48 | ||
|
|
e06d4555bf | ||
|
|
abd106bacb | ||
|
|
008de2fb8f | ||
|
|
2e67fa3e48 | ||
|
|
ea36951bc4 | ||
|
|
09c48b60bd | ||
|
|
4cc117ddf6 | ||
|
|
ceaf8edade | ||
|
|
520200d597 | ||
|
|
ab67985d21 | ||
|
|
bc5cc638fc | ||
|
|
bff8be8b76 | ||
|
|
3e95b8a158 | ||
|
|
e8539d4dae | ||
|
|
1907b31da7 | ||
|
|
6145a135bd | ||
|
|
97c3bc408b | ||
|
|
a00e908f52 | ||
|
|
4ad8891e05 | ||
|
|
2b8b2a4f30 | ||
|
|
5c24450e54 | ||
|
|
3a689a5c4f | ||
|
|
44e36d9aad | ||
|
|
62f7f72d20 | ||
|
|
829c632511 | ||
|
|
8730dfb1f9 | ||
|
|
6764365994 | ||
|
|
8addbc9655 | ||
|
|
658d1a7235 | ||
|
|
4b00d4d9d2 | ||
|
|
6a5829788e | ||
|
|
03074cd23e | ||
|
|
2620e8eada | ||
|
|
9b5e676ffa | ||
|
|
fd1ef11617 | ||
|
|
9fa567a6ce | ||
|
|
fc6c00cbe1 | ||
|
|
66f90a6101 | ||
|
|
1fe5c58d56 | ||
|
|
f23616acaf | ||
|
|
7d37913ea4 | ||
|
|
ac56053c74 | ||
|
|
d566ffaa5f | ||
|
|
d06d7cb9a4 | ||
|
|
e494b5d422 | ||
|
|
fdf7b3bcdf | ||
|
|
871e6c0c73 | ||
|
|
392485aa45 | ||
|
|
275a348b75 | ||
|
|
189689716c | ||
|
|
3965d432ca | ||
|
|
746b960c0d | ||
|
|
760416b81f | ||
|
|
1c785c32ef | ||
|
|
cd608b1877 | ||
|
|
c6dd75ccfb | ||
|
|
6b2023dc3e | ||
|
|
2f4a92d701 | ||
|
|
324c544922 | ||
|
|
fbbbcf97d8 | ||
|
|
d96cd236f3 | ||
|
|
581f950e10 | ||
|
|
9344816bd6 | ||
|
|
67c21fc42f | ||
|
|
c2d266efc6 | ||
|
|
ec1859b095 | ||
|
|
bc00cdeb2c | ||
|
|
3e6e35f383 | ||
|
|
b9e8e20c9c | ||
|
|
932988af46 | ||
|
|
69bc9224db | ||
|
|
a17efe6e8f | ||
|
|
e8b0722137 | ||
|
|
ed128fff26 | ||
|
|
a465fd5b99 | ||
|
|
9af0142a36 | ||
|
|
34fd47887e | ||
|
|
2dc9a0c724 | ||
|
|
c357985135 | ||
|
|
ae2b7f9523 | ||
|
|
5344dec760 | ||
|
|
89bc306632 | ||
|
|
dc05b106f2 | ||
|
|
a416cf7c45 | ||
|
|
09010410cf | ||
|
|
f8bbecebf5 | ||
|
|
9d67037570 | ||
|
|
e4daa4c065 | ||
|
|
08a10b8a6a | ||
|
|
af32240545 | ||
|
|
ee0d3bacbc | ||
|
|
9dcfa882b1 | ||
|
|
cb589b1f99 | ||
|
|
e6e3eef0ef | ||
|
|
0e113a4c81 | ||
|
|
1da3a8e24b | ||
|
|
3509714951 | ||
|
|
146be1f0b6 | ||
|
|
223a4f4741 | ||
|
|
1f1c1790f5 | ||
|
|
2ca00fa585 | ||
|
|
1901158b3e | ||
|
|
63d3403a20 | ||
|
|
7f7fe444d3 | ||
|
|
f4272ccf8f | ||
|
|
4196b0d341 | ||
|
|
ebc7a36a83 | ||
|
|
aab50cd2cc | ||
|
|
96c30452f9 | ||
|
|
4d0f227c70 | ||
|
|
50b87c3791 | ||
|
|
b6539399f4 | ||
|
|
8b8ef8acc0 | ||
|
|
74c6836f2f | ||
|
|
d8d6d0dc95 | ||
|
|
f6c6c4f917 | ||
|
|
918c507a66 | ||
|
|
1b61ca412b | ||
|
|
cd563473fa | ||
|
|
d26e19a296 | ||
|
|
a244e367ea | ||
|
|
347216d654 | ||
|
|
49e4f55b09 | ||
|
|
661ed387df | ||
|
|
ccfec0400f | ||
|
|
e109ed5cef | ||
|
|
b2c905d800 | ||
|
|
4bcff65ad0 | ||
|
|
e5d372f238 | ||
|
|
103d4793f0 | ||
|
|
2a610b011a | ||
|
|
cd030639a4 | ||
|
|
6d23fb2592 | ||
|
|
bc48cf076d | ||
|
|
be2ecf9186 | ||
|
|
d57aa531e1 | ||
|
|
bb898bf587 | ||
|
|
9d35e4fa6e | ||
|
|
bd1e5f4fc8 | ||
|
|
95951ce558 | ||
|
|
10a363ebf3 | ||
|
|
d6b30dd3a5 | ||
|
|
1c19f959db | ||
|
|
dde22d26a8 | ||
|
|
c8211ceb3e | ||
|
|
c910ead4db | ||
|
|
fe64f2b673 | ||
|
|
a91eb36277 | ||
|
|
026979e39d | ||
|
|
705f142b8d | ||
|
|
e880cc40e9 | ||
|
|
7bb4b7911b | ||
|
|
fadf248892 | ||
|
|
0f2b932e92 | ||
|
|
34bd1b3032 | ||
|
|
8924588511 | ||
|
|
6029d9e5a9 | ||
|
|
19a1ac1f34 | ||
|
|
30648d1cc9 | ||
|
|
842eb5da28 | ||
|
|
05df2ee8a4 | ||
|
|
ab3911ba9e | ||
|
|
013921782b | ||
|
|
c449e5f20a | ||
|
|
6e0de7b42c | ||
|
|
2e42391b86 | ||
|
|
21bd679076 | ||
|
|
fd8b9a3a44 | ||
|
|
5c1cb01936 | ||
|
|
ec4f58741b | ||
|
|
4ce6e5f0c5 | ||
|
|
a8a82e0b21 | ||
|
|
739cb87385 | ||
|
|
8492796a5c | ||
|
|
218b626016 | ||
|
|
f42c57d9a8 | ||
|
|
82a460ec90 | ||
|
|
b4e6ca63b5 | ||
|
|
1d36e68346 | ||
|
|
41c473cf5e | ||
|
|
b2ccbdffc1 | ||
|
|
769cc9879f | ||
|
|
0dbb31afeb | ||
|
|
1bfc3c1eb9 | ||
|
|
8bd178c2e5 | ||
|
|
b58dc083a9 | ||
|
|
65b2a2cb02 | ||
|
|
70363847aa | ||
|
|
1ce749c86a | ||
|
|
08c9b6037d | ||
|
|
57a2bd056c | ||
|
|
234bf99743 | ||
|
|
f93144fee7 | ||
|
|
945d01fd9e | ||
|
|
d99d27dcbe | ||
|
|
908db7c1d2 | ||
|
|
77337271fc | ||
|
|
c1479a2732 | ||
|
|
1f53ca5f4c | ||
|
|
425db289d5 | ||
|
|
d2eed169ae | ||
|
|
61ffe1eac4 | ||
|
|
9e7ad1e2aa | ||
|
|
ae9f183cda | ||
|
|
71bc20c453 | ||
|
|
ff1ae29f97 | ||
|
|
fdf6eecd59 | ||
|
|
651657edfd | ||
|
|
74770ab718 | ||
|
|
6153a2fb10 | ||
|
|
e5650bb549 | ||
|
|
18bb0ea1ea | ||
|
|
6a8f9135de | ||
|
|
704d8a62bf | ||
|
|
3b3ca65562 | ||
|
|
697ff926ce | ||
|
|
e8a9578774 | ||
|
|
0bf3a15886 | ||
|
|
cebc8c78a4 | ||
|
|
290e921920 | ||
|
|
94feb62b08 | ||
|
|
941176cd65 | ||
|
|
251b015210 | ||
|
|
616bad96af | ||
|
|
1b765b9740 | ||
|
|
0ce0c8fcfb | ||
|
|
811ac5ac3a | ||
|
|
901d98b687 | ||
|
|
4503b03b26 | ||
|
|
0e64406b06 | ||
|
|
1220b642eb | ||
|
|
cc03718d3c | ||
|
|
d7cb6146c8 | ||
|
|
4f021fc7dd | ||
|
|
498ebef357 | ||
|
|
cebbaf1664 | ||
|
|
227e067512 | ||
|
|
9d5b458479 | ||
|
|
8dd3622c6d | ||
|
|
564c3a9c96 | ||
|
|
4725e5c52e | ||
|
|
106027fc29 | ||
|
|
d1298fe5e7 | ||
|
|
eabfb370ac | ||
|
|
62164d955c | ||
|
|
a5545593ba | ||
|
|
f68fa667c8 | ||
|
|
7a29b14a20 | ||
|
|
df8346ef4d | ||
|
|
c0f6395cf0 | ||
|
|
50d63e4b0a | ||
|
|
6a417c538f | ||
|
|
7fae32095a | ||
|
|
37a5f8a30b | ||
|
|
f107967fdc | ||
|
|
a793533d1a | ||
|
|
3318d0b4b8 | ||
|
|
81f1cc662f | ||
|
|
28fe2987a0 | ||
|
|
26abf6fd82 | ||
|
|
594b189569 | ||
|
|
7696a38543 | ||
|
|
cde35d1606 | ||
|
|
9fc78cbece | ||
|
|
e4dff41560 | ||
|
|
2f2392f783 | ||
|
|
c3703ded95 | ||
|
|
e5fd010a6c | ||
|
|
ba762bcd49 | ||
|
|
6da8cb00e2 | ||
|
|
eed727c61b | ||
|
|
89e7bacd99 | ||
|
|
ff34955a0d | ||
|
|
a48a0e77eb | ||
|
|
cf6e22e9a6 | ||
|
|
c1202a2ecc | ||
|
|
01ae0daea5 | ||
|
|
45fc45a49e | ||
|
|
7bdc328a71 | ||
|
|
e71744b918 | ||
|
|
40e7a1a5c9 | ||
|
|
7878d9b3f6 | ||
|
|
9e1c4533b8 | ||
|
|
4b8e4dae58 | ||
|
|
0754f2a7af | ||
|
|
8d2d28f1dc | ||
|
|
e9620d9c8c | ||
|
|
de51f87e05 | ||
|
|
1afed48a2c | ||
|
|
c6fd2986d4 | ||
|
|
abceeee92f | ||
|
|
5fc791ac9a | ||
|
|
72884bf85f | ||
|
|
f97d4355be | ||
|
|
e19d1ea95a | ||
|
|
96b71236ed | ||
|
|
3b77a63d5d | ||
|
|
64fa59e24f | ||
|
|
79c9f14aec | ||
|
|
2ef414d05f | ||
|
|
77cf27b82b | ||
|
|
64996422c0 | ||
|
|
f8c9b70379 | ||
|
|
7b802c547d | ||
|
|
73bb3bc595 | ||
|
|
1320d07068 | ||
|
|
0b97ad8384 | ||
|
|
ddaff2d653 | ||
|
|
75a0ca6bd6 | ||
|
|
38944467d3 | ||
|
|
23adfff4fe | ||
|
|
b35adfbd2d | ||
|
|
526eedf98e | ||
|
|
dcedfdacd1 | ||
|
|
ea8d6d7abd | ||
|
|
f145d498a6 | ||
|
|
41c91391fc | ||
|
|
1ddfdc55dd | ||
|
|
a6a1e6ed1a | ||
|
|
f8430723e0 | ||
|
|
bfc68d3151 | ||
|
|
ee8b6d3444 | ||
|
|
2115a766f6 | ||
|
|
d1a5e97a7f | ||
|
|
7372282a72 | ||
|
|
bc0e5c0063 | ||
|
|
045e32b6ec | ||
|
|
fea55a9b87 | ||
|
|
763da10c7b | ||
|
|
1c98ec94da | ||
|
|
28660b4c1a | ||
|
|
fa72e65b59 | ||
|
|
7d5d676eac | ||
|
|
61f2cc45c2 | ||
|
|
c1d92d72e1 | ||
|
|
4f71a9fbde | ||
|
|
4142b8c352 | ||
|
|
d0fdfd44c5 | ||
|
|
f5995337e8 | ||
|
|
1469196d3b | ||
|
|
e9fd3def90 | ||
|
|
a2af490b7b | ||
|
|
4964daa5be | ||
|
|
718086f383 | ||
|
|
339b7588d2 | ||
|
|
0ac5f6a7ca | ||
|
|
1726b82a16 | ||
|
|
03db16d55b | ||
|
|
0c20973c17 | ||
|
|
f65d157786 | ||
|
|
899404f3b1 | ||
|
|
6aab526989 | ||
|
|
c349708eab | ||
|
|
9c3e0a8040 | ||
|
|
7f25183936 | ||
|
|
4b6138e69b | ||
|
|
b6fcbc5fba | ||
|
|
ed870a7237 | ||
|
|
3a06fb8831 | ||
|
|
d47120aeb3 | ||
|
|
9b907dd65a | ||
|
|
28f2fdb6de | ||
|
|
4e1055543c | ||
|
|
8ead29a302 | ||
|
|
fe98fe342a | ||
|
|
554f7f120c | ||
|
|
05ab58cd14 | ||
|
|
eae2d35ca5 | ||
|
|
85002883bd | ||
|
|
22b07bdb30 | ||
|
|
fe338745a3 | ||
|
|
6ce0c61dc0 | ||
|
|
78f4142f4f | ||
|
|
ea1fda5ebc | ||
|
|
67db77b8b3 | ||
|
|
64c4d00693 | ||
|
|
6661d9be1a | ||
|
|
c41f1c960b | ||
|
|
9a62a909bc | ||
|
|
93f4d2b3f1 | ||
|
|
558a133044 | ||
|
|
5037efdea9 | ||
|
|
e9888c8e25 | ||
|
|
3daaff3a42 | ||
|
|
d39f98aeb0 | ||
|
|
30c21b4abd | ||
|
|
cfd19dcdb5 | ||
|
|
b0481b9db1 | ||
|
|
5f39885975 | ||
|
|
9ff8067426 | ||
|
|
162619a426 | ||
|
|
2419d0029a | ||
|
|
b8f2dcea4d | ||
|
|
07d000cc54 | ||
|
|
6470743e51 | ||
|
|
143dce6672 | ||
|
|
96b2d1fd29 | ||
|
|
369177aa80 | ||
|
|
0bf533f753 | ||
|
|
67a6bc4ab5 | ||
|
|
ef397dca7c | ||
|
|
b65a5aceb0 | ||
|
|
4846846a2d | ||
|
|
414c614893 | ||
|
|
a17abae128 | ||
|
|
286edd4f1e | ||
|
|
4914eb29d1 | ||
|
|
825953bbdc | ||
|
|
fd6452749e | ||
|
|
7c2639ddd9 | ||
|
|
3f58028d31 | ||
|
|
94dfececf6 | ||
|
|
74febd5c31 | ||
|
|
857fe0551c | ||
|
|
5341bf59c2 | ||
|
|
43a28f04fa | ||
|
|
080002f8ed | ||
|
|
853a78681e | ||
|
|
9e46cbf7ea | ||
|
|
b60b58b627 | ||
|
|
3e975d8f28 | ||
|
|
a7833cca22 | ||
|
|
08ac3454cc | ||
|
|
3ca847b4e1 | ||
|
|
e7fcc08d26 | ||
|
|
520b470217 | ||
|
|
9a7471b740 | ||
|
|
061d4b4202 | ||
|
|
2ecd53ce09 | ||
|
|
561bb64963 | ||
|
|
d5899a53fd | ||
|
|
b9e680d06c | ||
|
|
0ccc0ac927 | ||
|
|
63eca0feb2 | ||
|
|
ae561d705f | ||
|
|
bc01ae4cbd | ||
|
|
319f43e6d2 | ||
|
|
f19919546d | ||
|
|
85f119e1e6 | ||
|
|
8b875d71d1 | ||
|
|
789c88509c | ||
|
|
bdf54908aa | ||
|
|
7244f09111 | ||
|
|
ca748ad44c | ||
|
|
79cb754358 | ||
|
|
582e450bad | ||
|
|
ae6d83a41e | ||
|
|
3e012122d1 | ||
|
|
a4a2c34831 | ||
|
|
36af9bb027 | ||
|
|
6599002149 | ||
|
|
cbd2bcf102 | ||
|
|
01f3ae1c50 | ||
|
|
eaff4616ad | ||
|
|
ab42549b1e | ||
|
|
02726f0003 | ||
|
|
36bcbca9ac | ||
|
|
4ed837bcfa | ||
|
|
54f3796f91 | ||
|
|
ae66d611f2 | ||
|
|
b22cb69a15 | ||
|
|
40707e3c5b | ||
|
|
acfb2bb8bc | ||
|
|
7f51bccf47 | ||
|
|
bfa5ad483f | ||
|
|
ae89aa55b9 | ||
|
|
63266928a5 | ||
|
|
fc92da4324 | ||
|
|
88dc8c694e | ||
|
|
785a2fd23a | ||
|
|
4328a6442b | ||
|
|
6496b1cf1f | ||
|
|
c0caedc373 | ||
|
|
524cf237b8 | ||
|
|
e4cb004460 | ||
|
|
71418639d3 | ||
|
|
f2ec226521 | ||
|
|
0931d4b7ff | ||
|
|
ccadebabba | ||
|
|
18771a39cf | ||
|
|
baf7da9d4a | ||
|
|
c0b35fa429 | ||
|
|
f31b0a3361 | ||
|
|
d28ea57083 | ||
|
|
8e26c5c066 | ||
|
|
5c1074aa7d | ||
|
|
bd72091150 | ||
|
|
faf3d7902a | ||
|
|
63f1ded167 | ||
|
|
3c30ab2807 | ||
|
|
310fa10035 | ||
|
|
bc847e8cc2 | ||
|
|
b82952bdba | ||
|
|
570a8dbf22 | ||
|
|
c68ea19e8d | ||
|
|
0c91d01866 | ||
|
|
e34cef312f | ||
|
|
d670c831c2 | ||
|
|
d1a16f24cf | ||
|
|
2d872ce3fa | ||
|
|
e3c58eff1c | ||
|
|
99de37ff94 | ||
|
|
5e3b9e3578 | ||
|
|
ad795c9f0c | ||
|
|
d6d479f94c | ||
|
|
6415528f96 | ||
|
|
4af1f2963c | ||
|
|
ba0322f353 | ||
|
|
1a705523c0 | ||
|
|
87b9e5467d | ||
|
|
625dac8d8c | ||
|
|
134e49cc8e | ||
|
|
cab426ffa3 | ||
|
|
3edf2bb417 | ||
|
|
9ebfbd150e | ||
|
|
e278742c5e | ||
|
|
ef08163c38 | ||
|
|
2e82268a67 | ||
|
|
00bdfad5f6 | ||
|
|
efd8dabd91 | ||
|
|
e4f443a57a | ||
|
|
d4df20a913 | ||
|
|
db495668ae | ||
|
|
996c653490 | ||
|
|
4acad897cf | ||
|
|
b37fffc2c5 | ||
|
|
a99450ab72 | ||
|
|
7776d6228e | ||
|
|
5415256a52 | ||
|
|
836e43db60 | ||
|
|
9c94538fb7 | ||
|
|
53eedd3ba4 | ||
|
|
42134bb49e | ||
|
|
0488bf54d3 | ||
|
|
da19aee307 | ||
|
|
d2c0b4905a | ||
|
|
153f07fdfb | ||
|
|
7e610aece5 | ||
|
|
16aedc0ef6 | ||
|
|
6596e585fe | ||
|
|
f98eda4d52 | ||
|
|
23717510c2 | ||
|
|
c51564ab5b | ||
|
|
1eb14c7743 | ||
|
|
56e9f97294 | ||
|
|
774faf4e85 | ||
|
|
d0711821f3 | ||
|
|
7024b45197 | ||
|
|
5fce673a56 | ||
|
|
29c9d3d5f4 | ||
|
|
708f1c336e | ||
|
|
dc4ac0b96f | ||
|
|
296748d32e | ||
|
|
ad408f269c | ||
|
|
e57754868f | ||
|
|
0c7e7f4998 | ||
|
|
136657bcc1 | ||
|
|
dc16820e02 | ||
|
|
4b85608e30 | ||
|
|
8ab77f4153 | ||
|
|
472585a7e8 | ||
|
|
8f42a8be0c | ||
|
|
c4b707bca2 | ||
|
|
9e35fe8c37 | ||
|
|
385904d75a | ||
|
|
b1e0b7728b | ||
|
|
eb255e6870 | ||
|
|
72e4c8f523 | ||
|
|
835d2e4b5f | ||
|
|
94b42a79d7 | ||
|
|
e40da2341c | ||
|
|
7aa72c56b6 | ||
|
|
5784c14ab7 | ||
|
|
3028bbb95b | ||
|
|
dfdc817db3 | ||
|
|
f4856a33c9 | ||
|
|
371af9c241 | ||
|
|
88a9bae160 | ||
|
|
ecd5c5f920 | ||
|
|
91d1186cbb | ||
|
|
467b3cf4c1 | ||
|
|
c007d8219e | ||
|
|
b318e82356 | ||
|
|
98fa00db12 | ||
|
|
69fca4f3cb | ||
|
|
f6ed45fc20 | ||
|
|
e81ff1e833 | ||
|
|
43b6ca0d14 | ||
|
|
34492ce480 | ||
|
|
163c38e175 | ||
|
|
11be390110 | ||
|
|
ea26a9f543 | ||
|
|
f9e1b0cd97 | ||
|
|
805564dcf2 | ||
|
|
76fb792544 | ||
|
|
ff35014eff | ||
|
|
de868d24c1 | ||
|
|
318a730c45 | ||
|
|
9017c51e7f | ||
|
|
bdb66aced7 | ||
|
|
ab83444cc3 | ||
|
|
64a6da3e45 | ||
|
|
dd9909a574 | ||
|
|
59c58f230e | ||
|
|
f79069f5b3 | ||
|
|
f5e0ba266e | ||
|
|
7361f29527 | ||
|
|
1d009a37df | ||
|
|
0fb208e63c | ||
|
|
dade01be29 | ||
|
|
45057667f1 | ||
|
|
4ab4e33450 | ||
|
|
0cfca69b42 | ||
|
|
1278a57afe | ||
|
|
071c0b5536 | ||
|
|
735fa8b652 | ||
|
|
0b37f98e16 | ||
|
|
5f8809e425 | ||
|
|
f143e269f4 | ||
|
|
1d1aec9631 | ||
|
|
817180bd55 | ||
|
|
60bd878f0a | ||
|
|
bbd8e645a2 | ||
|
|
97d659c9fd | ||
|
|
7b8227039f | ||
|
|
363487c97b | ||
|
|
f6bc662194 | ||
|
|
7bd9e53ae6 | ||
|
|
267744a568 | ||
|
|
8e67f4c4e6 | ||
|
|
1c59cff832 | ||
|
|
bc2819cab2 | ||
|
|
7ece67727d | ||
|
|
303351de6d | ||
|
|
831003156c | ||
|
|
54de4afd75 | ||
|
|
c01c487c62 | ||
|
|
2f6e931921 | ||
|
|
50dc2d8112 | ||
|
|
f4d7530587 | ||
|
|
185c0bd587 | ||
|
|
3c0090c0df | ||
|
|
6199252cda | ||
|
|
c08720bfba | ||
|
|
4882bda667 | ||
|
|
a817419fe4 | ||
|
|
37bf9a666a | ||
|
|
cd6d204a9d | ||
|
|
9baae3a701 | ||
|
|
92f504f98d | ||
|
|
75816150ec | ||
|
|
4681392bac | ||
|
|
17830c5894 | ||
|
|
edbcf7c039 | ||
|
|
96bee29e35 | ||
|
|
82ea534997 | ||
|
|
a4fe2a7c75 | ||
|
|
4ef9c7675a | ||
|
|
f69123050b | ||
|
|
a5a9c9f799 | ||
|
|
cce210f676 | ||
|
|
a8e493122e | ||
|
|
e00d7ee5be | ||
|
|
ad6b087353 | ||
|
|
3715e39e5d | ||
|
|
423109e64c | ||
|
|
71b7d92597 | ||
|
|
e034f8a2a3 | ||
|
|
47381bde3b | ||
|
|
c578efb32b | ||
|
|
5aa2679be7 | ||
|
|
d4e7faca21 | ||
|
|
4ffba76bb3 | ||
|
|
f4a08f7fb3 | ||
|
|
f6d9bcc9bb | ||
|
|
a7daf8e652 | ||
|
|
4771b4951d | ||
|
|
383698186f | ||
|
|
fb4c3ab4fb | ||
|
|
96ad0c8638 | ||
|
|
7985d746f9 | ||
|
|
a45f287ae1 | ||
|
|
7d9dd352cf | ||
|
|
a09660dc85 | ||
|
|
d78e5e7329 | ||
|
|
e61b2f99c1 | ||
|
|
d386f02893 | ||
|
|
5a3218e535 | ||
|
|
02653573d2 | ||
|
|
5c66664aef | ||
|
|
21b7a272c4 | ||
|
|
17a47b3335 | ||
|
|
89bbff18e5 | ||
|
|
fc95d00b2f | ||
|
|
3f4f844eeb | ||
|
|
6875ead7cf | ||
|
|
5388e8b124 | ||
|
|
02b14090c2 | ||
|
|
56a744599f | ||
|
|
9fa4b72a47 | ||
|
|
3e78b29cae | ||
|
|
d63c160bd6 | ||
|
|
2a6c0fc17f | ||
|
|
1340da7b54 | ||
|
|
89af509d10 | ||
|
|
89b8b792c1 | ||
|
|
a19491dbd2 | ||
|
|
f5c6e3973c | ||
|
|
e7beaac6f5 | ||
|
|
84684e53ed | ||
|
|
4c0e36a5e9 | ||
|
|
8ed83250d7 | ||
|
|
360a8918dd | ||
|
|
4d43a67419 | ||
|
|
33e80dae7f | ||
|
|
4f53619a15 | ||
|
|
3fb5b7a3bd | ||
|
|
bcd3e1af2f | ||
|
|
cd45ae3d0f | ||
|
|
e5dc58e710 | ||
|
|
cef7bb0619 | ||
|
|
a006b828a6 | ||
|
|
052bb24c7f | ||
|
|
3c630c0d90 | ||
|
|
d0810b0156 | ||
|
|
ffd3cdf519 | ||
|
|
ac2e822ea1 | ||
|
|
0cd2972d60 | ||
|
|
821ff68f54 | ||
|
|
e8eb4d233b | ||
|
|
414d1ff9e2 | ||
|
|
7d92ce061d | ||
|
|
a1e2a8bec6 | ||
|
|
f34a9b6a71 | ||
|
|
def870953a | ||
|
|
f2c6330505 | ||
|
|
077ffa5231 | ||
|
|
0802edf582 | ||
|
|
8bfa56648d | ||
|
|
4d20f1283f | ||
|
|
0a38e542c1 | ||
|
|
96f551a287 | ||
|
|
af05e4b2de | ||
|
|
4415d95c50 | ||
|
|
1cdf210e4f | ||
|
|
b0ad5ce8e2 | ||
|
|
b2447393e4 | ||
|
|
63ce6eee5c | ||
|
|
858b2d7439 | ||
|
|
6103e59c19 | ||
|
|
a106c0dbdc | ||
|
|
f37a3a84fa | ||
|
|
13cf5425db | ||
|
|
fb6ac9a1a6 | ||
|
|
033ae0dcae | ||
|
|
e261cc9e8f | ||
|
|
2ec160454a | ||
|
|
51d308c666 | ||
|
|
b3c439fb16 | ||
|
|
15ae9ca8a2 | ||
|
|
c3cd89705d | ||
|
|
1bd25925cb | ||
|
|
17e17ceb59 | ||
|
|
8da4a4276f | ||
|
|
3bb1cfdf36 | ||
|
|
e627f023a0 | ||
|
|
bd5cdbf1a4 | ||
|
|
34e57da1ca | ||
|
|
de8996ac3b | ||
|
|
33264d0fb6 | ||
|
|
cc65bda2cc | ||
|
|
4b2b65df9f | ||
|
|
4800f1df97 | ||
|
|
9850df35ae | ||
|
|
7dfa3442fe | ||
|
|
58bc6f3a18 | ||
|
|
a75c31143a | ||
|
|
15b375827e | ||
|
|
60578e0950 | ||
|
|
09d7654f46 | ||
|
|
28234f6e54 | ||
|
|
63fe487d93 | ||
|
|
d2b2c7c09e | ||
|
|
c930a92b72 | ||
|
|
cffd40c5d6 | ||
|
|
fb78854e9b | ||
|
|
461f53945d | ||
|
|
6c3ca42e0e | ||
|
|
0f4c83eb98 | ||
|
|
880aa870a0 | ||
|
|
cf136f1935 | ||
|
|
ca26de72c9 | ||
|
|
af574e58fe | ||
|
|
ed81aa8aae | ||
|
|
9ab64658ba | ||
|
|
3504a66eda | ||
|
|
3f0ac7adce | ||
|
|
0076339914 | ||
|
|
2176f4d697 | ||
|
|
843ffba567 |
2
.gitattributes
vendored
Normal file
2
.gitattributes
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
*.cpp diff=cpp
|
||||
*.h diff=cpp
|
||||
93
.gitignore
vendored
93
.gitignore
vendored
@@ -1,22 +1,99 @@
|
||||
map/*
|
||||
world/*
|
||||
## Generic ignorable patterns and files
|
||||
*~
|
||||
.*.swp
|
||||
.*-swp
|
||||
*bak*
|
||||
tags
|
||||
*.vim
|
||||
*.orig
|
||||
*.rej
|
||||
|
||||
## Files related to minetest development cycle
|
||||
/*.patch
|
||||
|
||||
## Non-static Minetest directories
|
||||
/bin/
|
||||
/games/*
|
||||
!/games/minimal/
|
||||
/cache/
|
||||
/textures/*
|
||||
!/textures/base/
|
||||
/sounds/
|
||||
/mods/*
|
||||
!/mods/minetest/
|
||||
/mods/minetest/*
|
||||
!/mods/minetest/mods_here.txt
|
||||
/worlds/
|
||||
/world/
|
||||
|
||||
## Configuration/log files
|
||||
minetest.conf
|
||||
debug.txt
|
||||
|
||||
## Doxygen files
|
||||
doc/Doxyfile
|
||||
doc/html/
|
||||
doc/doxygen_*
|
||||
|
||||
## Build files
|
||||
CMakeFiles/*
|
||||
src/CMakeFiles/*
|
||||
src/Makefile
|
||||
src/android_version_githash.h
|
||||
src/android_version.h
|
||||
src/cmake_config.h
|
||||
src/cmake_config_githash.h
|
||||
src/cmake_install.cmake
|
||||
src/script/CMakeFiles/*
|
||||
src/script/common/CMakeFiles/*
|
||||
src/script/cpp_api/CMakeFiles/*
|
||||
src/script/lua_api/CMakeFiles/*
|
||||
src/util/CMakeFiles/*
|
||||
src/unittest/CMakeFiles/*
|
||||
src/jthread/CMakeFiles/*
|
||||
src/jthread/Makefile
|
||||
src/jthread/cmake_config.h
|
||||
src/jthread/cmake_install.cmake
|
||||
minetest.conf
|
||||
bin/
|
||||
src/jthread/libjthread.a
|
||||
src/json/libjson.a
|
||||
src/lua/build/
|
||||
src/lua/CMakeFiles/
|
||||
src/cguittfont/CMakeFiles/
|
||||
src/cguittfont/libcguittfont.a
|
||||
src/cguittfont/cmake_install.cmake
|
||||
src/cguittfont/Makefile
|
||||
src/gmp/CMakeFiles/
|
||||
src/gmp/libgmp.a
|
||||
src/json/CMakeFiles/
|
||||
src/json/libjsoncpp.a
|
||||
src/sqlite/CMakeFiles/*
|
||||
src/sqlite/libsqlite3.a
|
||||
src/client/CMakeFiles/
|
||||
src/network/CMakeFiles/
|
||||
CMakeCache.txt
|
||||
CPackConfig.cmake
|
||||
CPackSourceConfig.cmake
|
||||
Makefile
|
||||
cmake_install.cmake
|
||||
src/jthread/libjthread.a
|
||||
debug.txt
|
||||
bin/debug.txt
|
||||
minetestmapper/map.png
|
||||
locale/
|
||||
.directory
|
||||
.kdev4/
|
||||
*.cbp
|
||||
*.kdev4
|
||||
*.layout
|
||||
*.o
|
||||
|
||||
## Android build files
|
||||
build/android/assets
|
||||
build/android/bin
|
||||
build/android/Debug
|
||||
build/android/deps
|
||||
build/android/gen
|
||||
build/android/jni/src
|
||||
build/android/libs
|
||||
build/android/obj
|
||||
build/android/path.cfg
|
||||
build/android/and_env
|
||||
build/android/AndroidManifest.xml
|
||||
timestamp
|
||||
|
||||
|
||||
25
.hgignore
25
.hgignore
@@ -1,25 +0,0 @@
|
||||
map/*
|
||||
world/*
|
||||
CMakeFiles/*
|
||||
src/CMakeFiles/*
|
||||
src/Makefile
|
||||
src/cmake_config.h
|
||||
src/cmake_install.cmake
|
||||
src/jthread/CMakeFiles/*
|
||||
src/jthread/Makefile
|
||||
src/jthread/cmake_config.h
|
||||
src/jthread/cmake_install.cmake
|
||||
src/.*.swp
|
||||
src/sqlite/libsqlite3.a
|
||||
src/session.vim
|
||||
util/uloste.png
|
||||
minetest.conf
|
||||
debug.txt
|
||||
bin/
|
||||
CMakeCache.txt
|
||||
CPackConfig.cmake
|
||||
CPackSourceConfig.cmake
|
||||
Makefile
|
||||
cmake_install.cmake
|
||||
src/jthread/libjthread.a
|
||||
data_temp/*
|
||||
28
.hgtags
28
.hgtags
@@ -1,28 +0,0 @@
|
||||
c37bcfd89dd627fdb131ae3f77fcaab02721bf76 working
|
||||
69547bd6be420eb40f55524fd2131cbbaa2e0e29 110107195706-exp
|
||||
e3c3c8e27bbc8c9b61710517a78944deb1c61696 110211211322
|
||||
23880c78e40c50ad54fcd8844510f7a423b37f2a 110212200513
|
||||
20c49c98c92a62df457b773c562df41d4167492b 110214175330
|
||||
10be2b71f965585af90af96903e83b4ddff52bf9 20110424_0
|
||||
9b05d4bfee9312aef4182fa6f63b4237368cec34 0.2.20110529_0
|
||||
6fa0a8b40406aa567f8fa84b5e2045a7e3762c1d 0.2.20110529_1
|
||||
cf6dd618ef0b7514c81ae87749733b5a328fc763 0.2.20110529_2
|
||||
96efc17b4cd92aacbe947b520a6ba91727d42f03 0.2.20110602_0
|
||||
0000000000000000000000000000000000000000 0.2.20110602_0
|
||||
6f17cd3f6c5481e6abc906fc441980c764632cbc 0.2.20110602_0
|
||||
dd08a9b5cb84d55b7576bb3fde3068dd263bc3bc 0.2.20110618_0_dev
|
||||
25aa2021937f7a8b36808390983cebbc16ae6965 0.2.20110704_0
|
||||
25aa2021937f7a8b36808390983cebbc16ae6965 0.2.20110704_0
|
||||
0000000000000000000000000000000000000000 0.2.20110704_0
|
||||
0000000000000000000000000000000000000000 0.2.20110704_0
|
||||
65263ec55caf526e3f3e0bdc6657ce42daee46bc 0.2.20110704_0
|
||||
06c62112b503e746d5d8cc40f951974447d590b7 0.2.20110731_0
|
||||
705a7e95b8710c8cada5524d8c7bb658f4b710d9 0.2.20110731_1
|
||||
4a6cf9491306988b24c79438ee6398885c432fce 0.2.20110731_2
|
||||
4a6cf9491306988b24c79438ee6398885c432fce 0.2.20110731_2
|
||||
0000000000000000000000000000000000000000 0.2.20110731_2
|
||||
0000000000000000000000000000000000000000 0.2.20110731_2
|
||||
8ad16fbce9a4da45b2552ad8b400a5a127722acc 0.2.20110731_2
|
||||
c87e28deaabf4a776c261b3a09b6bf5ea3e04abf 0.2.20110731_3
|
||||
c87e28deaabf4a776c261b3a09b6bf5ea3e04abf 0.2.20110731_3
|
||||
0000000000000000000000000000000000000000 0.2.20110731_3
|
||||
33
.mailmap
Normal file
33
.mailmap
Normal file
@@ -0,0 +1,33 @@
|
||||
0gb.us <0gb.us@0gb.us> <us_0gb@laptop-0gb-us.0gb.us>
|
||||
Calinou <calinou9999@gmail.com> <calinou9999spam@gmail.com>
|
||||
Perttu Ahola <celeron55@gmail.com> celeron55 <celeron55@gmail.com>
|
||||
Perttu Ahola <celeron55@gmail.com> celeron55 <celeron55@armada.(none)>
|
||||
Craig Robbins <kde.psych@gmail.com> <crobbins@localhost.localdomain>
|
||||
Diego Martínez <kaeza@users.sf.net> <lkaezadl3@gmail.com>
|
||||
Ilya Zhuravlev <zhuravlevilya@ya.ru> <whatever@xyz.is>
|
||||
kwolekr <kwolekr@minetest.net> <mirrorisim@gmail.com>
|
||||
PilzAdam <pilzadam@minetest.net> PilzAdam <adam-k@outlook.com>
|
||||
PilzAdam <pilzadam@minetest.net> Pilz Adam <PilzAdam@gmx.de>
|
||||
PilzAdam <pilzadam@minetest.net> PilzAdam <PilzAdam@gmx.de>
|
||||
proller <proller@github.com> <proler@github.com>
|
||||
proller <proller@github.com> <proler@gmail.com>
|
||||
RealBadAngel <maciej.kasatkin@o2.pl> <mk@realbadangel.pl>
|
||||
RealBadAngel <maciej.kasatkin@o2.pl> <maciej.kasatkin@yahoo.com>
|
||||
Selat <LongExampleTestName@gmail.com> <LongExampletestName@gmail.com>
|
||||
ShadowNinja <shadowninja@minetest.net> ShadowNinja <noreply@gmail.com>
|
||||
Shen Zheyu <arsdragonfly@gmail.com> arsdragonfly <arsdragonfly@gmail.com>
|
||||
Pavel Elagin <elagin.pasha@gmail.com> elagin <elagin.pasha@gmail.com>
|
||||
Esteban I. Ruiz Moreno <exio4.com@gmail.com> Esteban I. RM <exio4.com@gmail.com>
|
||||
manuel duarte <ffrogger0@yahoo.com> manuel joaquim <ffrogger0@yahoo.com>
|
||||
manuel duarte <ffrogger0@yahoo.com> sweetbomber <ffrogger _zero_ at yahoo dot com>
|
||||
Diego Martínez <kaeza@users.sf.net> kaeza <kaeza@users.sf.net>
|
||||
Diego Martínez <kaeza@users.sf.net> Diego Martinez <kaeza@users.sf.net>
|
||||
Lord James <neftali_dtctv@hotmail.com> Lord89James <neftali_dtctv@hotmail.com>
|
||||
BlockMen <nmuelll@web.de> Block Men <nmuelll@web.de>
|
||||
sfan5 <sfan5@live.de> Sfan5 <sfan5@live.de>
|
||||
DannyDark <the_skeleton_of_a_child@yahoo.co.uk> dannydark <the_skeleton_of_a_child@yahoo.co.uk>
|
||||
Ilya Pavlov <TTChangeTheWorld@gmail.com> Ilya <TTChangeTheWorld@gmail.com>
|
||||
Ilya Zhuravlev <zhuravlevilya@ya.ru> xyzz <zhuravlevilya@ya.ru>
|
||||
sapier <Sapier at GMX dot net> sapier <sapier AT gmx DOT net>
|
||||
sapier <Sapier at GMX dot net> sapier <sapier at gmx dot net>
|
||||
|
||||
19
.travis.yml
Normal file
19
.travis.yml
Normal file
@@ -0,0 +1,19 @@
|
||||
language: cpp
|
||||
compiler:
|
||||
- gcc
|
||||
- clang
|
||||
env:
|
||||
- PLATFORM=Win32
|
||||
- PLATFORM=Win64
|
||||
- PLATFORM=Linux
|
||||
before_install: ./util/travis/before_install.sh
|
||||
script: ./util/travis/script.sh
|
||||
notifications:
|
||||
email: false
|
||||
matrix:
|
||||
fast_finish: true
|
||||
exclude:
|
||||
- env: PLATFORM=Win32
|
||||
compiler: clang
|
||||
- env: PLATFORM=Win64
|
||||
compiler: clang
|
||||
231
CMakeLists.txt
231
CMakeLists.txt
@@ -1,79 +1,198 @@
|
||||
cmake_minimum_required(VERSION 2.6)
|
||||
|
||||
if(${CMAKE_VERSION} STREQUAL "2.8.2")
|
||||
# bug http://vtk.org/Bug/view.php?id=11020
|
||||
message( WARNING "CMake/CPack version 2.8.2 will not create working .deb packages!")
|
||||
endif(${CMAKE_VERSION} STREQUAL "2.8.2")
|
||||
# Bug http://vtk.org/Bug/view.php?id=11020
|
||||
message(WARNING "CMake/CPack version 2.8.2 will not create working .deb packages!")
|
||||
endif()
|
||||
|
||||
# This can be read from ${PROJECT_NAME} after project() is called
|
||||
project(minetest)
|
||||
set(PROJECT_NAME_CAPITALIZED "Minetest")
|
||||
|
||||
|
||||
# Also remember to set PROTOCOL_VERSION in network/networkprotocol.h when releasing
|
||||
set(VERSION_MAJOR 0)
|
||||
set(VERSION_MINOR 2)
|
||||
set(VERSION_PATCH 20110731_3)
|
||||
set(VERSION_MINOR 4)
|
||||
set(VERSION_PATCH 13)
|
||||
set(VERSION_EXTRA "" CACHE STRING "Stuff to append to version string")
|
||||
|
||||
# Change to false for releases
|
||||
set(DEVELOPMENT_BUILD FALSE)
|
||||
|
||||
set(VERSION_STRING "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
|
||||
if(VERSION_EXTRA)
|
||||
set(VERSION_STRING ${VERSION_STRING}-${VERSION_EXTRA})
|
||||
elseif(DEVELOPMENT_BUILD)
|
||||
set(VERSION_STRING "${VERSION_STRING}-dev")
|
||||
endif()
|
||||
|
||||
message(STATUS "*** Will build version ${VERSION_STRING} ***")
|
||||
|
||||
|
||||
# Configuration options
|
||||
|
||||
set(DEFAULT_RUN_IN_PLACE FALSE)
|
||||
if(WIN32)
|
||||
set(RUN_IN_PLACE 1 CACHE BOOL "Run directly in source directory structure")
|
||||
else()
|
||||
set(RUN_IN_PLACE 0 CACHE BOOL "Run directly in source directory structure")
|
||||
set(DEFAULT_RUN_IN_PLACE TRUE)
|
||||
endif()
|
||||
set(RUN_IN_PLACE ${DEFAULT_RUN_IN_PLACE} CACHE BOOL
|
||||
"Run directly in source directory structure")
|
||||
|
||||
set(BUILD_CLIENT 1 CACHE BOOL "Build client")
|
||||
if(WIN32)
|
||||
set(BUILD_SERVER 0 CACHE BOOL "Build server")
|
||||
else()
|
||||
set(BUILD_SERVER 1 CACHE BOOL "Build server")
|
||||
endif()
|
||||
|
||||
set(WARN_ALL 1 CACHE BOOL "Enable -Wall for Release build")
|
||||
set(BUILD_CLIENT TRUE CACHE BOOL "Build client")
|
||||
set(BUILD_SERVER FALSE CACHE BOOL "Build server")
|
||||
|
||||
|
||||
set(WARN_ALL TRUE CACHE BOOL "Enable -Wall for Release build")
|
||||
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
# Default to release
|
||||
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type: Debug or Release" FORCE)
|
||||
endif()
|
||||
|
||||
|
||||
# Included stuff
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
|
||||
include(${CMAKE_SOURCE_DIR}/cmake/Modules/misc.cmake)
|
||||
|
||||
# This is done here so that relative search paths are more reasnable
|
||||
|
||||
# This is done here so that relative search paths are more reasonable
|
||||
find_package(Irrlicht)
|
||||
|
||||
#
|
||||
|
||||
# Installation
|
||||
#
|
||||
|
||||
if(WIN32)
|
||||
set(DATADIR "data")
|
||||
set(SHAREDIR ".")
|
||||
set(BINDIR "bin")
|
||||
set(DOCDIR "doc")
|
||||
set(EXAMPLE_CONF_DIR ".")
|
||||
set(LOCALEDIR "locale")
|
||||
elseif(APPLE)
|
||||
# random placeholders
|
||||
set(DATADIR "share/${PROJECT_NAME}")
|
||||
set(BINDIR "bin")
|
||||
set(DOCDIR "share/doc/${PROJECT_NAME}")
|
||||
set(EXAMPLE_CONF_DIR ".")
|
||||
set(BUNDLE_NAME ${PROJECT_NAME}.app)
|
||||
set(BUNDLE_PATH "${BUNDLE_NAME}")
|
||||
set(BINDIR ${BUNDLE_NAME}/Contents/MacOS)
|
||||
set(SHAREDIR ${BUNDLE_NAME}/Contents/Resources)
|
||||
set(DOCDIR "${SHAREDIR}/${PROJECT_NAME}")
|
||||
set(EXAMPLE_CONF_DIR ${DOCDIR})
|
||||
set(LOCALEDIR "${SHAREDIR}/locale")
|
||||
elseif(UNIX) # Linux, BSD etc
|
||||
set(DATADIR "share/${PROJECT_NAME}")
|
||||
set(BINDIR "bin")
|
||||
set(DOCDIR "share/doc/${PROJECT_NAME}")
|
||||
set(EXAMPLE_CONF_DIR "share/doc/${PROJECT_NAME}")
|
||||
if(RUN_IN_PLACE)
|
||||
set(SHAREDIR ".")
|
||||
set(BINDIR "bin")
|
||||
set(DOCDIR "doc")
|
||||
set(EXAMPLE_CONF_DIR ".")
|
||||
set(MANDIR "unix/man")
|
||||
set(XDG_APPS_DIR "unix/applications")
|
||||
set(APPDATADIR "unix/appdata")
|
||||
set(ICONDIR "unix/icons")
|
||||
set(LOCALEDIR "locale")
|
||||
else()
|
||||
set(SHAREDIR "${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME}")
|
||||
set(BINDIR "${CMAKE_INSTALL_PREFIX}/bin")
|
||||
set(DOCDIR "${CMAKE_INSTALL_PREFIX}/share/doc/${PROJECT_NAME}")
|
||||
set(MANDIR "${CMAKE_INSTALL_PREFIX}/share/man")
|
||||
set(EXAMPLE_CONF_DIR ${DOCDIR})
|
||||
set(XDG_APPS_DIR "${CMAKE_INSTALL_PREFIX}/share/applications")
|
||||
set(APPDATADIR "${CMAKE_INSTALL_PREFIX}/share/appdata")
|
||||
set(ICONDIR "${CMAKE_INSTALL_PREFIX}/share/icons")
|
||||
set(LOCALEDIR "${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME}/locale")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(CUSTOM_SHAREDIR "" CACHE STRING "Directory to install data files into")
|
||||
if(NOT CUSTOM_SHAREDIR STREQUAL "")
|
||||
set(SHAREDIR "${CUSTOM_SHAREDIR}")
|
||||
message(STATUS "Using SHAREDIR=${SHAREDIR}")
|
||||
endif()
|
||||
|
||||
set(CUSTOM_BINDIR "" CACHE STRING "Directory to install binaries into")
|
||||
if(NOT CUSTOM_BINDIR STREQUAL "")
|
||||
set(BINDIR "${CUSTOM_BINDIR}")
|
||||
message(STATUS "Using BINDIR=${BINDIR}")
|
||||
endif()
|
||||
|
||||
set(CUSTOM_DOCDIR "" CACHE STRING "Directory to install documentation into")
|
||||
if(NOT CUSTOM_DOCDIR STREQUAL "")
|
||||
set(DOCDIR "${CUSTOM_DOCDIR}")
|
||||
message(STATUS "Using DOCDIR=${DOCDIR}")
|
||||
endif()
|
||||
|
||||
set(CUSTOM_MANDIR "" CACHE STRING "Directory to install manpages into")
|
||||
if(NOT CUSTOM_MANDIR STREQUAL "")
|
||||
set(MANDIR "${CUSTOM_MANDIR}")
|
||||
message(STATUS "Using MANDIR=${MANDIR}")
|
||||
endif()
|
||||
|
||||
set(CUSTOM_EXAMPLE_CONF_DIR "" CACHE STRING "Directory to install example config file into")
|
||||
if(NOT CUSTOM_EXAMPLE_CONF_DIR STREQUAL "")
|
||||
set(EXAMPLE_CONF_DIR "${CUSTOM_EXAMPLE_CONF_DIR}")
|
||||
message(STATUS "Using EXAMPLE_CONF_DIR=${EXAMPLE_CONF_DIR}")
|
||||
endif()
|
||||
|
||||
set(CUSTOM_XDG_APPS_DIR "" CACHE STRING "Directory to install .desktop files into")
|
||||
if(NOT CUSTOM_XDG_APPS_DIR STREQUAL "")
|
||||
set(XDG_APPS_DIR "${CUSTOM_XDG_APPS_DIR}")
|
||||
message(STATUS "Using XDG_APPS_DIR=${XDG_APPS_DIR}")
|
||||
endif()
|
||||
|
||||
set(CUSTOM_ICONDIR "" CACHE STRING "Directory to install icons into")
|
||||
if(NOT CUSTOM_ICONDIR STREQUAL "")
|
||||
set(ICONDIR "${CUSTOM_ICONDIR}")
|
||||
message(STATUS "Using ICONDIR=${ICONDIR}")
|
||||
endif()
|
||||
|
||||
set(CUSTOM_LOCALEDIR "" CACHE STRING "Directory to install l10n files into")
|
||||
if(NOT CUSTOM_LOCALEDIR STREQUAL "")
|
||||
set(LOCALEDIR "${CUSTOM_LOCALEDIR}")
|
||||
message(STATUS "Using LOCALEDIR=${LOCALEDIR}")
|
||||
endif()
|
||||
|
||||
|
||||
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/builtin" DESTINATION "${SHAREDIR}")
|
||||
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/client" DESTINATION "${SHAREDIR}")
|
||||
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/games/minimal" DESTINATION "${SHAREDIR}/games")
|
||||
set(MINETEST_GAME_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/games/minetest_game")
|
||||
if(EXISTS ${MINETEST_GAME_SOURCE} AND IS_DIRECTORY ${MINETEST_GAME_SOURCE})
|
||||
install(FILES ${MINETEST_GAME_SOURCE}/game.conf DESTINATION "${SHAREDIR}/games/minetest_game/")
|
||||
install(FILES ${MINETEST_GAME_SOURCE}/README.txt DESTINATION "${SHAREDIR}/games/minetest_game/")
|
||||
install(DIRECTORY ${MINETEST_GAME_SOURCE}/mods DESTINATION "${SHAREDIR}/games/minetest_game")
|
||||
install(DIRECTORY ${MINETEST_GAME_SOURCE}/menu DESTINATION "${SHAREDIR}/games/minetest_game")
|
||||
endif()
|
||||
if(BUILD_CLIENT)
|
||||
#install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/sounds/base/pack" DESTINATION "${SHAREDIR}/sounds/base")
|
||||
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/textures/base/pack" DESTINATION "${SHAREDIR}/textures/base")
|
||||
endif()
|
||||
if(RUN_IN_PLACE)
|
||||
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/mods/mods_here.txt" DESTINATION "${SHAREDIR}/mods")
|
||||
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/textures/texture_packs_here.txt" DESTINATION "${SHAREDIR}/textures")
|
||||
endif()
|
||||
|
||||
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/fonts" DESTINATION "${SHAREDIR}")
|
||||
|
||||
install(FILES "README.txt" DESTINATION "${DOCDIR}")
|
||||
install(FILES "doc/lua_api.txt" DESTINATION "${DOCDIR}")
|
||||
install(FILES "doc/menu_lua_api.txt" DESTINATION "${DOCDIR}")
|
||||
install(FILES "doc/mapformat.txt" DESTINATION "${DOCDIR}")
|
||||
install(FILES "minetest.conf.example" DESTINATION "${EXAMPLE_CONF_DIR}")
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
install(FILES "doc/minetest.6" "doc/minetestserver.6" DESTINATION "${MANDIR}/man6")
|
||||
install(FILES "misc/minetest.desktop" DESTINATION "${XDG_APPS_DIR}")
|
||||
install(FILES "misc/minetest.appdata.xml" DESTINATION "${APPDATADIR}")
|
||||
install(FILES "misc/minetest-icon.svg" DESTINATION "${ICONDIR}/hicolor/scalable/apps")
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
install(FILES "misc/minetest-icon.icns" DESTINATION "${SHAREDIR}")
|
||||
install(FILES "misc/Info.plist" DESTINATION "${BUNDLE_PATH}/Contents")
|
||||
endif()
|
||||
|
||||
install(FILES "doc/README.txt" DESTINATION "${DOCDIR}")
|
||||
install(FILES "doc/changelog.txt" DESTINATION "${DOCDIR}")
|
||||
install(FILES "minetest.conf.example" DESTINATION "${DOCDIR}")
|
||||
|
||||
#
|
||||
# Subdirectories
|
||||
# Be sure to add all relevant definitions above this
|
||||
#
|
||||
|
||||
add_subdirectory(src)
|
||||
|
||||
|
||||
# CPack
|
||||
|
||||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "An InfiniMiner/Minecraft inspired game")
|
||||
@@ -84,32 +203,17 @@ set(CPACK_PACKAGE_VENDOR "celeron55")
|
||||
set(CPACK_PACKAGE_CONTACT "Perttu Ahola <celeron55@gmail.com>")
|
||||
|
||||
if(WIN32)
|
||||
# For some reason these aren't copied otherwise
|
||||
# NOTE: For some reason now it seems to work without these
|
||||
#if(BUILD_CLIENT)
|
||||
# install(FILES bin/minetest.exe DESTINATION bin)
|
||||
#endif()
|
||||
#if(BUILD_SERVER)
|
||||
# install(FILES bin/minetestserver.exe DESTINATION bin)
|
||||
#endif()
|
||||
|
||||
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${VERSION_STRING}-win32")
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${VERSION_STRING}-win64")
|
||||
else()
|
||||
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${VERSION_STRING}-win32")
|
||||
endif()
|
||||
|
||||
set(CPACK_GENERATOR ZIP)
|
||||
|
||||
# This might be needed for some installer
|
||||
#set(CPACK_PACKAGE_EXECUTABLES bin/minetest.exe "Minetest" bin/minetestserver.exe "Minetest Server")
|
||||
elseif(APPLE)
|
||||
# TODO
|
||||
# see http://cmake.org/Wiki/CMake:CPackPackageGenerators#Bundle_.28OSX_only.29
|
||||
#
|
||||
set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY 0)
|
||||
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${VERSION_STRING}-osx")
|
||||
set(CPACK_PACKAGE_ICON "")
|
||||
set(CPACK_BUNDLE_NAME ${PROJECT_NAME})
|
||||
set(CPACK_BUNDLE_ICON "")
|
||||
set(CPACK_BUNDLE_PLIST "")
|
||||
set(CPACK_BUNDLE_STARTUP_COMMAND "Contents/MacOS/${PROJECT_NAME}")
|
||||
set(CPACK_GENERATOR "Bundle")
|
||||
set(CPACK_GENERATOR ZIP)
|
||||
else()
|
||||
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${VERSION_STRING}-linux")
|
||||
set(CPACK_GENERATOR TGZ)
|
||||
@@ -118,3 +222,16 @@ endif()
|
||||
|
||||
include(CPack)
|
||||
|
||||
|
||||
# Add a target to generate API documentation with Doxygen
|
||||
find_package(Doxygen)
|
||||
if(DOXYGEN_FOUND)
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/doc/Doxyfile.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/doc/Doxyfile @ONLY)
|
||||
add_custom_target(doc
|
||||
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/doc/Doxyfile
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc
|
||||
COMMENT "Generating API documentation with Doxygen" VERBATIM
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
396
README.txt
396
README.txt
@@ -1,50 +1,99 @@
|
||||
Minetest-c55
|
||||
---------------
|
||||
An InfiniMiner/Minecraft inspired game.
|
||||
Copyright (c) 2010-2011 Perttu Ahola <celeron55@gmail.com>
|
||||
(see source files for other contributors)
|
||||
Minetest
|
||||
========
|
||||
|
||||
Further documentation:
|
||||
An InfiniMiner/Minecraft inspired game.
|
||||
|
||||
Copyright (c) 2010-2013 Perttu Ahola <celeron55@gmail.com>
|
||||
and contributors (see source file comments and the version control log)
|
||||
|
||||
In case you downloaded the source code:
|
||||
---------------------------------------
|
||||
If you downloaded the Minetest Engine source code in which this file is
|
||||
contained, you probably want to download the minetest_game project too:
|
||||
https://github.com/minetest/minetest_game/
|
||||
See the README.txt in it.
|
||||
|
||||
Further documentation
|
||||
----------------------
|
||||
- Website: http://celeron.55.lt/~celeron55/minetest/
|
||||
- Wiki: http://celeron.55.lt/~celeron55/minetest/wiki/
|
||||
- Forum: http://celeron.55.lt/~celeron55/minetest/forum/
|
||||
- Website: http://minetest.net/
|
||||
- Wiki: http://wiki.minetest.net/
|
||||
- Developer wiki: http://dev.minetest.net/
|
||||
- Forum: http://forum.minetest.net/
|
||||
- Github: https://github.com/minetest/minetest/
|
||||
- doc/ directory of source distribution
|
||||
|
||||
This game is not finished:
|
||||
This game is not finished
|
||||
--------------------------
|
||||
- Don't expect it to work as well as a finished game will.
|
||||
- Please report any bugs to me. debug.txt is useful.
|
||||
- Please report any bugs. When doing that, debug.txt is useful.
|
||||
|
||||
Default Controls
|
||||
-----------------
|
||||
- WASD: move
|
||||
- Space: jump/climb
|
||||
- Shift: sneak/go down
|
||||
- Q: drop itemstack (+ SHIFT for single item)
|
||||
- I: inventory
|
||||
- Mouse: turn/look
|
||||
- Mouse left: dig/punch
|
||||
- Mouse right: place/use
|
||||
- Mouse wheel: select item
|
||||
- T: chat
|
||||
- 1-8: select item
|
||||
|
||||
- Esc: pause menu (pauses only singleplayer game)
|
||||
- R: Enable/Disable full range view
|
||||
- +: Increase view range
|
||||
- -: Decrease view range
|
||||
- K: Enable/Disable fly (needs fly privilege)
|
||||
- J: Enable/Disable fast (needs fast privilege)
|
||||
- H: Enable/Disable noclip (needs noclip privilege)
|
||||
|
||||
- F1: Hide/Show HUD
|
||||
- F2: Hide/Show Chat
|
||||
- F3: Disable/Enable Fog
|
||||
- F4: Disable/Enable Camera update (Mapblocks are not updated anymore when disabled)
|
||||
- F5: Toogle through debug info screens
|
||||
- F6: Toogle through output data
|
||||
- F7: Toggle through camera modes
|
||||
- F10: Show/Hide console
|
||||
- F12: Take screenshot
|
||||
|
||||
Controls:
|
||||
---------
|
||||
- See the in-game pause menu
|
||||
- Settable in the configuration file, see the section below.
|
||||
|
||||
Map directory:
|
||||
--------------
|
||||
- Map is stored in a directory, which can be removed to generate a new map.
|
||||
- There is a command-line option for it: --map-dir
|
||||
- For a RUN_IN_PLACE build, it is located in:
|
||||
../map
|
||||
- Otherwise something like this:
|
||||
Windows: C:\Documents and Settings\user\Application Data\minetest\map
|
||||
Linux: ~/.minetest/map
|
||||
OS X: ~/Library/Application Support/minetest/map
|
||||
Paths
|
||||
------
|
||||
$bin - Compiled binaries
|
||||
$share - Distributed read-only data
|
||||
$user - User-created modifiable data
|
||||
|
||||
Windows .zip / RUN_IN_PLACE source:
|
||||
$bin = bin
|
||||
$share = .
|
||||
$user = .
|
||||
|
||||
Linux installed:
|
||||
$bin = /usr/bin
|
||||
$share = /usr/share/minetest
|
||||
$user = ~/.minetest
|
||||
|
||||
OS X:
|
||||
$bin = Contents/MacOS
|
||||
$share = Contents/Resources
|
||||
$user = Contents/User OR ~/Library/Application Support/minetest
|
||||
|
||||
World directory
|
||||
----------------
|
||||
- Worlds can be found as separate folders in:
|
||||
$user/worlds/
|
||||
|
||||
Configuration file:
|
||||
-------------------
|
||||
- An optional configuration file can be used. See minetest.conf.example.
|
||||
- Path to file can be passed as a parameter to the executable:
|
||||
- Default location:
|
||||
$user/minetest.conf
|
||||
- It is created by Minetest when it is ran the first time.
|
||||
- A specific file can be specified on the command line:
|
||||
--config <path-to-file>
|
||||
- Defaults:
|
||||
- If built with -DRUN_IN_PLACE=1:
|
||||
../minetest.conf
|
||||
../../minetest.conf
|
||||
- Otherwise something like this:
|
||||
Windows: C:\Documents and Settings\user\Application Data\minetest\minetest.conf
|
||||
Linux: ~/.minetest/minetest.conf
|
||||
OS X: ~/Library/Application Support/minetest.conf
|
||||
|
||||
Command-line options:
|
||||
---------------------
|
||||
@@ -54,29 +103,132 @@ Compiling on GNU/Linux:
|
||||
-----------------------
|
||||
|
||||
Install dependencies. Here's an example for Debian/Ubuntu:
|
||||
$ apt-get install build-essential libirrlicht-dev cmake libbz2-dev libpng12-dev libjpeg8-dev libxxf86vm-dev libgl1-mesa-dev
|
||||
$ sudo apt-get install build-essential libirrlicht-dev cmake libbz2-dev libpng12-dev libjpeg-dev libxxf86vm-dev libgl1-mesa-dev libsqlite3-dev libogg-dev libvorbis-dev libopenal-dev libcurl4-gnutls-dev libfreetype6-dev zlib1g-dev libgmp-dev libjsoncpp-dev
|
||||
|
||||
Download source, extract (this is the URL to the latest of source repository, which might not work at all times):
|
||||
$ wget https://bitbucket.org/celeron55/minetest/get/tip.tar.gz
|
||||
$ tar xf tip.tar.gz
|
||||
You can install git for easily keeping your copy up to date.
|
||||
If you dont want git, read below on how to get the source without git.
|
||||
This is an example for installing git on Debian/Ubuntu:
|
||||
$ sudo apt-get install git-core
|
||||
|
||||
Download source (this is the URL to the latest of source repository, which might not work at all times) using git:
|
||||
$ git clone --depth 1 https://github.com/minetest/minetest.git
|
||||
$ cd minetest
|
||||
|
||||
Download minetest_game (otherwise only the "Minimal development test" game is available) using git:
|
||||
$ git clone --depth 1 https://github.com/minetest/minetest_game.git games/minetest_game
|
||||
|
||||
Download source, without using git:
|
||||
$ wget https://github.com/minetest/minetest/archive/master.tar.gz
|
||||
$ tar xf master.tar.gz
|
||||
$ cd minetest-master
|
||||
|
||||
Download minetest_game, without using git:
|
||||
$ cd games/
|
||||
$ wget https://github.com/minetest/minetest_game/archive/master.tar.gz
|
||||
$ tar xf master.tar.gz
|
||||
$ mv minetest_game-master minetest_game
|
||||
$ cd ..
|
||||
|
||||
Build a version that runs directly from the source directory:
|
||||
$ cmake . -DRUN_IN_PLACE=1
|
||||
$ make -j2
|
||||
$ cmake . -DRUN_IN_PLACE=TRUE
|
||||
$ make -j <number of processors>
|
||||
|
||||
Run it:
|
||||
$ cd bin
|
||||
$ ./minetest
|
||||
$ ./bin/minetest
|
||||
|
||||
- Use cmake . -LH to see all CMake options and their current state
|
||||
- If you want to install it system-wide (or are making a distribution package), you will want to use -DRUN_IN_PLACE=0
|
||||
- You can build a bare server or a bare client by specifying -DBUILD_CLIENT=0 or -DBUILD_SERVER=0
|
||||
- If you want to install it system-wide (or are making a distribution package),
|
||||
you will want to use -DRUN_IN_PLACE=FALSE
|
||||
- You can build a bare server by specifying -DBUILD_SERVER=TRUE
|
||||
- You can disable the client build by specifying -DBUILD_CLIENT=FALSE
|
||||
- You can select between Release and Debug build by -DCMAKE_BUILD_TYPE=<Debug or Release>
|
||||
- Note that the Debug build is considerably slower
|
||||
- Debug build is slower, but gives much more useful output in a debugger
|
||||
- If you build a bare server, you don't need to have Irrlicht installed.
|
||||
In that case use -DIRRLICHT_SOURCE_DIR=/the/irrlicht/source
|
||||
|
||||
CMake options
|
||||
-------------
|
||||
General options:
|
||||
|
||||
BUILD_CLIENT - Build Minetest client
|
||||
BUILD_SERVER - Build Minetest server
|
||||
CMAKE_BUILD_TYPE - Type of build (Release vs. Debug)
|
||||
Release - Release build
|
||||
Debug - Debug build
|
||||
SemiDebug - Partially optimized debug build
|
||||
RelWithDebInfo - Release build with Debug information
|
||||
MinSizeRel - Release build with -Os passed to compiler to make executable as small as possible
|
||||
ENABLE_CURL - Build with cURL; Enables use of online mod repo, public serverlist and remote media fetching via http
|
||||
ENABLE_FREETYPE - Build with FreeType2; Allows using TTF fonts
|
||||
ENABLE_GETTEXT - Build with Gettext; Allows using translations
|
||||
ENABLE_GLES - Search for Open GLES headers & libraries and use them
|
||||
ENABLE_LEVELDB - Build with LevelDB; Enables use of LevelDB map backend (faster than SQLite3)
|
||||
ENABLE_REDIS - Build with libhiredis; Enables use of Redis map backend
|
||||
ENABLE_SPATIAL - Build with LibSpatial; Speeds up AreaStores
|
||||
ENABLE_SOUND - Build with OpenAL, libogg & libvorbis; in-game Sounds
|
||||
ENABLE_LUAJIT - Build with LuaJIT (much faster than non-JIT Lua)
|
||||
ENABLE_SYSTEM_GMP - Use GMP from system (much faster than bundled mini-gmp)
|
||||
RUN_IN_PLACE - Create a portable install (worlds, settings etc. in current directory)
|
||||
USE_GPROF - Enable profiling using GProf
|
||||
VERSION_EXTRA - Text to append to version (e.g. VERSION_EXTRA=foobar -> Minetest 0.4.9-foobar)
|
||||
|
||||
Library specific options:
|
||||
|
||||
BZIP2_INCLUDE_DIR - Linux only; directory where bzlib.h is located
|
||||
BZIP2_LIBRARY - Linux only; path to libbz2.a/libbz2.so
|
||||
CURL_DLL - Only if building with cURL on Windows; path to libcurl.dll
|
||||
CURL_INCLUDE_DIR - Only if building with cURL; directory where curl.h is located
|
||||
CURL_LIBRARY - Only if building with cURL; path to libcurl.a/libcurl.so/libcurl.lib
|
||||
EGL_INCLUDE_DIR - Only if building with GLES; directory that contains egl.h
|
||||
EGL_LIBRARY - Only if building with GLES; path to libEGL.a/libEGL.so
|
||||
FREETYPE_INCLUDE_DIR_freetype2 - Only if building with Freetype2; directory that contains an freetype directory with files such as ftimage.h in it
|
||||
FREETYPE_INCLUDE_DIR_ft2build - Only if building with Freetype2; directory that contains ft2build.h
|
||||
FREETYPE_LIBRARY - Only if building with Freetype2; path to libfreetype.a/libfreetype.so/freetype.lib
|
||||
FREETYPE_DLL - Only if building with Freetype2 on Windows; path to libfreetype.dll
|
||||
GETTEXT_DLL - Only when building with Gettext on Windows; path to libintl3.dll
|
||||
GETTEXT_ICONV_DLL - Only when building with Gettext on Windows; path to libiconv2.dll
|
||||
GETTEXT_INCLUDE_DIR - Only when building with Gettext; directory that contains iconv.h
|
||||
GETTEXT_LIBRARY - Only when building with Gettext on Windows; path to libintl.dll.a
|
||||
GETTEXT_MSGFMT - Only when building with Gettext; path to msgfmt/msgfmt.exe
|
||||
IRRLICHT_DLL - Only on Windows; path to Irrlicht.dll
|
||||
IRRLICHT_INCLUDE_DIR - Directory that contains IrrCompileConfig.h
|
||||
IRRLICHT_LIBRARY - Path to libIrrlicht.a/libIrrlicht.so/libIrrlicht.dll.a/Irrlicht.lib
|
||||
LEVELDB_INCLUDE_DIR - Only when building with LevelDB; directory that contains db.h
|
||||
LEVELDB_LIBRARY - Only when building with LevelDB; path to libleveldb.a/libleveldb.so/libleveldb.dll.a
|
||||
LEVELDB_DLL - Only when building with LevelDB on Windows; path to libleveldb.dll
|
||||
REDIS_INCLUDE_DIR - Only when building with Redis; directory that contains hiredis.h
|
||||
REDIS_LIBRARY - Only when building with Redis; path to libhiredis.a/libhiredis.so
|
||||
SPATIAL_INCLUDE_DIR - Only when building with LibSpatial; directory that contains spatialindex/SpatialIndex.h
|
||||
SPATIAL_LIBRARY - Only when building with LibSpatial; path to libspatialindex_c.so/spatialindex-32.lib
|
||||
LUA_INCLUDE_DIR - Only if you want to use LuaJIT; directory where luajit.h is located
|
||||
LUA_LIBRARY - Only if you want to use LuaJIT; path to libluajit.a/libluajit.so
|
||||
MINGWM10_DLL - Only if compiling with MinGW; path to mingwm10.dll
|
||||
OGG_DLL - Only if building with sound on Windows; path to libogg.dll
|
||||
OGG_INCLUDE_DIR - Only if building with sound; directory that contains an ogg directory which contains ogg.h
|
||||
OGG_LIBRARY - Only if building with sound; path to libogg.a/libogg.so/libogg.dll.a
|
||||
OPENAL_DLL - Only if building with sound on Windows; path to OpenAL32.dll
|
||||
OPENAL_INCLUDE_DIR - Only if building with sound; directory where al.h is located
|
||||
OPENAL_LIBRARY - Only if building with sound; path to libopenal.a/libopenal.so/OpenAL32.lib
|
||||
OPENGLES2_INCLUDE_DIR - Only if building with GLES; directory that contains gl2.h
|
||||
OPENGLES2_LIBRARY - Only if building with GLES; path to libGLESv2.a/libGLESv2.so
|
||||
SQLITE3_INCLUDE_DIR - Directory that contains sqlite3.h
|
||||
SQLITE3_LIBRARY - Path to libsqlite3.a/libsqlite3.so/sqlite3.lib
|
||||
VORBISFILE_DLL - Only if building with sound on Windows; path to libvorbisfile-3.dll
|
||||
VORBISFILE_LIBRARY - Only if building with sound; path to libvorbisfile.a/libvorbisfile.so/libvorbisfile.dll.a
|
||||
VORBIS_DLL - Only if building with sound on Windows; path to libvorbis-0.dll
|
||||
VORBIS_INCLUDE_DIR - Only if building with sound; directory that contains a directory vorbis with vorbisenc.h inside
|
||||
VORBIS_LIBRARY - Only if building with sound; path to libvorbis.a/libvorbis.so/libvorbis.dll.a
|
||||
XXF86VM_LIBRARY - Only on Linux; path to libXXf86vm.a/libXXf86vm.so
|
||||
ZLIB_DLL - Only on Windows; path to zlib1.dll
|
||||
ZLIBWAPI_DLL - Only on Windows; path to zlibwapi.dll
|
||||
ZLIB_INCLUDE_DIR - Directory that contains zlib.h
|
||||
ZLIB_LIBRARY - Path to libz.a/libz.so/zlibwapi.lib
|
||||
|
||||
Compiling on Windows:
|
||||
---------------------
|
||||
- This section is outdated. In addition to what is described here:
|
||||
- In addition to minetest, you need to download minetest_game.
|
||||
- If you wish to have sound support, you need libogg, libvorbis and libopenal
|
||||
|
||||
- You need:
|
||||
* CMake:
|
||||
@@ -90,16 +242,19 @@ Compiling on Windows:
|
||||
http://www.winimage.com/zLibDll/index.html
|
||||
* Zlib library (zlibwapi.lib and zlibwapi.dll from zlib125dll.zip):
|
||||
http://www.winimage.com/zLibDll/index.html
|
||||
* gettext bibrary and tools:
|
||||
* Optional: gettext library and tools:
|
||||
http://gnuwin32.sourceforge.net/downlinks/gettext.php
|
||||
* And, of course, Minetest-c55:
|
||||
http://celeron.55.lt/~celeron55/minetest/download
|
||||
- This is used for other UI languages. Feel free to leave it out.
|
||||
* And, of course, Minetest:
|
||||
http://minetest.net/download
|
||||
- Steps:
|
||||
- Select a directory called DIR hereafter in which you will operate.
|
||||
- Make sure you have CMake and a compiler installed.
|
||||
- Download all the other stuff to DIR and extract them into there. All those
|
||||
packages contain a nice base directory in them, which should end up being
|
||||
the direct subdirectories of DIR.
|
||||
- Download all the other stuff to DIR and extract them into there.
|
||||
("extract here", not "extract to packagename/")
|
||||
NOTE: zlib125dll.zip needs to be extracted into zlib125dll
|
||||
- All those packages contain a nice base directory in them, which
|
||||
should end up being the direct subdirectories of DIR.
|
||||
- You will end up with a directory structure like this (+=dir, -=file):
|
||||
-----------------
|
||||
+ DIR
|
||||
@@ -119,7 +274,7 @@ Compiling on Windows:
|
||||
+ lib
|
||||
+ include
|
||||
...
|
||||
+ gettext
|
||||
+ gettext (optional)
|
||||
+bin
|
||||
+include
|
||||
+lib
|
||||
@@ -157,11 +312,14 @@ Compiling on Windows:
|
||||
GETTEXT_MSGFMT DIR/gettext/bin/msgfmt
|
||||
-----------------
|
||||
- Hit "Configure"
|
||||
- Hit "Configure" once again 8)
|
||||
- If something is still coloured red, you have a problem.
|
||||
- Hit "Generate"
|
||||
If using MSVC:
|
||||
- Open the generated minetest.sln
|
||||
- The project defaults to the "Debug" configuration. Make very sure to
|
||||
select "Release", unless you want to debug some stuff (it's slower)
|
||||
select "Release", unless you want to debug some stuff (it's slower
|
||||
and might not even work at all)
|
||||
- Build the ALL_BUILD project
|
||||
- Build the INSTALL project
|
||||
- You should now have a working game with the executable in
|
||||
@@ -171,26 +329,78 @@ Compiling on Windows:
|
||||
If using MinGW:
|
||||
- Using the command line, browse to the build directory and run 'make'
|
||||
(or mingw32-make or whatever it happens to be)
|
||||
- You may need to copy some of the downloaded DLLs into bin/, see what
|
||||
running the produced executable tells you it doesn't have.
|
||||
- You should now have a working game with the executable in
|
||||
DIR/minetest/bin/minetest.exe
|
||||
|
||||
License of Minetest-c55
|
||||
-----------------------
|
||||
Windows releases of minetest are built using a bat script like this:
|
||||
--------------------------------------------------------------------
|
||||
|
||||
Minetest-c55
|
||||
Copyright (C) 2010-2011 celeron55, Perttu Ahola <celeron55@gmail.com>
|
||||
set sourcedir=%CD%
|
||||
set installpath="C:\tmp\minetest_install"
|
||||
set irrlichtpath="C:\tmp\irrlicht-1.7.2"
|
||||
|
||||
set builddir=%sourcedir%\bvc10
|
||||
mkdir %builddir%
|
||||
pushd %builddir%
|
||||
cmake %sourcedir% -G "Visual Studio 10" -DIRRLICHT_SOURCE_DIR=%irrlichtpath% -DRUN_IN_PLACE=TRUE -DCMAKE_INSTALL_PREFIX=%installpath%
|
||||
if %errorlevel% neq 0 goto fail
|
||||
"C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" ALL_BUILD.vcxproj /p:Configuration=Release
|
||||
if %errorlevel% neq 0 goto fail
|
||||
"C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" INSTALL.vcxproj /p:Configuration=Release
|
||||
if %errorlevel% neq 0 goto fail
|
||||
"C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" PACKAGE.vcxproj /p:Configuration=Release
|
||||
if %errorlevel% neq 0 goto fail
|
||||
popd
|
||||
echo Finished.
|
||||
exit /b 0
|
||||
|
||||
:fail
|
||||
popd
|
||||
echo Failed.
|
||||
exit /b 1
|
||||
|
||||
License of Minetest textures and sounds
|
||||
---------------------------------------
|
||||
|
||||
This applies to textures and sounds contained in the main Minetest
|
||||
distribution.
|
||||
|
||||
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
|
||||
http://creativecommons.org/licenses/by-sa/3.0/
|
||||
|
||||
Authors of media files
|
||||
-----------------------
|
||||
Everything not listed in here:
|
||||
Copyright (C) 2010-2012 celeron55, Perttu Ahola <celeron55@gmail.com>
|
||||
|
||||
BlockMen:
|
||||
textures/base/pack/menuheader.png
|
||||
|
||||
erlehmann:
|
||||
misc/minetest-icon-24x24.png
|
||||
misc/minetest-icon.ico
|
||||
misc/minetest-icon.svg
|
||||
textures/base/pack/logo.png
|
||||
|
||||
License of Minetest source code
|
||||
-------------------------------
|
||||
|
||||
Minetest
|
||||
Copyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 2.1 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
You should have received a copy of the GNU Lesser General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
@@ -246,4 +456,68 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
IN THE SOFTWARE.
|
||||
|
||||
Lua
|
||||
---------------
|
||||
|
||||
Lua is licensed under the terms of the MIT license reproduced below.
|
||||
This means that Lua is free software and can be used for both academic
|
||||
and commercial purposes at absolutely no cost.
|
||||
|
||||
For details and rationale, see http://www.lua.org/license.html .
|
||||
|
||||
Copyright (C) 1994-2008 Lua.org, PUC-Rio.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
Fonts
|
||||
---------------
|
||||
|
||||
DejaVu Sans Mono:
|
||||
|
||||
Fonts are (c) Bitstream (see below). DejaVu changes are in public domain.
|
||||
Glyphs imported from Arev fonts are (c) Tavmjong Bah (see below)
|
||||
|
||||
Bitstream Vera Fonts Copyright:
|
||||
|
||||
Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is
|
||||
a trademark of Bitstream, Inc.
|
||||
|
||||
Arev Fonts Copyright:
|
||||
|
||||
Copyright (c) 2006 by Tavmjong Bah. All Rights Reserved.
|
||||
|
||||
Liberation Fonts Copyright:
|
||||
|
||||
Copyright (c) 2007 Red Hat, Inc. All rights reserved. LIBERATION is a trademark of Red Hat, Inc.
|
||||
|
||||
DroidSansFallback:
|
||||
|
||||
Copyright (C) 2008 The Android Open Source Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
35
build/android/AndroidManifest.xml.template
Normal file
35
build/android/AndroidManifest.xml.template
Normal file
@@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="net.minetest.minetest"
|
||||
android:versionCode="###ANDROID_VERSION###"
|
||||
android:versionName="###BASE_VERSION###.###ANDROID_VERSION###"
|
||||
android:installLocation="auto">
|
||||
<uses-sdk android:minSdkVersion="9"/>
|
||||
<uses-feature android:glEsVersion="0x00010000" android:required="true"/>
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
###DEBUG_BUILD###
|
||||
<application android:icon="@drawable/irr_icon" android:label="Minetest" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" ###DEBUG_FLAG###>
|
||||
<activity android:name=".MtNativeActivity"
|
||||
android:label="Minetest"
|
||||
android:launchMode="singleTask"
|
||||
android:configChanges="orientation|keyboard|keyboardHidden|navigation"
|
||||
android:screenOrientation="sensorLandscape"
|
||||
android:clearTaskOnLaunch="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
<meta-data android:name="android.app.lib_name" android:value="minetest" />
|
||||
</activity>
|
||||
<activity android:name=".MinetestTextEntry"
|
||||
android:theme="@style/Theme.Transparent"
|
||||
android:excludeFromRecents="true">
|
||||
</activity>
|
||||
<activity android:name=".MinetestAssetCopy"
|
||||
android:theme="@style/Theme.Transparent"
|
||||
android:excludeFromRecents="true">
|
||||
</activity>
|
||||
</application>
|
||||
</manifest>
|
||||
887
build/android/Makefile
Normal file
887
build/android/Makefile
Normal file
@@ -0,0 +1,887 @@
|
||||
# build options
|
||||
|
||||
OS := $(shell uname)
|
||||
|
||||
# compile with GPROF
|
||||
# GPROF = 1
|
||||
|
||||
# build for build platform
|
||||
APP_PLATFORM = android-9
|
||||
|
||||
# paths used for timestaps, dependencys, tree config and libs
|
||||
PATHCFGFILE = path.cfg
|
||||
|
||||
ROOT = $(shell pwd)
|
||||
|
||||
GAMES_TO_COPY = minetest_game
|
||||
|
||||
|
||||
VERSION_MAJOR := $(shell cat $(ROOT)/../../CMakeLists.txt | \
|
||||
grep ^set\(VERSION_MAJOR\ | sed 's/)/ /' | cut -f2 -d' ')
|
||||
VERSION_MINOR := $(shell cat $(ROOT)/../../CMakeLists.txt | \
|
||||
grep ^set\(VERSION_MINOR\ | sed 's/)/ /' | cut -f2 -d' ')
|
||||
VERSION_PATCH := $(shell cat $(ROOT)/../../CMakeLists.txt | \
|
||||
grep ^set\(VERSION_PATCH\ | sed 's/)/ /' | cut -f2 -d' ')
|
||||
|
||||
################################################################################
|
||||
# Android Version code
|
||||
# Increase for each build!
|
||||
################################################################################
|
||||
# Play Store actual version (16/03/15): 11
|
||||
ANDROID_VERSION_CODE = 13
|
||||
|
||||
################################################################################
|
||||
# toolchain config for arm old processors
|
||||
################################################################################
|
||||
#TARGET_HOST = arm-linux
|
||||
#TARGET_ABI = armeabi
|
||||
#TARGET_LIBDIR = armeabi
|
||||
#TARGET_TOOLCHAIN = arm-linux-androideabi-
|
||||
#TARGET_CFLAGS_ADDON = -mfloat-abi=softfp -mfpu=vfp
|
||||
#TARGET_ARCH = arm
|
||||
#CROSS_PREFIX = arm-linux-androideabi-
|
||||
#COMPILER_VERSION = 4.8
|
||||
#HAVE_LEVELDB = 1
|
||||
|
||||
################################################################################
|
||||
# toolchain config for arm new processors
|
||||
################################################################################
|
||||
TARGET_HOST = arm-linux
|
||||
TARGET_ABI = armeabi-v7a
|
||||
TARGET_LIBDIR = armeabi-v7a
|
||||
TARGET_TOOLCHAIN = arm-linux-androideabi-
|
||||
TARGET_CFLAGS_ADDON = -mfloat-abi=softfp -mfpu=vfpv3
|
||||
TARGET_CXXFLAGS_ADDON = $(TARGET_CFLAGS_ADDON)
|
||||
TARGET_ARCH = armv7
|
||||
CROSS_PREFIX = arm-linux-androideabi-
|
||||
COMPILER_VERSION = 4.8
|
||||
HAVE_LEVELDB = 1
|
||||
|
||||
################################################################################
|
||||
# toolchain config for little endian mips
|
||||
################################################################################
|
||||
#TARGET_HOST = mipsel-linux
|
||||
#TARGET_ABI = mips
|
||||
#TARGET_LIBDIR = mips
|
||||
#TARGET_TOOLCHAIN = mipsel-linux-android-
|
||||
#TARGET_ARCH = mips32
|
||||
#CROSS_PREFIX = mipsel-linux-android-
|
||||
#COMPILER_VERSION = 4.8
|
||||
#HAVE_LEVELDB = 0
|
||||
|
||||
################################################################################
|
||||
# toolchain config for x86
|
||||
################################################################################
|
||||
#TARGET_HOST = x86-linux
|
||||
#TARGET_ABI = x86
|
||||
#TARGET_LIBDIR = x86
|
||||
#TARGET_TOOLCHAIN = x86-
|
||||
#CROSS_PREFIX = i686-linux-android-
|
||||
#TARGET_ARCH = x86
|
||||
#COMPILER_VERSION = 4.8
|
||||
#HAVE_LEVELDB = 1
|
||||
|
||||
################################################################################
|
||||
ASSETS_TIMESTAMP = deps/assets_timestamp
|
||||
|
||||
LEVELDB_DIR = $(ROOT)/deps/leveldb/
|
||||
LEVELDB_LIB = $(LEVELDB_DIR)libleveldb.a
|
||||
LEVELDB_TIMESTAMP = $(LEVELDB_DIR)/timestamp
|
||||
LEVELDB_TIMESTAMP_INT = $(ROOT)/deps/leveldb_timestamp
|
||||
LEVELDB_URL_GIT = https://code.google.com/p/leveldb/
|
||||
|
||||
OPENAL_DIR = $(ROOT)/deps/openal-soft/
|
||||
OPENAL_LIB = $(OPENAL_DIR)libs/$(TARGET_ABI)/libopenal.so
|
||||
OPENAL_TIMESTAMP = $(OPENAL_DIR)/timestamp
|
||||
OPENAL_TIMESTAMP_INT = $(ROOT)/deps/openal_timestamp
|
||||
OPENAL_URL_GIT = https://github.com/apportable/openal-soft
|
||||
|
||||
OGG_DIR = $(ROOT)/deps/libvorbis-libogg-android/
|
||||
OGG_LIB = $(OGG_DIR)libs/$(TARGET_ABI)/libogg.so
|
||||
VORBIS_LIB = $(OGG_DIR)libs/$(TARGET_ABI)/libogg.so
|
||||
OGG_TIMESTAMP = $(OGG_DIR)timestamp
|
||||
OGG_TIMESTAMP_INT = $(ROOT)/deps/ogg_timestamp
|
||||
OGG_URL_GIT = https://github.com/vincentjames501/libvorbis-libogg-android
|
||||
|
||||
IRRLICHT_DIR = $(ROOT)/deps/irrlicht/
|
||||
IRRLICHT_LIB = $(IRRLICHT_DIR)lib/Android/libIrrlicht.a
|
||||
IRRLICHT_TIMESTAMP = $(IRRLICHT_DIR)timestamp
|
||||
IRRLICHT_TIMESTAMP_INT = $(ROOT)/deps/irrlicht_timestamp
|
||||
IRRLICHT_URL_SVN = http://svn.code.sf.net/p/irrlicht/code/branches/ogl-es/
|
||||
|
||||
OPENSSL_VERSION = 1.0.1l
|
||||
OPENSSL_BASEDIR = openssl-$(OPENSSL_VERSION)
|
||||
OPENSSL_DIR = $(ROOT)/deps/$(OPENSSL_BASEDIR)/
|
||||
OPENSSL_LIB = $(OPENSSL_DIR)/libssl.so.1.0.0
|
||||
OPENSSL_TIMESTAMP = $(OPENSSL_DIR)timestamp
|
||||
OPENSSL_TIMESTAMP_INT = $(ROOT)/deps/openssl_timestamp
|
||||
OPENSSL_URL = http://www.openssl.org/source/openssl-$(OPENSSL_VERSION).tar.gz
|
||||
|
||||
CURL_VERSION = 7.41.0
|
||||
CURL_DIR = $(ROOT)/deps/curl-$(CURL_VERSION)
|
||||
CURL_LIB = $(CURL_DIR)/lib/.libs/libcurl.a
|
||||
CURL_TIMESTAMP = $(CURL_DIR)/timestamp
|
||||
CURL_TIMESTAMP_INT = $(ROOT)/deps/curl_timestamp
|
||||
CURL_URL_HTTP = http://curl.haxx.se/download/curl-${CURL_VERSION}.tar.bz2
|
||||
|
||||
GMP_VERSION = 6.0.0
|
||||
GMP_DIR = $(ROOT)/deps/gmp-$(GMP_VERSION)
|
||||
GMP_LIB = $(GMP_DIR)/usr/lib/libgmp.so
|
||||
GMP_TIMESTAMP = $(GMP_DIR)/timestamp
|
||||
GMP_TIMESTAMP_INT = $(ROOT)/deps/gmp_timestamp
|
||||
GMP_URL_HTTP = https://gmplib.org/download/gmp/gmp-$(GMP_VERSION).tar.bz2
|
||||
|
||||
FREETYPE_DIR = $(ROOT)/deps/freetype2-android/
|
||||
FREETYPE_LIB = $(FREETYPE_DIR)/Android/obj/local/$(TARGET_ABI)/libfreetype2-static.a
|
||||
FREETYPE_TIMESTAMP = $(FREETYPE_DIR)timestamp
|
||||
FREETYPE_TIMESTAMP_INT = $(ROOT)/deps/freetype_timestamp
|
||||
FREETYPE_URL_GIT = https://github.com/cdave1/freetype2-android
|
||||
|
||||
ICONV_VERSION = 1.14
|
||||
ICONV_DIR = $(ROOT)/deps/libiconv/
|
||||
ICONV_LIB = $(ICONV_DIR)/lib/.libs/libiconv.so
|
||||
ICONV_TIMESTAMP = $(ICONV_DIR)timestamp
|
||||
ICONV_TIMESTAMP_INT = $(ROOT)/deps/iconv_timestamp
|
||||
ICONV_URL_HTTP = http://ftp.gnu.org/pub/gnu/libiconv/libiconv-$(ICONV_VERSION).tar.gz
|
||||
|
||||
SQLITE3_FOLDER = sqlite-amalgamation-3080704
|
||||
SQLITE3_URL = http://www.sqlite.org/2014/$(SQLITE3_FOLDER).zip
|
||||
|
||||
-include $(PATHCFGFILE)
|
||||
|
||||
#use interim target variable to switch leveldb on or off
|
||||
ifeq ($(HAVE_LEVELDB),1)
|
||||
LEVELDB_TARGET = $(LEVELDB_LIB)
|
||||
endif
|
||||
|
||||
.PHONY : debug release reconfig delconfig \
|
||||
leveldb_download clean_leveldb leveldb\
|
||||
irrlicht_download clean_irrlicht irrlicht \
|
||||
clean_assets assets sqlite3_download \
|
||||
freetype_download clean_freetype freetype \
|
||||
apk clean_apk \
|
||||
clean_all clean prep_srcdir \
|
||||
install_debug install envpaths all \
|
||||
manifest clean_manifest\
|
||||
$(ASSETS_TIMESTAMP) $(LEVELDB_TIMESTAMP) \
|
||||
$(OPENAL_TIMESTAMP) $(OGG_TIMESTAMP) \
|
||||
$(IRRLICHT_TIMESTAMP) $(CURL_TIMESTAMP) \
|
||||
$(OPENSSL_TIMESTAMP) curl_binary \
|
||||
$(ROOT)/jni/src/android_version.h \
|
||||
$(ROOT)/jni/src/android_version_githash.h
|
||||
|
||||
debug : $(PATHCFGFILE)
|
||||
export NDEBUG=; \
|
||||
export BUILD_TYPE=debug; \
|
||||
$(MAKE) apk
|
||||
|
||||
all : debug release
|
||||
|
||||
release : $(PATHCFGFILE)
|
||||
@export NDEBUG=1; \
|
||||
export BUILD_TYPE=release; \
|
||||
$(MAKE) apk
|
||||
|
||||
reconfig: delconfig
|
||||
@$(MAKE) $(PATHCFGFILE)
|
||||
|
||||
delconfig :
|
||||
$(RM) ${PATHCFGFILE}
|
||||
|
||||
$(PATHCFGFILE) :
|
||||
@echo "Please specify path of ANDROID NDK"; \
|
||||
echo "e.g. /home/user/android-ndk-r9c/"; \
|
||||
read ANDROID_NDK ; \
|
||||
if [ ! -d $$ANDROID_NDK ] ; then \
|
||||
echo "$$ANDROID_NDK is not a valid folder"; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
echo "ANDROID_NDK = $$ANDROID_NDK" > ${PATHCFGFILE}; \
|
||||
echo "NDK_MODULE_PATH = $$ANDROID_NDK/toolchains" >> ${PATHCFGFILE}; \
|
||||
echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++";\
|
||||
echo "+ Note: NDK_MODULE_PATH is set to $$ANDROID_NDK/toolchains"; \
|
||||
echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++";\
|
||||
echo "Please specify path of ANDROID SDK"; \
|
||||
echo "e.g. /home/user/adt-bundle-linux-x86_64-20131030/sdk/"; \
|
||||
read SDKFLDR ; \
|
||||
if [ ! -d $$SDKFLDR ] ; then \
|
||||
echo "$$SDKFLDR is not a valid folder"; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
echo "SDKFOLDER = $$SDKFLDR" >> ${PATHCFGFILE};
|
||||
|
||||
$(OPENAL_TIMESTAMP) : openal_download
|
||||
@LAST_MODIF=$$(find ${OPENAL_DIR} -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" "); \
|
||||
if [ $$(basename $$LAST_MODIF) != "timestamp" ] ; then \
|
||||
touch ${OPENAL_TIMESTAMP}; \
|
||||
fi
|
||||
|
||||
openal_download :
|
||||
@if [ ! -d ${OPENAL_DIR} ] ; then \
|
||||
echo "openal sources missing, downloading..."; \
|
||||
mkdir -p ${ROOT}/deps; \
|
||||
cd ${ROOT}/deps ; \
|
||||
git clone ${OPENAL_URL_GIT} || exit 1; \
|
||||
fi
|
||||
|
||||
openal : $(OPENAL_LIB)
|
||||
|
||||
$(OPENAL_LIB): $(OPENAL_TIMESTAMP)
|
||||
@REFRESH=0; \
|
||||
if [ ! -e ${OPENAL_TIMESTAMP_INT} ] ; then \
|
||||
REFRESH=1; \
|
||||
fi; \
|
||||
if [ ${OPENAL_TIMESTAMP} -nt ${OPENAL_TIMESTAMP_INT} ] ; then \
|
||||
REFRESH=1; \
|
||||
fi; \
|
||||
if [ $$REFRESH -ne 0 ] ; then \
|
||||
export PATH=$$PATH:${SDKFOLDER}/platform-tools:${ANDROID_NDK}; \
|
||||
echo "changed timestamp for openal detected building..."; \
|
||||
cd ${OPENAL_DIR}; \
|
||||
ndk-build NDEBUG=${NDEBUG} NDK_MODULE_PATH=${NDK_MODULE_PATH} \
|
||||
APP_ABI=${TARGET_ABI} TARGET_ARCH_ABI=${TARGET_ABI} \
|
||||
APP_PLATFORM=${APP_PLATFORM} TARGET_CFLAGS+="${TARGET_CFLAGS_ADDON}" \
|
||||
TARGET_LDFLAGS+="${TARGET_LDFLAGS_ADDON}" \
|
||||
TARGET_CXXFLAGS+="${TARGET_CXXFLAGS_ADDON}" || exit 1; \
|
||||
touch ${OPENAL_TIMESTAMP}; \
|
||||
touch ${OPENAL_TIMESTAMP_INT}; \
|
||||
else \
|
||||
echo "nothing to be done for openal"; \
|
||||
fi
|
||||
|
||||
clean_openal :
|
||||
$(RM) -rf ${OPENAL_DIR}
|
||||
|
||||
$(OGG_TIMESTAMP) : ogg_download
|
||||
@LAST_MODIF=$$(find ${OGG_DIR} -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" "); \
|
||||
if [ $$(basename $$LAST_MODIF) != "timestamp" ] ; then \
|
||||
touch ${OGG_TIMESTAMP}; \
|
||||
fi
|
||||
|
||||
ogg_download :
|
||||
@if [ ! -d ${OGG_DIR} ] ; then \
|
||||
echo "ogg sources missing, downloading..."; \
|
||||
mkdir -p ${ROOT}/deps; \
|
||||
cd ${ROOT}/deps ; \
|
||||
git clone ${OGG_URL_GIT}|| exit 1; \
|
||||
cd libvorbis-libogg-android ; \
|
||||
patch -p1 < ../../libvorbis-libogg-fpu.patch || exit 1; \
|
||||
sed -i 's-:-?-' jni/Application.mk; \
|
||||
fi
|
||||
|
||||
ogg : $(OGG_LIB)
|
||||
|
||||
$(OGG_LIB): $(OGG_TIMESTAMP)
|
||||
@REFRESH=0; \
|
||||
if [ ! -e ${OGG_TIMESTAMP_INT} ] ; then \
|
||||
echo "${OGG_TIMESTAMP_INT} doesn't exist"; \
|
||||
REFRESH=1; \
|
||||
fi; \
|
||||
if [ ${OGG_TIMESTAMP} -nt ${OGG_TIMESTAMP_INT} ] ; then \
|
||||
REFRESH=1; \
|
||||
fi; \
|
||||
if [ $$REFRESH -ne 0 ] ; then \
|
||||
export PATH=$$PATH:${SDKFOLDER}/platform-tools:${ANDROID_NDK}; \
|
||||
echo "changed timestamp for ogg detected building..."; \
|
||||
cd ${OGG_DIR}; \
|
||||
ndk-build NDEBUG=${NDEBUG} NDK_MODULE_PATH=${NDK_MODULE_PATH} \
|
||||
APP_ABI=${TARGET_ABI} APP_PLATFORM=${APP_PLATFORM} \
|
||||
TARGET_CFLAGS+="${TARGET_CFLAGS_ADDON}" \
|
||||
TARGET_LDFLAGS+="${TARGET_LDFLAGS_ADDON}" \
|
||||
TARGET_CXXFLAGS+="${TARGET_CXXFLAGS_ADDON}" || exit 1; \
|
||||
touch ${OGG_TIMESTAMP}; \
|
||||
touch ${OGG_TIMESTAMP_INT}; \
|
||||
else \
|
||||
echo "nothing to be done for libogg/libvorbis"; \
|
||||
fi
|
||||
|
||||
clean_ogg :
|
||||
$(RM) -rf ${OGG_DIR}
|
||||
|
||||
$(OPENSSL_TIMESTAMP) : openssl_download
|
||||
@LAST_MODIF=$$(find ${OPENSSL_DIR} -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" "); \
|
||||
if [ $$(basename $$LAST_MODIF) != "timestamp" ] ; then \
|
||||
touch ${OPENSSL_TIMESTAMP}; \
|
||||
fi
|
||||
|
||||
openssl_download :
|
||||
@if [ ! -d ${OPENSSL_DIR} ] ; then \
|
||||
echo "openssl sources missing, downloading..."; \
|
||||
mkdir -p ${ROOT}/deps; \
|
||||
cd ${ROOT}/deps ; \
|
||||
wget ${OPENSSL_URL} || exit 1; \
|
||||
tar -xzf ${OPENSSL_BASEDIR}.tar.gz; \
|
||||
cd ${OPENSSL_BASEDIR}; \
|
||||
patch -p1 < ../../openssl_arch.patch; \
|
||||
fi
|
||||
|
||||
openssl : $(OPENSSL_LIB)
|
||||
|
||||
$(OPENSSL_LIB): $(OPENSSL_TIMESTAMP)
|
||||
@REFRESH=0; \
|
||||
if [ ! -e ${OPENSSL_TIMESTAMP_INT} ] ; then \
|
||||
echo "${OPENSSL_TIMESTAMP_INT} doesn't exist"; \
|
||||
REFRESH=1; \
|
||||
fi; \
|
||||
if [ ${OPENSSL_TIMESTAMP} -nt ${OPENSSL_TIMESTAMP_INT} ] ; then \
|
||||
REFRESH=1; \
|
||||
fi; \
|
||||
if [ $$REFRESH -ne 0 ] ; then \
|
||||
echo "changed timestamp for openssl detected building..."; \
|
||||
cd ${OPENSSL_DIR}; \
|
||||
ln -s ${OPENSSL_DIR} ../openssl; \
|
||||
export TOOLCHAIN=/tmp/ndk-${TARGET_HOST}-openssl; \
|
||||
${ANDROID_NDK}/build/tools/make-standalone-toolchain.sh \
|
||||
--toolchain=${TARGET_TOOLCHAIN}${COMPILER_VERSION} \
|
||||
--install-dir=$${TOOLCHAIN}; \
|
||||
export PATH="$${TOOLCHAIN}/bin:$${PATH}"; \
|
||||
CC=${CROSS_PREFIX}gcc ./Configure android-${TARGET_ARCH} no-idea no-seed -no-sha0 -DL_ENDIAN;\
|
||||
CC=${CROSS_PREFIX}gcc ANDROID_DEV=/tmp/ndk-${TARGET_HOST} make build_libs; \
|
||||
touch ${OPENSSL_TIMESTAMP}; \
|
||||
touch ${OPENSSL_TIMESTAMP_INT}; \
|
||||
$(RM) -rf $${TOOLCHAIN}; \
|
||||
else \
|
||||
echo "nothing to be done for openssl"; \
|
||||
fi
|
||||
|
||||
clean_openssl :
|
||||
$(RM) -rf ${OPENSSL_DIR}; \
|
||||
$(RM) -rf $(ROOT)/deps/${OPENSSL_BASEDIR}.tar.gz; \
|
||||
$(RM) -rf $(ROOT)/deps/openssl
|
||||
|
||||
$(LEVELDB_TIMESTAMP) : leveldb_download
|
||||
@LAST_MODIF=$$(find ${LEVELDB_DIR} -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" "); \
|
||||
if [ $$(basename $$LAST_MODIF) != "timestamp" ] ; then \
|
||||
touch ${LEVELDB_TIMESTAMP}; \
|
||||
fi
|
||||
|
||||
leveldb_download :
|
||||
@if [ ! -d ${LEVELDB_DIR} ] ; then \
|
||||
echo "leveldb sources missing, downloading..."; \
|
||||
mkdir -p ${ROOT}/deps; \
|
||||
cd ${ROOT}/deps ; \
|
||||
git clone ${LEVELDB_URL_GIT} || exit 1; \
|
||||
fi
|
||||
|
||||
leveldb : $(LEVELDB_LIB)
|
||||
|
||||
$(LEVELDB_LIB): $(LEVELDB_TIMESTAMP)
|
||||
@REFRESH=0; \
|
||||
if [ ! -e ${LEVELDB_TIMESTAMP_INT} ] ; then \
|
||||
REFRESH=1; \
|
||||
fi; \
|
||||
if [ ${LEVELDB_TIMESTAMP} -nt ${LEVELDB_TIMESTAMP_INT} ] ; then \
|
||||
REFRESH=1; \
|
||||
fi; \
|
||||
if [ $$REFRESH -ne 0 ] ; then \
|
||||
export PATH=$${PATH}:${SDKFOLDER}/platform-tools:${ANDROID_NDK}; \
|
||||
echo "changed timestamp for leveldb detected building..."; \
|
||||
cd deps/leveldb; \
|
||||
export CROSS_PREFIX=${CROSS_PREFIX}; \
|
||||
export TOOLCHAIN=/tmp/ndk-${TARGET_HOST}-leveldb; \
|
||||
${ANDROID_NDK}/build/tools/make-standalone-toolchain.sh \
|
||||
--toolchain=${TARGET_TOOLCHAIN}${COMPILER_VERSION} \
|
||||
--install-dir=$${TOOLCHAIN}; \
|
||||
export PATH="$${TOOLCHAIN}/bin:$${PATH}"; \
|
||||
export CC=${CROSS_PREFIX}gcc; \
|
||||
export CXX=${CROSS_PREFIX}g++; \
|
||||
export CFLAGS="$${CFLAGS} ${TARGET_CFLAGS_ADDON}"; \
|
||||
export CPPFLAGS="$${CPPFLAGS} ${TARGET_CFLAGS_ADDON}"; \
|
||||
export LDFLAGS="$${LDFLAGS} ${TARGET_LDFLAGS_ADDON}"; \
|
||||
export TARGET_OS=OS_ANDROID_CROSSCOMPILE; \
|
||||
$(MAKE) -s || exit 1; \
|
||||
touch ${LEVELDB_TIMESTAMP}; \
|
||||
touch ${LEVELDB_TIMESTAMP_INT}; \
|
||||
$(RM) -rf $${TOOLCHAIN}; \
|
||||
else \
|
||||
echo "nothing to be done for leveldb"; \
|
||||
fi
|
||||
|
||||
clean_leveldb :
|
||||
$(RM) -rf deps/leveldb
|
||||
|
||||
$(FREETYPE_TIMESTAMP) : freetype_download
|
||||
@LAST_MODIF=$$(find ${FREETYPE_DIR} -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" "); \
|
||||
if [ $$(basename $$LAST_MODIF) != "timestamp" ] ; then \
|
||||
touch ${FREETYPE_TIMESTAMP}; \
|
||||
fi
|
||||
|
||||
freetype_download :
|
||||
@if [ ! -d ${FREETYPE_DIR} ] ; then \
|
||||
echo "freetype sources missing, downloading..."; \
|
||||
mkdir -p ${ROOT}/deps; \
|
||||
cd deps; \
|
||||
git clone ${FREETYPE_URL_GIT} || exit 1; \
|
||||
fi
|
||||
|
||||
freetype : $(FREETYPE_LIB)
|
||||
|
||||
$(FREETYPE_LIB) : $(FREETYPE_TIMESTAMP)
|
||||
@REFRESH=0; \
|
||||
if [ ! -e ${FREETYPE_TIMESTAMP_INT} ] ; then \
|
||||
REFRESH=1; \
|
||||
fi; \
|
||||
if [ ! -e ${FREETYPE_LIB} ] ; then \
|
||||
REFRESH=1; \
|
||||
fi; \
|
||||
if [ ${FREETYPE_TIMESTAMP} -nt ${FREETYPE_TIMESTAMP_INT} ] ; then \
|
||||
REFRESH=1; \
|
||||
fi; \
|
||||
if [ $$REFRESH -ne 0 ] ; then \
|
||||
mkdir -p ${FREETYPE_DIR}; \
|
||||
export PATH=$$PATH:${SDKFOLDER}/platform-tools:${ANDROID_NDK}; \
|
||||
echo "changed timestamp for freetype detected building..."; \
|
||||
cd ${FREETYPE_DIR}/Android/jni; \
|
||||
ndk-build NDEBUG=${NDEBUG} NDK_MODULE_PATH=${NDK_MODULE_PATH} \
|
||||
APP_PLATFORM=${APP_PLATFORM} APP_ABI=${TARGET_ABI} \
|
||||
TARGET_CFLAGS+="${TARGET_CFLAGS_ADDON}" \
|
||||
TARGET_LDFLAGS+="${TARGET_LDFLAGS_ADDON}" \
|
||||
TARGET_CXXFLAGS+="${TARGET_CXXFLAGS_ADDON}" || exit 1; \
|
||||
touch ${FREETYPE_TIMESTAMP}; \
|
||||
touch ${FREETYPE_TIMESTAMP_INT}; \
|
||||
else \
|
||||
echo "nothing to be done for freetype"; \
|
||||
fi
|
||||
|
||||
clean_freetype :
|
||||
$(RM) -rf ${FREETYPE_DIR}
|
||||
|
||||
$(ICONV_TIMESTAMP) : iconv_download
|
||||
@LAST_MODIF=$$(find ${ICONV_DIR} -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" "); \
|
||||
if [ $$(basename $$LAST_MODIF) != "timestamp" ] ; then \
|
||||
touch ${ICONV_TIMESTAMP}; \
|
||||
fi
|
||||
|
||||
iconv_download :
|
||||
@if [ ! -d ${ICONV_DIR} ] ; then \
|
||||
echo "iconv sources missing, downloading..."; \
|
||||
mkdir -p ${ROOT}/deps; \
|
||||
cd ${ROOT}/deps; \
|
||||
wget ${ICONV_URL_HTTP} || exit 1; \
|
||||
tar -xzf libiconv-${ICONV_VERSION}.tar.gz || exit 1; \
|
||||
rm libiconv-${ICONV_VERSION}.tar.gz; \
|
||||
ln -s libiconv-${ICONV_VERSION} libiconv; \
|
||||
cd ${ICONV_DIR}; \
|
||||
patch -p1 < ${ROOT}/libiconv_android.patch; \
|
||||
patch -p1 < ${ROOT}/libiconv_stdio.patch; \
|
||||
fi
|
||||
|
||||
iconv : $(ICONV_LIB)
|
||||
|
||||
$(ICONV_LIB) : $(ICONV_TIMESTAMP)
|
||||
@REFRESH=0; \
|
||||
if [ ! -e ${ICONV_TIMESTAMP_INT} ] ; then \
|
||||
REFRESH=1; \
|
||||
fi; \
|
||||
if [ ! -e ${ICONV_LIB} ] ; then \
|
||||
REFRESH=1; \
|
||||
fi; \
|
||||
if [ ${ICONV_TIMESTAMP} -nt ${ICONV_TIMESTAMP_INT} ] ; then \
|
||||
REFRESH=1; \
|
||||
fi; \
|
||||
if [ $$REFRESH -ne 0 ] ; then \
|
||||
mkdir -p ${ICONV_DIR}; \
|
||||
export PATH=$$PATH:${SDKFOLDER}/platform-tools:${ANDROID_NDK}; \
|
||||
echo "changed timestamp for iconv detected building..."; \
|
||||
cd ${ICONV_DIR}; \
|
||||
\
|
||||
export TOOLCHAIN=/tmp/ndk-${TARGET_HOST}-iconv; \
|
||||
${ANDROID_NDK}/build/tools/make-standalone-toolchain.sh \
|
||||
--toolchain=${TARGET_TOOLCHAIN}${COMPILER_VERSION} \
|
||||
--install-dir=$${TOOLCHAIN}; \
|
||||
export PATH="$${TOOLCHAIN}/bin:$${PATH}"; \
|
||||
export CC=${CROSS_PREFIX}gcc; \
|
||||
export CXX=${CROSS_PREFIX}g++; \
|
||||
export TARGET_OS=OS_ANDROID_CROSSCOMPILE; \
|
||||
./configure --host=${TARGET_HOST} || exit 1; \
|
||||
sed -i 's/LIBICONV_VERSION_INFO) /LIBICONV_VERSION_INFO) -avoid-version /g' lib/Makefile; \
|
||||
grep "iconv_LDFLAGS" src/Makefile; \
|
||||
$(MAKE) -s || exit 1; \
|
||||
touch ${ICONV_TIMESTAMP}; \
|
||||
touch ${ICONV_TIMESTAMP_INT}; \
|
||||
rm -rf ${TOOLCHAIN}; \
|
||||
else \
|
||||
echo "nothing to be done for iconv"; \
|
||||
fi
|
||||
|
||||
clean_iconv :
|
||||
$(RM) -rf ${ICONV_DIR}
|
||||
|
||||
#Note: Texturehack patch is required for gpu's not supporting color format
|
||||
# correctly. Known bad GPU:
|
||||
# -geforce on emulator
|
||||
# -Vivante Corporation GC1000 core (e.g. Galaxy Tab 3)
|
||||
|
||||
irrlicht_download :
|
||||
@if [ ! -d "deps/irrlicht" ] ; then \
|
||||
echo "irrlicht sources missing, downloading..."; \
|
||||
mkdir -p ${ROOT}/deps; \
|
||||
cd deps; \
|
||||
svn co ${IRRLICHT_URL_SVN} irrlicht || exit 1; \
|
||||
cd irrlicht; \
|
||||
patch -p1 < ../../irrlicht-touchcount.patch || exit 1; \
|
||||
patch -p1 < ../../irrlicht-back_button.patch || exit 1; \
|
||||
patch -p1 < ../../irrlicht-texturehack.patch || exit 1; \
|
||||
fi
|
||||
|
||||
$(IRRLICHT_TIMESTAMP) : irrlicht_download
|
||||
@LAST_MODIF=$$(find ${IRRLICHT_DIR} -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" "); \
|
||||
if [ $$(basename $$LAST_MODIF) != "timestamp" ] ; then \
|
||||
touch ${IRRLICHT_TIMESTAMP}; \
|
||||
fi
|
||||
|
||||
irrlicht : $(IRRLICHT_LIB)
|
||||
|
||||
$(IRRLICHT_LIB): $(IRRLICHT_TIMESTAMP) $(FREETYPE_LIB)
|
||||
@REFRESH=0; \
|
||||
if [ ! -e ${IRRLICHT_TIMESTAMP_INT} ] ; then \
|
||||
REFRESH=1; \
|
||||
fi; \
|
||||
if [ ! -e ${IRRLICHT_LIB} ] ; then \
|
||||
REFRESH=1; \
|
||||
fi; \
|
||||
if [ ${IRRLICHT_TIMESTAMP} -nt ${IRRLICHT_TIMESTAMP_INT} ] ; then \
|
||||
REFRESH=1; \
|
||||
fi; \
|
||||
if [ $$REFRESH -ne 0 ] ; then \
|
||||
mkdir -p ${IRRLICHT_DIR}; \
|
||||
export PATH=$$PATH:${SDKFOLDER}/platform-tools:${ANDROID_NDK}; \
|
||||
echo "changed timestamp for irrlicht detected building..."; \
|
||||
cd deps/irrlicht/source/Irrlicht/Android; \
|
||||
ndk-build NDEBUG=${NDEBUG} NDK_MODULE_PATH=${NDK_MODULE_PATH} \
|
||||
APP_ABI=${TARGET_ABI} APP_PLATFORM=${APP_PLATFORM} \
|
||||
TARGET_CFLAGS+="${TARGET_CFLAGS_ADDON}" \
|
||||
TARGET_LDFLAGS+="${TARGET_LDFLAGS_ADDON}" \
|
||||
TARGET_CXXFLAGS+="${TARGET_CXXFLAGS_ADDON}" || exit 1; \
|
||||
touch ${IRRLICHT_TIMESTAMP}; \
|
||||
touch ${IRRLICHT_TIMESTAMP_INT}; \
|
||||
else \
|
||||
echo "nothing to be done for irrlicht"; \
|
||||
fi
|
||||
|
||||
clean_irrlicht :
|
||||
$(RM) -rf deps/irrlicht
|
||||
|
||||
$(CURL_TIMESTAMP) : curl_download
|
||||
@LAST_MODIF=$$(find ${CURL_DIR} -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" "); \
|
||||
if [ $$(basename $$LAST_MODIF) != "timestamp" ] ; then \
|
||||
touch ${CURL_TIMESTAMP}; \
|
||||
fi
|
||||
|
||||
curl_download :
|
||||
@if [ ! -d "deps/curl-${CURL_VERSION}" ] ; then \
|
||||
echo "curl sources missing, downloading..."; \
|
||||
mkdir -p ${ROOT}/deps; \
|
||||
cd deps; \
|
||||
wget ${CURL_URL_HTTP} || exit 1; \
|
||||
tar -xjf curl-${CURL_VERSION}.tar.bz2 || exit 1; \
|
||||
rm curl-${CURL_VERSION}.tar.bz2; \
|
||||
ln -s curl-${CURL_VERSION} curl; \
|
||||
fi
|
||||
|
||||
curl : $(CURL_LIB)
|
||||
|
||||
$(CURL_LIB): $(CURL_TIMESTAMP) $(OPENSSL_LIB)
|
||||
@REFRESH=0; \
|
||||
if [ ! -e ${CURL_TIMESTAMP_INT} ] ; then \
|
||||
REFRESH=1; \
|
||||
fi; \
|
||||
if [ ! -e ${CURL_LIB} ] ; then \
|
||||
REFRESH=1; \
|
||||
fi; \
|
||||
if [ ${CURL_TIMESTAMP} -nt ${CURL_TIMESTAMP_INT} ] ; then \
|
||||
REFRESH=1; \
|
||||
fi; \
|
||||
if [ $$REFRESH -ne 0 ] ; then \
|
||||
mkdir -p ${CURL_DIR}; \
|
||||
export PATH="$${PATH}:${SDKFOLDER}/platform-tools:${ANDROID_NDK}"; \
|
||||
echo "changed timestamp for curl detected building..."; \
|
||||
cd deps/curl-${CURL_VERSION}; \
|
||||
export CROSS_PREFIX=${CROSS_PREFIX}; \
|
||||
export TOOLCHAIN=/tmp/ndk-${TARGET_HOST}-curl; \
|
||||
${ANDROID_NDK}/build/tools/make-standalone-toolchain.sh \
|
||||
--toolchain=${TARGET_TOOLCHAIN}${COMPILER_VERSION} \
|
||||
--install-dir=$${TOOLCHAIN}; \
|
||||
export PATH="$${TOOLCHAIN}/bin:$${PATH}"; \
|
||||
export CC=${CROSS_PREFIX}gcc; \
|
||||
export CXX=${CROSS_PREFIX}g++; \
|
||||
export TARGET_OS=OS_ANDROID_CROSSCOMPILE; \
|
||||
export CPPFLAGS="$${CPPFLAGS} -I${OPENSSL_DIR}/include \
|
||||
-L${OPENSSL_DIR} ${TARGET_CFLAGS_ADDON}"; \
|
||||
export CFLAGS="$${CFLAGS} ${TARGET_CFLAGS_ADDON}"; \
|
||||
export LDFLAGS="$${LDFLAGS} -L${OPENSSL_DIR} ${TARGET_LDFLAGS_ADDON}"; \
|
||||
./configure --host=${TARGET_HOST} --disable-shared --enable-static --with-ssl; \
|
||||
$(MAKE) -s || exit 1; \
|
||||
touch ${CURL_TIMESTAMP}; \
|
||||
touch ${CURL_TIMESTAMP_INT}; \
|
||||
$(RM) -rf $${TOOLCHAIN}; \
|
||||
else \
|
||||
echo "nothing to be done for curl"; \
|
||||
fi
|
||||
|
||||
clean_curl :
|
||||
$(RM) -rf deps/curl-${CURL_VERSION} \
|
||||
$(RM) -f deps/curl
|
||||
|
||||
|
||||
curl_binary:
|
||||
@if [ ! -d "deps/curl-${CURL_VERSION_BINARY}" ] ; then \
|
||||
echo "curl binary missing, downloading..."; \
|
||||
mkdir -p ${ROOT}/deps; \
|
||||
cd deps; \
|
||||
wget http://curl.haxx.se/gknw.net/7.34.0/dist-android/curl-7.34.0-rtmp-ssh2-ssl-zlib-static-bin-android.tar.gz || exit 1;\
|
||||
tar -xzf curl-7.34.0-rtmp-ssh2-ssl-zlib-static-bin-android.tar.gz || exit 1;\
|
||||
mv curl-7.34.0-rtmp-ssh2-ssl-zlib-static-bin-android curl-${CURL_VERSION_BINARY};\
|
||||
rm curl-7.34.0-rtmp-ssh2-ssl-zlib-static-bin-android.tar.gz; \
|
||||
fi
|
||||
|
||||
$(GMP_TIMESTAMP) : gmp_download
|
||||
@LAST_MODIF=$$(find ${GMP_DIR} -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" "); \
|
||||
if [ $$(basename $$LAST_MODIF) != "timestamp" ] ; then \
|
||||
touch ${GMP_TIMESTAMP}; \
|
||||
fi
|
||||
|
||||
gmp_download :
|
||||
@if [ ! -d "${GMP_DIR}" ] ; then \
|
||||
echo "gmp sources missing, downloading..."; \
|
||||
mkdir -p ${ROOT}/deps; \
|
||||
cd deps; \
|
||||
wget ${GMP_URL_HTTP} || exit 1; \
|
||||
tar -xjf gmp-${GMP_VERSION}.tar.bz2 || exit 1; \
|
||||
rm gmp-${GMP_VERSION}.tar.bz2; \
|
||||
ln -s gmp-${GMP_VERSION} gmp; \
|
||||
fi
|
||||
|
||||
gmp : $(GMP_LIB)
|
||||
|
||||
$(GMP_LIB): $(GMP_TIMESTAMP)
|
||||
@REFRESH=0; \
|
||||
if [ ! -e ${GMP_TIMESTAMP_INT} ] ; then \
|
||||
REFRESH=1; \
|
||||
fi; \
|
||||
if [ ! -e ${GMP_LIB} ] ; then \
|
||||
REFRESH=1; \
|
||||
fi; \
|
||||
if [ ${GMP_TIMESTAMP} -nt ${GMP_TIMESTAMP_INT} ] ; then \
|
||||
REFRESH=1; \
|
||||
fi; \
|
||||
if [ $$REFRESH -ne 0 ] ; then \
|
||||
mkdir -p ${GMP_DIR}; \
|
||||
export PATH="$${PATH}:${SDKFOLDER}/platform-tools:${ANDROID_NDK}"; \
|
||||
echo "changed timestamp for gmp detected building..."; \
|
||||
cd deps/gmp-${GMP_VERSION}; \
|
||||
export CROSS_PREFIX=${CROSS_PREFIX}; \
|
||||
export TOOLCHAIN=/tmp/ndk-${TARGET_HOST}-gmp; \
|
||||
${ANDROID_NDK}/build/tools/make-standalone-toolchain.sh \
|
||||
--toolchain=${TARGET_TOOLCHAIN}${COMPILER_VERSION} \
|
||||
--install-dir=$${TOOLCHAIN}; \
|
||||
export PATH="$${TOOLCHAIN}/bin:$${PATH}"; \
|
||||
export CC=${CROSS_PREFIX}gcc; \
|
||||
export CXX=${CROSS_PREFIX}g++; \
|
||||
export LIBGMP_LDFLAGS="-avoid-version"; \
|
||||
export LIBGMPXX_LDFLAGS="-avoid-version"; \
|
||||
./configure --disable-static --host=${TARGET_HOST} --prefix=/usr; \
|
||||
$(MAKE) install DESTDIR=/${GMP_DIR} || exit 1; \
|
||||
touch ${GMP_TIMESTAMP}; \
|
||||
touch ${GMP_TIMESTAMP_INT}; \
|
||||
$(RM) -rf $${TOOLCHAIN}; \
|
||||
else \
|
||||
echo "nothing to be done for gmp"; \
|
||||
fi
|
||||
|
||||
clean_gmp:
|
||||
$(RM) -rf deps/gmp-${GMP_VERSION} \
|
||||
$(RM) -f deps/gmp
|
||||
|
||||
sqlite3_download: deps/${SQLITE3_FOLDER}/sqlite3.c
|
||||
|
||||
deps/${SQLITE3_FOLDER}/sqlite3.c :
|
||||
cd deps; \
|
||||
wget ${SQLITE3_URL}; \
|
||||
unzip ${SQLITE3_FOLDER}.zip; \
|
||||
ln -s ${SQLITE3_FOLDER} sqlite
|
||||
|
||||
clean_sqlite3:
|
||||
cd deps && $(RM) -rf ${SQLITE3_FOLDER} && $(RM) -f ${SQLITE3_FOLDER}.zip && \
|
||||
$(RM) -f sqlite
|
||||
|
||||
$(ASSETS_TIMESTAMP) : $(IRRLICHT_LIB)
|
||||
@mkdir -p ${ROOT}/deps; \
|
||||
for DIRNAME in {builtin,client,doc,fonts,games,mods,po,textures}; do \
|
||||
LAST_MODIF=$$(find ${ROOT}/../../${DIRNAME} -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" "); \
|
||||
if [ $$(basename $$LAST_MODIF) != "timestamp" ]; then \
|
||||
touch ${ROOT}/../../${DIRNAME}/timestamp; \
|
||||
touch ${ASSETS_TIMESTAMP}; \
|
||||
echo ${DIRNAME} changed $$LAST_MODIF; \
|
||||
fi; \
|
||||
done; \
|
||||
LAST_MODIF=$$(find ${IRRLICHT_DIR}/media -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" "); \
|
||||
if [ $$(basename $$LAST_MODIF) != "timestamp" ] ; then \
|
||||
touch ${IRRLICHT_DIR}/media/timestamp; \
|
||||
touch ${ASSETS_TIMESTAMP}; \
|
||||
fi; \
|
||||
if [ ${ROOT}/../../minetest.conf.example -nt ${ASSETS_TIMESTAMP} ] ; then \
|
||||
echo "conf changed"; \
|
||||
touch ${ASSETS_TIMESTAMP}; \
|
||||
fi; \
|
||||
if [ ${ROOT}/../../README.txt -nt ${ASSETS_TIMESTAMP} ] ; then \
|
||||
touch ${ASSETS_TIMESTAMP}; \
|
||||
fi; \
|
||||
if [ ! -e $(ASSETS_TIMESTAMP) ] ; then \
|
||||
touch $(ASSETS_TIMESTAMP); \
|
||||
fi
|
||||
|
||||
assets : $(ASSETS_TIMESTAMP)
|
||||
@REFRESH=0; \
|
||||
if [ ! -e ${ASSETS_TIMESTAMP}.old ] ; then \
|
||||
REFRESH=1; \
|
||||
fi; \
|
||||
if [ ${ASSETS_TIMESTAMP} -nt ${ASSETS_TIMESTAMP}.old ] ; then \
|
||||
REFRESH=1; \
|
||||
fi; \
|
||||
if [ ! -d ${ROOT}/assets ] ; then \
|
||||
REFRESH=1; \
|
||||
fi; \
|
||||
if [ $$REFRESH -ne 0 ] ; then \
|
||||
echo "assets changed, refreshing..."; \
|
||||
$(MAKE) clean_assets; \
|
||||
mkdir -p ${ROOT}/assets/Minetest; \
|
||||
cp ${ROOT}/../../minetest.conf.example ${ROOT}/assets/Minetest; \
|
||||
cp ${ROOT}/../../README.txt ${ROOT}/assets/Minetest; \
|
||||
cp -r ${ROOT}/../../builtin ${ROOT}/assets/Minetest; \
|
||||
cp -r ${ROOT}/../../client ${ROOT}/assets/Minetest; \
|
||||
cp -r ${ROOT}/../../doc ${ROOT}/assets/Minetest; \
|
||||
cp -r ${ROOT}/../../fonts ${ROOT}/assets/Minetest; \
|
||||
mkdir ${ROOT}/assets/Minetest/games; \
|
||||
for game in ${GAMES_TO_COPY}; \
|
||||
do \
|
||||
cp -r ${ROOT}/../../games/$$game ${ROOT}/assets/Minetest/games/; \
|
||||
done; \
|
||||
cp -r ${ROOT}/../../mods ${ROOT}/assets/Minetest; \
|
||||
cp -r ${ROOT}/../../po ${ROOT}/assets/Minetest; \
|
||||
cp -r ${ROOT}/../../textures ${ROOT}/assets/Minetest; \
|
||||
mkdir -p ${ROOT}/assets/Minetest/media; \
|
||||
cp -r ${IRRLICHT_DIR}/media/Shaders ${ROOT}/assets/Minetest/media; \
|
||||
cd ${ROOT}/assets || exit 1; \
|
||||
find . -name "timestamp" -exec rm {} \; ; \
|
||||
find . -name "*.blend" -exec rm {} \; ; \
|
||||
find . -name "*~" -exec rm {} \; ; \
|
||||
find . -type d -path "*.git" -exec rm -rf {} \; ; \
|
||||
find . -type d -path "*.svn" -exec rm -rf {} \; ; \
|
||||
find . -type f -path "*.gitignore" -exec rm -rf {} \; ; \
|
||||
ls -R | grep ":$$" | sed -e 's/:$$//' -e 's/\.//' -e 's/^\///' > "index.txt"; \
|
||||
find Minetest >"filelist.txt"; \
|
||||
cp ${ROOT}/${ASSETS_TIMESTAMP} ${ROOT}/${ASSETS_TIMESTAMP}.old; \
|
||||
else \
|
||||
echo "nothing to be done for assets"; \
|
||||
fi
|
||||
|
||||
clean_assets :
|
||||
@$(RM) -r assets
|
||||
|
||||
apk: $(PATHCFGFILE) assets $(ICONV_LIB) $(IRRLICHT_LIB) $(CURL_LIB) $(GMP_LIB) $(LEVELDB_TARGET) \
|
||||
$(OPENAL_LIB) $(OGG_LIB) prep_srcdir $(ROOT)/jni/src/android_version.h \
|
||||
$(ROOT)/jni/src/android_version_githash.h sqlite3_download
|
||||
@export NDEBUG=$$NDEBUG; $(MAKE) manifest; \
|
||||
export PATH=$$PATH:${SDKFOLDER}/platform-tools:${ANDROID_NDK}; \
|
||||
export ANDROID_HOME=${SDKFOLDER}; \
|
||||
mkdir -p ${ROOT}/src; \
|
||||
ndk-build NDK_MODULE_PATH=${NDK_MODULE_PATH} \
|
||||
GPROF=${GPROF} APP_ABI=${TARGET_ABI} HAVE_LEVELDB=${HAVE_LEVELDB} \
|
||||
APP_PLATFORM=${APP_PLATFORM} \
|
||||
TARGET_LIBDIR=${TARGET_LIBDIR} \
|
||||
TARGET_CFLAGS+="${TARGET_CFLAGS_ADDON}" \
|
||||
TARGET_LDFLAGS+="${TARGET_LDFLAGS_ADDON}" \
|
||||
TARGET_CXXFLAGS+="${TARGET_CXXFLAGS_ADDON}" && \
|
||||
ant $$BUILD_TYPE && \
|
||||
echo "++ Success!" && \
|
||||
echo "APK: bin/Minetest-$$BUILD_TYPE.apk" && \
|
||||
echo "You can install it with \`adb install -r bin/Minetest-$$BUILD_TYPE.apk\`"
|
||||
|
||||
prep_srcdir :
|
||||
@if [ ! -e ${ROOT}/jni/src ]; then \
|
||||
ln -s ${ROOT}/../../src ${ROOT}/jni/src; \
|
||||
fi
|
||||
|
||||
clean_apk : manifest
|
||||
@export PATH=$$PATH:${SDKFOLDER}platform-tools:${ANDROID_NDK}; \
|
||||
export ANDROID_HOME=${SDKFOLDER}; \
|
||||
ant clean
|
||||
|
||||
install_debug :
|
||||
@export PATH=$$PATH:${SDKFOLDER}platform-tools:${ANDROID_NDK}; \
|
||||
adb install -r ${ROOT}/bin/Minetest-debug.apk
|
||||
|
||||
install :
|
||||
@export PATH=$$PATH:${SDKFOLDER}platform-tools:${ANDROID_NDK}; \
|
||||
adb install -r ${ROOT}/bin/Minetest-release.apk
|
||||
|
||||
envpaths :
|
||||
@echo "export PATH=$$PATH:${SDKFOLDER}platform-tools:${ANDROID_NDK}" > and_env;\
|
||||
echo "export ANDROID_HOME=${SDKFOLDER}" >> and_env;
|
||||
|
||||
clean_all :
|
||||
@$(MAKE) clean_apk; \
|
||||
$(MAKE) clean_assets clean_iconv clean_irrlicht clean_leveldb clean_curl clean_openssl \
|
||||
clean_openal clean_ogg clean_gmp clean_manifest; \
|
||||
sleep 1; \
|
||||
$(RM) -r gen libs obj deps bin Debug and_env
|
||||
|
||||
$(ROOT)/jni/src/android_version_githash.h : prep_srcdir
|
||||
@export VERSION_FILE=${ROOT}/jni/src/android_version_githash.h; \
|
||||
export VERSION_FILE_NEW=$${VERSION_FILE}.new; \
|
||||
{ \
|
||||
echo "#ifndef ANDROID_MT_VERSION_GITHASH_H"; \
|
||||
echo "#define ANDROID_MT_VERSION_GITHASH_H"; \
|
||||
export GITHASH=$$(git rev-parse --short=8 HEAD); \
|
||||
export VERSION_STR="${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}"; \
|
||||
echo "#define VERSION_GITHASH \"$$VERSION_STR-$$GITHASH-Android\""; \
|
||||
echo "#endif"; \
|
||||
} > "$${VERSION_FILE_NEW}"; \
|
||||
if ! cmp -s $${VERSION_FILE} $${VERSION_FILE_NEW}; then \
|
||||
echo "android_version_githash.h changed, updating..."; \
|
||||
mv "$${VERSION_FILE_NEW}" "$${VERSION_FILE}"; \
|
||||
else \
|
||||
rm "$${VERSION_FILE_NEW}"; \
|
||||
fi
|
||||
|
||||
|
||||
$(ROOT)/jni/src/android_version.h : prep_srcdir
|
||||
@export VERSION_FILE=${ROOT}/jni/src/android_version.h; \
|
||||
export VERSION_FILE_NEW=$${VERSION_FILE}.new; \
|
||||
{ \
|
||||
echo "#ifndef ANDROID_MT_VERSION_H"; \
|
||||
echo "#define ANDROID_MT_VERSION_H"; \
|
||||
echo "#define VERSION_MAJOR ${VERSION_MAJOR}"; \
|
||||
echo "#define VERSION_MINOR ${VERSION_MINOR}"; \
|
||||
echo "#define VERSION_PATCH ${VERSION_PATCH}"; \
|
||||
echo "#define VERSION_STRING STR(VERSION_MAJOR)\".\"STR(VERSION_MINOR)\
|
||||
\".\"STR(VERSION_PATCH)"; \
|
||||
echo "#endif"; \
|
||||
} > $${VERSION_FILE_NEW}; \
|
||||
if ! cmp -s $${VERSION_FILE} $${VERSION_FILE_NEW}; then \
|
||||
echo "android_version.h changed, updating..."; \
|
||||
mv "$${VERSION_FILE_NEW}" "$${VERSION_FILE}"; \
|
||||
else \
|
||||
rm "$${VERSION_FILE_NEW}"; \
|
||||
fi
|
||||
|
||||
manifest :
|
||||
@BASE_VERSION="${VERS_MAJOR}.${VERS_MINOR}.${VERS_PATCH}"; \
|
||||
if [ "${NDEBUG}x" != "x" ] ; then \
|
||||
DBG=''; \
|
||||
DBG_FLAG="android:debuggable=\"false\""; \
|
||||
else \
|
||||
DBG="<uses-permission android:name=\"android.permission.SET_DEBUG_APP\" />"; \
|
||||
DBG_FLAG="android:debuggable=\"true\""; \
|
||||
fi; \
|
||||
cat ${ROOT}/AndroidManifest.xml.template | \
|
||||
sed "s/###ANDROID_VERSION###/${ANDROID_VERSION_CODE}/g" | \
|
||||
sed "s/###BASE_VERSION###/$$BASE_VERSION/g" | \
|
||||
sed -e "s@###DEBUG_BUILD###@$$DBG@g" | \
|
||||
sed -e "s@###DEBUG_FLAG###@$$DBG_FLAG@g" >${ROOT}/AndroidManifest.xml
|
||||
|
||||
clean_manifest :
|
||||
rm -rf ${ROOT}/AndroidManifest.xml
|
||||
|
||||
clean : clean_apk clean_assets
|
||||
16
build/android/build.xml
Normal file
16
build/android/build.xml
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project name="Minetest" default="help">
|
||||
<property file="local.properties" />
|
||||
<property file="ant.properties" />
|
||||
<property environment="env" />
|
||||
<condition property="sdk.dir" value="${env.ANDROID_HOME}">
|
||||
<isset property="env.ANDROID_HOME" />
|
||||
</condition>
|
||||
<loadproperties srcFile="project.properties" />
|
||||
<fail
|
||||
message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable."
|
||||
unless="sdk.dir"
|
||||
/>
|
||||
<import file="custom_rules.xml" optional="true" />
|
||||
<import file="${sdk.dir}/tools/ant/build.xml" />
|
||||
</project>
|
||||
19
build/android/irrlicht-back_button.patch
Normal file
19
build/android/irrlicht-back_button.patch
Normal file
@@ -0,0 +1,19 @@
|
||||
--- irrlicht/source/Irrlicht/Android/CIrrDeviceAndroid.cpp 2014-06-03 20:56:21.289559503 +0200
|
||||
+++ irrlicht/source/Irrlicht/Android/CIrrDeviceAndroid.cpp.orig 2014-06-03 20:57:39.281556749 +0200
|
||||
@@ -423,6 +423,7 @@
|
||||
}
|
||||
|
||||
device->postEventFromUser(event);
|
||||
+ status = 1;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -479,7 +480,7 @@
|
||||
KeyMap[1] = KEY_LBUTTON; // AKEYCODE_SOFT_LEFT
|
||||
KeyMap[2] = KEY_RBUTTON; // AKEYCODE_SOFT_RIGHT
|
||||
KeyMap[3] = KEY_HOME; // AKEYCODE_HOME
|
||||
- KeyMap[4] = KEY_BACK; // AKEYCODE_BACK
|
||||
+ KeyMap[4] = KEY_CANCEL; // AKEYCODE_BACK
|
||||
KeyMap[5] = KEY_UNKNOWN; // AKEYCODE_CALL
|
||||
KeyMap[6] = KEY_UNKNOWN; // AKEYCODE_ENDCALL
|
||||
KeyMap[7] = KEY_KEY_0; // AKEYCODE_0
|
||||
240
build/android/irrlicht-texturehack.patch
Normal file
240
build/android/irrlicht-texturehack.patch
Normal file
@@ -0,0 +1,240 @@
|
||||
--- irrlicht/source/Irrlicht/COGLESTexture.cpp.orig 2014-06-22 17:01:13.266568869 +0200
|
||||
+++ irrlicht/source/Irrlicht/COGLESTexture.cpp 2014-06-22 17:03:59.298572810 +0200
|
||||
@@ -366,112 +366,140 @@
|
||||
void(*convert)(const void*, s32, void*) = 0;
|
||||
getFormatParameters(ColorFormat, InternalFormat, filtering, PixelFormat, PixelType, convert);
|
||||
|
||||
- // make sure we don't change the internal format of existing images
|
||||
- if (!newTexture)
|
||||
- InternalFormat = oldInternalFormat;
|
||||
-
|
||||
- Driver->setActiveTexture(0, this);
|
||||
-
|
||||
- if (Driver->testGLError())
|
||||
- os::Printer::log("Could not bind Texture", ELL_ERROR);
|
||||
-
|
||||
- // mipmap handling for main texture
|
||||
- if (!level && newTexture)
|
||||
- {
|
||||
- // auto generate if possible and no mipmap data is given
|
||||
- if (!IsCompressed && HasMipMaps && !mipmapData && Driver->queryFeature(EVDF_MIP_MAP_AUTO_UPDATE))
|
||||
- {
|
||||
- if (Driver->getTextureCreationFlag(ETCF_OPTIMIZED_FOR_SPEED))
|
||||
- glHint(GL_GENERATE_MIPMAP_HINT, GL_FASTEST);
|
||||
- else if (Driver->getTextureCreationFlag(ETCF_OPTIMIZED_FOR_QUALITY))
|
||||
- glHint(GL_GENERATE_MIPMAP_HINT, GL_NICEST);
|
||||
- else
|
||||
- glHint(GL_GENERATE_MIPMAP_HINT, GL_DONT_CARE);
|
||||
+ bool retry = false;
|
||||
+
|
||||
+ do {
|
||||
+ if (retry) {
|
||||
+ InternalFormat = GL_RGBA;
|
||||
+ PixelFormat = GL_RGBA;
|
||||
+ convert = CColorConverter::convert_A8R8G8B8toA8B8G8R8;
|
||||
+ }
|
||||
+ // make sure we don't change the internal format of existing images
|
||||
+ if (!newTexture)
|
||||
+ InternalFormat = oldInternalFormat;
|
||||
|
||||
- glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
|
||||
- AutomaticMipmapUpdate=true;
|
||||
- }
|
||||
+ Driver->setActiveTexture(0, this);
|
||||
|
||||
- // enable bilinear filter without mipmaps
|
||||
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filtering);
|
||||
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filtering);
|
||||
- }
|
||||
+ if (Driver->testGLError())
|
||||
+ os::Printer::log("Could not bind Texture", ELL_ERROR);
|
||||
|
||||
- // now get image data and upload to GPU
|
||||
+ // mipmap handling for main texture
|
||||
+ if (!level && newTexture)
|
||||
+ {
|
||||
+ // auto generate if possible and no mipmap data is given
|
||||
+ if (!IsCompressed && HasMipMaps && !mipmapData && Driver->queryFeature(EVDF_MIP_MAP_AUTO_UPDATE))
|
||||
+ {
|
||||
+ if (Driver->getTextureCreationFlag(ETCF_OPTIMIZED_FOR_SPEED))
|
||||
+ glHint(GL_GENERATE_MIPMAP_HINT, GL_FASTEST);
|
||||
+ else if (Driver->getTextureCreationFlag(ETCF_OPTIMIZED_FOR_QUALITY))
|
||||
+ glHint(GL_GENERATE_MIPMAP_HINT, GL_NICEST);
|
||||
+ else
|
||||
+ glHint(GL_GENERATE_MIPMAP_HINT, GL_DONT_CARE);
|
||||
+
|
||||
+ glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
|
||||
+ AutomaticMipmapUpdate=true;
|
||||
+ }
|
||||
+
|
||||
+ // enable bilinear filter without mipmaps
|
||||
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filtering);
|
||||
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filtering);
|
||||
+ }
|
||||
|
||||
- u32 compressedImageSize = IImage::getCompressedImageSize(ColorFormat, image->getDimension().Width, image->getDimension().Height);
|
||||
+ // now get image data and upload to GPU
|
||||
|
||||
- void* source = image->lock();
|
||||
+ u32 compressedImageSize = IImage::getCompressedImageSize(ColorFormat, image->getDimension().Width, image->getDimension().Height);
|
||||
|
||||
- IImage* tmpImage = 0;
|
||||
+ void* source = image->lock();
|
||||
|
||||
- if (convert)
|
||||
- {
|
||||
- tmpImage = new CImage(image->getColorFormat(), image->getDimension());
|
||||
- void* dest = tmpImage->lock();
|
||||
- convert(source, image->getDimension().getArea(), dest);
|
||||
- image->unlock();
|
||||
- source = dest;
|
||||
- }
|
||||
+ IImage* tmpImage = 0;
|
||||
|
||||
- if (newTexture)
|
||||
- {
|
||||
- if (IsCompressed)
|
||||
+ if (convert)
|
||||
{
|
||||
- glCompressedTexImage2D(GL_TEXTURE_2D, 0, InternalFormat, image->getDimension().Width,
|
||||
- image->getDimension().Height, 0, compressedImageSize, source);
|
||||
+ tmpImage = new CImage(image->getColorFormat(), image->getDimension());
|
||||
+ void* dest = tmpImage->lock();
|
||||
+ convert(source, image->getDimension().getArea(), dest);
|
||||
+ image->unlock();
|
||||
+ source = dest;
|
||||
}
|
||||
- else
|
||||
- glTexImage2D(GL_TEXTURE_2D, level, InternalFormat, image->getDimension().Width,
|
||||
- image->getDimension().Height, 0, PixelFormat, PixelType, source);
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- if (IsCompressed)
|
||||
+
|
||||
+ if (newTexture)
|
||||
{
|
||||
- glCompressedTexSubImage2D(GL_TEXTURE_2D, level, 0, 0, image->getDimension().Width,
|
||||
- image->getDimension().Height, PixelFormat, compressedImageSize, source);
|
||||
+ if (IsCompressed)
|
||||
+ {
|
||||
+ glCompressedTexImage2D(GL_TEXTURE_2D, 0, InternalFormat, image->getDimension().Width,
|
||||
+ image->getDimension().Height, 0, compressedImageSize, source);
|
||||
+ }
|
||||
+ else
|
||||
+ glTexImage2D(GL_TEXTURE_2D, level, InternalFormat, image->getDimension().Width,
|
||||
+ image->getDimension().Height, 0, PixelFormat, PixelType, source);
|
||||
}
|
||||
else
|
||||
- glTexSubImage2D(GL_TEXTURE_2D, level, 0, 0, image->getDimension().Width,
|
||||
- image->getDimension().Height, PixelFormat, PixelType, source);
|
||||
- }
|
||||
-
|
||||
- if (convert)
|
||||
- {
|
||||
- tmpImage->unlock();
|
||||
- tmpImage->drop();
|
||||
- }
|
||||
- else
|
||||
- image->unlock();
|
||||
-
|
||||
- if (!level && newTexture)
|
||||
- {
|
||||
- if (IsCompressed && !mipmapData)
|
||||
{
|
||||
- if (image->hasMipMaps())
|
||||
- mipmapData = static_cast<u8*>(image->lock())+compressedImageSize;
|
||||
+ if (IsCompressed)
|
||||
+ {
|
||||
+ glCompressedTexSubImage2D(GL_TEXTURE_2D, level, 0, 0, image->getDimension().Width,
|
||||
+ image->getDimension().Height, PixelFormat, compressedImageSize, source);
|
||||
+ }
|
||||
else
|
||||
- HasMipMaps = false;
|
||||
+ glTexSubImage2D(GL_TEXTURE_2D, level, 0, 0, image->getDimension().Width,
|
||||
+ image->getDimension().Height, PixelFormat, PixelType, source);
|
||||
}
|
||||
|
||||
- regenerateMipMapLevels(mipmapData);
|
||||
-
|
||||
- if (HasMipMaps) // might have changed in regenerateMipMapLevels
|
||||
+ if (convert)
|
||||
{
|
||||
- // enable bilinear mipmap filter
|
||||
- GLint filteringMipMaps = GL_LINEAR_MIPMAP_NEAREST;
|
||||
-
|
||||
- if (filtering != GL_LINEAR)
|
||||
- filteringMipMaps = GL_NEAREST_MIPMAP_NEAREST;
|
||||
+ tmpImage->unlock();
|
||||
+ tmpImage->drop();
|
||||
+ }
|
||||
+ else
|
||||
+ image->unlock();
|
||||
+
|
||||
+ if (glGetError() != GL_NO_ERROR) {
|
||||
+ static bool warned = false;
|
||||
+ if ((!retry) && (ColorFormat == ECF_A8R8G8B8)) {
|
||||
+
|
||||
+ if (!warned) {
|
||||
+ os::Printer::log("Your driver claims to support GL_BGRA but fails on trying to upload a texture, converting to GL_RGBA and trying again", ELL_ERROR);
|
||||
+ warned = true;
|
||||
+ }
|
||||
+ }
|
||||
+ else if (retry) {
|
||||
+ os::Printer::log("Neither uploading texture as GL_BGRA nor, converted one using GL_RGBA succeeded", ELL_ERROR);
|
||||
+ }
|
||||
+ retry = !retry;
|
||||
+ continue;
|
||||
+ } else {
|
||||
+ retry = false;
|
||||
+ }
|
||||
|
||||
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filteringMipMaps);
|
||||
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filtering);
|
||||
+ if (!level && newTexture)
|
||||
+ {
|
||||
+ if (IsCompressed && !mipmapData)
|
||||
+ {
|
||||
+ if (image->hasMipMaps())
|
||||
+ mipmapData = static_cast<u8*>(image->lock())+compressedImageSize;
|
||||
+ else
|
||||
+ HasMipMaps = false;
|
||||
+ }
|
||||
+
|
||||
+ regenerateMipMapLevels(mipmapData);
|
||||
+
|
||||
+ if (HasMipMaps) // might have changed in regenerateMipMapLevels
|
||||
+ {
|
||||
+ // enable bilinear mipmap filter
|
||||
+ GLint filteringMipMaps = GL_LINEAR_MIPMAP_NEAREST;
|
||||
+
|
||||
+ if (filtering != GL_LINEAR)
|
||||
+ filteringMipMaps = GL_NEAREST_MIPMAP_NEAREST;
|
||||
+
|
||||
+ glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filteringMipMaps);
|
||||
+ glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filtering);
|
||||
+ }
|
||||
}
|
||||
- }
|
||||
|
||||
- if (Driver->testGLError())
|
||||
- os::Printer::log("Could not glTexImage2D", ELL_ERROR);
|
||||
+ if (Driver->testGLError())
|
||||
+ os::Printer::log("Could not glTexImage2D", ELL_ERROR);
|
||||
+ }
|
||||
+ while(retry);
|
||||
}
|
||||
|
||||
|
||||
--- irrlicht/source/Irrlicht/COGLESTexture.cpp.orig 2014-06-25 00:28:50.820501856 +0200
|
||||
+++ irrlicht/source/Irrlicht/COGLESTexture.cpp 2014-06-25 00:08:37.712544692 +0200
|
||||
@@ -422,6 +422,9 @@
|
||||
source = dest;
|
||||
}
|
||||
|
||||
+ //clear old error
|
||||
+ glGetError();
|
||||
+
|
||||
if (newTexture)
|
||||
{
|
||||
if (IsCompressed)
|
||||
30
build/android/irrlicht-touchcount.patch
Normal file
30
build/android/irrlicht-touchcount.patch
Normal file
@@ -0,0 +1,30 @@
|
||||
--- irrlicht.orig/include/IEventReceiver.h 2014-06-03 19:43:50.433713133 +0200
|
||||
+++ irrlicht/include/IEventReceiver.h 2014-06-03 19:44:36.993711489 +0200
|
||||
@@ -375,6 +375,9 @@
|
||||
// Y position of simple touch.
|
||||
s32 Y;
|
||||
|
||||
+ // number of current touches
|
||||
+ s32 touchedCount;
|
||||
+
|
||||
//! Type of touch event.
|
||||
ETOUCH_INPUT_EVENT Event;
|
||||
};
|
||||
--- irrlicht.orig/source/Irrlicht/Android/CIrrDeviceAndroid.cpp 2014-06-03 19:43:50.505713130 +0200
|
||||
+++ irrlicht/source/Irrlicht/Android/CIrrDeviceAndroid.cpp 2014-06-03 19:45:37.265709359 +0200
|
||||
@@ -315,6 +315,7 @@
|
||||
event.TouchInput.ID = AMotionEvent_getPointerId(androidEvent, i);
|
||||
event.TouchInput.X = AMotionEvent_getX(androidEvent, i);
|
||||
event.TouchInput.Y = AMotionEvent_getY(androidEvent, i);
|
||||
+ event.TouchInput.touchedCount = AMotionEvent_getPointerCount(androidEvent);
|
||||
|
||||
device->postEventFromUser(event);
|
||||
}
|
||||
@@ -326,6 +327,7 @@
|
||||
event.TouchInput.ID = AMotionEvent_getPointerId(androidEvent, pointerIndex);
|
||||
event.TouchInput.X = AMotionEvent_getX(androidEvent, pointerIndex);
|
||||
event.TouchInput.Y = AMotionEvent_getY(androidEvent, pointerIndex);
|
||||
+ event.TouchInput.touchedCount = AMotionEvent_getPointerCount(androidEvent);
|
||||
|
||||
device->postEventFromUser(event);
|
||||
}
|
||||
372
build/android/jni/Android.mk
Normal file
372
build/android/jni/Android.mk
Normal file
@@ -0,0 +1,372 @@
|
||||
LOCAL_PATH := $(call my-dir)/..
|
||||
|
||||
#LOCAL_ADDRESS_SANITIZER:=true
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE := Irrlicht
|
||||
LOCAL_SRC_FILES := deps/irrlicht/lib/Android/libIrrlicht.a
|
||||
include $(PREBUILT_STATIC_LIBRARY)
|
||||
|
||||
ifeq ($(HAVE_LEVELDB), 1)
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE := LevelDB
|
||||
LOCAL_SRC_FILES := deps/leveldb/libleveldb.a
|
||||
include $(PREBUILT_STATIC_LIBRARY)
|
||||
endif
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE := curl
|
||||
LOCAL_SRC_FILES := deps/curl/lib/.libs/libcurl.a
|
||||
include $(PREBUILT_STATIC_LIBRARY)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE := freetype
|
||||
LOCAL_SRC_FILES := deps/freetype2-android/Android/obj/local/$(TARGET_ARCH_ABI)/libfreetype2-static.a
|
||||
include $(PREBUILT_STATIC_LIBRARY)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE := iconv
|
||||
LOCAL_SRC_FILES := deps/libiconv/lib/.libs/libiconv.so
|
||||
include $(PREBUILT_SHARED_LIBRARY)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE := openal
|
||||
LOCAL_SRC_FILES := deps/openal-soft/libs/$(TARGET_LIBDIR)/libopenal.so
|
||||
include $(PREBUILT_SHARED_LIBRARY)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE := ogg
|
||||
LOCAL_SRC_FILES := deps/libvorbis-libogg-android/libs/$(TARGET_LIBDIR)/libogg.so
|
||||
include $(PREBUILT_SHARED_LIBRARY)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE := vorbis
|
||||
LOCAL_SRC_FILES := deps/libvorbis-libogg-android/libs/$(TARGET_LIBDIR)/libvorbis.so
|
||||
include $(PREBUILT_SHARED_LIBRARY)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE := gmp
|
||||
LOCAL_SRC_FILES := deps/gmp/usr/lib/libgmp.so
|
||||
include $(PREBUILT_SHARED_LIBRARY)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE := ssl
|
||||
LOCAL_SRC_FILES := deps/openssl/libssl.a
|
||||
include $(PREBUILT_STATIC_LIBRARY)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE := crypto
|
||||
LOCAL_SRC_FILES := deps/openssl/libcrypto.a
|
||||
include $(PREBUILT_STATIC_LIBRARY)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE := minetest
|
||||
|
||||
LOCAL_CPP_FEATURES += exceptions
|
||||
|
||||
ifdef GPROF
|
||||
GPROF_DEF=-DGPROF
|
||||
endif
|
||||
|
||||
LOCAL_CFLAGS := -D_IRR_ANDROID_PLATFORM_ \
|
||||
-DHAVE_TOUCHSCREENGUI \
|
||||
-DUSE_CURL=1 \
|
||||
-DUSE_SOUND=1 \
|
||||
-DUSE_FREETYPE=1 \
|
||||
-DUSE_LEVELDB=$(HAVE_LEVELDB) \
|
||||
$(GPROF_DEF) \
|
||||
-pipe -fstrict-aliasing
|
||||
|
||||
ifndef NDEBUG
|
||||
LOCAL_CFLAGS += -g -D_DEBUG -O0 -fno-omit-frame-pointer
|
||||
else
|
||||
LOCAL_CFLAGS += -fexpensive-optimizations -O3
|
||||
endif
|
||||
|
||||
ifdef GPROF
|
||||
PROFILER_LIBS := android-ndk-profiler
|
||||
LOCAL_CFLAGS += -pg
|
||||
endif
|
||||
|
||||
# LOCAL_CFLAGS += -fsanitize=address
|
||||
# LOCAL_LDFLAGS += -fsanitize=address
|
||||
|
||||
ifeq ($(TARGET_ARCH_ABI),x86)
|
||||
LOCAL_CFLAGS += -fno-stack-protector
|
||||
endif
|
||||
|
||||
LOCAL_C_INCLUDES := \
|
||||
jni/src jni/src/sqlite \
|
||||
jni/src/script \
|
||||
jni/src/lua/src \
|
||||
jni/src/json \
|
||||
jni/src/cguittfont \
|
||||
deps/irrlicht/include \
|
||||
deps/libiconv/include \
|
||||
deps/freetype2-android/include \
|
||||
deps/curl/include \
|
||||
deps/openal-soft/jni/OpenAL/include \
|
||||
deps/libvorbis-libogg-android/jni/include \
|
||||
deps/gmp/usr/include \
|
||||
deps/leveldb/include \
|
||||
deps/sqlite/
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
jni/src/areastore.cpp \
|
||||
jni/src/ban.cpp \
|
||||
jni/src/camera.cpp \
|
||||
jni/src/cavegen.cpp \
|
||||
jni/src/chat.cpp \
|
||||
jni/src/client.cpp \
|
||||
jni/src/clientiface.cpp \
|
||||
jni/src/clientmap.cpp \
|
||||
jni/src/clientmedia.cpp \
|
||||
jni/src/clientobject.cpp \
|
||||
jni/src/clouds.cpp \
|
||||
jni/src/collision.cpp \
|
||||
jni/src/content_abm.cpp \
|
||||
jni/src/content_cao.cpp \
|
||||
jni/src/content_cso.cpp \
|
||||
jni/src/content_mapblock.cpp \
|
||||
jni/src/content_mapnode.cpp \
|
||||
jni/src/content_nodemeta.cpp \
|
||||
jni/src/content_sao.cpp \
|
||||
jni/src/convert_json.cpp \
|
||||
jni/src/craftdef.cpp \
|
||||
jni/src/database-dummy.cpp \
|
||||
jni/src/database-sqlite3.cpp \
|
||||
jni/src/database.cpp \
|
||||
jni/src/debug.cpp \
|
||||
jni/src/defaultsettings.cpp \
|
||||
jni/src/drawscene.cpp \
|
||||
jni/src/dungeongen.cpp \
|
||||
jni/src/emerge.cpp \
|
||||
jni/src/environment.cpp \
|
||||
jni/src/filecache.cpp \
|
||||
jni/src/filesys.cpp \
|
||||
jni/src/fontengine.cpp \
|
||||
jni/src/game.cpp \
|
||||
jni/src/genericobject.cpp \
|
||||
jni/src/gettext.cpp \
|
||||
jni/src/guiChatConsole.cpp \
|
||||
jni/src/guiEngine.cpp \
|
||||
jni/src/guiFileSelectMenu.cpp \
|
||||
jni/src/guiFormSpecMenu.cpp \
|
||||
jni/src/guiKeyChangeMenu.cpp \
|
||||
jni/src/guiPasswordChange.cpp \
|
||||
jni/src/guiTable.cpp \
|
||||
jni/src/guiscalingfilter.cpp \
|
||||
jni/src/guiVolumeChange.cpp \
|
||||
jni/src/httpfetch.cpp \
|
||||
jni/src/hud.cpp \
|
||||
jni/src/imagefilters.cpp \
|
||||
jni/src/intlGUIEditBox.cpp \
|
||||
jni/src/inventory.cpp \
|
||||
jni/src/inventorymanager.cpp \
|
||||
jni/src/itemdef.cpp \
|
||||
jni/src/keycode.cpp \
|
||||
jni/src/light.cpp \
|
||||
jni/src/localplayer.cpp \
|
||||
jni/src/log.cpp \
|
||||
jni/src/main.cpp \
|
||||
jni/src/map.cpp \
|
||||
jni/src/mapblock.cpp \
|
||||
jni/src/mapblock_mesh.cpp \
|
||||
jni/src/mapgen.cpp \
|
||||
jni/src/mapgen_singlenode.cpp \
|
||||
jni/src/mapgen_v5.cpp \
|
||||
jni/src/mapgen_v6.cpp \
|
||||
jni/src/mapgen_v7.cpp \
|
||||
jni/src/mapnode.cpp \
|
||||
jni/src/mapsector.cpp \
|
||||
jni/src/mesh.cpp \
|
||||
jni/src/mg_biome.cpp \
|
||||
jni/src/mg_decoration.cpp \
|
||||
jni/src/mg_ore.cpp \
|
||||
jni/src/mg_schematic.cpp \
|
||||
jni/src/minimap.cpp \
|
||||
jni/src/mods.cpp \
|
||||
jni/src/nameidmapping.cpp \
|
||||
jni/src/nodedef.cpp \
|
||||
jni/src/nodemetadata.cpp \
|
||||
jni/src/nodetimer.cpp \
|
||||
jni/src/noise.cpp \
|
||||
jni/src/objdef.cpp \
|
||||
jni/src/object_properties.cpp \
|
||||
jni/src/particles.cpp \
|
||||
jni/src/pathfinder.cpp \
|
||||
jni/src/player.cpp \
|
||||
jni/src/porting_android.cpp \
|
||||
jni/src/porting.cpp \
|
||||
jni/src/profiler.cpp \
|
||||
jni/src/quicktune.cpp \
|
||||
jni/src/rollback.cpp \
|
||||
jni/src/rollback_interface.cpp \
|
||||
jni/src/serialization.cpp \
|
||||
jni/src/server.cpp \
|
||||
jni/src/serverlist.cpp \
|
||||
jni/src/serverobject.cpp \
|
||||
jni/src/shader.cpp \
|
||||
jni/src/sky.cpp \
|
||||
jni/src/socket.cpp \
|
||||
jni/src/sound.cpp \
|
||||
jni/src/sound_openal.cpp \
|
||||
jni/src/staticobject.cpp \
|
||||
jni/src/subgame.cpp \
|
||||
jni/src/tool.cpp \
|
||||
jni/src/treegen.cpp \
|
||||
jni/src/version.cpp \
|
||||
jni/src/voxel.cpp \
|
||||
jni/src/voxelalgorithms.cpp \
|
||||
jni/src/util/auth.cpp \
|
||||
jni/src/util/base64.cpp \
|
||||
jni/src/util/directiontables.cpp \
|
||||
jni/src/util/numeric.cpp \
|
||||
jni/src/util/pointedthing.cpp \
|
||||
jni/src/util/serialize.cpp \
|
||||
jni/src/util/sha1.cpp \
|
||||
jni/src/util/string.cpp \
|
||||
jni/src/util/srp.cpp \
|
||||
jni/src/util/timetaker.cpp \
|
||||
jni/src/unittest/test.cpp \
|
||||
jni/src/unittest/test_collision.cpp \
|
||||
jni/src/unittest/test_compression.cpp \
|
||||
jni/src/unittest/test_connection.cpp \
|
||||
jni/src/unittest/test_filepath.cpp \
|
||||
jni/src/unittest/test_inventory.cpp \
|
||||
jni/src/unittest/test_mapnode.cpp \
|
||||
jni/src/unittest/test_nodedef.cpp \
|
||||
jni/src/unittest/test_noderesolver.cpp \
|
||||
jni/src/unittest/test_noise.cpp \
|
||||
jni/src/unittest/test_objdef.cpp \
|
||||
jni/src/unittest/test_profiler.cpp \
|
||||
jni/src/unittest/test_random.cpp \
|
||||
jni/src/unittest/test_schematic.cpp \
|
||||
jni/src/unittest/test_serialization.cpp \
|
||||
jni/src/unittest/test_settings.cpp \
|
||||
jni/src/unittest/test_socket.cpp \
|
||||
jni/src/unittest/test_utilities.cpp \
|
||||
jni/src/unittest/test_voxelalgorithms.cpp \
|
||||
jni/src/unittest/test_voxelmanipulator.cpp \
|
||||
jni/src/touchscreengui.cpp \
|
||||
jni/src/database-leveldb.cpp \
|
||||
jni/src/settings.cpp \
|
||||
jni/src/wieldmesh.cpp \
|
||||
jni/src/client/clientlauncher.cpp \
|
||||
jni/src/client/tile.cpp
|
||||
|
||||
# intentionally kept out (we already build openssl itself): jni/src/util/sha256.c
|
||||
|
||||
# Network
|
||||
LOCAL_SRC_FILES += \
|
||||
jni/src/network/connection.cpp \
|
||||
jni/src/network/networkpacket.cpp \
|
||||
jni/src/network/clientopcodes.cpp \
|
||||
jni/src/network/clientpackethandler.cpp \
|
||||
jni/src/network/serveropcodes.cpp \
|
||||
jni/src/network/serverpackethandler.cpp \
|
||||
|
||||
# lua api
|
||||
LOCAL_SRC_FILES += \
|
||||
jni/src/script/common/c_content.cpp \
|
||||
jni/src/script/common/c_converter.cpp \
|
||||
jni/src/script/common/c_internal.cpp \
|
||||
jni/src/script/common/c_types.cpp \
|
||||
jni/src/script/cpp_api/s_async.cpp \
|
||||
jni/src/script/cpp_api/s_base.cpp \
|
||||
jni/src/script/cpp_api/s_entity.cpp \
|
||||
jni/src/script/cpp_api/s_env.cpp \
|
||||
jni/src/script/cpp_api/s_inventory.cpp \
|
||||
jni/src/script/cpp_api/s_item.cpp \
|
||||
jni/src/script/cpp_api/s_mainmenu.cpp \
|
||||
jni/src/script/cpp_api/s_node.cpp \
|
||||
jni/src/script/cpp_api/s_nodemeta.cpp \
|
||||
jni/src/script/cpp_api/s_player.cpp \
|
||||
jni/src/script/cpp_api/s_security.cpp \
|
||||
jni/src/script/cpp_api/s_server.cpp \
|
||||
jni/src/script/lua_api/l_areastore.cpp \
|
||||
jni/src/script/lua_api/l_base.cpp \
|
||||
jni/src/script/lua_api/l_craft.cpp \
|
||||
jni/src/script/lua_api/l_env.cpp \
|
||||
jni/src/script/lua_api/l_inventory.cpp \
|
||||
jni/src/script/lua_api/l_item.cpp \
|
||||
jni/src/script/lua_api/l_mainmenu.cpp \
|
||||
jni/src/script/lua_api/l_mapgen.cpp \
|
||||
jni/src/script/lua_api/l_nodemeta.cpp \
|
||||
jni/src/script/lua_api/l_nodetimer.cpp \
|
||||
jni/src/script/lua_api/l_noise.cpp \
|
||||
jni/src/script/lua_api/l_object.cpp \
|
||||
jni/src/script/lua_api/l_particles.cpp \
|
||||
jni/src/script/lua_api/l_rollback.cpp \
|
||||
jni/src/script/lua_api/l_server.cpp \
|
||||
jni/src/script/lua_api/l_settings.cpp \
|
||||
jni/src/script/lua_api/l_util.cpp \
|
||||
jni/src/script/lua_api/l_vmanip.cpp \
|
||||
jni/src/script/scripting_game.cpp \
|
||||
jni/src/script/scripting_mainmenu.cpp
|
||||
|
||||
#freetype2 support
|
||||
LOCAL_SRC_FILES += \
|
||||
jni/src/cguittfont/xCGUITTFont.cpp
|
||||
|
||||
# lua
|
||||
LOCAL_SRC_FILES += \
|
||||
jni/src/lua/src/lapi.c \
|
||||
jni/src/lua/src/lauxlib.c \
|
||||
jni/src/lua/src/lbaselib.c \
|
||||
jni/src/lua/src/lcode.c \
|
||||
jni/src/lua/src/ldblib.c \
|
||||
jni/src/lua/src/ldebug.c \
|
||||
jni/src/lua/src/ldo.c \
|
||||
jni/src/lua/src/ldump.c \
|
||||
jni/src/lua/src/lfunc.c \
|
||||
jni/src/lua/src/lgc.c \
|
||||
jni/src/lua/src/linit.c \
|
||||
jni/src/lua/src/liolib.c \
|
||||
jni/src/lua/src/llex.c \
|
||||
jni/src/lua/src/lmathlib.c \
|
||||
jni/src/lua/src/lmem.c \
|
||||
jni/src/lua/src/loadlib.c \
|
||||
jni/src/lua/src/lobject.c \
|
||||
jni/src/lua/src/lopcodes.c \
|
||||
jni/src/lua/src/loslib.c \
|
||||
jni/src/lua/src/lparser.c \
|
||||
jni/src/lua/src/lstate.c \
|
||||
jni/src/lua/src/lstring.c \
|
||||
jni/src/lua/src/lstrlib.c \
|
||||
jni/src/lua/src/ltable.c \
|
||||
jni/src/lua/src/ltablib.c \
|
||||
jni/src/lua/src/ltm.c \
|
||||
jni/src/lua/src/lundump.c \
|
||||
jni/src/lua/src/lvm.c \
|
||||
jni/src/lua/src/lzio.c \
|
||||
jni/src/lua/src/print.c
|
||||
|
||||
# sqlite
|
||||
LOCAL_SRC_FILES += deps/sqlite/sqlite3.c
|
||||
|
||||
# jthread
|
||||
LOCAL_SRC_FILES += \
|
||||
jni/src/jthread/pthread/jevent.cpp \
|
||||
jni/src/jthread/pthread/jmutex.cpp \
|
||||
jni/src/jthread/pthread/jsemaphore.cpp \
|
||||
jni/src/jthread/pthread/jthread.cpp
|
||||
|
||||
# json
|
||||
LOCAL_SRC_FILES += jni/src/json/jsoncpp.cpp
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := iconv openal ogg vorbis gmp
|
||||
LOCAL_STATIC_LIBRARIES := Irrlicht freetype curl ssl crypto android_native_app_glue $(PROFILER_LIBS)
|
||||
|
||||
ifeq ($(HAVE_LEVELDB), 1)
|
||||
LOCAL_STATIC_LIBRARIES += LevelDB
|
||||
endif
|
||||
LOCAL_LDLIBS := -lEGL -llog -lGLESv1_CM -lGLESv2 -lz -landroid
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
||||
# at the end of Android.mk
|
||||
ifdef GPROF
|
||||
$(call import-module,android-ndk-profiler)
|
||||
endif
|
||||
$(call import-module,android/native_app_glue)
|
||||
8
build/android/jni/Application.mk
Normal file
8
build/android/jni/Application.mk
Normal file
@@ -0,0 +1,8 @@
|
||||
# NDK_TOOLCHAIN_VERSION := clang3.3
|
||||
|
||||
APP_PLATFORM := android-9
|
||||
APP_MODULES := minetest
|
||||
APP_STL := gnustl_static
|
||||
|
||||
APP_CPPFLAGS += -fexceptions
|
||||
APP_GNUSTL_FORCE_CPP_FEATURES := rtti
|
||||
39
build/android/libiconv_android.patch
Normal file
39
build/android/libiconv_android.patch
Normal file
@@ -0,0 +1,39 @@
|
||||
--- a/libcharset/lib/localcharset.c 2015-06-10 11:55:25.933870724 +0200
|
||||
+++ b/libcharset/lib/localcharset.c 2015-06-10 11:55:39.578063493 +0200
|
||||
@@ -47,7 +47,7 @@
|
||||
|
||||
#if !defined WIN32_NATIVE
|
||||
# include <unistd.h>
|
||||
-# if HAVE_LANGINFO_CODESET
|
||||
+# if HAVE_LANGINFO_CODESET && !(defined __ANDROID__)
|
||||
# include <langinfo.h>
|
||||
# else
|
||||
# if 0 /* see comment below */
|
||||
@@ -124,7 +124,7 @@ get_charset_aliases (void)
|
||||
cp = charset_aliases;
|
||||
if (cp == NULL)
|
||||
{
|
||||
-#if !(defined DARWIN7 || defined VMS || defined WIN32_NATIVE || defined __CYGWIN__)
|
||||
+#if !(defined DARWIN7 || defined VMS || defined WIN32_NATIVE || defined __CYGWIN__ || defined __ANDROID__)
|
||||
const char *dir;
|
||||
const char *base = "charset.alias";
|
||||
char *file_name;
|
||||
@@ -338,6 +338,9 @@ get_charset_aliases (void)
|
||||
"CP54936" "\0" "GB18030" "\0"
|
||||
"CP65001" "\0" "UTF-8" "\0";
|
||||
# endif
|
||||
+# if defined __ANDROID__
|
||||
+ cp = "*" "\0" "UTF-8" "\0";
|
||||
+# endif
|
||||
#endif
|
||||
|
||||
charset_aliases = cp;
|
||||
@@ -361,7 +364,7 @@ locale_charset (void)
|
||||
const char *codeset;
|
||||
const char *aliases;
|
||||
|
||||
-#if !(defined WIN32_NATIVE || defined OS2)
|
||||
+#if !(defined WIN32_NATIVE || defined OS2 || defined __ANDROID__)
|
||||
|
||||
# if HAVE_LANGINFO_CODESET
|
||||
|
||||
13
build/android/libiconv_stdio.patch
Normal file
13
build/android/libiconv_stdio.patch
Normal file
@@ -0,0 +1,13 @@
|
||||
--- a/srclib/stdio.in.h 2011-08-07 15:42:06.000000000 +0200
|
||||
+++ b/srclib/stdio.in.h 2015-06-10 09:27:58.129056262 +0200
|
||||
@@ -695,8 +696,9 @@ _GL_CXXALIASWARN (gets);
|
||||
/* It is very rare that the developer ever has full control of stdin,
|
||||
so any use of gets warrants an unconditional warning. Assume it is
|
||||
always declared, since it is required by C89. */
|
||||
-_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
|
||||
+/*_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");*/
|
||||
+#define gets(a) fgets( a, sizeof(*(a)), stdin)
|
||||
#endif
|
||||
|
||||
|
||||
#if @GNULIB_OBSTACK_PRINTF@ || @GNULIB_OBSTACK_PRINTF_POSIX@
|
||||
37
build/android/libvorbis-libogg-fpu.patch
Normal file
37
build/android/libvorbis-libogg-fpu.patch
Normal file
@@ -0,0 +1,37 @@
|
||||
--- libvorbis-libogg-android/jni/libvorbis-jni/Android.mk.orig 2014-06-17 19:22:50.621559073 +0200
|
||||
+++ libvorbis-libogg-android/jni/libvorbis-jni/Android.mk 2014-06-17 19:38:20.641581140 +0200
|
||||
@@ -4,9 +4,6 @@
|
||||
|
||||
LOCAL_MODULE := vorbis-jni
|
||||
LOCAL_CFLAGS += -I$(LOCAL_PATH)/../include -fsigned-char
|
||||
-ifeq ($(TARGET_ARCH),arm)
|
||||
- LOCAL_CFLAGS += -march=armv6 -marm -mfloat-abi=softfp -mfpu=vfp
|
||||
-endif
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := libogg libvorbis
|
||||
|
||||
--- libvorbis-libogg-android/jni/libvorbis/Android.mk.orig 2014-06-17 19:22:39.077558797 +0200
|
||||
+++ libvorbis-libogg-android/jni/libvorbis/Android.mk 2014-06-17 19:38:52.121581887 +0200
|
||||
@@ -4,9 +4,6 @@
|
||||
|
||||
LOCAL_MODULE := libvorbis
|
||||
LOCAL_CFLAGS += -I$(LOCAL_PATH)/../include -ffast-math -fsigned-char
|
||||
-ifeq ($(TARGET_ARCH),arm)
|
||||
- LOCAL_CFLAGS += -march=armv6 -marm -mfloat-abi=softfp -mfpu=vfp
|
||||
-endif
|
||||
LOCAL_SHARED_LIBRARIES := libogg
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
--- libvorbis-libogg-android/jni/libogg/Android.mk.orig 2014-06-17 19:22:33.965558675 +0200
|
||||
+++ libvorbis-libogg-android/jni/libogg/Android.mk 2014-06-17 19:38:25.337581252 +0200
|
||||
@@ -4,10 +4,6 @@
|
||||
|
||||
LOCAL_MODULE := libogg
|
||||
LOCAL_CFLAGS += -I$(LOCAL_PATH)/../include -ffast-math -fsigned-char
|
||||
-ifeq ($(TARGET_ARCH),arm)
|
||||
- LOCAL_CFLAGS += -march=armv6 -marm -mfloat-abi=softfp -mfpu=vfp
|
||||
-endif
|
||||
-
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
bitwise.c \
|
||||
11
build/android/openssl_arch.patch
Normal file
11
build/android/openssl_arch.patch
Normal file
@@ -0,0 +1,11 @@
|
||||
--- openssl-1.0.1j/Configure.orig 2014-10-15 14:53:39.000000000 +0200
|
||||
+++ openssl-1.0.1j/Configure 2015-01-03 22:41:43.505749921 +0100
|
||||
@@ -407,6 +407,8 @@
|
||||
"android","gcc:-mandroid -I\$(ANDROID_DEV)/include -B\$(ANDROID_DEV)/lib -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"android-x86","gcc:-mandroid -I\$(ANDROID_DEV)/include -B\$(ANDROID_DEV)/lib -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:".eval{my $asm=${x86_elf_asm};$asm=~s/:elf/:android/;$asm}.":dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
"android-armv7","gcc:-march=armv7-a -mandroid -I\$(ANDROID_DEV)/include -B\$(ANDROID_DEV)/lib -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${armv4_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
+"android-arm","gcc:-march=armv4 -mandroid -I\$(ANDROID_DEV)/include -B\$(ANDROID_DEV)/lib -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${armv4_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
+"android-mips32","gcc:-march=mips32 -mandroid -I\$(ANDROID_DEV)/include -B\$(ANDROID_DEV)/lib -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${mips32_asm}:o32:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
|
||||
#### *BSD [do see comment about ${BSDthreads} above!]
|
||||
"BSD-generic32","gcc:-DTERMIOS -O3 -fomit-frame-pointer -Wall::${BSDthreads}:::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
|
||||
1
build/android/project.properties
Normal file
1
build/android/project.properties
Normal file
@@ -0,0 +1 @@
|
||||
target=android-10
|
||||
BIN
build/android/res/drawable-hdpi/irr_icon.png
Normal file
BIN
build/android/res/drawable-hdpi/irr_icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.4 KiB |
BIN
build/android/res/drawable-ldpi/irr_icon.png
Normal file
BIN
build/android/res/drawable-ldpi/irr_icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.2 KiB |
BIN
build/android/res/drawable-mdpi/irr_icon.png
Normal file
BIN
build/android/res/drawable-mdpi/irr_icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.0 KiB |
BIN
build/android/res/drawable-xhdpi/irr_icon.png
Normal file
BIN
build/android/res/drawable-xhdpi/irr_icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.4 KiB |
22
build/android/res/layout/assetcopy.xml
Normal file
22
build/android/res/layout/assetcopy.xml
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progressBar1"
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:text="preparing media ..."
|
||||
android:textAppearance="?android:attr/textAppearanceSmall" />
|
||||
|
||||
</LinearLayout>
|
||||
11
build/android/res/values/styles.xml
Normal file
11
build/android/res/values/styles.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<style name="Theme.Transparent" parent="android:Theme">
|
||||
<item name="android:windowIsTranslucent">true</item>
|
||||
<item name="android:windowBackground">@android:color/transparent</item>
|
||||
<item name="android:windowContentOverlay">@null</item>
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
<item name="android:windowIsFloating">true</item>
|
||||
<item name="android:backgroundDimEnabled">false</item>
|
||||
</style>
|
||||
</resources>
|
||||
456
build/android/src/net/minetest/minetest/MinetestAssetCopy.java
Normal file
456
build/android/src/net/minetest/minetest/MinetestAssetCopy.java
Normal file
@@ -0,0 +1,456 @@
|
||||
package net.minetest.minetest;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
import java.util.Vector;
|
||||
import java.util.Iterator;
|
||||
import java.lang.Object;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.res.AssetFileDescriptor;
|
||||
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
import android.os.Environment;
|
||||
import android.util.Log;
|
||||
import android.view.Display;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.Paint;
|
||||
import android.text.TextPaint;
|
||||
|
||||
public class MinetestAssetCopy extends Activity
|
||||
{
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState)
|
||||
{
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
setContentView(R.layout.assetcopy);
|
||||
|
||||
m_ProgressBar = (ProgressBar) findViewById(R.id.progressBar1);
|
||||
m_Filename = (TextView) findViewById(R.id.textView1);
|
||||
|
||||
Display display = getWindowManager().getDefaultDisplay();
|
||||
m_ProgressBar.getLayoutParams().width = (int) (display.getWidth() * 0.8);
|
||||
m_ProgressBar.invalidate();
|
||||
|
||||
/* check if there's already a copy in progress and reuse in case it is*/
|
||||
MinetestAssetCopy prevActivity =
|
||||
(MinetestAssetCopy) getLastNonConfigurationInstance();
|
||||
if(prevActivity!= null) {
|
||||
m_AssetCopy = prevActivity.m_AssetCopy;
|
||||
}
|
||||
else {
|
||||
m_AssetCopy = new copyAssetTask();
|
||||
m_AssetCopy.execute();
|
||||
}
|
||||
}
|
||||
|
||||
/* preserve asset copy background task to prevent restart of copying */
|
||||
/* this way of doing it is not recommended for latest android version */
|
||||
/* but the recommended way isn't available on android 2.x */
|
||||
public Object onRetainNonConfigurationInstance()
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
ProgressBar m_ProgressBar;
|
||||
TextView m_Filename;
|
||||
|
||||
copyAssetTask m_AssetCopy;
|
||||
|
||||
private class copyAssetTask extends AsyncTask<String, Integer, String>
|
||||
{
|
||||
private long getFullSize(String filename)
|
||||
{
|
||||
long size = 0;
|
||||
try {
|
||||
InputStream src = getAssets().open(filename);
|
||||
byte[] buf = new byte[4096];
|
||||
|
||||
int len = 0;
|
||||
while ((len = src.read(buf)) > 0)
|
||||
{
|
||||
size += len;
|
||||
}
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
return size;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String doInBackground(String... files)
|
||||
{
|
||||
m_foldernames = new Vector<String>();
|
||||
m_filenames = new Vector<String>();
|
||||
m_tocopy = new Vector<String>();
|
||||
m_asset_size_unknown = new Vector<String>();
|
||||
String baseDir =
|
||||
Environment.getExternalStorageDirectory().getAbsolutePath()
|
||||
+ "/";
|
||||
|
||||
|
||||
// prepare temp folder
|
||||
File TempFolder = new File(baseDir + "Minetest/tmp/");
|
||||
|
||||
if (!TempFolder.exists())
|
||||
{
|
||||
TempFolder.mkdir();
|
||||
}
|
||||
else {
|
||||
File[] todel = TempFolder.listFiles();
|
||||
|
||||
for(int i=0; i < todel.length; i++)
|
||||
{
|
||||
Log.v("MinetestAssetCopy","deleting: " + todel[i].getAbsolutePath());
|
||||
todel[i].delete();
|
||||
}
|
||||
}
|
||||
|
||||
// add a .nomedia file
|
||||
try {
|
||||
OutputStream dst = new FileOutputStream(baseDir + "Minetest/.nomedia");
|
||||
dst.close();
|
||||
} catch (IOException e) {
|
||||
Log.e("MinetestAssetCopy","Failed to create .nomedia file");
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
// build lists from prepared data
|
||||
BuildFolderList();
|
||||
BuildFileList();
|
||||
|
||||
// scan filelist
|
||||
ProcessFileList();
|
||||
|
||||
// doing work
|
||||
m_copy_started = true;
|
||||
m_ProgressBar.setMax(m_tocopy.size());
|
||||
|
||||
for (int i = 0; i < m_tocopy.size(); i++)
|
||||
{
|
||||
try
|
||||
{
|
||||
String filename = m_tocopy.get(i);
|
||||
publishProgress(i);
|
||||
|
||||
boolean asset_size_unknown = false;
|
||||
long filesize = -1;
|
||||
|
||||
if (m_asset_size_unknown.contains(filename))
|
||||
{
|
||||
File testme = new File(baseDir + "/" + filename);
|
||||
|
||||
if(testme.exists())
|
||||
{
|
||||
filesize = testme.length();
|
||||
}
|
||||
asset_size_unknown = true;
|
||||
}
|
||||
|
||||
InputStream src;
|
||||
try
|
||||
{
|
||||
src = getAssets().open(filename);
|
||||
} catch (IOException e) {
|
||||
Log.e("MinetestAssetCopy","Copying file: " + filename + " FAILED (not in assets)");
|
||||
e.printStackTrace();
|
||||
continue;
|
||||
}
|
||||
|
||||
// Transfer bytes from in to out
|
||||
byte[] buf = new byte[1*1024];
|
||||
int len = src.read(buf, 0, 1024);
|
||||
|
||||
/* following handling is crazy but we need to deal with */
|
||||
/* compressed assets.Flash chips limited livetime due to */
|
||||
/* write operations, we can't allow large files to destroy */
|
||||
/* users flash. */
|
||||
if (asset_size_unknown)
|
||||
{
|
||||
if ( (len > 0) && (len < buf.length) && (len == filesize))
|
||||
{
|
||||
src.close();
|
||||
continue;
|
||||
}
|
||||
|
||||
if (len == buf.length)
|
||||
{
|
||||
src.close();
|
||||
long size = getFullSize(filename);
|
||||
if ( size == filesize)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
src = getAssets().open(filename);
|
||||
len = src.read(buf, 0, 1024);
|
||||
}
|
||||
}
|
||||
if (len > 0)
|
||||
{
|
||||
int total_filesize = 0;
|
||||
OutputStream dst;
|
||||
try
|
||||
{
|
||||
dst = new FileOutputStream(baseDir + "/" + filename);
|
||||
} catch (IOException e) {
|
||||
Log.e("MinetestAssetCopy","Copying file: " + baseDir +
|
||||
"/" + filename + " FAILED (couldn't open output file)");
|
||||
e.printStackTrace();
|
||||
src.close();
|
||||
continue;
|
||||
}
|
||||
dst.write(buf, 0, len);
|
||||
total_filesize += len;
|
||||
|
||||
while ((len = src.read(buf)) > 0)
|
||||
{
|
||||
dst.write(buf, 0, len);
|
||||
total_filesize += len;
|
||||
}
|
||||
|
||||
dst.close();
|
||||
Log.v("MinetestAssetCopy","Copied file: " +
|
||||
m_tocopy.get(i) + " (" + total_filesize +
|
||||
" bytes)");
|
||||
}
|
||||
else if (len < 0)
|
||||
{
|
||||
Log.e("MinetestAssetCopy","Copying file: " +
|
||||
m_tocopy.get(i) + " failed, size < 0");
|
||||
}
|
||||
src.close();
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
Log.e("MinetestAssetCopy","Copying file: " +
|
||||
m_tocopy.get(i) + " failed");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* update progress bar
|
||||
*/
|
||||
protected void onProgressUpdate(Integer... progress)
|
||||
{
|
||||
|
||||
if (m_copy_started)
|
||||
{
|
||||
boolean shortened = false;
|
||||
String todisplay = m_tocopy.get(progress[0]);
|
||||
m_ProgressBar.setProgress(progress[0]);
|
||||
|
||||
// make sure our text doesn't exceed our layout width
|
||||
Rect bounds = new Rect();
|
||||
Paint textPaint = m_Filename.getPaint();
|
||||
textPaint.getTextBounds(todisplay, 0, todisplay.length(), bounds);
|
||||
|
||||
while (bounds.width() > getResources().getDisplayMetrics().widthPixels * 0.7) {
|
||||
if (todisplay.length() < 2) {
|
||||
break;
|
||||
}
|
||||
todisplay = todisplay.substring(1);
|
||||
textPaint.getTextBounds(todisplay, 0, todisplay.length(), bounds);
|
||||
shortened = true;
|
||||
}
|
||||
|
||||
if (! shortened) {
|
||||
m_Filename.setText(todisplay);
|
||||
}
|
||||
else {
|
||||
m_Filename.setText(".." + todisplay);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
boolean shortened = false;
|
||||
String todisplay = m_Foldername;
|
||||
String full_text = "scanning " + todisplay + " ...";
|
||||
// make sure our text doesn't exceed our layout width
|
||||
Rect bounds = new Rect();
|
||||
Paint textPaint = m_Filename.getPaint();
|
||||
textPaint.getTextBounds(full_text, 0, full_text.length(), bounds);
|
||||
|
||||
while (bounds.width() > getResources().getDisplayMetrics().widthPixels * 0.7) {
|
||||
if (todisplay.length() < 2) {
|
||||
break;
|
||||
}
|
||||
todisplay = todisplay.substring(1);
|
||||
full_text = "scanning " + todisplay + " ...";
|
||||
textPaint.getTextBounds(full_text, 0, full_text.length(), bounds);
|
||||
shortened = true;
|
||||
}
|
||||
|
||||
if (! shortened) {
|
||||
m_Filename.setText(full_text);
|
||||
}
|
||||
else {
|
||||
m_Filename.setText("scanning .." + todisplay + " ...");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* check al files and folders in filelist
|
||||
*/
|
||||
protected void ProcessFileList()
|
||||
{
|
||||
String FlashBaseDir =
|
||||
Environment.getExternalStorageDirectory().getAbsolutePath();
|
||||
|
||||
Iterator itr = m_filenames.iterator();
|
||||
|
||||
while (itr.hasNext())
|
||||
{
|
||||
String current_path = (String) itr.next();
|
||||
String FlashPath = FlashBaseDir + "/" + current_path;
|
||||
|
||||
if (isAssetFolder(current_path))
|
||||
{
|
||||
/* store information and update gui */
|
||||
m_Foldername = current_path;
|
||||
publishProgress(0);
|
||||
|
||||
/* open file in order to check if it's a folder */
|
||||
File current_folder = new File(FlashPath);
|
||||
if (!current_folder.exists())
|
||||
{
|
||||
if (!current_folder.mkdirs())
|
||||
{
|
||||
Log.e("MinetestAssetCopy","\t failed create folder: " +
|
||||
FlashPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.v("MinetestAssetCopy","\t created folder: " +
|
||||
FlashPath);
|
||||
}
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
/* if it's not a folder it's most likely a file */
|
||||
boolean refresh = true;
|
||||
|
||||
File testme = new File(FlashPath);
|
||||
|
||||
long asset_filesize = -1;
|
||||
long stored_filesize = -1;
|
||||
|
||||
if (testme.exists())
|
||||
{
|
||||
try
|
||||
{
|
||||
AssetFileDescriptor fd = getAssets().openFd(current_path);
|
||||
asset_filesize = fd.getLength();
|
||||
fd.close();
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
refresh = true;
|
||||
m_asset_size_unknown.add(current_path);
|
||||
Log.e("MinetestAssetCopy","Failed to open asset file \"" +
|
||||
FlashPath + "\" for size check");
|
||||
}
|
||||
|
||||
stored_filesize = testme.length();
|
||||
|
||||
if (asset_filesize == stored_filesize)
|
||||
{
|
||||
refresh = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (refresh)
|
||||
{
|
||||
m_tocopy.add(current_path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* read list of folders prepared on package build
|
||||
*/
|
||||
protected void BuildFolderList()
|
||||
{
|
||||
try
|
||||
{
|
||||
InputStream is = getAssets().open("index.txt");
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(is));
|
||||
|
||||
String line = reader.readLine();
|
||||
while (line != null)
|
||||
{
|
||||
m_foldernames.add(line);
|
||||
line = reader.readLine();
|
||||
}
|
||||
is.close();
|
||||
} catch (IOException e1)
|
||||
{
|
||||
Log.e("MinetestAssetCopy","Error on processing index.txt");
|
||||
e1.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* read list of asset files prepared on package build
|
||||
*/
|
||||
protected void BuildFileList()
|
||||
{
|
||||
long entrycount = 0;
|
||||
try
|
||||
{
|
||||
InputStream is = getAssets().open("filelist.txt");
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(is));
|
||||
|
||||
String line = reader.readLine();
|
||||
while (line != null)
|
||||
{
|
||||
m_filenames.add(line);
|
||||
line = reader.readLine();
|
||||
entrycount ++;
|
||||
}
|
||||
is.close();
|
||||
}
|
||||
catch (IOException e1)
|
||||
{
|
||||
Log.e("MinetestAssetCopy","Error on processing filelist.txt");
|
||||
e1.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
protected void onPostExecute (String result)
|
||||
{
|
||||
finish();
|
||||
}
|
||||
|
||||
protected boolean isAssetFolder(String path)
|
||||
{
|
||||
return m_foldernames.contains(path);
|
||||
}
|
||||
|
||||
boolean m_copy_started = false;
|
||||
String m_Foldername = "media";
|
||||
Vector<String> m_foldernames;
|
||||
Vector<String> m_filenames;
|
||||
Vector<String> m_tocopy;
|
||||
Vector<String> m_asset_size_unknown;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package net.minetest.minetest;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.text.InputType;
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.view.View.OnKeyListener;
|
||||
import android.widget.EditText;
|
||||
|
||||
public class MinetestTextEntry extends Activity {
|
||||
public AlertDialog mTextInputDialog;
|
||||
public EditText mTextInputWidget;
|
||||
|
||||
private final int MultiLineTextInput = 1;
|
||||
private final int SingleLineTextInput = 2;
|
||||
private final int SingleLinePasswordInput = 3;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
Bundle b = getIntent().getExtras();
|
||||
String acceptButton = b.getString("EnterButton");
|
||||
String hint = b.getString("hint");
|
||||
String current = b.getString("current");
|
||||
int editType = b.getInt("editType");
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
mTextInputWidget = new EditText(this);
|
||||
mTextInputWidget.setHint(hint);
|
||||
mTextInputWidget.setText(current);
|
||||
mTextInputWidget.setMinWidth(300);
|
||||
if (editType == SingleLinePasswordInput) {
|
||||
mTextInputWidget.setInputType(InputType.TYPE_CLASS_TEXT |
|
||||
InputType.TYPE_TEXT_VARIATION_PASSWORD);
|
||||
}
|
||||
else {
|
||||
mTextInputWidget.setInputType(InputType.TYPE_CLASS_TEXT);
|
||||
}
|
||||
|
||||
|
||||
builder.setView(mTextInputWidget);
|
||||
|
||||
if (editType == MultiLineTextInput) {
|
||||
builder.setPositiveButton(acceptButton, new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int whichButton)
|
||||
{ pushResult(mTextInputWidget.getText().toString()); }
|
||||
});
|
||||
}
|
||||
|
||||
builder.setOnCancelListener(new DialogInterface.OnCancelListener() {
|
||||
public void onCancel(DialogInterface dialog) {
|
||||
cancelDialog();
|
||||
}
|
||||
});
|
||||
|
||||
mTextInputWidget.setOnKeyListener(new OnKeyListener() {
|
||||
@Override
|
||||
public boolean onKey(View view, int KeyCode, KeyEvent event) {
|
||||
if ( KeyCode == KeyEvent.KEYCODE_ENTER){
|
||||
|
||||
pushResult(mTextInputWidget.getText().toString());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
mTextInputDialog = builder.create();
|
||||
mTextInputDialog.show();
|
||||
}
|
||||
|
||||
public void pushResult(String text) {
|
||||
Intent resultData = new Intent();
|
||||
resultData.putExtra("text", text);
|
||||
setResult(Activity.RESULT_OK,resultData);
|
||||
mTextInputDialog.dismiss();
|
||||
finish();
|
||||
}
|
||||
|
||||
public void cancelDialog() {
|
||||
setResult(Activity.RESULT_CANCELED);
|
||||
mTextInputDialog.dismiss();
|
||||
finish();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
package net.minetest.minetest;
|
||||
|
||||
import android.app.NativeActivity;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.WindowManager;
|
||||
|
||||
public class MtNativeActivity extends NativeActivity {
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
m_MessagReturnCode = -1;
|
||||
m_MessageReturnValue = "";
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
|
||||
public void copyAssets() {
|
||||
Intent intent = new Intent(this, MinetestAssetCopy.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
public void showDialog(String acceptButton, String hint, String current,
|
||||
int editType) {
|
||||
|
||||
Intent intent = new Intent(this, MinetestTextEntry.class);
|
||||
Bundle params = new Bundle();
|
||||
params.putString("acceptButton", acceptButton);
|
||||
params.putString("hint", hint);
|
||||
params.putString("current", current);
|
||||
params.putInt("editType", editType);
|
||||
intent.putExtras(params);
|
||||
startActivityForResult(intent, 101);
|
||||
m_MessageReturnValue = "";
|
||||
m_MessagReturnCode = -1;
|
||||
}
|
||||
|
||||
public static native void putMessageBoxResult(String text);
|
||||
|
||||
/* ugly code to workaround putMessageBoxResult not beeing found */
|
||||
public int getDialogState() {
|
||||
return m_MessagReturnCode;
|
||||
}
|
||||
|
||||
public String getDialogValue() {
|
||||
m_MessagReturnCode = -1;
|
||||
return m_MessageReturnValue;
|
||||
}
|
||||
|
||||
public float getDensity() {
|
||||
return getResources().getDisplayMetrics().density;
|
||||
}
|
||||
|
||||
public int getDisplayWidth() {
|
||||
return getResources().getDisplayMetrics().widthPixels;
|
||||
}
|
||||
|
||||
public int getDisplayHeight() {
|
||||
return getResources().getDisplayMetrics().heightPixels;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode,
|
||||
Intent data) {
|
||||
if (requestCode == 101) {
|
||||
if (resultCode == RESULT_OK) {
|
||||
String text = data.getStringExtra("text");
|
||||
m_MessagReturnCode = 0;
|
||||
m_MessageReturnValue = text;
|
||||
}
|
||||
else {
|
||||
m_MessagReturnCode = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static {
|
||||
System.loadLibrary("openal");
|
||||
System.loadLibrary("ogg");
|
||||
System.loadLibrary("vorbis");
|
||||
System.loadLibrary("ssl");
|
||||
System.loadLibrary("crypto");
|
||||
System.loadLibrary("gmp");
|
||||
|
||||
// We don't have to load libminetest.so ourselves,
|
||||
// but if we do, we get nicer logcat errors when
|
||||
// loading fails.
|
||||
System.loadLibrary("minetest");
|
||||
}
|
||||
|
||||
private int m_MessagReturnCode;
|
||||
private String m_MessageReturnValue;
|
||||
}
|
||||
17
builtin/async/init.lua
Normal file
17
builtin/async/init.lua
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
core.log("info", "Initializing Asynchronous environment")
|
||||
|
||||
function core.job_processor(serialized_func, serialized_param)
|
||||
local func = loadstring(serialized_func)
|
||||
local param = core.deserialize(serialized_param)
|
||||
local retval = nil
|
||||
|
||||
if type(func) == "function" then
|
||||
retval = core.serialize(func(param))
|
||||
else
|
||||
core.log("error", "ASYNC WORKER: Unable to deserialize function")
|
||||
end
|
||||
|
||||
return retval or core.serialize(nil)
|
||||
end
|
||||
|
||||
40
builtin/common/async_event.lua
Normal file
40
builtin/common/async_event.lua
Normal file
@@ -0,0 +1,40 @@
|
||||
|
||||
core.async_jobs = {}
|
||||
|
||||
local function handle_job(jobid, serialized_retval)
|
||||
local retval = core.deserialize(serialized_retval)
|
||||
assert(type(core.async_jobs[jobid]) == "function")
|
||||
core.async_jobs[jobid](retval)
|
||||
core.async_jobs[jobid] = nil
|
||||
end
|
||||
|
||||
if core.register_globalstep then
|
||||
core.register_globalstep(function(dtime)
|
||||
for i, job in ipairs(core.get_finished_jobs()) do
|
||||
handle_job(job.jobid, job.retval)
|
||||
end
|
||||
end)
|
||||
else
|
||||
core.async_event_handler = handle_job
|
||||
end
|
||||
|
||||
function core.handle_async(func, parameter, callback)
|
||||
-- Serialize function
|
||||
local serialized_func = string.dump(func)
|
||||
|
||||
assert(serialized_func ~= nil)
|
||||
|
||||
-- Serialize parameters
|
||||
local serialized_param = core.serialize(parameter)
|
||||
|
||||
if serialized_param == nil then
|
||||
return false
|
||||
end
|
||||
|
||||
local jobid = core.do_async_callback(serialized_func, serialized_param)
|
||||
|
||||
core.async_jobs[jobid] = callback
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
317
builtin/common/filterlist.lua
Normal file
317
builtin/common/filterlist.lua
Normal file
@@ -0,0 +1,317 @@
|
||||
--Minetest
|
||||
--Copyright (C) 2013 sapier
|
||||
--
|
||||
--This program is free software; you can redistribute it and/or modify
|
||||
--it under the terms of the GNU Lesser General Public License as published by
|
||||
--the Free Software Foundation; either version 2.1 of the License, or
|
||||
--(at your option) any later version.
|
||||
--
|
||||
--This program is distributed in the hope that it will be useful,
|
||||
--but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
--GNU Lesser General Public License for more details.
|
||||
--
|
||||
--You should have received a copy of the GNU Lesser General Public License along
|
||||
--with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
--51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- TODO improve doc --
|
||||
-- TODO code cleanup --
|
||||
-- Generic implementation of a filter/sortable list --
|
||||
-- Usage: --
|
||||
-- Filterlist needs to be initialized on creation. To achieve this you need to --
|
||||
-- pass following functions: --
|
||||
-- raw_fct() (mandatory): --
|
||||
-- function returning a table containing the elements to be filtered --
|
||||
-- compare_fct(element1,element2) (mandatory): --
|
||||
-- function returning true/false if element1 is same element as element2 --
|
||||
-- uid_match_fct(element1,uid) (optional) --
|
||||
-- function telling if uid is attached to element1 --
|
||||
-- filter_fct(element,filtercriteria) (optional) --
|
||||
-- function returning true/false if filtercriteria met to element --
|
||||
-- fetch_param (optional) --
|
||||
-- parameter passed to raw_fct to aquire correct raw data --
|
||||
-- --
|
||||
--------------------------------------------------------------------------------
|
||||
filterlist = {}
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function filterlist.refresh(self)
|
||||
self.m_raw_list = self.m_raw_list_fct(self.m_fetch_param)
|
||||
filterlist.process(self)
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function filterlist.create(raw_fct,compare_fct,uid_match_fct,filter_fct,fetch_param)
|
||||
|
||||
assert((raw_fct ~= nil) and (type(raw_fct) == "function"))
|
||||
assert((compare_fct ~= nil) and (type(compare_fct) == "function"))
|
||||
|
||||
local self = {}
|
||||
|
||||
self.m_raw_list_fct = raw_fct
|
||||
self.m_compare_fct = compare_fct
|
||||
self.m_filter_fct = filter_fct
|
||||
self.m_uid_match_fct = uid_match_fct
|
||||
|
||||
self.m_filtercriteria = nil
|
||||
self.m_fetch_param = fetch_param
|
||||
|
||||
self.m_sortmode = "none"
|
||||
self.m_sort_list = {}
|
||||
|
||||
self.m_processed_list = nil
|
||||
self.m_raw_list = self.m_raw_list_fct(self.m_fetch_param)
|
||||
|
||||
self.add_sort_mechanism = filterlist.add_sort_mechanism
|
||||
self.set_filtercriteria = filterlist.set_filtercriteria
|
||||
self.get_filtercriteria = filterlist.get_filtercriteria
|
||||
self.set_sortmode = filterlist.set_sortmode
|
||||
self.get_list = filterlist.get_list
|
||||
self.get_raw_list = filterlist.get_raw_list
|
||||
self.get_raw_element = filterlist.get_raw_element
|
||||
self.get_raw_index = filterlist.get_raw_index
|
||||
self.get_current_index = filterlist.get_current_index
|
||||
self.size = filterlist.size
|
||||
self.uid_exists_raw = filterlist.uid_exists_raw
|
||||
self.raw_index_by_uid = filterlist.raw_index_by_uid
|
||||
self.refresh = filterlist.refresh
|
||||
|
||||
filterlist.process(self)
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function filterlist.add_sort_mechanism(self,name,fct)
|
||||
self.m_sort_list[name] = fct
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function filterlist.set_filtercriteria(self,criteria)
|
||||
if criteria == self.m_filtercriteria and
|
||||
type(criteria) ~= "table" then
|
||||
return
|
||||
end
|
||||
self.m_filtercriteria = criteria
|
||||
filterlist.process(self)
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function filterlist.get_filtercriteria(self)
|
||||
return self.m_filtercriteria
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
--supported sort mode "alphabetic|none"
|
||||
function filterlist.set_sortmode(self,mode)
|
||||
if (mode == self.m_sortmode) then
|
||||
return
|
||||
end
|
||||
self.m_sortmode = mode
|
||||
filterlist.process(self)
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function filterlist.get_list(self)
|
||||
return self.m_processed_list
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function filterlist.get_raw_list(self)
|
||||
return self.m_raw_list
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function filterlist.get_raw_element(self,idx)
|
||||
if type(idx) ~= "number" then
|
||||
idx = tonumber(idx)
|
||||
end
|
||||
|
||||
if idx ~= nil and idx > 0 and idx <= #self.m_raw_list then
|
||||
return self.m_raw_list[idx]
|
||||
end
|
||||
|
||||
return nil
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function filterlist.get_raw_index(self,listindex)
|
||||
assert(self.m_processed_list ~= nil)
|
||||
|
||||
if listindex ~= nil and listindex > 0 and
|
||||
listindex <= #self.m_processed_list then
|
||||
local entry = self.m_processed_list[listindex]
|
||||
|
||||
for i,v in ipairs(self.m_raw_list) do
|
||||
|
||||
if self.m_compare_fct(v,entry) then
|
||||
return i
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return 0
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function filterlist.get_current_index(self,listindex)
|
||||
assert(self.m_processed_list ~= nil)
|
||||
|
||||
if listindex ~= nil and listindex > 0 and
|
||||
listindex <= #self.m_raw_list then
|
||||
local entry = self.m_raw_list[listindex]
|
||||
|
||||
for i,v in ipairs(self.m_processed_list) do
|
||||
|
||||
if self.m_compare_fct(v,entry) then
|
||||
return i
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return 0
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function filterlist.process(self)
|
||||
assert(self.m_raw_list ~= nil)
|
||||
|
||||
if self.m_sortmode == "none" and
|
||||
self.m_filtercriteria == nil then
|
||||
self.m_processed_list = self.m_raw_list
|
||||
return
|
||||
end
|
||||
|
||||
self.m_processed_list = {}
|
||||
|
||||
for k,v in pairs(self.m_raw_list) do
|
||||
if self.m_filtercriteria == nil or
|
||||
self.m_filter_fct(v,self.m_filtercriteria) then
|
||||
table.insert(self.m_processed_list,v)
|
||||
end
|
||||
end
|
||||
|
||||
if self.m_sortmode == "none" then
|
||||
return
|
||||
end
|
||||
|
||||
if self.m_sort_list[self.m_sortmode] ~= nil and
|
||||
type(self.m_sort_list[self.m_sortmode]) == "function" then
|
||||
|
||||
self.m_sort_list[self.m_sortmode](self)
|
||||
end
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function filterlist.size(self)
|
||||
if self.m_processed_list == nil then
|
||||
return 0
|
||||
end
|
||||
|
||||
return #self.m_processed_list
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function filterlist.uid_exists_raw(self,uid)
|
||||
for i,v in ipairs(self.m_raw_list) do
|
||||
if self.m_uid_match_fct(v,uid) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function filterlist.raw_index_by_uid(self, uid)
|
||||
local elementcount = 0
|
||||
local elementidx = 0
|
||||
for i,v in ipairs(self.m_raw_list) do
|
||||
if self.m_uid_match_fct(v,uid) then
|
||||
elementcount = elementcount +1
|
||||
elementidx = i
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-- If there are more elements than one with same name uid can't decide which
|
||||
-- one is meant. self shouldn't be possible but just for sure.
|
||||
if elementcount > 1 then
|
||||
elementidx=0
|
||||
end
|
||||
|
||||
return elementidx
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- COMMON helper functions --
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function compare_worlds(world1,world2)
|
||||
|
||||
if world1.path ~= world2.path then
|
||||
return false
|
||||
end
|
||||
|
||||
if world1.name ~= world2.name then
|
||||
return false
|
||||
end
|
||||
|
||||
if world1.gameid ~= world2.gameid then
|
||||
return false
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function sort_worlds_alphabetic(self)
|
||||
|
||||
table.sort(self.m_processed_list, function(a, b)
|
||||
--fixes issue #857 (crash due to sorting nil in worldlist)
|
||||
if a == nil or b == nil then
|
||||
if a == nil and b ~= nil then return false end
|
||||
if b == nil and a ~= nil then return true end
|
||||
return false
|
||||
end
|
||||
if a.name:lower() == b.name:lower() then
|
||||
return a.name < b.name
|
||||
end
|
||||
return a.name:lower() < b.name:lower()
|
||||
end)
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function sort_mod_list(self)
|
||||
|
||||
table.sort(self.m_processed_list, function(a, b)
|
||||
-- Show game mods at bottom
|
||||
if a.typ ~= b.typ then
|
||||
return b.typ == "game_mod"
|
||||
end
|
||||
-- If in same or no modpack, sort by name
|
||||
if a.modpack == b.modpack then
|
||||
if a.name:lower() == b.name:lower() then
|
||||
return a.name < b.name
|
||||
end
|
||||
return a.name:lower() < b.name:lower()
|
||||
-- Else compare name to modpack name
|
||||
else
|
||||
-- Always show modpack pseudo-mod on top of modpack mod list
|
||||
if a.name == b.modpack then
|
||||
return true
|
||||
elseif b.name == a.modpack then
|
||||
return false
|
||||
end
|
||||
|
||||
local name_a = a.modpack or a.name
|
||||
local name_b = b.modpack or b.name
|
||||
if name_a:lower() == name_b:lower() then
|
||||
return name_a < name_b
|
||||
end
|
||||
return name_a:lower() < name_b:lower()
|
||||
end
|
||||
end)
|
||||
end
|
||||
611
builtin/common/misc_helpers.lua
Normal file
611
builtin/common/misc_helpers.lua
Normal file
@@ -0,0 +1,611 @@
|
||||
-- Minetest: builtin/misc_helpers.lua
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- Localize functions to avoid table lookups (better performance).
|
||||
local table_insert = table.insert
|
||||
local string_sub, string_find = string.sub, string.find
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function basic_dump(o)
|
||||
local tp = type(o)
|
||||
if tp == "number" then
|
||||
return tostring(o)
|
||||
elseif tp == "string" then
|
||||
return string.format("%q", o)
|
||||
elseif tp == "boolean" then
|
||||
return tostring(o)
|
||||
elseif tp == "nil" then
|
||||
return "nil"
|
||||
-- Uncomment for full function dumping support.
|
||||
-- Not currently enabled because bytecode isn't very human-readable and
|
||||
-- dump's output is intended for humans.
|
||||
--elseif tp == "function" then
|
||||
-- return string.format("loadstring(%q)", string.dump(o))
|
||||
else
|
||||
return string.format("<%s>", tp)
|
||||
end
|
||||
end
|
||||
|
||||
local keywords = {
|
||||
["and"] = true,
|
||||
["break"] = true,
|
||||
["do"] = true,
|
||||
["else"] = true,
|
||||
["elseif"] = true,
|
||||
["end"] = true,
|
||||
["false"] = true,
|
||||
["for"] = true,
|
||||
["function"] = true,
|
||||
["goto"] = true, -- Lua 5.2
|
||||
["if"] = true,
|
||||
["in"] = true,
|
||||
["local"] = true,
|
||||
["nil"] = true,
|
||||
["not"] = true,
|
||||
["or"] = true,
|
||||
["repeat"] = true,
|
||||
["return"] = true,
|
||||
["then"] = true,
|
||||
["true"] = true,
|
||||
["until"] = true,
|
||||
["while"] = true,
|
||||
}
|
||||
local function is_valid_identifier(str)
|
||||
if not str:find("^[a-zA-Z_][a-zA-Z0-9_]*$") or keywords[str] then
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- Dumps values in a line-per-value format.
|
||||
-- For example, {test = {"Testing..."}} becomes:
|
||||
-- _["test"] = {}
|
||||
-- _["test"][1] = "Testing..."
|
||||
-- This handles tables as keys and circular references properly.
|
||||
-- It also handles multiple references well, writing the table only once.
|
||||
-- The dumped argument is internal-only.
|
||||
|
||||
function dump2(o, name, dumped)
|
||||
name = name or "_"
|
||||
-- "dumped" is used to keep track of serialized tables to handle
|
||||
-- multiple references and circular tables properly.
|
||||
-- It only contains tables as keys. The value is the name that
|
||||
-- the table has in the dump, eg:
|
||||
-- {x = {"y"}} -> dumped[{"y"}] = '_["x"]'
|
||||
dumped = dumped or {}
|
||||
if type(o) ~= "table" then
|
||||
return string.format("%s = %s\n", name, basic_dump(o))
|
||||
end
|
||||
if dumped[o] then
|
||||
return string.format("%s = %s\n", name, dumped[o])
|
||||
end
|
||||
dumped[o] = name
|
||||
-- This contains a list of strings to be concatenated later (because
|
||||
-- Lua is slow at individual concatenation).
|
||||
local t = {}
|
||||
for k, v in pairs(o) do
|
||||
local keyStr
|
||||
if type(k) == "table" then
|
||||
if dumped[k] then
|
||||
keyStr = dumped[k]
|
||||
else
|
||||
-- Key tables don't have a name, so use one of
|
||||
-- the form _G["table: 0xFFFFFFF"]
|
||||
keyStr = string.format("_G[%q]", tostring(k))
|
||||
-- Dump key table
|
||||
table_insert(t, dump2(k, keyStr, dumped))
|
||||
end
|
||||
else
|
||||
keyStr = basic_dump(k)
|
||||
end
|
||||
local vname = string.format("%s[%s]", name, keyStr)
|
||||
table_insert(t, dump2(v, vname, dumped))
|
||||
end
|
||||
return string.format("%s = {}\n%s", name, table.concat(t))
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- This dumps values in a one-statement format.
|
||||
-- For example, {test = {"Testing..."}} becomes:
|
||||
-- [[{
|
||||
-- test = {
|
||||
-- "Testing..."
|
||||
-- }
|
||||
-- }]]
|
||||
-- This supports tables as keys, but not circular references.
|
||||
-- It performs poorly with multiple references as it writes out the full
|
||||
-- table each time.
|
||||
-- The indent field specifies a indentation string, it defaults to a tab.
|
||||
-- Use the empty string to disable indentation.
|
||||
-- The dumped and level arguments are internal-only.
|
||||
|
||||
function dump(o, indent, nested, level)
|
||||
if type(o) ~= "table" then
|
||||
return basic_dump(o)
|
||||
end
|
||||
-- Contains table -> true/nil of currently nested tables
|
||||
nested = nested or {}
|
||||
if nested[o] then
|
||||
return "<circular reference>"
|
||||
end
|
||||
nested[o] = true
|
||||
indent = indent or "\t"
|
||||
level = level or 1
|
||||
local t = {}
|
||||
local dumped_indexes = {}
|
||||
for i, v in ipairs(o) do
|
||||
table_insert(t, dump(v, indent, nested, level + 1))
|
||||
dumped_indexes[i] = true
|
||||
end
|
||||
for k, v in pairs(o) do
|
||||
if not dumped_indexes[k] then
|
||||
if type(k) ~= "string" or not is_valid_identifier(k) then
|
||||
k = "["..dump(k, indent, nested, level + 1).."]"
|
||||
end
|
||||
v = dump(v, indent, nested, level + 1)
|
||||
table_insert(t, k.." = "..v)
|
||||
end
|
||||
end
|
||||
nested[o] = nil
|
||||
if indent ~= "" then
|
||||
local indent_str = "\n"..string.rep(indent, level)
|
||||
local end_indent_str = "\n"..string.rep(indent, level - 1)
|
||||
return string.format("{%s%s%s}",
|
||||
indent_str,
|
||||
table.concat(t, ","..indent_str),
|
||||
end_indent_str)
|
||||
end
|
||||
return "{"..table.concat(t, ", ").."}"
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function string.split(str, delim, include_empty, max_splits, sep_is_pattern)
|
||||
delim = delim or ","
|
||||
max_splits = max_splits or -1
|
||||
local items = {}
|
||||
local pos, len, seplen = 1, #str, #delim
|
||||
local plain = not sep_is_pattern
|
||||
max_splits = max_splits + 1
|
||||
repeat
|
||||
local np, npe = string_find(str, delim, pos, plain)
|
||||
np, npe = (np or (len+1)), (npe or (len+1))
|
||||
if (not np) or (max_splits == 1) then
|
||||
np = len + 1
|
||||
npe = np
|
||||
end
|
||||
local s = string_sub(str, pos, np - 1)
|
||||
if include_empty or (s ~= "") then
|
||||
max_splits = max_splits - 1
|
||||
table_insert(items, s)
|
||||
end
|
||||
pos = npe + 1
|
||||
until (max_splits == 0) or (pos > (len + 1))
|
||||
return items
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function table.indexof(list, val)
|
||||
for i = 1, #list do
|
||||
if list[i] == val then
|
||||
return i
|
||||
end
|
||||
end
|
||||
return -1
|
||||
end
|
||||
|
||||
assert(table.indexof({"foo", "bar"}, "foo") == 1)
|
||||
assert(table.indexof({"foo", "bar"}, "baz") == -1)
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function file_exists(filename)
|
||||
local f = io.open(filename, "r")
|
||||
if f == nil then
|
||||
return false
|
||||
else
|
||||
f:close()
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function string:trim()
|
||||
return (self:gsub("^%s*(.-)%s*$", "%1"))
|
||||
end
|
||||
|
||||
assert(string.trim("\n \t\tfoo bar\t ") == "foo bar")
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function math.hypot(x, y)
|
||||
local t
|
||||
x = math.abs(x)
|
||||
y = math.abs(y)
|
||||
t = math.min(x, y)
|
||||
x = math.max(x, y)
|
||||
if x == 0 then return 0 end
|
||||
t = t / x
|
||||
return x * math.sqrt(1 + t * t)
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function math.sign(x, tolerance)
|
||||
tolerance = tolerance or 0
|
||||
if x > tolerance then
|
||||
return 1
|
||||
elseif x < -tolerance then
|
||||
return -1
|
||||
end
|
||||
return 0
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function get_last_folder(text,count)
|
||||
local parts = text:split(DIR_DELIM)
|
||||
|
||||
if count == nil then
|
||||
return parts[#parts]
|
||||
end
|
||||
|
||||
local retval = ""
|
||||
for i=1,count,1 do
|
||||
retval = retval .. parts[#parts - (count-i)] .. DIR_DELIM
|
||||
end
|
||||
|
||||
return retval
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function cleanup_path(temppath)
|
||||
|
||||
local parts = temppath:split("-")
|
||||
temppath = ""
|
||||
for i=1,#parts,1 do
|
||||
if temppath ~= "" then
|
||||
temppath = temppath .. "_"
|
||||
end
|
||||
temppath = temppath .. parts[i]
|
||||
end
|
||||
|
||||
parts = temppath:split(".")
|
||||
temppath = ""
|
||||
for i=1,#parts,1 do
|
||||
if temppath ~= "" then
|
||||
temppath = temppath .. "_"
|
||||
end
|
||||
temppath = temppath .. parts[i]
|
||||
end
|
||||
|
||||
parts = temppath:split("'")
|
||||
temppath = ""
|
||||
for i=1,#parts,1 do
|
||||
if temppath ~= "" then
|
||||
temppath = temppath .. ""
|
||||
end
|
||||
temppath = temppath .. parts[i]
|
||||
end
|
||||
|
||||
parts = temppath:split(" ")
|
||||
temppath = ""
|
||||
for i=1,#parts,1 do
|
||||
if temppath ~= "" then
|
||||
temppath = temppath
|
||||
end
|
||||
temppath = temppath .. parts[i]
|
||||
end
|
||||
|
||||
return temppath
|
||||
end
|
||||
|
||||
function core.formspec_escape(text)
|
||||
if text ~= nil then
|
||||
text = string.gsub(text,"\\","\\\\")
|
||||
text = string.gsub(text,"%]","\\]")
|
||||
text = string.gsub(text,"%[","\\[")
|
||||
text = string.gsub(text,";","\\;")
|
||||
text = string.gsub(text,",","\\,")
|
||||
end
|
||||
return text
|
||||
end
|
||||
|
||||
|
||||
function core.splittext(text,charlimit)
|
||||
local retval = {}
|
||||
|
||||
local current_idx = 1
|
||||
|
||||
local start,stop = string_find(text, " ", current_idx)
|
||||
local nl_start,nl_stop = string_find(text, "\n", current_idx)
|
||||
local gotnewline = false
|
||||
if nl_start ~= nil and (start == nil or nl_start < start) then
|
||||
start = nl_start
|
||||
stop = nl_stop
|
||||
gotnewline = true
|
||||
end
|
||||
local last_line = ""
|
||||
while start ~= nil do
|
||||
if string.len(last_line) + (stop-start) > charlimit then
|
||||
table_insert(retval, last_line)
|
||||
last_line = ""
|
||||
end
|
||||
|
||||
if last_line ~= "" then
|
||||
last_line = last_line .. " "
|
||||
end
|
||||
|
||||
last_line = last_line .. string_sub(text, current_idx, stop - 1)
|
||||
|
||||
if gotnewline then
|
||||
table_insert(retval, last_line)
|
||||
last_line = ""
|
||||
gotnewline = false
|
||||
end
|
||||
current_idx = stop+1
|
||||
|
||||
start,stop = string_find(text, " ", current_idx)
|
||||
nl_start,nl_stop = string_find(text, "\n", current_idx)
|
||||
|
||||
if nl_start ~= nil and (start == nil or nl_start < start) then
|
||||
start = nl_start
|
||||
stop = nl_stop
|
||||
gotnewline = true
|
||||
end
|
||||
end
|
||||
|
||||
--add last part of text
|
||||
if string.len(last_line) + (string.len(text) - current_idx) > charlimit then
|
||||
table_insert(retval, last_line)
|
||||
table_insert(retval, string_sub(text, current_idx))
|
||||
else
|
||||
last_line = last_line .. " " .. string_sub(text, current_idx)
|
||||
table_insert(retval, last_line)
|
||||
end
|
||||
|
||||
return retval
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
if INIT == "game" then
|
||||
local dirs1 = {9, 18, 7, 12}
|
||||
local dirs2 = {20, 23, 22, 21}
|
||||
|
||||
function core.rotate_and_place(itemstack, placer, pointed_thing,
|
||||
infinitestacks, orient_flags)
|
||||
orient_flags = orient_flags or {}
|
||||
|
||||
local unode = core.get_node_or_nil(pointed_thing.under)
|
||||
if not unode then
|
||||
return
|
||||
end
|
||||
local undef = core.registered_nodes[unode.name]
|
||||
if undef and undef.on_rightclick then
|
||||
undef.on_rightclick(pointed_thing.under, unode, placer,
|
||||
itemstack, pointed_thing)
|
||||
return
|
||||
end
|
||||
local pitch = placer:get_look_pitch()
|
||||
local fdir = core.dir_to_facedir(placer:get_look_dir())
|
||||
local wield_name = itemstack:get_name()
|
||||
|
||||
local above = pointed_thing.above
|
||||
local under = pointed_thing.under
|
||||
local iswall = (above.y == under.y)
|
||||
local isceiling = not iswall and (above.y < under.y)
|
||||
local anode = core.get_node_or_nil(above)
|
||||
if not anode then
|
||||
return
|
||||
end
|
||||
local pos = pointed_thing.above
|
||||
local node = anode
|
||||
|
||||
if undef and undef.buildable_to then
|
||||
pos = pointed_thing.under
|
||||
node = unode
|
||||
iswall = false
|
||||
end
|
||||
|
||||
if core.is_protected(pos, placer:get_player_name()) then
|
||||
core.record_protection_violation(pos,
|
||||
placer:get_player_name())
|
||||
return
|
||||
end
|
||||
|
||||
local ndef = core.registered_nodes[node.name]
|
||||
if not ndef or not ndef.buildable_to then
|
||||
return
|
||||
end
|
||||
|
||||
if orient_flags.force_floor then
|
||||
iswall = false
|
||||
isceiling = false
|
||||
elseif orient_flags.force_ceiling then
|
||||
iswall = false
|
||||
isceiling = true
|
||||
elseif orient_flags.force_wall then
|
||||
iswall = true
|
||||
isceiling = false
|
||||
elseif orient_flags.invert_wall then
|
||||
iswall = not iswall
|
||||
end
|
||||
|
||||
if iswall then
|
||||
core.set_node(pos, {name = wield_name,
|
||||
param2 = dirs1[fdir+1]})
|
||||
elseif isceiling then
|
||||
if orient_flags.force_facedir then
|
||||
core.set_node(pos, {name = wield_name,
|
||||
param2 = 20})
|
||||
else
|
||||
core.set_node(pos, {name = wield_name,
|
||||
param2 = dirs2[fdir+1]})
|
||||
end
|
||||
else -- place right side up
|
||||
if orient_flags.force_facedir then
|
||||
core.set_node(pos, {name = wield_name,
|
||||
param2 = 0})
|
||||
else
|
||||
core.set_node(pos, {name = wield_name,
|
||||
param2 = fdir})
|
||||
end
|
||||
end
|
||||
|
||||
if not infinitestacks then
|
||||
itemstack:take_item()
|
||||
return itemstack
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
--Wrapper for rotate_and_place() to check for sneak and assume Creative mode
|
||||
--implies infinite stacks when performing a 6d rotation.
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
|
||||
core.rotate_node = function(itemstack, placer, pointed_thing)
|
||||
core.rotate_and_place(itemstack, placer, pointed_thing,
|
||||
core.setting_getbool("creative_mode"),
|
||||
{invert_wall = placer:get_player_control().sneak})
|
||||
return itemstack
|
||||
end
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function core.explode_table_event(evt)
|
||||
if evt ~= nil then
|
||||
local parts = evt:split(":")
|
||||
if #parts == 3 then
|
||||
local t = parts[1]:trim()
|
||||
local r = tonumber(parts[2]:trim())
|
||||
local c = tonumber(parts[3]:trim())
|
||||
if type(r) == "number" and type(c) == "number"
|
||||
and t ~= "INV" then
|
||||
return {type=t, row=r, column=c}
|
||||
end
|
||||
end
|
||||
end
|
||||
return {type="INV", row=0, column=0}
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function core.explode_textlist_event(evt)
|
||||
if evt ~= nil then
|
||||
local parts = evt:split(":")
|
||||
if #parts == 2 then
|
||||
local t = parts[1]:trim()
|
||||
local r = tonumber(parts[2]:trim())
|
||||
if type(r) == "number" and t ~= "INV" then
|
||||
return {type=t, index=r}
|
||||
end
|
||||
end
|
||||
end
|
||||
return {type="INV", index=0}
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function core.explode_scrollbar_event(evt)
|
||||
local retval = core.explode_textlist_event(evt)
|
||||
|
||||
retval.value = retval.index
|
||||
retval.index = nil
|
||||
|
||||
return retval
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function core.pos_to_string(pos, decimal_places)
|
||||
local x = pos.x
|
||||
local y = pos.y
|
||||
local z = pos.z
|
||||
if decimal_places ~= nil then
|
||||
x = string.format("%." .. decimal_places .. "f", x)
|
||||
y = string.format("%." .. decimal_places .. "f", y)
|
||||
z = string.format("%." .. decimal_places .. "f", z)
|
||||
end
|
||||
return "(" .. x .. "," .. y .. "," .. z .. ")"
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function core.string_to_pos(value)
|
||||
if value == nil then
|
||||
return nil
|
||||
end
|
||||
|
||||
local p = {}
|
||||
p.x, p.y, p.z = string.match(value, "^([%d.-]+)[, ] *([%d.-]+)[, ] *([%d.-]+)$")
|
||||
if p.x and p.y and p.z then
|
||||
p.x = tonumber(p.x)
|
||||
p.y = tonumber(p.y)
|
||||
p.z = tonumber(p.z)
|
||||
return p
|
||||
end
|
||||
local p = {}
|
||||
p.x, p.y, p.z = string.match(value, "^%( *([%d.-]+)[, ] *([%d.-]+)[, ] *([%d.-]+) *%)$")
|
||||
if p.x and p.y and p.z then
|
||||
p.x = tonumber(p.x)
|
||||
p.y = tonumber(p.y)
|
||||
p.z = tonumber(p.z)
|
||||
return p
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
assert(core.string_to_pos("10.0, 5, -2").x == 10)
|
||||
assert(core.string_to_pos("( 10.0, 5, -2)").z == -2)
|
||||
assert(core.string_to_pos("asd, 5, -2)") == nil)
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function table.copy(t, seen)
|
||||
local n = {}
|
||||
seen = seen or {}
|
||||
seen[t] = n
|
||||
for k, v in pairs(t) do
|
||||
n[(type(k) == "table" and (seen[k] or table.copy(k, seen))) or k] =
|
||||
(type(v) == "table" and (seen[v] or table.copy(v, seen))) or v
|
||||
end
|
||||
return n
|
||||
end
|
||||
--------------------------------------------------------------------------------
|
||||
-- mainmenu only functions
|
||||
--------------------------------------------------------------------------------
|
||||
if INIT == "mainmenu" then
|
||||
function core.get_game(index)
|
||||
local games = game.get_games()
|
||||
|
||||
if index > 0 and index <= #games then
|
||||
return games[index]
|
||||
end
|
||||
|
||||
return nil
|
||||
end
|
||||
|
||||
function fgettext_ne(text, ...)
|
||||
text = core.gettext(text)
|
||||
local arg = {n=select('#', ...), ...}
|
||||
if arg.n >= 1 then
|
||||
-- Insert positional parameters ($1, $2, ...)
|
||||
local result = ''
|
||||
local pos = 1
|
||||
while pos <= text:len() do
|
||||
local newpos = text:find('[$]', pos)
|
||||
if newpos == nil then
|
||||
result = result .. text:sub(pos)
|
||||
pos = text:len() + 1
|
||||
else
|
||||
local paramindex =
|
||||
tonumber(text:sub(newpos+1, newpos+1))
|
||||
result = result .. text:sub(pos, newpos-1)
|
||||
.. tostring(arg[paramindex])
|
||||
pos = newpos + 2
|
||||
end
|
||||
end
|
||||
text = result
|
||||
end
|
||||
return text
|
||||
end
|
||||
|
||||
function fgettext(text, ...)
|
||||
return core.formspec_escape(fgettext_ne(text, ...))
|
||||
end
|
||||
end
|
||||
|
||||
218
builtin/common/serialize.lua
Normal file
218
builtin/common/serialize.lua
Normal file
@@ -0,0 +1,218 @@
|
||||
--- Lua module to serialize values as Lua code.
|
||||
-- From: https://github.com/fab13n/metalua/blob/no-dll/src/lib/serialize.lua
|
||||
-- License: MIT
|
||||
-- @copyright 2006-2997 Fabien Fleutot <metalua@gmail.com>
|
||||
-- @author Fabien Fleutot <metalua@gmail.com>
|
||||
-- @author ShadowNinja <shadowninja@minetest.net>
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
--- Serialize an object into a source code string. This string, when passed as
|
||||
-- an argument to deserialize(), returns an object structurally identical to
|
||||
-- the original one. The following are currently supported:
|
||||
-- * Booleans, numbers, strings, and nil.
|
||||
-- * Functions; uses interpreter-dependent (and sometimes platform-dependent) bytecode!
|
||||
-- * Tables; they can cantain multiple references and can be recursive, but metatables aren't saved.
|
||||
-- This works in two phases:
|
||||
-- 1. Recursively find and record multiple references and recursion.
|
||||
-- 2. Recursively dump the value into a string.
|
||||
-- @param x Value to serialize (nil is allowed).
|
||||
-- @return load()able string containing the value.
|
||||
function core.serialize(x)
|
||||
local local_index = 1 -- Top index of the "_" local table in the dump
|
||||
-- table->nil/1/2 set of tables seen.
|
||||
-- nil = not seen, 1 = seen once, 2 = seen multiple times.
|
||||
local seen = {}
|
||||
|
||||
-- nest_points are places where a table appears within itself, directly
|
||||
-- or not. For instance, all of these chunks create nest points in
|
||||
-- table x: "x = {}; x[x] = 1", "x = {}; x[1] = x",
|
||||
-- "x = {}; x[1] = {y = {x}}".
|
||||
-- To handle those, two tables are used by mark_nest_point:
|
||||
-- * nested - Transient set of tables being currently traversed.
|
||||
-- Used for detecting nested tables.
|
||||
-- * nest_points - parent->{key=value, ...} table cantaining the nested
|
||||
-- keys and values in the parent. They're all dumped after all the
|
||||
-- other table operations have been performed.
|
||||
--
|
||||
-- mark_nest_point(p, k, v) fills nest_points with information required
|
||||
-- to remember that key/value (k, v) creates a nest point in table
|
||||
-- parent. It also marks "parent" and the nested item(s) as occuring
|
||||
-- multiple times, since several references to it will be required in
|
||||
-- order to patch the nest points.
|
||||
local nest_points = {}
|
||||
local nested = {}
|
||||
local function mark_nest_point(parent, k, v)
|
||||
local nk, nv = nested[k], nested[v]
|
||||
local np = nest_points[parent]
|
||||
if not np then
|
||||
np = {}
|
||||
nest_points[parent] = np
|
||||
end
|
||||
np[k] = v
|
||||
seen[parent] = 2
|
||||
if nk then seen[k] = 2 end
|
||||
if nv then seen[v] = 2 end
|
||||
end
|
||||
|
||||
-- First phase, list the tables and functions which appear more than
|
||||
-- once in x.
|
||||
local function mark_multiple_occurences(x)
|
||||
local tp = type(x)
|
||||
if tp ~= "table" and tp ~= "function" then
|
||||
-- No identity (comparison is done by value, not by instance)
|
||||
return
|
||||
end
|
||||
if seen[x] == 1 then
|
||||
seen[x] = 2
|
||||
elseif seen[x] ~= 2 then
|
||||
seen[x] = 1
|
||||
end
|
||||
|
||||
if tp == "table" then
|
||||
nested[x] = true
|
||||
for k, v in pairs(x) do
|
||||
if nested[k] or nested[v] then
|
||||
mark_nest_point(x, k, v)
|
||||
else
|
||||
mark_multiple_occurences(k)
|
||||
mark_multiple_occurences(v)
|
||||
end
|
||||
end
|
||||
nested[x] = nil
|
||||
end
|
||||
end
|
||||
|
||||
local dumped = {} -- object->varname set
|
||||
local local_defs = {} -- Dumped local definitions as source code lines
|
||||
|
||||
-- Mutually recursive local functions:
|
||||
local dump_val, dump_or_ref_val
|
||||
|
||||
-- If x occurs multiple times, dump the local variable rather than
|
||||
-- the value. If it's the first time it's dumped, also dump the
|
||||
-- content in local_defs.
|
||||
function dump_or_ref_val(x)
|
||||
if seen[x] ~= 2 then
|
||||
return dump_val(x)
|
||||
end
|
||||
local var = dumped[x]
|
||||
if var then -- Already referenced
|
||||
return var
|
||||
end
|
||||
-- First occurence, create and register reference
|
||||
local val = dump_val(x)
|
||||
local i = local_index
|
||||
local_index = local_index + 1
|
||||
var = "_["..i.."]"
|
||||
table.insert(local_defs, var.." = "..val)
|
||||
dumped[x] = var
|
||||
return var
|
||||
end
|
||||
|
||||
-- Second phase. Dump the object; subparts occuring multiple times
|
||||
-- are dumped in local variables which can be referenced multiple
|
||||
-- times. Care is taken to dump local vars in a sensible order.
|
||||
function dump_val(x)
|
||||
local tp = type(x)
|
||||
if x == nil then return "nil"
|
||||
elseif tp == "string" then return string.format("%q", x)
|
||||
elseif tp == "boolean" then return x and "true" or "false"
|
||||
elseif tp == "function" then
|
||||
return string.format("loadstring(%q)", string.dump(x))
|
||||
elseif tp == "number" then
|
||||
-- Serialize integers with string.format to prevent
|
||||
-- scientific notation, which doesn't preserve
|
||||
-- precision and breaks things like node position
|
||||
-- hashes. Serialize floats normally.
|
||||
if math.floor(x) == x then
|
||||
return string.format("%d", x)
|
||||
else
|
||||
return tostring(x)
|
||||
end
|
||||
elseif tp == "table" then
|
||||
local vals = {}
|
||||
local idx_dumped = {}
|
||||
local np = nest_points[x]
|
||||
for i, v in ipairs(x) do
|
||||
if not np or not np[i] then
|
||||
table.insert(vals, dump_or_ref_val(v))
|
||||
end
|
||||
idx_dumped[i] = true
|
||||
end
|
||||
for k, v in pairs(x) do
|
||||
if (not np or not np[k]) and
|
||||
not idx_dumped[k] then
|
||||
table.insert(vals,
|
||||
"["..dump_or_ref_val(k).."] = "
|
||||
..dump_or_ref_val(v))
|
||||
end
|
||||
end
|
||||
return "{"..table.concat(vals, ", ").."}"
|
||||
else
|
||||
error("Can't serialize data of type "..tp)
|
||||
end
|
||||
end
|
||||
|
||||
local function dump_nest_points()
|
||||
for parent, vals in pairs(nest_points) do
|
||||
for k, v in pairs(vals) do
|
||||
table.insert(local_defs, dump_or_ref_val(parent)
|
||||
.."["..dump_or_ref_val(k).."] = "
|
||||
..dump_or_ref_val(v))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
mark_multiple_occurences(x)
|
||||
local top_level = dump_or_ref_val(x)
|
||||
dump_nest_points()
|
||||
|
||||
if next(local_defs) then
|
||||
return "local _ = {}\n"
|
||||
..table.concat(local_defs, "\n")
|
||||
.."\nreturn "..top_level
|
||||
else
|
||||
return "return "..top_level
|
||||
end
|
||||
end
|
||||
|
||||
-- Deserialization
|
||||
|
||||
local env = {
|
||||
loadstring = loadstring,
|
||||
}
|
||||
|
||||
local safe_env = {
|
||||
loadstring = function() end,
|
||||
}
|
||||
|
||||
function core.deserialize(str, safe)
|
||||
if str:byte(1) == 0x1B then
|
||||
return nil, "Bytecode prohibited"
|
||||
end
|
||||
local f, err = loadstring(str)
|
||||
if not f then return nil, err end
|
||||
setfenv(f, safe and safe_env or env)
|
||||
|
||||
local good, data = pcall(f)
|
||||
if good then
|
||||
return data
|
||||
else
|
||||
return nil, data
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-- Unit tests
|
||||
local test_in = {cat={sound="nyan", speed=400}, dog={sound="woof"}}
|
||||
local test_out = core.deserialize(core.serialize(test_in))
|
||||
|
||||
assert(test_in.cat.sound == test_out.cat.sound)
|
||||
assert(test_in.cat.speed == test_out.cat.speed)
|
||||
assert(test_in.dog.sound == test_out.dog.sound)
|
||||
|
||||
test_in = {escape_chars="\n\r\t\v\\\"\'", non_european="θשׁ٩∂"}
|
||||
test_out = core.deserialize(core.serialize(test_in))
|
||||
assert(test_in.escape_chars == test_out.escape_chars)
|
||||
assert(test_in.non_european == test_out.non_european)
|
||||
|
||||
59
builtin/common/strict.lua
Normal file
59
builtin/common/strict.lua
Normal file
@@ -0,0 +1,59 @@
|
||||
|
||||
-- Always warn when creating a global variable, even outside of a function.
|
||||
-- This ignores mod namespaces (variables with the same name as the current mod).
|
||||
local WARN_INIT = false
|
||||
|
||||
|
||||
function core.global_exists(name)
|
||||
return rawget(_G, name) ~= nil
|
||||
end
|
||||
|
||||
|
||||
local function warn(message)
|
||||
print(os.date("%H:%M:%S: WARNING: ")..message)
|
||||
end
|
||||
|
||||
|
||||
local meta = {}
|
||||
local declared = {}
|
||||
-- Key is source file, line, and variable name; seperated by NULs
|
||||
local warned = {}
|
||||
|
||||
function meta:__newindex(name, value)
|
||||
local info = debug.getinfo(2, "Sl")
|
||||
local desc = ("%s:%d"):format(info.short_src, info.currentline)
|
||||
if not declared[name] then
|
||||
local warn_key = ("%s\0%d\0%s"):format(info.source,
|
||||
info.currentline, name)
|
||||
if not warned[warn_key] and info.what ~= "main" and
|
||||
info.what ~= "C" then
|
||||
warn(("Assignment to undeclared "..
|
||||
"global %q inside a function at %s.")
|
||||
:format(name, desc))
|
||||
warned[warn_key] = true
|
||||
end
|
||||
declared[name] = true
|
||||
end
|
||||
-- Ignore mod namespaces
|
||||
if WARN_INIT and (not core.get_current_modname or
|
||||
name ~= core.get_current_modname()) then
|
||||
warn(("Global variable %q created at %s.")
|
||||
:format(name, desc))
|
||||
end
|
||||
rawset(self, name, value)
|
||||
end
|
||||
|
||||
|
||||
function meta:__index(name)
|
||||
local info = debug.getinfo(2, "Sl")
|
||||
local warn_key = ("%s\0%d\0%s"):format(info.source, info.currentline, name)
|
||||
if not declared[name] and not warned[warn_key] and info.what ~= "C" then
|
||||
warn(("Undeclared global variable %q accessed at %s:%s")
|
||||
:format(name, info.short_src, info.currentline))
|
||||
warned[warn_key] = true
|
||||
end
|
||||
return rawget(self, name)
|
||||
end
|
||||
|
||||
setmetatable(_G, meta)
|
||||
|
||||
133
builtin/common/vector.lua
Normal file
133
builtin/common/vector.lua
Normal file
@@ -0,0 +1,133 @@
|
||||
|
||||
vector = {}
|
||||
|
||||
function vector.new(a, b, c)
|
||||
if type(a) == "table" then
|
||||
assert(a.x and a.y and a.z, "Invalid vector passed to vector.new()")
|
||||
return {x=a.x, y=a.y, z=a.z}
|
||||
elseif a then
|
||||
assert(b and c, "Invalid arguments for vector.new()")
|
||||
return {x=a, y=b, z=c}
|
||||
end
|
||||
return {x=0, y=0, z=0}
|
||||
end
|
||||
|
||||
function vector.equals(a, b)
|
||||
return a.x == b.x and
|
||||
a.y == b.y and
|
||||
a.z == b.z
|
||||
end
|
||||
|
||||
function vector.length(v)
|
||||
return math.hypot(v.x, math.hypot(v.y, v.z))
|
||||
end
|
||||
|
||||
function vector.normalize(v)
|
||||
local len = vector.length(v)
|
||||
if len == 0 then
|
||||
return {x=0, y=0, z=0}
|
||||
else
|
||||
return vector.divide(v, len)
|
||||
end
|
||||
end
|
||||
|
||||
function vector.round(v)
|
||||
return {
|
||||
x = math.floor(v.x + 0.5),
|
||||
y = math.floor(v.y + 0.5),
|
||||
z = math.floor(v.z + 0.5)
|
||||
}
|
||||
end
|
||||
|
||||
function vector.apply(v, func)
|
||||
return {
|
||||
x = func(v.x),
|
||||
y = func(v.y),
|
||||
z = func(v.z)
|
||||
}
|
||||
end
|
||||
|
||||
function vector.distance(a, b)
|
||||
local x = a.x - b.x
|
||||
local y = a.y - b.y
|
||||
local z = a.z - b.z
|
||||
return math.hypot(x, math.hypot(y, z))
|
||||
end
|
||||
|
||||
function vector.direction(pos1, pos2)
|
||||
local x_raw = pos2.x - pos1.x
|
||||
local y_raw = pos2.y - pos1.y
|
||||
local z_raw = pos2.z - pos1.z
|
||||
local x_abs = math.abs(x_raw)
|
||||
local y_abs = math.abs(y_raw)
|
||||
local z_abs = math.abs(z_raw)
|
||||
if x_abs >= y_abs and
|
||||
x_abs >= z_abs then
|
||||
y_raw = y_raw * (1 / x_abs)
|
||||
z_raw = z_raw * (1 / x_abs)
|
||||
x_raw = x_raw / x_abs
|
||||
end
|
||||
if y_abs >= x_abs and
|
||||
y_abs >= z_abs then
|
||||
x_raw = x_raw * (1 / y_abs)
|
||||
z_raw = z_raw * (1 / y_abs)
|
||||
y_raw = y_raw / y_abs
|
||||
end
|
||||
if z_abs >= y_abs and
|
||||
z_abs >= x_abs then
|
||||
x_raw = x_raw * (1 / z_abs)
|
||||
y_raw = y_raw * (1 / z_abs)
|
||||
z_raw = z_raw / z_abs
|
||||
end
|
||||
return {x=x_raw, y=y_raw, z=z_raw}
|
||||
end
|
||||
|
||||
|
||||
function vector.add(a, b)
|
||||
if type(b) == "table" then
|
||||
return {x = a.x + b.x,
|
||||
y = a.y + b.y,
|
||||
z = a.z + b.z}
|
||||
else
|
||||
return {x = a.x + b,
|
||||
y = a.y + b,
|
||||
z = a.z + b}
|
||||
end
|
||||
end
|
||||
|
||||
function vector.subtract(a, b)
|
||||
if type(b) == "table" then
|
||||
return {x = a.x - b.x,
|
||||
y = a.y - b.y,
|
||||
z = a.z - b.z}
|
||||
else
|
||||
return {x = a.x - b,
|
||||
y = a.y - b,
|
||||
z = a.z - b}
|
||||
end
|
||||
end
|
||||
|
||||
function vector.multiply(a, b)
|
||||
if type(b) == "table" then
|
||||
return {x = a.x * b.x,
|
||||
y = a.y * b.y,
|
||||
z = a.z * b.z}
|
||||
else
|
||||
return {x = a.x * b,
|
||||
y = a.y * b,
|
||||
z = a.z * b}
|
||||
end
|
||||
end
|
||||
|
||||
function vector.divide(a, b)
|
||||
if type(b) == "table" then
|
||||
return {x = a.x / b.x,
|
||||
y = a.y / b.y,
|
||||
z = a.z / b.z}
|
||||
else
|
||||
return {x = a.x / b,
|
||||
y = a.y / b,
|
||||
z = a.z / b}
|
||||
end
|
||||
end
|
||||
|
||||
210
builtin/fstk/buttonbar.lua
Normal file
210
builtin/fstk/buttonbar.lua
Normal file
@@ -0,0 +1,210 @@
|
||||
--Minetest
|
||||
--Copyright (C) 2014 sapier
|
||||
--
|
||||
--self program is free software; you can redistribute it and/or modify
|
||||
--it under the terms of the GNU Lesser General Public License as published by
|
||||
--the Free Software Foundation; either version 2.1 of the License, or
|
||||
--(at your option) any later version.
|
||||
--
|
||||
--self program is distributed in the hope that it will be useful,
|
||||
--but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
--GNU Lesser General Public License for more details.
|
||||
--
|
||||
--You should have received a copy of the GNU Lesser General Public License along
|
||||
--with self program; if not, write to the Free Software Foundation, Inc.,
|
||||
--51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
|
||||
local function buttonbar_formspec(self)
|
||||
|
||||
if self.hidden then
|
||||
return ""
|
||||
end
|
||||
|
||||
local formspec = string.format("box[%f,%f;%f,%f;%s]",
|
||||
self.pos.x,self.pos.y ,self.size.x,self.size.y,self.bgcolor)
|
||||
|
||||
for i=self.startbutton,#self.buttons,1 do
|
||||
local btn_name = self.buttons[i].name
|
||||
local btn_pos = {}
|
||||
|
||||
if self.orientation == "horizontal" then
|
||||
btn_pos.x = self.pos.x + --base pos
|
||||
(i - self.startbutton) * self.btn_size + --button offset
|
||||
self.btn_initial_offset
|
||||
else
|
||||
btn_pos.x = self.pos.x + (self.btn_size * 0.05)
|
||||
end
|
||||
|
||||
if self.orientation == "vertical" then
|
||||
btn_pos.y = self.pos.y + --base pos
|
||||
(i - self.startbutton) * self.btn_size + --button offset
|
||||
self.btn_initial_offset
|
||||
else
|
||||
btn_pos.y = self.pos.y + (self.btn_size * 0.05)
|
||||
end
|
||||
|
||||
if (self.orientation == "vertical" and
|
||||
(btn_pos.y + self.btn_size <= self.pos.y + self.size.y)) or
|
||||
(self.orientation == "horizontal" and
|
||||
(btn_pos.x + self.btn_size <= self.pos.x + self.size.x)) then
|
||||
|
||||
local borders="true"
|
||||
|
||||
if self.buttons[i].image ~= nil then
|
||||
borders="false"
|
||||
end
|
||||
|
||||
formspec = formspec ..
|
||||
string.format("image_button[%f,%f;%f,%f;%s;%s;%s;true;%s]tooltip[%s;%s]",
|
||||
btn_pos.x, btn_pos.y, self.btn_size, self.btn_size,
|
||||
self.buttons[i].image, btn_name, self.buttons[i].caption,
|
||||
borders, btn_name, self.buttons[i].tooltip)
|
||||
else
|
||||
--print("end of displayable buttons: orientation: " .. self.orientation)
|
||||
--print( "button_end: " .. (btn_pos.y + self.btn_size - (self.btn_size * 0.05)))
|
||||
--print( "bar_end: " .. (self.pos.x + self.size.x))
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
if (self.have_move_buttons) then
|
||||
local btn_dec_pos = {}
|
||||
btn_dec_pos.x = self.pos.x + (self.btn_size * 0.05)
|
||||
btn_dec_pos.y = self.pos.y + (self.btn_size * 0.05)
|
||||
local btn_inc_pos = {}
|
||||
local btn_size = {}
|
||||
|
||||
if self.orientation == "horizontal" then
|
||||
btn_size.x = 0.5
|
||||
btn_size.y = self.btn_size
|
||||
btn_inc_pos.x = self.pos.x + self.size.x - 0.5
|
||||
btn_inc_pos.y = self.pos.y + (self.btn_size * 0.05)
|
||||
else
|
||||
btn_size.x = self.btn_size
|
||||
btn_size.y = 0.5
|
||||
btn_inc_pos.x = self.pos.x + (self.btn_size * 0.05)
|
||||
btn_inc_pos.y = self.pos.y + self.size.y - 0.5
|
||||
end
|
||||
|
||||
local text_dec = "<"
|
||||
local text_inc = ">"
|
||||
if self.orientation == "vertical" then
|
||||
text_dec = "^"
|
||||
text_inc = "v"
|
||||
end
|
||||
|
||||
formspec = formspec ..
|
||||
string.format("image_button[%f,%f;%f,%f;;btnbar_dec_%s;%s;true;true]",
|
||||
btn_dec_pos.x, btn_dec_pos.y, btn_size.x, btn_size.y,
|
||||
self.name, text_dec)
|
||||
|
||||
formspec = formspec ..
|
||||
string.format("image_button[%f,%f;%f,%f;;btnbar_inc_%s;%s;true;true]",
|
||||
btn_inc_pos.x, btn_inc_pos.y, btn_size.x, btn_size.y,
|
||||
self.name, text_inc)
|
||||
end
|
||||
|
||||
return formspec
|
||||
end
|
||||
|
||||
local function buttonbar_buttonhandler(self, fields)
|
||||
|
||||
if fields["btnbar_inc_" .. self.name] ~= nil and
|
||||
self.startbutton < #self.buttons then
|
||||
|
||||
self.startbutton = self.startbutton + 1
|
||||
return true
|
||||
end
|
||||
|
||||
if fields["btnbar_dec_" .. self.name] ~= nil and self.startbutton > 1 then
|
||||
self.startbutton = self.startbutton - 1
|
||||
return true
|
||||
end
|
||||
|
||||
for i=1,#self.buttons,1 do
|
||||
if fields[self.buttons[i].name] ~= nil then
|
||||
return self.userbuttonhandler(fields)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local buttonbar_metatable = {
|
||||
handle_buttons = buttonbar_buttonhandler,
|
||||
handle_events = function(self, event) end,
|
||||
get_formspec = buttonbar_formspec,
|
||||
|
||||
hide = function(self) self.hidden = true end,
|
||||
show = function(self) self.hidden = false end,
|
||||
|
||||
delete = function(self) ui.delete(self) end,
|
||||
|
||||
add_button = function(self, name, caption, image, tooltip)
|
||||
if caption == nil then caption = "" end
|
||||
if image == nil then image = "" end
|
||||
if tooltip == nil then tooltip = "" end
|
||||
|
||||
table.insert(self.buttons,{ name=name, caption=caption, image=image, tooltip=tooltip})
|
||||
if self.orientation == "horizontal" then
|
||||
if ( (self.btn_size * #self.buttons) + (self.btn_size * 0.05 *2)
|
||||
> self.size.x ) then
|
||||
|
||||
self.btn_initial_offset = self.btn_size * 0.05 + 0.5
|
||||
self.have_move_buttons = true
|
||||
end
|
||||
else
|
||||
if ((self.btn_size * #self.buttons) + (self.btn_size * 0.05 *2)
|
||||
> self.size.y ) then
|
||||
|
||||
self.btn_initial_offset = self.btn_size * 0.05 + 0.5
|
||||
self.have_move_buttons = true
|
||||
end
|
||||
end
|
||||
end,
|
||||
|
||||
set_bgparams = function(self, bgcolor)
|
||||
if (type(bgcolor) == "string") then
|
||||
self.bgcolor = bgcolor
|
||||
end
|
||||
end,
|
||||
}
|
||||
|
||||
buttonbar_metatable.__index = buttonbar_metatable
|
||||
|
||||
function buttonbar_create(name, cbf_buttonhandler, pos, orientation, size)
|
||||
assert(name ~= nil)
|
||||
assert(cbf_buttonhandler ~= nil)
|
||||
assert(orientation == "vertical" or orientation == "horizontal")
|
||||
assert(pos ~= nil and type(pos) == "table")
|
||||
assert(size ~= nil and type(size) == "table")
|
||||
|
||||
local self = {}
|
||||
self.name = name
|
||||
self.type = "addon"
|
||||
self.bgcolor = "#000000"
|
||||
self.pos = pos
|
||||
self.size = size
|
||||
self.orientation = orientation
|
||||
self.startbutton = 1
|
||||
self.have_move_buttons = false
|
||||
self.hidden = false
|
||||
|
||||
if self.orientation == "horizontal" then
|
||||
self.btn_size = self.size.y
|
||||
else
|
||||
self.btn_size = self.size.x
|
||||
end
|
||||
|
||||
if (self.btn_initial_offset == nil) then
|
||||
self.btn_initial_offset = self.btn_size * 0.05
|
||||
end
|
||||
|
||||
self.userbuttonhandler = cbf_buttonhandler
|
||||
self.buttons = {}
|
||||
|
||||
setmetatable(self,buttonbar_metatable)
|
||||
|
||||
ui.add(self)
|
||||
return self
|
||||
end
|
||||
69
builtin/fstk/dialog.lua
Normal file
69
builtin/fstk/dialog.lua
Normal file
@@ -0,0 +1,69 @@
|
||||
--Minetest
|
||||
--Copyright (C) 2014 sapier
|
||||
--
|
||||
--self program is free software; you can redistribute it and/or modify
|
||||
--it under the terms of the GNU Lesser General Public License as published by
|
||||
--the Free Software Foundation; either version 2.1 of the License, or
|
||||
--(at your option) any later version.
|
||||
--
|
||||
--self program is distributed in the hope that it will be useful,
|
||||
--but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
--GNU Lesser General Public License for more details.
|
||||
--
|
||||
--You should have received a copy of the GNU Lesser General Public License along
|
||||
--with self program; if not, write to the Free Software Foundation, Inc.,
|
||||
--51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
local function dialog_event_handler(self,event)
|
||||
if self.user_eventhandler == nil or
|
||||
self.user_eventhandler(event) == false then
|
||||
|
||||
--close dialog on esc
|
||||
if event == "MenuQuit" then
|
||||
self:delete()
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local dialog_metatable = {
|
||||
eventhandler = dialog_event_handler,
|
||||
get_formspec = function(self)
|
||||
if not self.hidden then return self.formspec(self.data) end
|
||||
end,
|
||||
handle_buttons = function(self,fields)
|
||||
if not self.hidden then return self.buttonhandler(self,fields) end
|
||||
end,
|
||||
handle_events = function(self,event)
|
||||
if not self.hidden then return self.eventhandler(self,event) end
|
||||
end,
|
||||
hide = function(self) self.hidden = true end,
|
||||
show = function(self) self.hidden = false end,
|
||||
delete = function(self)
|
||||
if self.parent ~= nil then
|
||||
self.parent:show()
|
||||
end
|
||||
ui.delete(self)
|
||||
end,
|
||||
set_parent = function(self,parent) self.parent = parent end
|
||||
}
|
||||
dialog_metatable.__index = dialog_metatable
|
||||
|
||||
function dialog_create(name,get_formspec,buttonhandler,eventhandler)
|
||||
local self = {}
|
||||
|
||||
self.name = name
|
||||
self.type = "toplevel"
|
||||
self.hidden = true
|
||||
self.data = {}
|
||||
|
||||
self.formspec = get_formspec
|
||||
self.buttonhandler = buttonhandler
|
||||
self.user_eventhandler = eventhandler
|
||||
|
||||
setmetatable(self,dialog_metatable)
|
||||
|
||||
ui.add(self)
|
||||
return self
|
||||
end
|
||||
273
builtin/fstk/tabview.lua
Normal file
273
builtin/fstk/tabview.lua
Normal file
@@ -0,0 +1,273 @@
|
||||
--Minetest
|
||||
--Copyright (C) 2014 sapier
|
||||
--
|
||||
--self program is free software; you can redistribute it and/or modify
|
||||
--it under the terms of the GNU Lesser General Public License as published by
|
||||
--the Free Software Foundation; either version 2.1 of the License, or
|
||||
--(at your option) any later version.
|
||||
--
|
||||
--self program is distributed in the hope that it will be useful,
|
||||
--but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
--GNU Lesser General Public License for more details.
|
||||
--
|
||||
--You should have received a copy of the GNU Lesser General Public License along
|
||||
--with self program; if not, write to the Free Software Foundation, Inc.,
|
||||
--51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- A tabview implementation --
|
||||
-- Usage: --
|
||||
-- tabview.create: returns initialized tabview raw element --
|
||||
-- element.add(tab): add a tab declaration --
|
||||
-- element.handle_buttons() --
|
||||
-- element.handle_events() --
|
||||
-- element.getFormspec() returns formspec of tabview --
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
local function add_tab(self,tab)
|
||||
assert(tab.size == nil or (type(tab.size) == table and
|
||||
tab.size.x ~= nil and tab.size.y ~= nil))
|
||||
assert(tab.cbf_formspec ~= nil and type(tab.cbf_formspec) == "function")
|
||||
assert(tab.cbf_button_handler == nil or
|
||||
type(tab.cbf_button_handler) == "function")
|
||||
assert(tab.cbf_events == nil or type(tab.cbf_events) == "function")
|
||||
|
||||
local newtab = {
|
||||
name = tab.name,
|
||||
caption = tab.caption,
|
||||
button_handler = tab.cbf_button_handler,
|
||||
event_handler = tab.cbf_events,
|
||||
get_formspec = tab.cbf_formspec,
|
||||
tabsize = tab.tabsize,
|
||||
on_change = tab.on_change,
|
||||
tabdata = {},
|
||||
}
|
||||
|
||||
table.insert(self.tablist,newtab)
|
||||
|
||||
if self.last_tab_index == #self.tablist then
|
||||
self.current_tab = tab.name
|
||||
if tab.on_activate ~= nil then
|
||||
tab.on_activate(nil,tab.name)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
local function get_formspec(self)
|
||||
local formspec = ""
|
||||
|
||||
if not self.hidden and (self.parent == nil or not self.parent.hidden) then
|
||||
|
||||
if self.parent == nil then
|
||||
local tsize = self.tablist[self.last_tab_index].tabsize or
|
||||
{width=self.width, height=self.height}
|
||||
formspec = formspec ..
|
||||
string.format("size[%f,%f,%s]",tsize.width,tsize.height,
|
||||
dump(self.fixed_size))
|
||||
end
|
||||
formspec = formspec .. self:tab_header()
|
||||
formspec = formspec ..
|
||||
self.tablist[self.last_tab_index].get_formspec(
|
||||
self,
|
||||
self.tablist[self.last_tab_index].name,
|
||||
self.tablist[self.last_tab_index].tabdata,
|
||||
self.tablist[self.last_tab_index].tabsize
|
||||
)
|
||||
end
|
||||
return formspec
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
local function handle_buttons(self,fields)
|
||||
|
||||
if self.hidden then
|
||||
return false
|
||||
end
|
||||
|
||||
if self:handle_tab_buttons(fields) then
|
||||
return true
|
||||
end
|
||||
|
||||
if self.glb_btn_handler ~= nil and
|
||||
self.glb_btn_handler(self,fields) then
|
||||
return true
|
||||
end
|
||||
|
||||
if self.tablist[self.last_tab_index].button_handler ~= nil then
|
||||
return
|
||||
self.tablist[self.last_tab_index].button_handler(
|
||||
self,
|
||||
fields,
|
||||
self.tablist[self.last_tab_index].name,
|
||||
self.tablist[self.last_tab_index].tabdata
|
||||
)
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
local function handle_events(self,event)
|
||||
|
||||
if self.hidden then
|
||||
return false
|
||||
end
|
||||
|
||||
if self.glb_evt_handler ~= nil and
|
||||
self.glb_evt_handler(self,event) then
|
||||
return true
|
||||
end
|
||||
|
||||
if self.tablist[self.last_tab_index].evt_handler ~= nil then
|
||||
return
|
||||
self.tablist[self.last_tab_index].evt_handler(
|
||||
self,
|
||||
event,
|
||||
self.tablist[self.last_tab_index].name,
|
||||
self.tablist[self.last_tab_index].tabdata
|
||||
)
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
local function tab_header(self)
|
||||
|
||||
local toadd = ""
|
||||
|
||||
for i=1,#self.tablist,1 do
|
||||
|
||||
if toadd ~= "" then
|
||||
toadd = toadd .. ","
|
||||
end
|
||||
|
||||
toadd = toadd .. self.tablist[i].caption
|
||||
end
|
||||
return string.format("tabheader[%f,%f;%s;%s;%i;true;false]",
|
||||
self.header_x, self.header_y, self.name, toadd, self.last_tab_index);
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
local function switch_to_tab(self, index)
|
||||
--first call on_change for tab to leave
|
||||
if self.tablist[self.last_tab_index].on_change ~= nil then
|
||||
self.tablist[self.last_tab_index].on_change("LEAVE",
|
||||
self.current_tab, self.tablist[index].name)
|
||||
end
|
||||
|
||||
--update tabview data
|
||||
self.last_tab_index = index
|
||||
local old_tab = self.current_tab
|
||||
self.current_tab = self.tablist[index].name
|
||||
|
||||
if (self.autosave_tab) then
|
||||
core.setting_set(self.name .. "_LAST",self.current_tab)
|
||||
end
|
||||
|
||||
-- call for tab to enter
|
||||
if self.tablist[index].on_change ~= nil then
|
||||
self.tablist[index].on_change("ENTER",
|
||||
old_tab,self.current_tab)
|
||||
end
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
local function handle_tab_buttons(self,fields)
|
||||
--save tab selection to config file
|
||||
if fields[self.name] then
|
||||
local index = tonumber(fields[self.name])
|
||||
switch_to_tab(self, index)
|
||||
return true
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
local function set_tab_by_name(self, name)
|
||||
for i=1,#self.tablist,1 do
|
||||
if self.tablist[i].name == name then
|
||||
switch_to_tab(self, i)
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
local function hide_tabview(self)
|
||||
self.hidden=true
|
||||
|
||||
--call on_change as we're not gonna show self tab any longer
|
||||
if self.tablist[self.last_tab_index].on_change ~= nil then
|
||||
self.tablist[self.last_tab_index].on_change("LEAVE",
|
||||
self.current_tab, nil)
|
||||
end
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
local function show_tabview(self)
|
||||
self.hidden=false
|
||||
|
||||
-- call for tab to enter
|
||||
if self.tablist[self.last_tab_index].on_change ~= nil then
|
||||
self.tablist[self.last_tab_index].on_change("ENTER",
|
||||
nil,self.current_tab)
|
||||
end
|
||||
end
|
||||
|
||||
local tabview_metatable = {
|
||||
add = add_tab,
|
||||
handle_buttons = handle_buttons,
|
||||
handle_events = handle_events,
|
||||
get_formspec = get_formspec,
|
||||
show = show_tabview,
|
||||
hide = hide_tabview,
|
||||
delete = function(self) ui.delete(self) end,
|
||||
set_parent = function(self,parent) self.parent = parent end,
|
||||
set_autosave_tab =
|
||||
function(self,value) self.autosave_tab = value end,
|
||||
set_tab = set_tab_by_name,
|
||||
set_global_button_handler =
|
||||
function(self,handler) self.glb_btn_handler = handler end,
|
||||
set_global_event_handler =
|
||||
function(self,handler) self.glb_evt_handler = handler end,
|
||||
set_fixed_size =
|
||||
function(self,state) self.fixed_size = state end,
|
||||
tab_header = tab_header,
|
||||
handle_tab_buttons = handle_tab_buttons
|
||||
}
|
||||
|
||||
tabview_metatable.__index = tabview_metatable
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function tabview_create(name, size, tabheaderpos)
|
||||
local self = {}
|
||||
|
||||
self.name = name
|
||||
self.type = "toplevel"
|
||||
self.width = size.x
|
||||
self.height = size.y
|
||||
self.header_x = tabheaderpos.x
|
||||
self.header_y = tabheaderpos.y
|
||||
|
||||
setmetatable(self, tabview_metatable)
|
||||
|
||||
self.fixed_size = true
|
||||
self.hidden = true
|
||||
self.current_tab = nil
|
||||
self.last_tab_index = 1
|
||||
self.tablist = {}
|
||||
|
||||
self.autosave_tab = false
|
||||
|
||||
ui.add(self)
|
||||
return self
|
||||
end
|
||||
206
builtin/fstk/ui.lua
Normal file
206
builtin/fstk/ui.lua
Normal file
@@ -0,0 +1,206 @@
|
||||
--Minetest
|
||||
--Copyright (C) 2014 sapier
|
||||
--
|
||||
--self program is free software; you can redistribute it and/or modify
|
||||
--it under the terms of the GNU Lesser General Public License as published by
|
||||
--the Free Software Foundation; either version 2.1 of the License, or
|
||||
--(at your option) any later version.
|
||||
--
|
||||
--self program is distributed in the hope that it will be useful,
|
||||
--but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
--GNU Lesser General Public License for more details.
|
||||
--
|
||||
--You should have received a copy of the GNU Lesser General Public License along
|
||||
--with self program; if not, write to the Free Software Foundation, Inc.,
|
||||
--51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
ui = {}
|
||||
ui.childlist = {}
|
||||
ui.default = nil
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function ui.add(child)
|
||||
--TODO check child
|
||||
ui.childlist[child.name] = child
|
||||
|
||||
return child.name
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function ui.delete(child)
|
||||
|
||||
if ui.childlist[child.name] == nil then
|
||||
return false
|
||||
end
|
||||
|
||||
ui.childlist[child.name] = nil
|
||||
return true
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function ui.set_default(name)
|
||||
ui.default = name
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function ui.find_by_name(name)
|
||||
return ui.childlist[name]
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
--------------------------------------------------------------------------------
|
||||
-- Internal functions not to be called from user
|
||||
--------------------------------------------------------------------------------
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
local function wordwrap_quickhack(str)
|
||||
local res = ""
|
||||
local ar = str:split("\n")
|
||||
for i = 1, #ar do
|
||||
local text = ar[i]
|
||||
-- Hack to add word wrapping.
|
||||
-- TODO: Add engine support for wrapping in formspecs
|
||||
while #text > 80 do
|
||||
if res ~= "" then
|
||||
res = res .. ","
|
||||
end
|
||||
res = res .. core.formspec_escape(string.sub(text, 1, 79))
|
||||
text = string.sub(text, 80, #text)
|
||||
end
|
||||
if res ~= "" then
|
||||
res = res .. ","
|
||||
end
|
||||
res = res .. core.formspec_escape(text)
|
||||
end
|
||||
return res
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function ui.update()
|
||||
local formspec = ""
|
||||
|
||||
-- handle errors
|
||||
if gamedata ~= nil and gamedata.reconnect_requested then
|
||||
formspec = wordwrap_quickhack(gamedata.errormessage or "")
|
||||
formspec = "size[12,5]" ..
|
||||
"label[0.5,0;" .. fgettext("The server has requested a reconnect:") ..
|
||||
"]textlist[0.2,0.8;11.5,3.5;;" .. formspec ..
|
||||
"]button[6,4.6;3,0.5;btn_reconnect_no;" .. fgettext("Main menu") .. "]" ..
|
||||
"button[3,4.6;3,0.5;btn_reconnect_yes;" .. fgettext("Reconnect") .. "]"
|
||||
elseif gamedata ~= nil and gamedata.errormessage ~= nil then
|
||||
formspec = wordwrap_quickhack(gamedata.errormessage)
|
||||
local error_title
|
||||
if string.find(gamedata.errormessage, "ModError") then
|
||||
error_title = fgettext("An error occured in a Lua script, such as a mod:")
|
||||
else
|
||||
error_title = fgettext("An error occured:")
|
||||
end
|
||||
formspec = "size[12,5]" ..
|
||||
"label[0.5,0;" .. error_title ..
|
||||
"]textlist[0.2,0.8;11.5,3.5;;" .. formspec ..
|
||||
"]button[4.5,4.6;3,0.5;btn_error_confirm;" .. fgettext("Ok") .. "]"
|
||||
else
|
||||
local active_toplevel_ui_elements = 0
|
||||
for key,value in pairs(ui.childlist) do
|
||||
if (value.type == "toplevel") then
|
||||
local retval = value:get_formspec()
|
||||
|
||||
if retval ~= nil and retval ~= "" then
|
||||
active_toplevel_ui_elements = active_toplevel_ui_elements +1
|
||||
formspec = formspec .. retval
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- no need to show addons if there ain't a toplevel element
|
||||
if (active_toplevel_ui_elements > 0) then
|
||||
for key,value in pairs(ui.childlist) do
|
||||
if (value.type == "addon") then
|
||||
local retval = value:get_formspec()
|
||||
|
||||
if retval ~= nil and retval ~= "" then
|
||||
formspec = formspec .. retval
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if (active_toplevel_ui_elements > 1) then
|
||||
print("WARNING: ui manager detected more then one active ui element, self most likely isn't intended")
|
||||
end
|
||||
|
||||
if (active_toplevel_ui_elements == 0) then
|
||||
print("WARNING: not a single toplevel ui element active switching to default")
|
||||
ui.childlist[ui.default]:show()
|
||||
formspec = ui.childlist[ui.default]:get_formspec()
|
||||
end
|
||||
end
|
||||
core.update_formspec(formspec)
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function ui.handle_buttons(fields)
|
||||
for key,value in pairs(ui.childlist) do
|
||||
|
||||
local retval = value:handle_buttons(fields)
|
||||
|
||||
if retval then
|
||||
ui.update()
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function ui.handle_events(event)
|
||||
|
||||
for key,value in pairs(ui.childlist) do
|
||||
|
||||
if value.handle_events ~= nil then
|
||||
local retval = value:handle_events(event)
|
||||
|
||||
if retval then
|
||||
return retval
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
--------------------------------------------------------------------------------
|
||||
-- initialize callbacks
|
||||
--------------------------------------------------------------------------------
|
||||
--------------------------------------------------------------------------------
|
||||
core.button_handler = function(fields)
|
||||
if fields["btn_reconnect_yes"] then
|
||||
gamedata.reconnect_requested = false
|
||||
gamedata.errormessage = nil
|
||||
gamedata.do_reconnect = true
|
||||
core.start()
|
||||
return
|
||||
elseif fields["btn_reconnect_no"] or fields["btn_error_confirm"] then
|
||||
gamedata.errormessage = nil
|
||||
gamedata.reconnect_requested = false
|
||||
ui.update()
|
||||
return
|
||||
end
|
||||
|
||||
if ui.handle_buttons(fields) then
|
||||
ui.update()
|
||||
end
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
core.event_handler = function(event)
|
||||
if ui.handle_events(event) then
|
||||
ui.update()
|
||||
return
|
||||
end
|
||||
|
||||
if event == "Refresh" then
|
||||
ui.update()
|
||||
return
|
||||
end
|
||||
end
|
||||
201
builtin/game/auth.lua
Normal file
201
builtin/game/auth.lua
Normal file
@@ -0,0 +1,201 @@
|
||||
-- Minetest: builtin/auth.lua
|
||||
|
||||
--
|
||||
-- Authentication handler
|
||||
--
|
||||
|
||||
function core.string_to_privs(str, delim)
|
||||
assert(type(str) == "string")
|
||||
delim = delim or ','
|
||||
local privs = {}
|
||||
for _, priv in pairs(string.split(str, delim)) do
|
||||
privs[priv:trim()] = true
|
||||
end
|
||||
return privs
|
||||
end
|
||||
|
||||
function core.privs_to_string(privs, delim)
|
||||
assert(type(privs) == "table")
|
||||
delim = delim or ','
|
||||
local list = {}
|
||||
for priv, bool in pairs(privs) do
|
||||
if bool then
|
||||
table.insert(list, priv)
|
||||
end
|
||||
end
|
||||
return table.concat(list, delim)
|
||||
end
|
||||
|
||||
assert(core.string_to_privs("a,b").b == true)
|
||||
assert(core.privs_to_string({a=true,b=true}) == "a,b")
|
||||
|
||||
core.auth_file_path = core.get_worldpath().."/auth.txt"
|
||||
core.auth_table = {}
|
||||
|
||||
local function read_auth_file()
|
||||
local newtable = {}
|
||||
local file, errmsg = io.open(core.auth_file_path, 'rb')
|
||||
if not file then
|
||||
core.log("info", core.auth_file_path.." could not be opened for reading ("..errmsg.."); assuming new world")
|
||||
return
|
||||
end
|
||||
for line in file:lines() do
|
||||
if line ~= "" then
|
||||
local fields = line:split(":", true)
|
||||
local name, password, privilege_string, last_login = unpack(fields)
|
||||
last_login = tonumber(last_login)
|
||||
if not (name and password and privilege_string) then
|
||||
error("Invalid line in auth.txt: "..dump(line))
|
||||
end
|
||||
local privileges = core.string_to_privs(privilege_string)
|
||||
newtable[name] = {password=password, privileges=privileges, last_login=last_login}
|
||||
end
|
||||
end
|
||||
io.close(file)
|
||||
core.auth_table = newtable
|
||||
core.notify_authentication_modified()
|
||||
end
|
||||
|
||||
local function save_auth_file()
|
||||
local newtable = {}
|
||||
-- Check table for validness before attempting to save
|
||||
for name, stuff in pairs(core.auth_table) do
|
||||
assert(type(name) == "string")
|
||||
assert(name ~= "")
|
||||
assert(type(stuff) == "table")
|
||||
assert(type(stuff.password) == "string")
|
||||
assert(type(stuff.privileges) == "table")
|
||||
assert(stuff.last_login == nil or type(stuff.last_login) == "number")
|
||||
end
|
||||
local file, errmsg = io.open(core.auth_file_path, 'w+b')
|
||||
if not file then
|
||||
error(core.auth_file_path.." could not be opened for writing: "..errmsg)
|
||||
end
|
||||
for name, stuff in pairs(core.auth_table) do
|
||||
local priv_string = core.privs_to_string(stuff.privileges)
|
||||
local parts = {name, stuff.password, priv_string, stuff.last_login or ""}
|
||||
file:write(table.concat(parts, ":").."\n")
|
||||
end
|
||||
io.close(file)
|
||||
end
|
||||
|
||||
read_auth_file()
|
||||
|
||||
core.builtin_auth_handler = {
|
||||
get_auth = function(name)
|
||||
assert(type(name) == "string")
|
||||
-- Figure out what password to use for a new player (singleplayer
|
||||
-- always has an empty password, otherwise use default, which is
|
||||
-- usually empty too)
|
||||
local new_password_hash = ""
|
||||
-- If not in authentication table, return nil
|
||||
if not core.auth_table[name] then
|
||||
return nil
|
||||
end
|
||||
-- Figure out what privileges the player should have.
|
||||
-- Take a copy of the privilege table
|
||||
local privileges = {}
|
||||
for priv, _ in pairs(core.auth_table[name].privileges) do
|
||||
privileges[priv] = true
|
||||
end
|
||||
-- If singleplayer, give all privileges except those marked as give_to_singleplayer = false
|
||||
if core.is_singleplayer() then
|
||||
for priv, def in pairs(core.registered_privileges) do
|
||||
if def.give_to_singleplayer then
|
||||
privileges[priv] = true
|
||||
end
|
||||
end
|
||||
-- For the admin, give everything
|
||||
elseif name == core.setting_get("name") then
|
||||
for priv, def in pairs(core.registered_privileges) do
|
||||
privileges[priv] = true
|
||||
end
|
||||
end
|
||||
-- All done
|
||||
return {
|
||||
password = core.auth_table[name].password,
|
||||
privileges = privileges,
|
||||
-- Is set to nil if unknown
|
||||
last_login = core.auth_table[name].last_login,
|
||||
}
|
||||
end,
|
||||
create_auth = function(name, password)
|
||||
assert(type(name) == "string")
|
||||
assert(type(password) == "string")
|
||||
core.log('info', "Built-in authentication handler adding player '"..name.."'")
|
||||
core.auth_table[name] = {
|
||||
password = password,
|
||||
privileges = core.string_to_privs(core.setting_get("default_privs")),
|
||||
last_login = os.time(),
|
||||
}
|
||||
save_auth_file()
|
||||
end,
|
||||
set_password = function(name, password)
|
||||
assert(type(name) == "string")
|
||||
assert(type(password) == "string")
|
||||
if not core.auth_table[name] then
|
||||
core.builtin_auth_handler.create_auth(name, password)
|
||||
else
|
||||
core.log('info', "Built-in authentication handler setting password of player '"..name.."'")
|
||||
core.auth_table[name].password = password
|
||||
save_auth_file()
|
||||
end
|
||||
return true
|
||||
end,
|
||||
set_privileges = function(name, privileges)
|
||||
assert(type(name) == "string")
|
||||
assert(type(privileges) == "table")
|
||||
if not core.auth_table[name] then
|
||||
core.builtin_auth_handler.create_auth(name,
|
||||
core.get_password_hash(name,
|
||||
core.setting_get("default_password")))
|
||||
end
|
||||
core.auth_table[name].privileges = privileges
|
||||
core.notify_authentication_modified(name)
|
||||
save_auth_file()
|
||||
end,
|
||||
reload = function()
|
||||
read_auth_file()
|
||||
return true
|
||||
end,
|
||||
record_login = function(name)
|
||||
assert(type(name) == "string")
|
||||
assert(core.auth_table[name]).last_login = os.time()
|
||||
save_auth_file()
|
||||
end,
|
||||
}
|
||||
|
||||
function core.register_authentication_handler(handler)
|
||||
if core.registered_auth_handler then
|
||||
error("Add-on authentication handler already registered by "..core.registered_auth_handler_modname)
|
||||
end
|
||||
core.registered_auth_handler = handler
|
||||
core.registered_auth_handler_modname = core.get_current_modname()
|
||||
handler.mod_origin = core.registered_auth_handler_modname
|
||||
end
|
||||
|
||||
function core.get_auth_handler()
|
||||
return core.registered_auth_handler or core.builtin_auth_handler
|
||||
end
|
||||
|
||||
local function auth_pass(name)
|
||||
return function(...)
|
||||
local auth_handler = core.get_auth_handler()
|
||||
if auth_handler[name] then
|
||||
return auth_handler[name](...)
|
||||
end
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
core.set_player_password = auth_pass("set_password")
|
||||
core.set_player_privs = auth_pass("set_privileges")
|
||||
core.auth_reload = auth_pass("reload")
|
||||
|
||||
|
||||
local record_login = auth_pass("record_login")
|
||||
|
||||
core.register_on_joinplayer(function(player)
|
||||
record_login(player:get_player_name())
|
||||
end)
|
||||
|
||||
842
builtin/game/chatcommands.lua
Normal file
842
builtin/game/chatcommands.lua
Normal file
@@ -0,0 +1,842 @@
|
||||
-- Minetest: builtin/chatcommands.lua
|
||||
|
||||
--
|
||||
-- Chat command handler
|
||||
--
|
||||
|
||||
core.chatcommands = {}
|
||||
function core.register_chatcommand(cmd, def)
|
||||
def = def or {}
|
||||
def.params = def.params or ""
|
||||
def.description = def.description or ""
|
||||
def.privs = def.privs or {}
|
||||
def.mod_origin = core.get_current_modname() or "??"
|
||||
core.chatcommands[cmd] = def
|
||||
end
|
||||
|
||||
if core.setting_getbool("mod_profiling") then
|
||||
local tracefct = profiling_print_log
|
||||
profiling_print_log = nil
|
||||
core.register_chatcommand("save_mod_profile",
|
||||
{
|
||||
params = "",
|
||||
description = "save mod profiling data to logfile " ..
|
||||
"(depends on default loglevel)",
|
||||
func = tracefct,
|
||||
privs = { server=true }
|
||||
})
|
||||
end
|
||||
|
||||
core.register_on_chat_message(function(name, message)
|
||||
local cmd, param = string.match(message, "^/([^ ]+) *(.*)")
|
||||
if not param then
|
||||
param = ""
|
||||
end
|
||||
local cmd_def = core.chatcommands[cmd]
|
||||
if not cmd_def then
|
||||
return false
|
||||
end
|
||||
local has_privs, missing_privs = core.check_player_privs(name, cmd_def.privs)
|
||||
if has_privs then
|
||||
core.set_last_run_mod(cmd_def.mod_origin)
|
||||
local success, message = cmd_def.func(name, param)
|
||||
if message then
|
||||
core.chat_send_player(name, message)
|
||||
end
|
||||
else
|
||||
core.chat_send_player(name, "You don't have permission"
|
||||
.. " to run this command (missing privileges: "
|
||||
.. table.concat(missing_privs, ", ") .. ")")
|
||||
end
|
||||
return true -- Handled chat message
|
||||
end)
|
||||
|
||||
--
|
||||
-- Chat commands
|
||||
--
|
||||
core.register_chatcommand("me", {
|
||||
params = "<action>",
|
||||
description = "chat action (eg. /me orders a pizza)",
|
||||
privs = {shout=true},
|
||||
func = function(name, param)
|
||||
core.chat_send_all("* " .. name .. " " .. param)
|
||||
end,
|
||||
})
|
||||
|
||||
core.register_chatcommand("help", {
|
||||
privs = {},
|
||||
params = "[all/privs/<cmd>]",
|
||||
description = "Get help for commands or list privileges",
|
||||
func = function(name, param)
|
||||
local function format_help_line(cmd, def)
|
||||
local msg = "/"..cmd
|
||||
if def.params and def.params ~= "" then
|
||||
msg = msg .. " " .. def.params
|
||||
end
|
||||
if def.description and def.description ~= "" then
|
||||
msg = msg .. ": " .. def.description
|
||||
end
|
||||
return msg
|
||||
end
|
||||
if param == "" then
|
||||
local msg = ""
|
||||
local cmds = {}
|
||||
for cmd, def in pairs(core.chatcommands) do
|
||||
if core.check_player_privs(name, def.privs) then
|
||||
table.insert(cmds, cmd)
|
||||
end
|
||||
end
|
||||
table.sort(cmds)
|
||||
return true, "Available commands: " .. table.concat(cmds, " ") .. "\n"
|
||||
.. "Use '/help <cmd>' to get more information,"
|
||||
.. " or '/help all' to list everything."
|
||||
elseif param == "all" then
|
||||
local cmds = {}
|
||||
for cmd, def in pairs(core.chatcommands) do
|
||||
if core.check_player_privs(name, def.privs) then
|
||||
table.insert(cmds, format_help_line(cmd, def))
|
||||
end
|
||||
end
|
||||
table.sort(cmds)
|
||||
return true, "Available commands:\n"..table.concat(cmds, "\n")
|
||||
elseif param == "privs" then
|
||||
local privs = {}
|
||||
for priv, def in pairs(core.registered_privileges) do
|
||||
table.insert(privs, priv .. ": " .. def.description)
|
||||
end
|
||||
table.sort(privs)
|
||||
return true, "Available privileges:\n"..table.concat(privs, "\n")
|
||||
else
|
||||
local cmd = param
|
||||
local def = core.chatcommands[cmd]
|
||||
if not def then
|
||||
return false, "Command not available: "..cmd
|
||||
else
|
||||
return true, format_help_line(cmd, def)
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
core.register_chatcommand("privs", {
|
||||
params = "<name>",
|
||||
description = "print out privileges of player",
|
||||
func = function(name, param)
|
||||
param = (param ~= "" and param or name)
|
||||
return true, "Privileges of " .. param .. ": "
|
||||
.. core.privs_to_string(
|
||||
core.get_player_privs(param), ' ')
|
||||
end,
|
||||
})
|
||||
core.register_chatcommand("grant", {
|
||||
params = "<name> <privilege>|all",
|
||||
description = "Give privilege to player",
|
||||
func = function(name, param)
|
||||
if not core.check_player_privs(name, {privs=true}) and
|
||||
not core.check_player_privs(name, {basic_privs=true}) then
|
||||
return false, "Your privileges are insufficient."
|
||||
end
|
||||
local grantname, grantprivstr = string.match(param, "([^ ]+) (.+)")
|
||||
if not grantname or not grantprivstr then
|
||||
return false, "Invalid parameters (see /help grant)"
|
||||
elseif not core.auth_table[grantname] then
|
||||
return false, "Player " .. grantname .. " does not exist."
|
||||
end
|
||||
local grantprivs = core.string_to_privs(grantprivstr)
|
||||
if grantprivstr == "all" then
|
||||
grantprivs = core.registered_privileges
|
||||
end
|
||||
local privs = core.get_player_privs(grantname)
|
||||
local privs_unknown = ""
|
||||
for priv, _ in pairs(grantprivs) do
|
||||
if priv ~= "interact" and priv ~= "shout" and
|
||||
not core.check_player_privs(name, {privs=true}) then
|
||||
return false, "Your privileges are insufficient."
|
||||
end
|
||||
if not core.registered_privileges[priv] then
|
||||
privs_unknown = privs_unknown .. "Unknown privilege: " .. priv .. "\n"
|
||||
end
|
||||
privs[priv] = true
|
||||
end
|
||||
if privs_unknown ~= "" then
|
||||
return false, privs_unknown
|
||||
end
|
||||
core.set_player_privs(grantname, privs)
|
||||
core.log("action", name..' granted ('..core.privs_to_string(grantprivs, ', ')..') privileges to '..grantname)
|
||||
if grantname ~= name then
|
||||
core.chat_send_player(grantname, name
|
||||
.. " granted you privileges: "
|
||||
.. core.privs_to_string(grantprivs, ' '))
|
||||
end
|
||||
return true, "Privileges of " .. grantname .. ": "
|
||||
.. core.privs_to_string(
|
||||
core.get_player_privs(grantname), ' ')
|
||||
end,
|
||||
})
|
||||
core.register_chatcommand("revoke", {
|
||||
params = "<name> <privilege>|all",
|
||||
description = "Remove privilege from player",
|
||||
privs = {},
|
||||
func = function(name, param)
|
||||
if not core.check_player_privs(name, {privs=true}) and
|
||||
not core.check_player_privs(name, {basic_privs=true}) then
|
||||
return false, "Your privileges are insufficient."
|
||||
end
|
||||
local revoke_name, revoke_priv_str = string.match(param, "([^ ]+) (.+)")
|
||||
if not revoke_name or not revoke_priv_str then
|
||||
return false, "Invalid parameters (see /help revoke)"
|
||||
elseif not core.auth_table[revoke_name] then
|
||||
return false, "Player " .. revoke_name .. " does not exist."
|
||||
end
|
||||
local revoke_privs = core.string_to_privs(revoke_priv_str)
|
||||
local privs = core.get_player_privs(revoke_name)
|
||||
for priv, _ in pairs(revoke_privs) do
|
||||
if priv ~= "interact" and priv ~= "shout" and
|
||||
not core.check_player_privs(name, {privs=true}) then
|
||||
return false, "Your privileges are insufficient."
|
||||
end
|
||||
end
|
||||
if revoke_priv_str == "all" then
|
||||
privs = {}
|
||||
else
|
||||
for priv, _ in pairs(revoke_privs) do
|
||||
privs[priv] = nil
|
||||
end
|
||||
end
|
||||
core.set_player_privs(revoke_name, privs)
|
||||
core.log("action", name..' revoked ('
|
||||
..core.privs_to_string(revoke_privs, ', ')
|
||||
..') privileges from '..revoke_name)
|
||||
if revoke_name ~= name then
|
||||
core.chat_send_player(revoke_name, name
|
||||
.. " revoked privileges from you: "
|
||||
.. core.privs_to_string(revoke_privs, ' '))
|
||||
end
|
||||
return true, "Privileges of " .. revoke_name .. ": "
|
||||
.. core.privs_to_string(
|
||||
core.get_player_privs(revoke_name), ' ')
|
||||
end,
|
||||
})
|
||||
|
||||
core.register_chatcommand("setpassword", {
|
||||
params = "<name> <password>",
|
||||
description = "set given password",
|
||||
privs = {password=true},
|
||||
func = function(name, param)
|
||||
local toname, raw_password = string.match(param, "^([^ ]+) +(.+)$")
|
||||
if not toname then
|
||||
toname = param:match("^([^ ]+) *$")
|
||||
raw_password = nil
|
||||
end
|
||||
if not toname then
|
||||
return false, "Name field required"
|
||||
end
|
||||
local act_str_past = "?"
|
||||
local act_str_pres = "?"
|
||||
if not raw_password then
|
||||
core.set_player_password(toname, "")
|
||||
act_str_past = "cleared"
|
||||
act_str_pres = "clears"
|
||||
else
|
||||
core.set_player_password(toname,
|
||||
core.get_password_hash(toname,
|
||||
raw_password))
|
||||
act_str_past = "set"
|
||||
act_str_pres = "sets"
|
||||
end
|
||||
if toname ~= name then
|
||||
core.chat_send_player(toname, "Your password was "
|
||||
.. act_str_past .. " by " .. name)
|
||||
end
|
||||
|
||||
core.log("action", name .. " " .. act_str_pres
|
||||
.. " password of " .. toname .. ".")
|
||||
|
||||
return true, "Password of player \"" .. toname .. "\" " .. act_str_past
|
||||
end,
|
||||
})
|
||||
|
||||
core.register_chatcommand("clearpassword", {
|
||||
params = "<name>",
|
||||
description = "set empty password",
|
||||
privs = {password=true},
|
||||
func = function(name, param)
|
||||
local toname = param
|
||||
if toname == "" then
|
||||
return false, "Name field required"
|
||||
end
|
||||
core.set_player_password(toname, '')
|
||||
|
||||
core.log("action", name .. " clears password of " .. toname .. ".")
|
||||
|
||||
return true, "Password of player \"" .. toname .. "\" cleared"
|
||||
end,
|
||||
})
|
||||
|
||||
core.register_chatcommand("auth_reload", {
|
||||
params = "",
|
||||
description = "reload authentication data",
|
||||
privs = {server=true},
|
||||
func = function(name, param)
|
||||
local done = core.auth_reload()
|
||||
return done, (done and "Done." or "Failed.")
|
||||
end,
|
||||
})
|
||||
|
||||
core.register_chatcommand("teleport", {
|
||||
params = "<X>,<Y>,<Z> | <to_name> | <name> <X>,<Y>,<Z> | <name> <to_name>",
|
||||
description = "teleport to given position",
|
||||
privs = {teleport=true},
|
||||
func = function(name, param)
|
||||
-- Returns (pos, true) if found, otherwise (pos, false)
|
||||
local function find_free_position_near(pos)
|
||||
local tries = {
|
||||
{x=1,y=0,z=0},
|
||||
{x=-1,y=0,z=0},
|
||||
{x=0,y=0,z=1},
|
||||
{x=0,y=0,z=-1},
|
||||
}
|
||||
for _, d in ipairs(tries) do
|
||||
local p = {x = pos.x+d.x, y = pos.y+d.y, z = pos.z+d.z}
|
||||
local n = core.get_node_or_nil(p)
|
||||
if n and n.name then
|
||||
local def = core.registered_nodes[n.name]
|
||||
if def and not def.walkable then
|
||||
return p, true
|
||||
end
|
||||
end
|
||||
end
|
||||
return pos, false
|
||||
end
|
||||
|
||||
local teleportee = nil
|
||||
local p = {}
|
||||
p.x, p.y, p.z = string.match(param, "^([%d.-]+)[, ] *([%d.-]+)[, ] *([%d.-]+)$")
|
||||
p.x = tonumber(p.x)
|
||||
p.y = tonumber(p.y)
|
||||
p.z = tonumber(p.z)
|
||||
teleportee = core.get_player_by_name(name)
|
||||
if teleportee and p.x and p.y and p.z then
|
||||
teleportee:setpos(p)
|
||||
return true, "Teleporting to "..core.pos_to_string(p)
|
||||
end
|
||||
|
||||
local teleportee = nil
|
||||
local p = nil
|
||||
local target_name = nil
|
||||
target_name = param:match("^([^ ]+)$")
|
||||
teleportee = core.get_player_by_name(name)
|
||||
if target_name then
|
||||
local target = core.get_player_by_name(target_name)
|
||||
if target then
|
||||
p = target:getpos()
|
||||
end
|
||||
end
|
||||
if teleportee and p then
|
||||
p = find_free_position_near(p)
|
||||
teleportee:setpos(p)
|
||||
return true, "Teleporting to " .. target_name
|
||||
.. " at "..core.pos_to_string(p)
|
||||
end
|
||||
|
||||
if not core.check_player_privs(name, {bring=true}) then
|
||||
return false, "You don't have permission to teleport other players (missing bring privilege)"
|
||||
end
|
||||
|
||||
local teleportee = nil
|
||||
local p = {}
|
||||
local teleportee_name = nil
|
||||
teleportee_name, p.x, p.y, p.z = param:match(
|
||||
"^([^ ]+) +([%d.-]+)[, ] *([%d.-]+)[, ] *([%d.-]+)$")
|
||||
p.x, p.y, p.z = tonumber(p.x), tonumber(p.y), tonumber(p.z)
|
||||
if teleportee_name then
|
||||
teleportee = core.get_player_by_name(teleportee_name)
|
||||
end
|
||||
if teleportee and p.x and p.y and p.z then
|
||||
teleportee:setpos(p)
|
||||
return true, "Teleporting " .. teleportee_name
|
||||
.. " to " .. core.pos_to_string(p)
|
||||
end
|
||||
|
||||
local teleportee = nil
|
||||
local p = nil
|
||||
local teleportee_name = nil
|
||||
local target_name = nil
|
||||
teleportee_name, target_name = string.match(param, "^([^ ]+) +([^ ]+)$")
|
||||
if teleportee_name then
|
||||
teleportee = core.get_player_by_name(teleportee_name)
|
||||
end
|
||||
if target_name then
|
||||
local target = core.get_player_by_name(target_name)
|
||||
if target then
|
||||
p = target:getpos()
|
||||
end
|
||||
end
|
||||
if teleportee and p then
|
||||
p = find_free_position_near(p)
|
||||
teleportee:setpos(p)
|
||||
return true, "Teleporting " .. teleportee_name
|
||||
.. " to " .. target_name
|
||||
.. " at " .. core.pos_to_string(p)
|
||||
end
|
||||
|
||||
return false, 'Invalid parameters ("' .. param
|
||||
.. '") or player not found (see /help teleport)'
|
||||
end,
|
||||
})
|
||||
|
||||
core.register_chatcommand("set", {
|
||||
params = "[-n] <name> <value> | <name>",
|
||||
description = "set or read server configuration setting",
|
||||
privs = {server=true},
|
||||
func = function(name, param)
|
||||
local arg, setname, setvalue = string.match(param, "(-[n]) ([^ ]+) (.+)")
|
||||
if arg and arg == "-n" and setname and setvalue then
|
||||
core.setting_set(setname, setvalue)
|
||||
return true, setname .. " = " .. setvalue
|
||||
end
|
||||
local setname, setvalue = string.match(param, "([^ ]+) (.+)")
|
||||
if setname and setvalue then
|
||||
if not core.setting_get(setname) then
|
||||
return false, "Failed. Use '/set -n <name> <value>' to create a new setting."
|
||||
end
|
||||
core.setting_set(setname, setvalue)
|
||||
return true, setname .. " = " .. setvalue
|
||||
end
|
||||
local setname = string.match(param, "([^ ]+)")
|
||||
if setname then
|
||||
local setvalue = core.setting_get(setname)
|
||||
if not setvalue then
|
||||
setvalue = "<not set>"
|
||||
end
|
||||
return true, setname .. " = " .. setvalue
|
||||
end
|
||||
return false, "Invalid parameters (see /help set)."
|
||||
end,
|
||||
})
|
||||
|
||||
core.register_chatcommand("deleteblocks", {
|
||||
params = "(here [radius]) | (<pos1> <pos2>)",
|
||||
description = "delete map blocks contained in area pos1 to pos2",
|
||||
privs = {server=true},
|
||||
func = function(name, param)
|
||||
local p1 = {}
|
||||
local p2 = {}
|
||||
local args = param:split(" ")
|
||||
if args[1] == "here" then
|
||||
local player = core.get_player_by_name(name)
|
||||
if player == nil then
|
||||
core.log("error", "player is nil")
|
||||
return false, "Unable to get current position; player is nil"
|
||||
end
|
||||
p1 = player:getpos()
|
||||
p2 = p1
|
||||
|
||||
if #args >= 2 then
|
||||
local radius = tonumber(args[2]) or 0
|
||||
p1 = vector.add(p1, radius)
|
||||
p2 = vector.subtract(p2, radius)
|
||||
end
|
||||
else
|
||||
local pos1, pos2 = unpack(param:split(") ("))
|
||||
if pos1 == nil or pos2 == nil then
|
||||
return false, "Incorrect area format. Expected: (x1,y1,z1) (x2,y2,z2)"
|
||||
end
|
||||
|
||||
p1 = core.string_to_pos(pos1 .. ")")
|
||||
p2 = core.string_to_pos("(" .. pos2)
|
||||
|
||||
if p1 == nil or p2 == nil then
|
||||
return false, "Incorrect area format. Expected: (x1,y1,z1) (x2,y2,z2)"
|
||||
end
|
||||
end
|
||||
|
||||
if core.delete_area(p1, p2) then
|
||||
return true, "Successfully cleared area ranging from " ..
|
||||
core.pos_to_string(p1, 1) .. " to " .. core.pos_to_string(p2, 1)
|
||||
else
|
||||
return false, "Failed to clear one or more blocks in area"
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
core.register_chatcommand("mods", {
|
||||
params = "",
|
||||
description = "List mods installed on the server",
|
||||
privs = {},
|
||||
func = function(name, param)
|
||||
return true, table.concat(core.get_modnames(), ", ")
|
||||
end,
|
||||
})
|
||||
|
||||
local function handle_give_command(cmd, giver, receiver, stackstring)
|
||||
core.log("action", giver .. " invoked " .. cmd
|
||||
.. ', stackstring="' .. stackstring .. '"')
|
||||
local itemstack = ItemStack(stackstring)
|
||||
if itemstack:is_empty() then
|
||||
return false, "Cannot give an empty item"
|
||||
elseif not itemstack:is_known() then
|
||||
return false, "Cannot give an unknown item"
|
||||
end
|
||||
local receiverref = core.get_player_by_name(receiver)
|
||||
if receiverref == nil then
|
||||
return false, receiver .. " is not a known player"
|
||||
end
|
||||
local leftover = receiverref:get_inventory():add_item("main", itemstack)
|
||||
local partiality
|
||||
if leftover:is_empty() then
|
||||
partiality = ""
|
||||
elseif leftover:get_count() == itemstack:get_count() then
|
||||
partiality = "could not be "
|
||||
else
|
||||
partiality = "partially "
|
||||
end
|
||||
-- The actual item stack string may be different from what the "giver"
|
||||
-- entered (e.g. big numbers are always interpreted as 2^16-1).
|
||||
stackstring = itemstack:to_string()
|
||||
if giver == receiver then
|
||||
return true, ("%q %sadded to inventory.")
|
||||
:format(stackstring, partiality)
|
||||
else
|
||||
core.chat_send_player(receiver, ("%q %sadded to inventory.")
|
||||
:format(stackstring, partiality))
|
||||
return true, ("%q %sadded to %s's inventory.")
|
||||
:format(stackstring, partiality, receiver)
|
||||
end
|
||||
end
|
||||
|
||||
core.register_chatcommand("give", {
|
||||
params = "<name> <ItemString>",
|
||||
description = "give item to player",
|
||||
privs = {give=true},
|
||||
func = function(name, param)
|
||||
local toname, itemstring = string.match(param, "^([^ ]+) +(.+)$")
|
||||
if not toname or not itemstring then
|
||||
return false, "Name and ItemString required"
|
||||
end
|
||||
return handle_give_command("/give", name, toname, itemstring)
|
||||
end,
|
||||
})
|
||||
|
||||
core.register_chatcommand("giveme", {
|
||||
params = "<ItemString>",
|
||||
description = "give item to yourself",
|
||||
privs = {give=true},
|
||||
func = function(name, param)
|
||||
local itemstring = string.match(param, "(.+)$")
|
||||
if not itemstring then
|
||||
return false, "ItemString required"
|
||||
end
|
||||
return handle_give_command("/giveme", name, name, itemstring)
|
||||
end,
|
||||
})
|
||||
|
||||
core.register_chatcommand("spawnentity", {
|
||||
params = "<EntityName> [<X>,<Y>,<Z>]",
|
||||
description = "Spawn entity at given (or your) position",
|
||||
privs = {give=true, interact=true},
|
||||
func = function(name, param)
|
||||
local entityname, p = string.match(param, "^([^ ]+) *(.*)$")
|
||||
if not entityname then
|
||||
return false, "EntityName required"
|
||||
end
|
||||
core.log("action", ("%s invokes /spawnentity, entityname=%q")
|
||||
:format(name, entityname))
|
||||
local player = core.get_player_by_name(name)
|
||||
if player == nil then
|
||||
core.log("error", "Unable to spawn entity, player is nil")
|
||||
return false, "Unable to spawn entity, player is nil"
|
||||
end
|
||||
if p == "" then
|
||||
p = player:getpos()
|
||||
else
|
||||
p = core.string_to_pos(p)
|
||||
if p == nil then
|
||||
return false, "Invalid parameters ('" .. param .. "')"
|
||||
end
|
||||
end
|
||||
p.y = p.y + 1
|
||||
core.add_entity(p, entityname)
|
||||
return true, ("%q spawned."):format(entityname)
|
||||
end,
|
||||
})
|
||||
|
||||
core.register_chatcommand("pulverize", {
|
||||
params = "",
|
||||
description = "Destroy item in hand",
|
||||
func = function(name, param)
|
||||
local player = core.get_player_by_name(name)
|
||||
if not player then
|
||||
core.log("error", "Unable to pulverize, no player.")
|
||||
return false, "Unable to pulverize, no player."
|
||||
end
|
||||
if player:get_wielded_item():is_empty() then
|
||||
return false, "Unable to pulverize, no item in hand."
|
||||
end
|
||||
player:set_wielded_item(nil)
|
||||
return true, "An item was pulverized."
|
||||
end,
|
||||
})
|
||||
|
||||
-- Key = player name
|
||||
core.rollback_punch_callbacks = {}
|
||||
|
||||
core.register_on_punchnode(function(pos, node, puncher)
|
||||
local name = puncher:get_player_name()
|
||||
if core.rollback_punch_callbacks[name] then
|
||||
core.rollback_punch_callbacks[name](pos, node, puncher)
|
||||
core.rollback_punch_callbacks[name] = nil
|
||||
end
|
||||
end)
|
||||
|
||||
core.register_chatcommand("rollback_check", {
|
||||
params = "[<range>] [<seconds>] [limit]",
|
||||
description = "Check who has last touched a node or near it,"
|
||||
.. " max. <seconds> ago (default range=0,"
|
||||
.. " seconds=86400=24h, limit=5)",
|
||||
privs = {rollback=true},
|
||||
func = function(name, param)
|
||||
if not core.setting_getbool("enable_rollback_recording") then
|
||||
return false, "Rollback functions are disabled."
|
||||
end
|
||||
local range, seconds, limit =
|
||||
param:match("(%d+) *(%d*) *(%d*)")
|
||||
range = tonumber(range) or 0
|
||||
seconds = tonumber(seconds) or 86400
|
||||
limit = tonumber(limit) or 5
|
||||
if limit > 100 then
|
||||
return false, "That limit is too high!"
|
||||
end
|
||||
|
||||
core.rollback_punch_callbacks[name] = function(pos, node, puncher)
|
||||
local name = puncher:get_player_name()
|
||||
core.chat_send_player(name, "Checking " .. core.pos_to_string(pos) .. "...")
|
||||
local actions = core.rollback_get_node_actions(pos, range, seconds, limit)
|
||||
if not actions then
|
||||
core.chat_send_player(name, "Rollback functions are disabled")
|
||||
return
|
||||
end
|
||||
local num_actions = #actions
|
||||
if num_actions == 0 then
|
||||
core.chat_send_player(name, "Nobody has touched"
|
||||
.. " the specified location in "
|
||||
.. seconds .. " seconds")
|
||||
return
|
||||
end
|
||||
local time = os.time()
|
||||
for i = num_actions, 1, -1 do
|
||||
local action = actions[i]
|
||||
core.chat_send_player(name,
|
||||
("%s %s %s -> %s %d seconds ago.")
|
||||
:format(
|
||||
core.pos_to_string(action.pos),
|
||||
action.actor,
|
||||
action.oldnode.name,
|
||||
action.newnode.name,
|
||||
time - action.time))
|
||||
end
|
||||
end
|
||||
|
||||
return true, "Punch a node (range=" .. range .. ", seconds="
|
||||
.. seconds .. "s, limit=" .. limit .. ")"
|
||||
end,
|
||||
})
|
||||
|
||||
core.register_chatcommand("rollback", {
|
||||
params = "<player name> [<seconds>] | :<actor> [<seconds>]",
|
||||
description = "revert actions of a player; default for <seconds> is 60",
|
||||
privs = {rollback=true},
|
||||
func = function(name, param)
|
||||
if not core.setting_getbool("enable_rollback_recording") then
|
||||
return false, "Rollback functions are disabled."
|
||||
end
|
||||
local target_name, seconds = string.match(param, ":([^ ]+) *(%d*)")
|
||||
if not target_name then
|
||||
local player_name = nil
|
||||
player_name, seconds = string.match(param, "([^ ]+) *(%d*)")
|
||||
if not player_name then
|
||||
return false, "Invalid parameters. See /help rollback"
|
||||
.. " and /help rollback_check."
|
||||
end
|
||||
target_name = "player:"..player_name
|
||||
end
|
||||
seconds = tonumber(seconds) or 60
|
||||
core.chat_send_player(name, "Reverting actions of "
|
||||
.. target_name .. " since "
|
||||
.. seconds .. " seconds.")
|
||||
local success, log = core.rollback_revert_actions_by(
|
||||
target_name, seconds)
|
||||
local response = ""
|
||||
if #log > 100 then
|
||||
response = "(log is too long to show)\n"
|
||||
else
|
||||
for _, line in pairs(log) do
|
||||
response = response .. line .. "\n"
|
||||
end
|
||||
end
|
||||
response = response .. "Reverting actions "
|
||||
.. (success and "succeeded." or "FAILED.")
|
||||
return success, response
|
||||
end,
|
||||
})
|
||||
|
||||
core.register_chatcommand("status", {
|
||||
description = "Print server status",
|
||||
func = function(name, param)
|
||||
return true, core.get_server_status()
|
||||
end,
|
||||
})
|
||||
|
||||
core.register_chatcommand("time", {
|
||||
params = "<0..23>:<0..59> | <0..24000>",
|
||||
description = "set time of day",
|
||||
privs = {},
|
||||
func = function(name, param)
|
||||
if param == "" then
|
||||
local current_time = math.floor(core.get_timeofday() * 1440)
|
||||
local minutes = current_time % 60
|
||||
local hour = (current_time - minutes) / 60
|
||||
return true, ("Current time is %d:%02d"):format(hour, minutes)
|
||||
end
|
||||
local player_privs = minetest.get_player_privs(name)
|
||||
if not player_privs.settime then
|
||||
return false, "You don't have permission to run this command " ..
|
||||
"(missing privilege: settime)."
|
||||
end
|
||||
local hour, minute = param:match("^(%d+):(%d+)$")
|
||||
if not hour then
|
||||
local new_time = tonumber(param)
|
||||
if not new_time then
|
||||
return false, "Invalid time."
|
||||
end
|
||||
-- Backward compatibility.
|
||||
core.set_timeofday((new_time % 24000) / 24000)
|
||||
core.log("action", name .. " sets time to " .. new_time)
|
||||
return true, "Time of day changed."
|
||||
end
|
||||
hour = tonumber(hour)
|
||||
minute = tonumber(minute)
|
||||
if hour < 0 or hour > 23 then
|
||||
return false, "Invalid hour (must be between 0 and 23 inclusive)."
|
||||
elseif minute < 0 or minute > 59 then
|
||||
return false, "Invalid minute (must be between 0 and 59 inclusive)."
|
||||
end
|
||||
core.set_timeofday((hour * 60 + minute) / 1440)
|
||||
core.log("action", ("%s sets time to %d:%02d"):format(name, hour, minute))
|
||||
return true, "Time of day changed."
|
||||
end,
|
||||
})
|
||||
|
||||
core.register_chatcommand("shutdown", {
|
||||
description = "shutdown server",
|
||||
privs = {server=true},
|
||||
func = function(name, param)
|
||||
core.log("action", name .. " shuts down server")
|
||||
core.request_shutdown()
|
||||
core.chat_send_all("*** Server shutting down (operator request).")
|
||||
end,
|
||||
})
|
||||
|
||||
core.register_chatcommand("ban", {
|
||||
params = "<name>",
|
||||
description = "Ban IP of player",
|
||||
privs = {ban=true},
|
||||
func = function(name, param)
|
||||
if param == "" then
|
||||
return true, "Ban list: " .. core.get_ban_list()
|
||||
end
|
||||
if not core.get_player_by_name(param) then
|
||||
return false, "No such player."
|
||||
end
|
||||
if not core.ban_player(param) then
|
||||
return false, "Failed to ban player."
|
||||
end
|
||||
local desc = core.get_ban_description(param)
|
||||
core.log("action", name .. " bans " .. desc .. ".")
|
||||
return true, "Banned " .. desc .. "."
|
||||
end,
|
||||
})
|
||||
|
||||
core.register_chatcommand("unban", {
|
||||
params = "<name/ip>",
|
||||
description = "remove IP ban",
|
||||
privs = {ban=true},
|
||||
func = function(name, param)
|
||||
if not core.unban_player_or_ip(param) then
|
||||
return false, "Failed to unban player/IP."
|
||||
end
|
||||
core.log("action", name .. " unbans " .. param)
|
||||
return true, "Unbanned " .. param
|
||||
end,
|
||||
})
|
||||
|
||||
core.register_chatcommand("kick", {
|
||||
params = "<name> [reason]",
|
||||
description = "kick a player",
|
||||
privs = {kick=true},
|
||||
func = function(name, param)
|
||||
local tokick, reason = param:match("([^ ]+) (.+)")
|
||||
tokick = tokick or param
|
||||
if not core.kick_player(tokick, reason) then
|
||||
return false, "Failed to kick player " .. tokick
|
||||
end
|
||||
local log_reason = ""
|
||||
if reason then
|
||||
log_reason = " with reason \"" .. reason .. "\""
|
||||
end
|
||||
core.log("action", name .. " kicks " .. tokick .. log_reason)
|
||||
return true, "Kicked " .. tokick
|
||||
end,
|
||||
})
|
||||
|
||||
core.register_chatcommand("clearobjects", {
|
||||
description = "clear all objects in world",
|
||||
privs = {server=true},
|
||||
func = function(name, param)
|
||||
core.log("action", name .. " clears all objects.")
|
||||
core.chat_send_all("Clearing all objects. This may take long."
|
||||
.. " You may experience a timeout. (by "
|
||||
.. name .. ")")
|
||||
core.clear_objects()
|
||||
core.log("action", "Object clearing done.")
|
||||
core.chat_send_all("*** Cleared all objects.")
|
||||
end,
|
||||
})
|
||||
|
||||
core.register_chatcommand("msg", {
|
||||
params = "<name> <message>",
|
||||
description = "Send a private message",
|
||||
privs = {shout=true},
|
||||
func = function(name, param)
|
||||
local sendto, message = param:match("^(%S+)%s(.+)$")
|
||||
if not sendto then
|
||||
return false, "Invalid usage, see /help msg."
|
||||
end
|
||||
if not core.get_player_by_name(sendto) then
|
||||
return false, "The player " .. sendto
|
||||
.. " is not online."
|
||||
end
|
||||
core.log("action", "PM from " .. name .. " to " .. sendto
|
||||
.. ": " .. message)
|
||||
core.chat_send_player(sendto, "PM from " .. name .. ": "
|
||||
.. message)
|
||||
return true, "Message sent."
|
||||
end,
|
||||
})
|
||||
|
||||
core.register_chatcommand("last-login", {
|
||||
params = "[name]",
|
||||
description = "Get the last login time of a player",
|
||||
func = function(name, param)
|
||||
if param == "" then
|
||||
param = name
|
||||
end
|
||||
local pauth = core.get_auth_handler().get_auth(param)
|
||||
if pauth and pauth.last_login then
|
||||
-- Time in UTC, ISO 8601 format
|
||||
return true, "Last login time was " ..
|
||||
os.date("!%Y-%m-%dT%H:%M:%SZ", pauth.last_login)
|
||||
end
|
||||
return false, "Last login time is unknown"
|
||||
end,
|
||||
})
|
||||
53
builtin/game/deprecated.lua
Normal file
53
builtin/game/deprecated.lua
Normal file
@@ -0,0 +1,53 @@
|
||||
-- Minetest: builtin/deprecated.lua
|
||||
|
||||
--
|
||||
-- Default material types
|
||||
--
|
||||
function digprop_err()
|
||||
core.log("info", debug.traceback())
|
||||
core.log("info", "WARNING: The core.digprop_* functions are obsolete and need to be replaced by item groups.")
|
||||
end
|
||||
|
||||
core.digprop_constanttime = digprop_err
|
||||
core.digprop_stonelike = digprop_err
|
||||
core.digprop_dirtlike = digprop_err
|
||||
core.digprop_gravellike = digprop_err
|
||||
core.digprop_woodlike = digprop_err
|
||||
core.digprop_leaveslike = digprop_err
|
||||
core.digprop_glasslike = digprop_err
|
||||
|
||||
core.node_metadata_inventory_move_allow_all = function()
|
||||
core.log("info", "WARNING: core.node_metadata_inventory_move_allow_all is obsolete and does nothing.")
|
||||
end
|
||||
|
||||
core.add_to_creative_inventory = function(itemstring)
|
||||
core.log('info', "WARNING: core.add_to_creative_inventory: This function is deprecated and does nothing.")
|
||||
end
|
||||
|
||||
--
|
||||
-- EnvRef
|
||||
--
|
||||
core.env = {}
|
||||
local envref_deprecation_message_printed = false
|
||||
setmetatable(core.env, {
|
||||
__index = function(table, key)
|
||||
if not envref_deprecation_message_printed then
|
||||
core.log("info", "WARNING: core.env:[...] is deprecated and should be replaced with core.[...]")
|
||||
envref_deprecation_message_printed = true
|
||||
end
|
||||
local func = core[key]
|
||||
if type(func) == "function" then
|
||||
rawset(table, key, function(self, ...)
|
||||
return func(...)
|
||||
end)
|
||||
else
|
||||
rawset(table, key, nil)
|
||||
end
|
||||
return rawget(table, key)
|
||||
end
|
||||
})
|
||||
|
||||
function core.rollback_get_last_node_actor(pos, range, seconds)
|
||||
return core.rollback_get_node_actions(pos, range, seconds, 1)[1]
|
||||
end
|
||||
|
||||
20
builtin/game/detached_inventory.lua
Normal file
20
builtin/game/detached_inventory.lua
Normal file
@@ -0,0 +1,20 @@
|
||||
-- Minetest: builtin/detached_inventory.lua
|
||||
|
||||
core.detached_inventories = {}
|
||||
|
||||
function core.create_detached_inventory(name, callbacks)
|
||||
local stuff = {}
|
||||
stuff.name = name
|
||||
if callbacks then
|
||||
stuff.allow_move = callbacks.allow_move
|
||||
stuff.allow_put = callbacks.allow_put
|
||||
stuff.allow_take = callbacks.allow_take
|
||||
stuff.on_move = callbacks.on_move
|
||||
stuff.on_put = callbacks.on_put
|
||||
stuff.on_take = callbacks.on_take
|
||||
end
|
||||
stuff.mod_origin = core.get_current_modname() or "??"
|
||||
core.detached_inventories[name] = stuff
|
||||
return core.create_detached_inventory_raw(name)
|
||||
end
|
||||
|
||||
224
builtin/game/falling.lua
Normal file
224
builtin/game/falling.lua
Normal file
@@ -0,0 +1,224 @@
|
||||
-- Minetest: builtin/item.lua
|
||||
|
||||
--
|
||||
-- Falling stuff
|
||||
--
|
||||
|
||||
core.register_entity(":__builtin:falling_node", {
|
||||
initial_properties = {
|
||||
physical = true,
|
||||
collide_with_objects = false,
|
||||
collisionbox = {-0.5,-0.5,-0.5, 0.5,0.5,0.5},
|
||||
visual = "wielditem",
|
||||
textures = {},
|
||||
visual_size = {x=0.667, y=0.667},
|
||||
},
|
||||
|
||||
node = {},
|
||||
|
||||
set_node = function(self, node)
|
||||
self.node = node
|
||||
local stack = ItemStack(node.name)
|
||||
local itemtable = stack:to_table()
|
||||
local itemname = nil
|
||||
if itemtable then
|
||||
itemname = stack:to_table().name
|
||||
end
|
||||
local item_texture = nil
|
||||
local item_type = ""
|
||||
if core.registered_items[itemname] then
|
||||
item_texture = core.registered_items[itemname].inventory_image
|
||||
item_type = core.registered_items[itemname].type
|
||||
end
|
||||
local prop = {
|
||||
is_visible = true,
|
||||
textures = {node.name},
|
||||
}
|
||||
self.object:set_properties(prop)
|
||||
end,
|
||||
|
||||
get_staticdata = function(self)
|
||||
return self.node.name
|
||||
end,
|
||||
|
||||
on_activate = function(self, staticdata)
|
||||
self.object:set_armor_groups({immortal=1})
|
||||
self:set_node({name=staticdata})
|
||||
end,
|
||||
|
||||
on_step = function(self, dtime)
|
||||
-- Set gravity
|
||||
self.object:setacceleration({x=0, y=-10, z=0})
|
||||
-- Turn to actual sand when collides to ground or just move
|
||||
local pos = self.object:getpos()
|
||||
local bcp = {x=pos.x, y=pos.y-0.7, z=pos.z} -- Position of bottom center point
|
||||
local bcn = core.get_node(bcp)
|
||||
local bcd = core.registered_nodes[bcn.name]
|
||||
-- Note: walkable is in the node definition, not in item groups
|
||||
if not bcd or
|
||||
(bcd.walkable or
|
||||
(core.get_item_group(self.node.name, "float") ~= 0 and
|
||||
bcd.liquidtype ~= "none")) then
|
||||
if bcd and bcd.leveled and
|
||||
bcn.name == self.node.name then
|
||||
local addlevel = self.node.level
|
||||
if addlevel == nil or addlevel <= 0 then
|
||||
addlevel = bcd.leveled
|
||||
end
|
||||
if core.add_node_level(bcp, addlevel) == 0 then
|
||||
self.object:remove()
|
||||
return
|
||||
end
|
||||
elseif bcd and bcd.buildable_to and
|
||||
(core.get_item_group(self.node.name, "float") == 0 or
|
||||
bcd.liquidtype == "none") then
|
||||
core.remove_node(bcp)
|
||||
return
|
||||
end
|
||||
local np = {x=bcp.x, y=bcp.y+1, z=bcp.z}
|
||||
-- Check what's here
|
||||
local n2 = core.get_node(np)
|
||||
-- If it's not air or liquid, remove node and replace it with
|
||||
-- it's drops
|
||||
if n2.name ~= "air" and (not core.registered_nodes[n2.name] or
|
||||
core.registered_nodes[n2.name].liquidtype == "none") then
|
||||
core.remove_node(np)
|
||||
if core.registered_nodes[n2.name].buildable_to == false then
|
||||
-- Add dropped items
|
||||
local drops = core.get_node_drops(n2.name, "")
|
||||
local _, dropped_item
|
||||
for _, dropped_item in ipairs(drops) do
|
||||
core.add_item(np, dropped_item)
|
||||
end
|
||||
end
|
||||
-- Run script hook
|
||||
local _, callback
|
||||
for _, callback in ipairs(core.registered_on_dignodes) do
|
||||
callback(np, n2, nil)
|
||||
end
|
||||
end
|
||||
-- Create node and remove entity
|
||||
core.add_node(np, self.node)
|
||||
self.object:remove()
|
||||
nodeupdate(np)
|
||||
return
|
||||
end
|
||||
local vel = self.object:getvelocity()
|
||||
if vector.equals(vel, {x=0,y=0,z=0}) then
|
||||
local npos = self.object:getpos()
|
||||
self.object:setpos(vector.round(npos))
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
function spawn_falling_node(p, node)
|
||||
local obj = core.add_entity(p, "__builtin:falling_node")
|
||||
obj:get_luaentity():set_node(node)
|
||||
end
|
||||
|
||||
function drop_attached_node(p)
|
||||
local nn = core.get_node(p).name
|
||||
core.remove_node(p)
|
||||
for _,item in ipairs(core.get_node_drops(nn, "")) do
|
||||
local pos = {
|
||||
x = p.x + math.random()/2 - 0.25,
|
||||
y = p.y + math.random()/2 - 0.25,
|
||||
z = p.z + math.random()/2 - 0.25,
|
||||
}
|
||||
core.add_item(pos, item)
|
||||
end
|
||||
end
|
||||
|
||||
function check_attached_node(p, n)
|
||||
local def = core.registered_nodes[n.name]
|
||||
local d = {x=0, y=0, z=0}
|
||||
if def.paramtype2 == "wallmounted" then
|
||||
if n.param2 == 0 then
|
||||
d.y = 1
|
||||
elseif n.param2 == 1 then
|
||||
d.y = -1
|
||||
elseif n.param2 == 2 then
|
||||
d.x = 1
|
||||
elseif n.param2 == 3 then
|
||||
d.x = -1
|
||||
elseif n.param2 == 4 then
|
||||
d.z = 1
|
||||
elseif n.param2 == 5 then
|
||||
d.z = -1
|
||||
end
|
||||
else
|
||||
d.y = -1
|
||||
end
|
||||
local p2 = {x=p.x+d.x, y=p.y+d.y, z=p.z+d.z}
|
||||
local nn = core.get_node(p2).name
|
||||
local def2 = core.registered_nodes[nn]
|
||||
if def2 and not def2.walkable then
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
--
|
||||
-- Some common functions
|
||||
--
|
||||
|
||||
function nodeupdate_single(p, delay)
|
||||
local n = core.get_node(p)
|
||||
if core.get_item_group(n.name, "falling_node") ~= 0 then
|
||||
local p_bottom = {x=p.x, y=p.y-1, z=p.z}
|
||||
local n_bottom = core.get_node(p_bottom)
|
||||
-- Note: walkable is in the node definition, not in item groups
|
||||
if core.registered_nodes[n_bottom.name] and
|
||||
(core.get_item_group(n.name, "float") == 0 or
|
||||
core.registered_nodes[n_bottom.name].liquidtype == "none") and
|
||||
(n.name ~= n_bottom.name or (core.registered_nodes[n_bottom.name].leveled and
|
||||
core.get_node_level(p_bottom) < core.get_node_max_level(p_bottom))) and
|
||||
(not core.registered_nodes[n_bottom.name].walkable or
|
||||
core.registered_nodes[n_bottom.name].buildable_to) then
|
||||
if delay then
|
||||
core.after(0.1, nodeupdate_single, {x=p.x, y=p.y, z=p.z}, false)
|
||||
else
|
||||
n.level = core.get_node_level(p)
|
||||
core.remove_node(p)
|
||||
spawn_falling_node(p, n)
|
||||
nodeupdate(p)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if core.get_item_group(n.name, "attached_node") ~= 0 then
|
||||
if not check_attached_node(p, n) then
|
||||
drop_attached_node(p)
|
||||
nodeupdate(p)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function nodeupdate(p, delay)
|
||||
-- Round p to prevent falling entities to get stuck
|
||||
p.x = math.floor(p.x+0.5)
|
||||
p.y = math.floor(p.y+0.5)
|
||||
p.z = math.floor(p.z+0.5)
|
||||
|
||||
for x = -1,1 do
|
||||
for y = -1,1 do
|
||||
for z = -1,1 do
|
||||
nodeupdate_single({x=p.x+x, y=p.y+y, z=p.z+z}, delay or not (x==0 and y==0 and z==0))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--
|
||||
-- Global callbacks
|
||||
--
|
||||
|
||||
function on_placenode(p, node)
|
||||
nodeupdate(p)
|
||||
end
|
||||
core.register_on_placenode(on_placenode)
|
||||
|
||||
function on_dignode(p, node)
|
||||
nodeupdate(p)
|
||||
end
|
||||
core.register_on_dignode(on_dignode)
|
||||
30
builtin/game/features.lua
Normal file
30
builtin/game/features.lua
Normal file
@@ -0,0 +1,30 @@
|
||||
-- Minetest: builtin/features.lua
|
||||
|
||||
core.features = {
|
||||
glasslike_framed = true,
|
||||
nodebox_as_selectionbox = true,
|
||||
chat_send_player_param3 = true,
|
||||
get_all_craft_recipes_works = true,
|
||||
use_texture_alpha = true,
|
||||
no_legacy_abms = true,
|
||||
texture_names_parens = true,
|
||||
}
|
||||
|
||||
function core.has_feature(arg)
|
||||
if type(arg) == "table" then
|
||||
missing_features = {}
|
||||
result = true
|
||||
for ft, _ in pairs(arg) do
|
||||
if not core.features[ftr] then
|
||||
missing_features[ftr] = true
|
||||
result = false
|
||||
end
|
||||
end
|
||||
return result, missing_features
|
||||
elseif type(arg) == "string" then
|
||||
if not core.features[arg] then
|
||||
return false, {[arg]=true}
|
||||
end
|
||||
return true, {}
|
||||
end
|
||||
end
|
||||
79
builtin/game/forceloading.lua
Normal file
79
builtin/game/forceloading.lua
Normal file
@@ -0,0 +1,79 @@
|
||||
-- Prevent anyone else accessing those functions
|
||||
local forceload_block = core.forceload_block
|
||||
local forceload_free_block = core.forceload_free_block
|
||||
core.forceload_block = nil
|
||||
core.forceload_free_block = nil
|
||||
|
||||
local blocks_forceloaded
|
||||
local total_forceloaded = 0
|
||||
|
||||
local BLOCKSIZE = 16
|
||||
local function get_blockpos(pos)
|
||||
return {
|
||||
x = math.floor(pos.x/BLOCKSIZE),
|
||||
y = math.floor(pos.y/BLOCKSIZE),
|
||||
z = math.floor(pos.z/BLOCKSIZE)}
|
||||
end
|
||||
|
||||
function core.forceload_block(pos)
|
||||
local blockpos = get_blockpos(pos)
|
||||
local hash = core.hash_node_position(blockpos)
|
||||
if blocks_forceloaded[hash] ~= nil then
|
||||
blocks_forceloaded[hash] = blocks_forceloaded[hash] + 1
|
||||
return true
|
||||
else
|
||||
if total_forceloaded >= (tonumber(core.setting_get("max_forceloaded_blocks")) or 16) then
|
||||
return false
|
||||
end
|
||||
total_forceloaded = total_forceloaded+1
|
||||
blocks_forceloaded[hash] = 1
|
||||
forceload_block(blockpos)
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
function core.forceload_free_block(pos)
|
||||
local blockpos = get_blockpos(pos)
|
||||
local hash = core.hash_node_position(blockpos)
|
||||
if blocks_forceloaded[hash] == nil then return end
|
||||
if blocks_forceloaded[hash] > 1 then
|
||||
blocks_forceloaded[hash] = blocks_forceloaded[hash] - 1
|
||||
else
|
||||
total_forceloaded = total_forceloaded-1
|
||||
blocks_forceloaded[hash] = nil
|
||||
forceload_free_block(blockpos)
|
||||
end
|
||||
end
|
||||
|
||||
-- Keep the forceloaded areas after restart
|
||||
local wpath = core.get_worldpath()
|
||||
local function read_file(filename)
|
||||
local f = io.open(filename, "r")
|
||||
if f==nil then return {} end
|
||||
local t = f:read("*all")
|
||||
f:close()
|
||||
if t=="" or t==nil then return {} end
|
||||
return core.deserialize(t) or {}
|
||||
end
|
||||
|
||||
local function write_file(filename, table)
|
||||
local f = io.open(filename, "w")
|
||||
f:write(core.serialize(table))
|
||||
f:close()
|
||||
end
|
||||
|
||||
blocks_forceloaded = read_file(wpath.."/force_loaded.txt")
|
||||
for _, __ in pairs(blocks_forceloaded) do
|
||||
total_forceloaded = total_forceloaded + 1
|
||||
end
|
||||
|
||||
core.after(5, function()
|
||||
for hash, _ in pairs(blocks_forceloaded) do
|
||||
local blockpos = core.get_position_from_hash(hash)
|
||||
forceload_block(blockpos)
|
||||
end
|
||||
end)
|
||||
|
||||
core.register_on_shutdown(function()
|
||||
write_file(wpath.."/force_loaded.txt", blocks_forceloaded)
|
||||
end)
|
||||
28
builtin/game/init.lua
Normal file
28
builtin/game/init.lua
Normal file
@@ -0,0 +1,28 @@
|
||||
|
||||
local scriptpath = minetest.get_builtin_path()..DIR_DELIM
|
||||
local commonpath = scriptpath.."common"..DIR_DELIM
|
||||
local gamepath = scriptpath.."game"..DIR_DELIM
|
||||
|
||||
dofile(commonpath.."vector.lua")
|
||||
|
||||
dofile(gamepath.."item.lua")
|
||||
dofile(gamepath.."register.lua")
|
||||
|
||||
if core.setting_getbool("mod_profiling") then
|
||||
dofile(gamepath.."mod_profiling.lua")
|
||||
end
|
||||
|
||||
dofile(gamepath.."item_entity.lua")
|
||||
dofile(gamepath.."deprecated.lua")
|
||||
dofile(gamepath.."misc.lua")
|
||||
dofile(gamepath.."privileges.lua")
|
||||
dofile(gamepath.."auth.lua")
|
||||
dofile(gamepath.."chatcommands.lua")
|
||||
dofile(gamepath.."static_spawn.lua")
|
||||
dofile(gamepath.."detached_inventory.lua")
|
||||
dofile(gamepath.."falling.lua")
|
||||
dofile(gamepath.."features.lua")
|
||||
dofile(gamepath.."voxelarea.lua")
|
||||
dofile(gamepath.."forceloading.lua")
|
||||
dofile(gamepath.."statbars.lua")
|
||||
|
||||
627
builtin/game/item.lua
Normal file
627
builtin/game/item.lua
Normal file
@@ -0,0 +1,627 @@
|
||||
-- Minetest: builtin/item.lua
|
||||
|
||||
local function copy_pointed_thing(pointed_thing)
|
||||
return {
|
||||
type = pointed_thing.type,
|
||||
above = vector.new(pointed_thing.above),
|
||||
under = vector.new(pointed_thing.under),
|
||||
ref = pointed_thing.ref,
|
||||
}
|
||||
end
|
||||
|
||||
--
|
||||
-- Item definition helpers
|
||||
--
|
||||
|
||||
function core.inventorycube(img1, img2, img3)
|
||||
img2 = img2 or img1
|
||||
img3 = img3 or img1
|
||||
return "[inventorycube"
|
||||
.. "{" .. img1:gsub("%^", "&")
|
||||
.. "{" .. img2:gsub("%^", "&")
|
||||
.. "{" .. img3:gsub("%^", "&")
|
||||
end
|
||||
|
||||
function core.get_pointed_thing_position(pointed_thing, above)
|
||||
if pointed_thing.type == "node" then
|
||||
if above then
|
||||
-- The position where a node would be placed
|
||||
return pointed_thing.above
|
||||
else
|
||||
-- The position where a node would be dug
|
||||
return pointed_thing.under
|
||||
end
|
||||
elseif pointed_thing.type == "object" then
|
||||
obj = pointed_thing.ref
|
||||
if obj ~= nil then
|
||||
return obj:getpos()
|
||||
else
|
||||
return nil
|
||||
end
|
||||
else
|
||||
return nil
|
||||
end
|
||||
end
|
||||
|
||||
function core.dir_to_facedir(dir, is6d)
|
||||
--account for y if requested
|
||||
if is6d and math.abs(dir.y) > math.abs(dir.x) and math.abs(dir.y) > math.abs(dir.z) then
|
||||
|
||||
--from above
|
||||
if dir.y < 0 then
|
||||
if math.abs(dir.x) > math.abs(dir.z) then
|
||||
if dir.x < 0 then
|
||||
return 19
|
||||
else
|
||||
return 13
|
||||
end
|
||||
else
|
||||
if dir.z < 0 then
|
||||
return 10
|
||||
else
|
||||
return 4
|
||||
end
|
||||
end
|
||||
|
||||
--from below
|
||||
else
|
||||
if math.abs(dir.x) > math.abs(dir.z) then
|
||||
if dir.x < 0 then
|
||||
return 15
|
||||
else
|
||||
return 17
|
||||
end
|
||||
else
|
||||
if dir.z < 0 then
|
||||
return 6
|
||||
else
|
||||
return 8
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--otherwise, place horizontally
|
||||
elseif math.abs(dir.x) > math.abs(dir.z) then
|
||||
if dir.x < 0 then
|
||||
return 3
|
||||
else
|
||||
return 1
|
||||
end
|
||||
else
|
||||
if dir.z < 0 then
|
||||
return 2
|
||||
else
|
||||
return 0
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function core.facedir_to_dir(facedir)
|
||||
--a table of possible dirs
|
||||
return ({{x=0, y=0, z=1},
|
||||
{x=1, y=0, z=0},
|
||||
{x=0, y=0, z=-1},
|
||||
{x=-1, y=0, z=0},
|
||||
{x=0, y=-1, z=0},
|
||||
{x=0, y=1, z=0}})
|
||||
|
||||
--indexed into by a table of correlating facedirs
|
||||
[({[0]=1, 2, 3, 4,
|
||||
5, 2, 6, 4,
|
||||
6, 2, 5, 4,
|
||||
1, 5, 3, 6,
|
||||
1, 6, 3, 5,
|
||||
1, 4, 3, 2})
|
||||
|
||||
--indexed into by the facedir in question
|
||||
[facedir]]
|
||||
end
|
||||
|
||||
function core.dir_to_wallmounted(dir)
|
||||
if math.abs(dir.y) > math.max(math.abs(dir.x), math.abs(dir.z)) then
|
||||
if dir.y < 0 then
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
end
|
||||
elseif math.abs(dir.x) > math.abs(dir.z) then
|
||||
if dir.x < 0 then
|
||||
return 3
|
||||
else
|
||||
return 2
|
||||
end
|
||||
else
|
||||
if dir.z < 0 then
|
||||
return 5
|
||||
else
|
||||
return 4
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function core.get_node_drops(nodename, toolname)
|
||||
local drop = ItemStack({name=nodename}):get_definition().drop
|
||||
if drop == nil then
|
||||
-- default drop
|
||||
return {nodename}
|
||||
elseif type(drop) == "string" then
|
||||
-- itemstring drop
|
||||
return {drop}
|
||||
elseif drop.items == nil then
|
||||
-- drop = {} to disable default drop
|
||||
return {}
|
||||
end
|
||||
|
||||
-- Extended drop table
|
||||
local got_items = {}
|
||||
local got_count = 0
|
||||
local _, item, tool
|
||||
for _, item in ipairs(drop.items) do
|
||||
local good_rarity = true
|
||||
local good_tool = true
|
||||
if item.rarity ~= nil then
|
||||
good_rarity = item.rarity < 1 or math.random(item.rarity) == 1
|
||||
end
|
||||
if item.tools ~= nil then
|
||||
good_tool = false
|
||||
for _, tool in ipairs(item.tools) do
|
||||
if tool:sub(1, 1) == '~' then
|
||||
good_tool = toolname:find(tool:sub(2)) ~= nil
|
||||
else
|
||||
good_tool = toolname == tool
|
||||
end
|
||||
if good_tool then
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
if good_rarity and good_tool then
|
||||
got_count = got_count + 1
|
||||
for _, add_item in ipairs(item.items) do
|
||||
got_items[#got_items+1] = add_item
|
||||
end
|
||||
if drop.max_items ~= nil and got_count == drop.max_items then
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
return got_items
|
||||
end
|
||||
|
||||
function core.item_place_node(itemstack, placer, pointed_thing, param2)
|
||||
local item = itemstack:peek_item()
|
||||
local def = itemstack:get_definition()
|
||||
if def.type ~= "node" or pointed_thing.type ~= "node" then
|
||||
return itemstack, false
|
||||
end
|
||||
|
||||
local under = pointed_thing.under
|
||||
local oldnode_under = core.get_node_or_nil(under)
|
||||
local above = pointed_thing.above
|
||||
local oldnode_above = core.get_node_or_nil(above)
|
||||
|
||||
if not oldnode_under or not oldnode_above then
|
||||
core.log("info", placer:get_player_name() .. " tried to place"
|
||||
.. " node in unloaded position " .. core.pos_to_string(above))
|
||||
return itemstack, false
|
||||
end
|
||||
|
||||
local olddef_under = ItemStack({name=oldnode_under.name}):get_definition()
|
||||
olddef_under = olddef_under or core.nodedef_default
|
||||
local olddef_above = ItemStack({name=oldnode_above.name}):get_definition()
|
||||
olddef_above = olddef_above or core.nodedef_default
|
||||
|
||||
if not olddef_above.buildable_to and not olddef_under.buildable_to then
|
||||
core.log("info", placer:get_player_name() .. " tried to place"
|
||||
.. " node in invalid position " .. core.pos_to_string(above)
|
||||
.. ", replacing " .. oldnode_above.name)
|
||||
return itemstack, false
|
||||
end
|
||||
|
||||
-- Place above pointed node
|
||||
local place_to = {x = above.x, y = above.y, z = above.z}
|
||||
|
||||
-- If node under is buildable_to, place into it instead (eg. snow)
|
||||
if olddef_under.buildable_to then
|
||||
core.log("info", "node under is buildable to")
|
||||
place_to = {x = under.x, y = under.y, z = under.z}
|
||||
end
|
||||
|
||||
if core.is_protected(place_to, placer:get_player_name()) then
|
||||
core.log("action", placer:get_player_name()
|
||||
.. " tried to place " .. def.name
|
||||
.. " at protected position "
|
||||
.. core.pos_to_string(place_to))
|
||||
core.record_protection_violation(place_to, placer:get_player_name())
|
||||
return itemstack
|
||||
end
|
||||
|
||||
core.log("action", placer:get_player_name() .. " places node "
|
||||
.. def.name .. " at " .. core.pos_to_string(place_to))
|
||||
|
||||
local oldnode = core.get_node(place_to)
|
||||
local newnode = {name = def.name, param1 = 0, param2 = param2}
|
||||
|
||||
-- Calculate direction for wall mounted stuff like torches and signs
|
||||
if def.paramtype2 == 'wallmounted' and not param2 then
|
||||
local dir = {
|
||||
x = under.x - above.x,
|
||||
y = under.y - above.y,
|
||||
z = under.z - above.z
|
||||
}
|
||||
newnode.param2 = core.dir_to_wallmounted(dir)
|
||||
-- Calculate the direction for furnaces and chests and stuff
|
||||
elseif def.paramtype2 == 'facedir' and not param2 then
|
||||
local placer_pos = placer:getpos()
|
||||
if placer_pos then
|
||||
local dir = {
|
||||
x = above.x - placer_pos.x,
|
||||
y = above.y - placer_pos.y,
|
||||
z = above.z - placer_pos.z
|
||||
}
|
||||
newnode.param2 = core.dir_to_facedir(dir)
|
||||
core.log("action", "facedir: " .. newnode.param2)
|
||||
end
|
||||
end
|
||||
|
||||
-- Check if the node is attached and if it can be placed there
|
||||
if core.get_item_group(def.name, "attached_node") ~= 0 and
|
||||
not check_attached_node(place_to, newnode) then
|
||||
core.log("action", "attached node " .. def.name ..
|
||||
" can not be placed at " .. core.pos_to_string(place_to))
|
||||
return itemstack, false
|
||||
end
|
||||
|
||||
-- Add node and update
|
||||
core.add_node(place_to, newnode)
|
||||
|
||||
local take_item = true
|
||||
|
||||
-- Run callback
|
||||
if def.after_place_node then
|
||||
-- Deepcopy place_to and pointed_thing because callback can modify it
|
||||
local place_to_copy = {x=place_to.x, y=place_to.y, z=place_to.z}
|
||||
local pointed_thing_copy = copy_pointed_thing(pointed_thing)
|
||||
if def.after_place_node(place_to_copy, placer, itemstack,
|
||||
pointed_thing_copy) then
|
||||
take_item = false
|
||||
end
|
||||
end
|
||||
|
||||
-- Run script hook
|
||||
local _, callback
|
||||
for _, callback in ipairs(core.registered_on_placenodes) do
|
||||
-- Deepcopy pos, node and pointed_thing because callback can modify them
|
||||
local place_to_copy = {x=place_to.x, y=place_to.y, z=place_to.z}
|
||||
local newnode_copy = {name=newnode.name, param1=newnode.param1, param2=newnode.param2}
|
||||
local oldnode_copy = {name=oldnode.name, param1=oldnode.param1, param2=oldnode.param2}
|
||||
local pointed_thing_copy = copy_pointed_thing(pointed_thing)
|
||||
if callback(place_to_copy, newnode_copy, placer, oldnode_copy, itemstack, pointed_thing_copy) then
|
||||
take_item = false
|
||||
end
|
||||
end
|
||||
|
||||
if take_item then
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack, true
|
||||
end
|
||||
|
||||
function core.item_place_object(itemstack, placer, pointed_thing)
|
||||
local pos = core.get_pointed_thing_position(pointed_thing, true)
|
||||
if pos ~= nil then
|
||||
local item = itemstack:take_item()
|
||||
core.add_item(pos, item)
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
|
||||
function core.item_place(itemstack, placer, pointed_thing, param2)
|
||||
-- Call on_rightclick if the pointed node defines it
|
||||
if pointed_thing.type == "node" and placer and
|
||||
not placer:get_player_control().sneak then
|
||||
local n = core.get_node(pointed_thing.under)
|
||||
local nn = n.name
|
||||
if core.registered_nodes[nn] and core.registered_nodes[nn].on_rightclick then
|
||||
return core.registered_nodes[nn].on_rightclick(pointed_thing.under, n,
|
||||
placer, itemstack, pointed_thing) or itemstack, false
|
||||
end
|
||||
end
|
||||
|
||||
if itemstack:get_definition().type == "node" then
|
||||
return core.item_place_node(itemstack, placer, pointed_thing, param2)
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
|
||||
function core.item_drop(itemstack, dropper, pos)
|
||||
if dropper.is_player then
|
||||
local v = dropper:get_look_dir()
|
||||
local p = {x=pos.x, y=pos.y+1.2, z=pos.z}
|
||||
local cs = itemstack:get_count()
|
||||
if dropper:get_player_control().sneak then
|
||||
cs = 1
|
||||
end
|
||||
local item = itemstack:take_item(cs)
|
||||
local obj = core.add_item(p, item)
|
||||
if obj then
|
||||
v.x = v.x*2
|
||||
v.y = v.y*2 + 2
|
||||
v.z = v.z*2
|
||||
obj:setvelocity(v)
|
||||
end
|
||||
|
||||
else
|
||||
core.add_item(pos, itemstack)
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
|
||||
function core.do_item_eat(hp_change, replace_with_item, itemstack, user, pointed_thing)
|
||||
for _, callback in pairs(core.registered_on_item_eats) do
|
||||
local result = callback(hp_change, replace_with_item, itemstack, user, pointed_thing)
|
||||
if result then
|
||||
return result
|
||||
end
|
||||
end
|
||||
if itemstack:take_item() ~= nil then
|
||||
user:set_hp(user:get_hp() + hp_change)
|
||||
|
||||
if replace_with_item then
|
||||
if itemstack:is_empty() then
|
||||
itemstack:add_item(replace_with_item)
|
||||
else
|
||||
local inv = user:get_inventory()
|
||||
if inv:room_for_item("main", {name=replace_with_item}) then
|
||||
inv:add_item("main", replace_with_item)
|
||||
else
|
||||
local pos = user:getpos()
|
||||
pos.y = math.floor(pos.y + 0.5)
|
||||
core.add_item(pos, replace_with_item)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
|
||||
function core.item_eat(hp_change, replace_with_item)
|
||||
return function(itemstack, user, pointed_thing) -- closure
|
||||
return core.do_item_eat(hp_change, replace_with_item, itemstack, user, pointed_thing)
|
||||
end
|
||||
end
|
||||
|
||||
function core.node_punch(pos, node, puncher, pointed_thing)
|
||||
-- Run script hook
|
||||
for _, callback in ipairs(core.registered_on_punchnodes) do
|
||||
-- Copy pos and node because callback can modify them
|
||||
local pos_copy = vector.new(pos)
|
||||
local node_copy = {name=node.name, param1=node.param1, param2=node.param2}
|
||||
local pointed_thing_copy = pointed_thing and copy_pointed_thing(pointed_thing) or nil
|
||||
callback(pos_copy, node_copy, puncher, pointed_thing_copy)
|
||||
end
|
||||
end
|
||||
|
||||
function core.handle_node_drops(pos, drops, digger)
|
||||
-- Add dropped items to object's inventory
|
||||
if digger:get_inventory() then
|
||||
local _, dropped_item
|
||||
for _, dropped_item in ipairs(drops) do
|
||||
local left = digger:get_inventory():add_item("main", dropped_item)
|
||||
if not left:is_empty() then
|
||||
local p = {
|
||||
x = pos.x + math.random()/2-0.25,
|
||||
y = pos.y + math.random()/2-0.25,
|
||||
z = pos.z + math.random()/2-0.25,
|
||||
}
|
||||
core.add_item(p, left)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function core.node_dig(pos, node, digger)
|
||||
local def = ItemStack({name=node.name}):get_definition()
|
||||
if not def.diggable or (def.can_dig and not def.can_dig(pos,digger)) then
|
||||
core.log("info", digger:get_player_name() .. " tried to dig "
|
||||
.. node.name .. " which is not diggable "
|
||||
.. core.pos_to_string(pos))
|
||||
return
|
||||
end
|
||||
|
||||
if core.is_protected(pos, digger:get_player_name()) then
|
||||
core.log("action", digger:get_player_name()
|
||||
.. " tried to dig " .. node.name
|
||||
.. " at protected position "
|
||||
.. core.pos_to_string(pos))
|
||||
core.record_protection_violation(pos, digger:get_player_name())
|
||||
return
|
||||
end
|
||||
|
||||
core.log('action', digger:get_player_name() .. " digs "
|
||||
.. node.name .. " at " .. core.pos_to_string(pos))
|
||||
|
||||
local wielded = digger:get_wielded_item()
|
||||
local drops = core.get_node_drops(node.name, wielded:get_name())
|
||||
|
||||
local wdef = wielded:get_definition()
|
||||
local tp = wielded:get_tool_capabilities()
|
||||
local dp = core.get_dig_params(def.groups, tp)
|
||||
if wdef and wdef.after_use then
|
||||
wielded = wdef.after_use(wielded, digger, node, dp) or wielded
|
||||
else
|
||||
-- Wear out tool
|
||||
if not core.setting_getbool("creative_mode") then
|
||||
wielded:add_wear(dp.wear)
|
||||
end
|
||||
end
|
||||
digger:set_wielded_item(wielded)
|
||||
|
||||
-- Handle drops
|
||||
core.handle_node_drops(pos, drops, digger)
|
||||
|
||||
local oldmetadata = nil
|
||||
if def.after_dig_node then
|
||||
oldmetadata = core.get_meta(pos):to_table()
|
||||
end
|
||||
|
||||
-- Remove node and update
|
||||
core.remove_node(pos)
|
||||
|
||||
-- Run callback
|
||||
if def.after_dig_node then
|
||||
-- Copy pos and node because callback can modify them
|
||||
local pos_copy = {x=pos.x, y=pos.y, z=pos.z}
|
||||
local node_copy = {name=node.name, param1=node.param1, param2=node.param2}
|
||||
def.after_dig_node(pos_copy, node_copy, oldmetadata, digger)
|
||||
end
|
||||
|
||||
-- Run script hook
|
||||
local _, callback
|
||||
for _, callback in ipairs(core.registered_on_dignodes) do
|
||||
local origin = core.callback_origins[callback]
|
||||
if origin then
|
||||
core.set_last_run_mod(origin.mod)
|
||||
--print("Running " .. tostring(callback) ..
|
||||
-- " (a " .. origin.name .. " callback in " .. origin.mod .. ")")
|
||||
else
|
||||
--print("No data associated with callback")
|
||||
end
|
||||
|
||||
-- Copy pos and node because callback can modify them
|
||||
local pos_copy = {x=pos.x, y=pos.y, z=pos.z}
|
||||
local node_copy = {name=node.name, param1=node.param1, param2=node.param2}
|
||||
callback(pos_copy, node_copy, digger)
|
||||
end
|
||||
end
|
||||
|
||||
-- This is used to allow mods to redefine core.item_place and so on
|
||||
-- NOTE: This is not the preferred way. Preferred way is to provide enough
|
||||
-- callbacks to not require redefining global functions. -celeron55
|
||||
local function redef_wrapper(table, name)
|
||||
return function(...)
|
||||
return table[name](...)
|
||||
end
|
||||
end
|
||||
|
||||
--
|
||||
-- Item definition defaults
|
||||
--
|
||||
|
||||
core.nodedef_default = {
|
||||
-- Item properties
|
||||
type="node",
|
||||
-- name intentionally not defined here
|
||||
description = "",
|
||||
groups = {},
|
||||
inventory_image = "",
|
||||
wield_image = "",
|
||||
wield_scale = {x=1,y=1,z=1},
|
||||
stack_max = 99,
|
||||
usable = false,
|
||||
liquids_pointable = false,
|
||||
tool_capabilities = nil,
|
||||
node_placement_prediction = nil,
|
||||
|
||||
-- Interaction callbacks
|
||||
on_place = redef_wrapper(core, 'item_place'), -- core.item_place
|
||||
on_drop = redef_wrapper(core, 'item_drop'), -- core.item_drop
|
||||
on_use = nil,
|
||||
can_dig = nil,
|
||||
|
||||
on_punch = redef_wrapper(core, 'node_punch'), -- core.node_punch
|
||||
on_rightclick = nil,
|
||||
on_dig = redef_wrapper(core, 'node_dig'), -- core.node_dig
|
||||
|
||||
on_receive_fields = nil,
|
||||
|
||||
on_metadata_inventory_move = core.node_metadata_inventory_move_allow_all,
|
||||
on_metadata_inventory_offer = core.node_metadata_inventory_offer_allow_all,
|
||||
on_metadata_inventory_take = core.node_metadata_inventory_take_allow_all,
|
||||
|
||||
-- Node properties
|
||||
drawtype = "normal",
|
||||
visual_scale = 1.0,
|
||||
-- Don't define these because otherwise the old tile_images and
|
||||
-- special_materials wouldn't be read
|
||||
--tiles ={""},
|
||||
--special_tiles = {
|
||||
-- {name="", backface_culling=true},
|
||||
-- {name="", backface_culling=true},
|
||||
--},
|
||||
alpha = 255,
|
||||
post_effect_color = {a=0, r=0, g=0, b=0},
|
||||
paramtype = "none",
|
||||
paramtype2 = "none",
|
||||
is_ground_content = true,
|
||||
sunlight_propagates = false,
|
||||
walkable = true,
|
||||
pointable = true,
|
||||
diggable = true,
|
||||
climbable = false,
|
||||
buildable_to = false,
|
||||
liquidtype = "none",
|
||||
liquid_alternative_flowing = "",
|
||||
liquid_alternative_source = "",
|
||||
liquid_viscosity = 0,
|
||||
drowning = 0,
|
||||
light_source = 0,
|
||||
damage_per_second = 0,
|
||||
selection_box = {type="regular"},
|
||||
legacy_facedir_simple = false,
|
||||
legacy_wallmounted = false,
|
||||
}
|
||||
|
||||
core.craftitemdef_default = {
|
||||
type="craft",
|
||||
-- name intentionally not defined here
|
||||
description = "",
|
||||
groups = {},
|
||||
inventory_image = "",
|
||||
wield_image = "",
|
||||
wield_scale = {x=1,y=1,z=1},
|
||||
stack_max = 99,
|
||||
liquids_pointable = false,
|
||||
tool_capabilities = nil,
|
||||
|
||||
-- Interaction callbacks
|
||||
on_place = redef_wrapper(core, 'item_place'), -- core.item_place
|
||||
on_drop = redef_wrapper(core, 'item_drop'), -- core.item_drop
|
||||
on_use = nil,
|
||||
}
|
||||
|
||||
core.tooldef_default = {
|
||||
type="tool",
|
||||
-- name intentionally not defined here
|
||||
description = "",
|
||||
groups = {},
|
||||
inventory_image = "",
|
||||
wield_image = "",
|
||||
wield_scale = {x=1,y=1,z=1},
|
||||
stack_max = 1,
|
||||
liquids_pointable = false,
|
||||
tool_capabilities = nil,
|
||||
|
||||
-- Interaction callbacks
|
||||
on_place = redef_wrapper(core, 'item_place'), -- core.item_place
|
||||
on_drop = redef_wrapper(core, 'item_drop'), -- core.item_drop
|
||||
on_use = nil,
|
||||
}
|
||||
|
||||
core.noneitemdef_default = { -- This is used for the hand and unknown items
|
||||
type="none",
|
||||
-- name intentionally not defined here
|
||||
description = "",
|
||||
groups = {},
|
||||
inventory_image = "",
|
||||
wield_image = "",
|
||||
wield_scale = {x=1,y=1,z=1},
|
||||
stack_max = 99,
|
||||
liquids_pointable = false,
|
||||
tool_capabilities = nil,
|
||||
|
||||
-- Interaction callbacks
|
||||
on_place = redef_wrapper(core, 'item_place'),
|
||||
on_drop = nil,
|
||||
on_use = nil,
|
||||
}
|
||||
210
builtin/game/item_entity.lua
Normal file
210
builtin/game/item_entity.lua
Normal file
@@ -0,0 +1,210 @@
|
||||
-- Minetest: builtin/item_entity.lua
|
||||
|
||||
function core.spawn_item(pos, item)
|
||||
-- Take item in any format
|
||||
local stack = ItemStack(item)
|
||||
local obj = core.add_entity(pos, "__builtin:item")
|
||||
obj:get_luaentity():set_item(stack:to_string())
|
||||
return obj
|
||||
end
|
||||
|
||||
-- If item_entity_ttl is not set, enity will have default life time
|
||||
-- Setting it to -1 disables the feature
|
||||
|
||||
local time_to_live = tonumber(core.setting_get("item_entity_ttl"))
|
||||
if not time_to_live then
|
||||
time_to_live = 900
|
||||
end
|
||||
|
||||
core.register_entity(":__builtin:item", {
|
||||
initial_properties = {
|
||||
hp_max = 1,
|
||||
physical = true,
|
||||
collide_with_objects = false,
|
||||
collisionbox = {-0.3, -0.3, -0.3, 0.3, 0.3, 0.3},
|
||||
visual = "wielditem",
|
||||
visual_size = {x = 0.4, y = 0.4},
|
||||
textures = {""},
|
||||
spritediv = {x = 1, y = 1},
|
||||
initial_sprite_basepos = {x = 0, y = 0},
|
||||
is_visible = false,
|
||||
},
|
||||
|
||||
itemstring = '',
|
||||
physical_state = true,
|
||||
age = 0,
|
||||
|
||||
set_item = function(self, itemstring)
|
||||
self.itemstring = itemstring
|
||||
local stack = ItemStack(itemstring)
|
||||
local count = stack:get_count()
|
||||
local max_count = stack:get_stack_max()
|
||||
if count > max_count then
|
||||
count = max_count
|
||||
self.itemstring = stack:get_name().." "..max_count
|
||||
end
|
||||
local s = 0.2 + 0.1 * (count / max_count)
|
||||
local c = s
|
||||
local itemtable = stack:to_table()
|
||||
local itemname = nil
|
||||
if itemtable then
|
||||
itemname = stack:to_table().name
|
||||
end
|
||||
local item_texture = nil
|
||||
local item_type = ""
|
||||
if core.registered_items[itemname] then
|
||||
item_texture = core.registered_items[itemname].inventory_image
|
||||
item_type = core.registered_items[itemname].type
|
||||
end
|
||||
local prop = {
|
||||
is_visible = true,
|
||||
visual = "wielditem",
|
||||
textures = {itemname},
|
||||
visual_size = {x = s, y = s},
|
||||
collisionbox = {-c, -c, -c, c, c, c},
|
||||
automatic_rotate = math.pi * 0.5,
|
||||
}
|
||||
self.object:set_properties(prop)
|
||||
end,
|
||||
|
||||
get_staticdata = function(self)
|
||||
return core.serialize({
|
||||
itemstring = self.itemstring,
|
||||
always_collect = self.always_collect,
|
||||
age = self.age
|
||||
})
|
||||
end,
|
||||
|
||||
on_activate = function(self, staticdata, dtime_s)
|
||||
if string.sub(staticdata, 1, string.len("return")) == "return" then
|
||||
local data = core.deserialize(staticdata)
|
||||
if data and type(data) == "table" then
|
||||
self.itemstring = data.itemstring
|
||||
self.always_collect = data.always_collect
|
||||
if data.age then
|
||||
self.age = data.age + dtime_s
|
||||
else
|
||||
self.age = dtime_s
|
||||
end
|
||||
end
|
||||
else
|
||||
self.itemstring = staticdata
|
||||
end
|
||||
self.object:set_armor_groups({immortal = 1})
|
||||
self.object:setvelocity({x = 0, y = 2, z = 0})
|
||||
self.object:setacceleration({x = 0, y = -10, z = 0})
|
||||
self:set_item(self.itemstring)
|
||||
end,
|
||||
|
||||
try_merge_with = function(self, own_stack, object, obj)
|
||||
local stack = ItemStack(obj.itemstring)
|
||||
if own_stack:get_name() == stack:get_name() and stack:get_free_space() > 0 then
|
||||
local overflow = false
|
||||
local count = stack:get_count() + own_stack:get_count()
|
||||
local max_count = stack:get_stack_max()
|
||||
if count > max_count then
|
||||
overflow = true
|
||||
count = count - max_count
|
||||
else
|
||||
self.itemstring = ''
|
||||
end
|
||||
local pos = object:getpos()
|
||||
pos.y = pos.y + (count - stack:get_count()) / max_count * 0.15
|
||||
object:moveto(pos, false)
|
||||
local s, c
|
||||
local max_count = stack:get_stack_max()
|
||||
local name = stack:get_name()
|
||||
if not overflow then
|
||||
obj.itemstring = name .. " " .. count
|
||||
s = 0.2 + 0.1 * (count / max_count)
|
||||
c = s
|
||||
object:set_properties({
|
||||
visual_size = {x = s, y = s},
|
||||
collisionbox = {-c, -c, -c, c, c, c}
|
||||
})
|
||||
self.object:remove()
|
||||
-- merging succeeded
|
||||
return true
|
||||
else
|
||||
s = 0.4
|
||||
c = 0.3
|
||||
object:set_properties({
|
||||
visual_size = {x = s, y = s},
|
||||
collisionbox = {-c, -c, -c, c, c, c}
|
||||
})
|
||||
obj.itemstring = name .. " " .. max_count
|
||||
s = 0.2 + 0.1 * (count / max_count)
|
||||
c = s
|
||||
self.object:set_properties({
|
||||
visual_size = {x = s, y = s},
|
||||
collisionbox = {-c, -c, -c, c, c, c}
|
||||
})
|
||||
self.itemstring = name .. " " .. count
|
||||
end
|
||||
end
|
||||
-- merging didn't succeed
|
||||
return false
|
||||
end,
|
||||
|
||||
on_step = function(self, dtime)
|
||||
self.age = self.age + dtime
|
||||
if time_to_live > 0 and self.age > time_to_live then
|
||||
self.itemstring = ''
|
||||
self.object:remove()
|
||||
return
|
||||
end
|
||||
local p = self.object:getpos()
|
||||
p.y = p.y - 0.5
|
||||
local node = core.get_node_or_nil(p)
|
||||
local in_unloaded = (node == nil)
|
||||
if in_unloaded then
|
||||
-- Don't infinetly fall into unloaded map
|
||||
self.object:setvelocity({x = 0, y = 0, z = 0})
|
||||
self.object:setacceleration({x = 0, y = 0, z = 0})
|
||||
self.physical_state = false
|
||||
self.object:set_properties({physical = false})
|
||||
return
|
||||
end
|
||||
local nn = node.name
|
||||
-- If node is not registered or node is walkably solid and resting on nodebox
|
||||
local v = self.object:getvelocity()
|
||||
if not core.registered_nodes[nn] or core.registered_nodes[nn].walkable and v.y == 0 then
|
||||
if self.physical_state then
|
||||
local own_stack = ItemStack(self.object:get_luaentity().itemstring)
|
||||
-- Merge with close entities of the same item
|
||||
for _, object in ipairs(core.get_objects_inside_radius(p, 0.8)) do
|
||||
local obj = object:get_luaentity()
|
||||
if obj and obj.name == "__builtin:item"
|
||||
and obj.physical_state == false then
|
||||
if self:try_merge_with(own_stack, object, obj) then
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
self.object:setvelocity({x = 0, y = 0, z = 0})
|
||||
self.object:setacceleration({x = 0, y = 0, z = 0})
|
||||
self.physical_state = false
|
||||
self.object:set_properties({physical = false})
|
||||
end
|
||||
else
|
||||
if not self.physical_state then
|
||||
self.object:setvelocity({x = 0, y = 0, z = 0})
|
||||
self.object:setacceleration({x = 0, y = -10, z = 0})
|
||||
self.physical_state = true
|
||||
self.object:set_properties({physical = true})
|
||||
end
|
||||
end
|
||||
end,
|
||||
|
||||
on_punch = function(self, hitter)
|
||||
if self.itemstring ~= '' then
|
||||
local left = hitter:get_inventory():add_item("main", self.itemstring)
|
||||
if not left:is_empty() then
|
||||
self.itemstring = left:to_string()
|
||||
return
|
||||
end
|
||||
end
|
||||
self.itemstring = ''
|
||||
self.object:remove()
|
||||
end,
|
||||
})
|
||||
168
builtin/game/misc.lua
Normal file
168
builtin/game/misc.lua
Normal file
@@ -0,0 +1,168 @@
|
||||
-- Minetest: builtin/misc.lua
|
||||
|
||||
--
|
||||
-- Misc. API functions
|
||||
--
|
||||
|
||||
local timers = {}
|
||||
local mintime
|
||||
local function update_timers(delay)
|
||||
mintime = false
|
||||
local sub = 0
|
||||
for index = 1, #timers do
|
||||
index = index - sub
|
||||
local timer = timers[index]
|
||||
timer.time = timer.time - delay
|
||||
if timer.time <= 0 then
|
||||
core.set_last_run_mod(timer.mod_origin)
|
||||
timer.func(unpack(timer.args or {}))
|
||||
table.remove(timers, index)
|
||||
sub = sub + 1
|
||||
elseif mintime then
|
||||
mintime = math.min(mintime, timer.time)
|
||||
else
|
||||
mintime = timer.time
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local timers_to_add
|
||||
local function add_timers()
|
||||
for _, timer in ipairs(timers_to_add) do
|
||||
table.insert(timers, timer)
|
||||
end
|
||||
timers_to_add = false
|
||||
end
|
||||
|
||||
local delay = 0
|
||||
core.register_globalstep(function(dtime)
|
||||
if not mintime then
|
||||
-- abort if no timers are running
|
||||
return
|
||||
end
|
||||
if timers_to_add then
|
||||
add_timers()
|
||||
end
|
||||
delay = delay + dtime
|
||||
if delay < mintime then
|
||||
return
|
||||
end
|
||||
update_timers(delay)
|
||||
delay = 0
|
||||
end)
|
||||
|
||||
function core.after(time, func, ...)
|
||||
assert(tonumber(time) and type(func) == "function",
|
||||
"Invalid core.after invocation")
|
||||
if not mintime then
|
||||
mintime = time
|
||||
timers_to_add = {{
|
||||
time = time+delay,
|
||||
func = func,
|
||||
args = {...},
|
||||
mod_origin = core.get_last_run_mod(),
|
||||
}}
|
||||
return
|
||||
end
|
||||
mintime = math.min(mintime, time)
|
||||
timers_to_add = timers_to_add or {}
|
||||
timers_to_add[#timers_to_add+1] = {
|
||||
time = time+delay,
|
||||
func = func,
|
||||
args = {...},
|
||||
mod_origin = core.get_last_run_mod(),
|
||||
}
|
||||
end
|
||||
|
||||
function core.check_player_privs(name, privs)
|
||||
local player_privs = core.get_player_privs(name)
|
||||
local missing_privileges = {}
|
||||
for priv, val in pairs(privs) do
|
||||
if val
|
||||
and not player_privs[priv] then
|
||||
table.insert(missing_privileges, priv)
|
||||
end
|
||||
end
|
||||
if #missing_privileges > 0 then
|
||||
return false, missing_privileges
|
||||
end
|
||||
return true, ""
|
||||
end
|
||||
|
||||
local player_list = {}
|
||||
|
||||
core.register_on_joinplayer(function(player)
|
||||
player_list[player:get_player_name()] = player
|
||||
end)
|
||||
|
||||
core.register_on_leaveplayer(function(player)
|
||||
player_list[player:get_player_name()] = nil
|
||||
end)
|
||||
|
||||
function core.get_connected_players()
|
||||
local temp_table = {}
|
||||
for index, value in pairs(player_list) do
|
||||
if value:is_player_connected() then
|
||||
table.insert(temp_table, value)
|
||||
end
|
||||
end
|
||||
return temp_table
|
||||
end
|
||||
|
||||
function core.hash_node_position(pos)
|
||||
return (pos.z+32768)*65536*65536 + (pos.y+32768)*65536 + pos.x+32768
|
||||
end
|
||||
|
||||
function core.get_position_from_hash(hash)
|
||||
local pos = {}
|
||||
pos.x = (hash%65536) - 32768
|
||||
hash = math.floor(hash/65536)
|
||||
pos.y = (hash%65536) - 32768
|
||||
hash = math.floor(hash/65536)
|
||||
pos.z = (hash%65536) - 32768
|
||||
return pos
|
||||
end
|
||||
|
||||
function core.get_item_group(name, group)
|
||||
if not core.registered_items[name] or not
|
||||
core.registered_items[name].groups[group] then
|
||||
return 0
|
||||
end
|
||||
return core.registered_items[name].groups[group]
|
||||
end
|
||||
|
||||
function core.get_node_group(name, group)
|
||||
core.log("deprecated", "Deprecated usage of get_node_group, use get_item_group instead")
|
||||
return core.get_item_group(name, group)
|
||||
end
|
||||
|
||||
function core.setting_get_pos(name)
|
||||
local value = core.setting_get(name)
|
||||
if not value then
|
||||
return nil
|
||||
end
|
||||
return core.string_to_pos(value)
|
||||
end
|
||||
|
||||
-- To be overriden by protection mods
|
||||
function core.is_protected(pos, name)
|
||||
return false
|
||||
end
|
||||
|
||||
function core.record_protection_violation(pos, name)
|
||||
for _, func in pairs(core.registered_on_protection_violation) do
|
||||
func(pos, name)
|
||||
end
|
||||
end
|
||||
|
||||
local raillike_ids = {}
|
||||
local raillike_cur_id = 0
|
||||
function core.raillike_group(name)
|
||||
local id = raillike_ids[name]
|
||||
if not id then
|
||||
raillike_cur_id = raillike_cur_id + 1
|
||||
raillike_ids[name] = raillike_cur_id
|
||||
id = raillike_cur_id
|
||||
end
|
||||
return id
|
||||
end
|
||||
356
builtin/game/mod_profiling.lua
Normal file
356
builtin/game/mod_profiling.lua
Normal file
@@ -0,0 +1,356 @@
|
||||
-- Minetest: builtin/game/mod_profiling.lua
|
||||
|
||||
local mod_statistics = {}
|
||||
mod_statistics.step_total = 0
|
||||
mod_statistics.data = {}
|
||||
mod_statistics.stats = {}
|
||||
mod_statistics.stats["total"] = {
|
||||
min_us = math.huge,
|
||||
max_us = 0,
|
||||
avg_us = 0,
|
||||
min_per = 100,
|
||||
max_per = 100,
|
||||
avg_per = 100
|
||||
}
|
||||
|
||||
local replacement_table = {
|
||||
"register_globalstep",
|
||||
"register_on_placenode",
|
||||
"register_on_dignode",
|
||||
"register_on_punchnode",
|
||||
"register_on_generated",
|
||||
"register_on_newplayer",
|
||||
"register_on_dieplayer",
|
||||
"register_on_respawnplayer",
|
||||
"register_on_prejoinplayer",
|
||||
"register_on_joinplayer",
|
||||
"register_on_leaveplayer",
|
||||
"register_on_cheat",
|
||||
"register_on_chat_message",
|
||||
"register_on_player_receive_fields",
|
||||
"register_on_mapgen_init",
|
||||
"register_on_craft",
|
||||
"register_craft_predict",
|
||||
"register_on_item_eat"
|
||||
}
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function mod_statistics.log_time(type, modname, time_in_us)
|
||||
|
||||
if modname == nil then
|
||||
modname = "builtin"
|
||||
end
|
||||
|
||||
if mod_statistics.data[modname] == nil then
|
||||
mod_statistics.data[modname] = {}
|
||||
end
|
||||
|
||||
if mod_statistics.data[modname][type] == nil then
|
||||
mod_statistics.data[modname][type] = 0
|
||||
end
|
||||
|
||||
mod_statistics.data[modname][type] =
|
||||
mod_statistics.data[modname][type] + time_in_us
|
||||
mod_statistics.step_total = mod_statistics.step_total + time_in_us
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function mod_statistics.update_statistics(dtime)
|
||||
for modname,types in pairs(mod_statistics.data) do
|
||||
|
||||
if mod_statistics.stats[modname] == nil then
|
||||
mod_statistics.stats[modname] = {
|
||||
min_us = math.huge,
|
||||
max_us = 0,
|
||||
avg_us = 0,
|
||||
min_per = 100,
|
||||
max_per = 0,
|
||||
avg_per = 0
|
||||
}
|
||||
end
|
||||
|
||||
local modtime = 0
|
||||
for type,time in pairs(types) do
|
||||
modtime = modtime + time
|
||||
if mod_statistics.stats[modname].types == nil then
|
||||
mod_statistics.stats[modname].types = {}
|
||||
end
|
||||
if mod_statistics.stats[modname].types[type] == nil then
|
||||
mod_statistics.stats[modname].types[type] = {
|
||||
min_us = math.huge,
|
||||
max_us = 0,
|
||||
avg_us = 0,
|
||||
min_per = 100,
|
||||
max_per = 0,
|
||||
avg_per = 0
|
||||
}
|
||||
end
|
||||
|
||||
local toupdate = mod_statistics.stats[modname].types[type]
|
||||
|
||||
--update us values
|
||||
toupdate.min_us = math.min(time, toupdate.min_us)
|
||||
toupdate.max_us = math.max(time, toupdate.max_us)
|
||||
--TODO find better algorithm
|
||||
toupdate.avg_us = toupdate.avg_us * 0.99 + modtime * 0.01
|
||||
|
||||
--update percentage values
|
||||
local cur_per = (time/mod_statistics.step_total) * 100
|
||||
toupdate.min_per = math.min(toupdate.min_per, cur_per)
|
||||
|
||||
toupdate.max_per = math.max(toupdate.max_per, cur_per)
|
||||
|
||||
--TODO find better algorithm
|
||||
toupdate.avg_per = toupdate.avg_per * 0.99 + cur_per * 0.01
|
||||
|
||||
mod_statistics.data[modname][type] = 0
|
||||
end
|
||||
|
||||
--per mod statistics
|
||||
--update us values
|
||||
mod_statistics.stats[modname].min_us =
|
||||
math.min(modtime, mod_statistics.stats[modname].min_us)
|
||||
mod_statistics.stats[modname].max_us =
|
||||
math.max(modtime, mod_statistics.stats[modname].max_us)
|
||||
--TODO find better algorithm
|
||||
mod_statistics.stats[modname].avg_us =
|
||||
mod_statistics.stats[modname].avg_us * 0.99 + modtime * 0.01
|
||||
|
||||
--update percentage values
|
||||
local cur_per = (modtime/mod_statistics.step_total) * 100
|
||||
mod_statistics.stats[modname].min_per =
|
||||
math.min(mod_statistics.stats[modname].min_per, cur_per)
|
||||
|
||||
mod_statistics.stats[modname].max_per =
|
||||
math.max(mod_statistics.stats[modname].max_per, cur_per)
|
||||
|
||||
--TODO find better algorithm
|
||||
mod_statistics.stats[modname].avg_per =
|
||||
mod_statistics.stats[modname].avg_per * 0.99 + cur_per * 0.01
|
||||
end
|
||||
|
||||
--update "total"
|
||||
mod_statistics.stats["total"].min_us =
|
||||
math.min(mod_statistics.step_total, mod_statistics.stats["total"].min_us)
|
||||
mod_statistics.stats["total"].max_us =
|
||||
math.max(mod_statistics.step_total, mod_statistics.stats["total"].max_us)
|
||||
--TODO find better algorithm
|
||||
mod_statistics.stats["total"].avg_us =
|
||||
mod_statistics.stats["total"].avg_us * 0.99 +
|
||||
mod_statistics.step_total * 0.01
|
||||
|
||||
mod_statistics.step_total = 0
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
local function build_callback(log_id, fct)
|
||||
return function( toregister )
|
||||
local modname = core.get_current_modname()
|
||||
|
||||
fct(function(...)
|
||||
local starttime = core.get_us_time()
|
||||
-- note maximum 10 return values are supported unless someone finds
|
||||
-- a way to store a variable lenght return value list
|
||||
local r0, r1, r2, r3, r4, r5, r6, r7, r8, r9 = toregister(...)
|
||||
local delta = core.get_us_time() - starttime
|
||||
mod_statistics.log_time(log_id, modname, delta)
|
||||
return r0, r1, r2, r3, r4, r5, r6, r7, r8, r9
|
||||
end
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function profiling_print_log(cmd, filter)
|
||||
|
||||
print("Filter:" .. dump(filter))
|
||||
|
||||
core.log("action", "Values below show times/percentages per server step.")
|
||||
core.log("action", "Following suffixes are used for entities:")
|
||||
core.log("action", "\t#oa := on_activate, #os := on_step, #op := on_punch, #or := on_rightclick, #gs := get_staticdata")
|
||||
core.log("action",
|
||||
string.format("%16s | %25s | %10s | %10s | %10s | %9s | %9s | %9s",
|
||||
"modname", "type" , "min µs", "max µs", "avg µs", "min %", "max %", "avg %")
|
||||
)
|
||||
core.log("action",
|
||||
"-----------------+---------------------------+-----------+" ..
|
||||
"-----------+-----------+-----------+-----------+-----------")
|
||||
for modname,statistics in pairs(mod_statistics.stats) do
|
||||
if modname ~= "total" then
|
||||
|
||||
if (filter == "") or (modname == filter) then
|
||||
if modname:len() > 16 then
|
||||
modname = "..." .. modname:sub(-13)
|
||||
end
|
||||
|
||||
core.log("action",
|
||||
string.format("%16s | %25s | %9d | %9d | %9d | %9d | %9d | %9d",
|
||||
modname,
|
||||
" ",
|
||||
statistics.min_us,
|
||||
statistics.max_us,
|
||||
statistics.avg_us,
|
||||
statistics.min_per,
|
||||
statistics.max_per,
|
||||
statistics.avg_per)
|
||||
)
|
||||
if core.setting_getbool("detailed_profiling") then
|
||||
if statistics.types ~= nil then
|
||||
for type,typestats in pairs(statistics.types) do
|
||||
|
||||
if type:len() > 25 then
|
||||
type = "..." .. type:sub(-22)
|
||||
end
|
||||
|
||||
core.log("action",
|
||||
string.format(
|
||||
"%16s | %25s | %9d | %9d | %9d | %9d | %9d | %9d",
|
||||
" ",
|
||||
type,
|
||||
typestats.min_us,
|
||||
typestats.max_us,
|
||||
typestats.avg_us,
|
||||
typestats.min_per,
|
||||
typestats.max_per,
|
||||
typestats.avg_per)
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
core.log("action",
|
||||
"-----------------+---------------------------+-----------+" ..
|
||||
"-----------+-----------+-----------+-----------+-----------")
|
||||
|
||||
if filter == "" then
|
||||
core.log("action",
|
||||
string.format("%16s | %25s | %9d | %9d | %9d | %9d | %9d | %9d",
|
||||
"total",
|
||||
" ",
|
||||
mod_statistics.stats["total"].min_us,
|
||||
mod_statistics.stats["total"].max_us,
|
||||
mod_statistics.stats["total"].avg_us,
|
||||
mod_statistics.stats["total"].min_per,
|
||||
mod_statistics.stats["total"].max_per,
|
||||
mod_statistics.stats["total"].avg_per)
|
||||
)
|
||||
end
|
||||
core.log("action", " ")
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
local function initialize_profiling()
|
||||
core.log("action", "Initialize tracing")
|
||||
|
||||
mod_statistics.entity_callbacks = {}
|
||||
|
||||
-- first register our own globalstep handler
|
||||
core.register_globalstep(mod_statistics.update_statistics)
|
||||
|
||||
local rp_register_entity = core.register_entity
|
||||
core.register_entity = function(name, prototype)
|
||||
local modname = core.get_current_modname()
|
||||
local new_on_activate = nil
|
||||
local new_on_step = nil
|
||||
local new_on_punch = nil
|
||||
local new_rightclick = nil
|
||||
local new_get_staticdata = nil
|
||||
|
||||
if prototype.on_activate ~= nil then
|
||||
local cbid = name .. "#oa"
|
||||
mod_statistics.entity_callbacks[cbid] = prototype.on_activate
|
||||
new_on_activate = function(self, staticdata, dtime_s)
|
||||
local starttime = core.get_us_time()
|
||||
mod_statistics.entity_callbacks[cbid](self, staticdata, dtime_s)
|
||||
local delta = core.get_us_time() -starttime
|
||||
mod_statistics.log_time(cbid, modname, delta)
|
||||
end
|
||||
end
|
||||
|
||||
if prototype.on_step ~= nil then
|
||||
local cbid = name .. "#os"
|
||||
mod_statistics.entity_callbacks[cbid] = prototype.on_step
|
||||
new_on_step = function(self, dtime)
|
||||
local starttime = core.get_us_time()
|
||||
mod_statistics.entity_callbacks[cbid](self, dtime)
|
||||
local delta = core.get_us_time() -starttime
|
||||
mod_statistics.log_time(cbid, modname, delta)
|
||||
end
|
||||
end
|
||||
|
||||
if prototype.on_punch ~= nil then
|
||||
local cbid = name .. "#op"
|
||||
mod_statistics.entity_callbacks[cbid] = prototype.on_punch
|
||||
new_on_punch = function(self, hitter)
|
||||
local starttime = core.get_us_time()
|
||||
mod_statistics.entity_callbacks[cbid](self, hitter)
|
||||
local delta = core.get_us_time() -starttime
|
||||
mod_statistics.log_time(cbid, modname, delta)
|
||||
end
|
||||
end
|
||||
|
||||
if prototype.rightclick ~= nil then
|
||||
local cbid = name .. "#rc"
|
||||
mod_statistics.entity_callbacks[cbid] = prototype.rightclick
|
||||
new_rightclick = function(self, clicker)
|
||||
local starttime = core.get_us_time()
|
||||
mod_statistics.entity_callbacks[cbid](self, clicker)
|
||||
local delta = core.get_us_time() -starttime
|
||||
mod_statistics.log_time(cbid, modname, delta)
|
||||
end
|
||||
end
|
||||
|
||||
if prototype.get_staticdata ~= nil then
|
||||
local cbid = name .. "#gs"
|
||||
mod_statistics.entity_callbacks[cbid] = prototype.get_staticdata
|
||||
new_get_staticdata = function(self)
|
||||
local starttime = core.get_us_time()
|
||||
local retval = mod_statistics.entity_callbacks[cbid](self)
|
||||
local delta = core.get_us_time() -starttime
|
||||
mod_statistics.log_time(cbid, modname, delta)
|
||||
return retval
|
||||
end
|
||||
end
|
||||
|
||||
prototype.on_activate = new_on_activate
|
||||
prototype.on_step = new_on_step
|
||||
prototype.on_punch = new_on_punch
|
||||
prototype.rightclick = new_rightclick
|
||||
prototype.get_staticdata = new_get_staticdata
|
||||
|
||||
rp_register_entity(name,prototype)
|
||||
end
|
||||
|
||||
for i,v in ipairs(replacement_table) do
|
||||
local to_replace = core[v]
|
||||
core[v] = build_callback(v, to_replace)
|
||||
end
|
||||
|
||||
local rp_register_abm = core.register_abm
|
||||
core.register_abm = function(spec)
|
||||
|
||||
local modname = core.get_current_modname()
|
||||
|
||||
local replacement_spec = {
|
||||
nodenames = spec.nodenames,
|
||||
neighbors = spec.neighbors,
|
||||
interval = spec.interval,
|
||||
chance = spec.chance,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
local starttime = core.get_us_time()
|
||||
spec.action(pos, node, active_object_count, active_object_count_wider)
|
||||
local delta = core.get_us_time() - starttime
|
||||
mod_statistics.log_time("abm", modname, delta)
|
||||
end
|
||||
}
|
||||
rp_register_abm(replacement_spec)
|
||||
end
|
||||
|
||||
core.log("action", "Mod profiling initialized")
|
||||
end
|
||||
|
||||
initialize_profiling()
|
||||
53
builtin/game/privileges.lua
Normal file
53
builtin/game/privileges.lua
Normal file
@@ -0,0 +1,53 @@
|
||||
-- Minetest: builtin/privileges.lua
|
||||
|
||||
--
|
||||
-- Privileges
|
||||
--
|
||||
|
||||
core.registered_privileges = {}
|
||||
|
||||
function core.register_privilege(name, param)
|
||||
local function fill_defaults(def)
|
||||
if def.give_to_singleplayer == nil then
|
||||
def.give_to_singleplayer = true
|
||||
end
|
||||
if def.description == nil then
|
||||
def.description = "(no description)"
|
||||
end
|
||||
end
|
||||
local def = {}
|
||||
if type(param) == "table" then
|
||||
def = param
|
||||
else
|
||||
def = {description = param}
|
||||
end
|
||||
fill_defaults(def)
|
||||
core.registered_privileges[name] = def
|
||||
end
|
||||
|
||||
core.register_privilege("interact", "Can interact with things and modify the world")
|
||||
core.register_privilege("teleport", "Can use /teleport command")
|
||||
core.register_privilege("bring", "Can teleport other players")
|
||||
core.register_privilege("settime", "Can use /time")
|
||||
core.register_privilege("privs", "Can modify privileges")
|
||||
core.register_privilege("basic_privs", "Can modify 'shout' and 'interact' privileges")
|
||||
core.register_privilege("server", "Can do server maintenance stuff")
|
||||
core.register_privilege("shout", "Can speak in chat")
|
||||
core.register_privilege("ban", "Can ban and unban players")
|
||||
core.register_privilege("kick", "Can kick players")
|
||||
core.register_privilege("give", "Can use /give and /giveme")
|
||||
core.register_privilege("password", "Can use /setpassword and /clearpassword")
|
||||
core.register_privilege("fly", {
|
||||
description = "Can fly using the free_move mode",
|
||||
give_to_singleplayer = false,
|
||||
})
|
||||
core.register_privilege("fast", {
|
||||
description = "Can walk fast using the fast_move mode",
|
||||
give_to_singleplayer = false,
|
||||
})
|
||||
core.register_privilege("noclip", {
|
||||
description = "Can fly through walls",
|
||||
give_to_singleplayer = false,
|
||||
})
|
||||
core.register_privilege("rollback", "Can use the rollback functionality")
|
||||
|
||||
505
builtin/game/register.lua
Normal file
505
builtin/game/register.lua
Normal file
@@ -0,0 +1,505 @@
|
||||
-- Minetest: builtin/misc_register.lua
|
||||
|
||||
--
|
||||
-- Make raw registration functions inaccessible to anyone except this file
|
||||
--
|
||||
|
||||
local register_item_raw = core.register_item_raw
|
||||
core.register_item_raw = nil
|
||||
|
||||
local register_alias_raw = core.register_alias_raw
|
||||
core.register_alias_raw = nil
|
||||
|
||||
--
|
||||
-- Item / entity / ABM registration functions
|
||||
--
|
||||
|
||||
core.registered_abms = {}
|
||||
core.registered_entities = {}
|
||||
core.registered_items = {}
|
||||
core.registered_nodes = {}
|
||||
core.registered_craftitems = {}
|
||||
core.registered_tools = {}
|
||||
core.registered_aliases = {}
|
||||
|
||||
-- For tables that are indexed by item name:
|
||||
-- If table[X] does not exist, default to table[core.registered_aliases[X]]
|
||||
local alias_metatable = {
|
||||
__index = function(t, name)
|
||||
return rawget(t, core.registered_aliases[name])
|
||||
end
|
||||
}
|
||||
setmetatable(core.registered_items, alias_metatable)
|
||||
setmetatable(core.registered_nodes, alias_metatable)
|
||||
setmetatable(core.registered_craftitems, alias_metatable)
|
||||
setmetatable(core.registered_tools, alias_metatable)
|
||||
|
||||
-- These item names may not be used because they would interfere
|
||||
-- with legacy itemstrings
|
||||
local forbidden_item_names = {
|
||||
MaterialItem = true,
|
||||
MaterialItem2 = true,
|
||||
MaterialItem3 = true,
|
||||
NodeItem = true,
|
||||
node = true,
|
||||
CraftItem = true,
|
||||
craft = true,
|
||||
MBOItem = true,
|
||||
ToolItem = true,
|
||||
tool = true,
|
||||
}
|
||||
|
||||
local function check_modname_prefix(name)
|
||||
if name:sub(1,1) == ":" then
|
||||
-- Escape the modname prefix enforcement mechanism
|
||||
return name:sub(2)
|
||||
else
|
||||
-- Modname prefix enforcement
|
||||
local expected_prefix = core.get_current_modname() .. ":"
|
||||
if name:sub(1, #expected_prefix) ~= expected_prefix then
|
||||
error("Name " .. name .. " does not follow naming conventions: " ..
|
||||
"\"modname:\" or \":\" prefix required")
|
||||
end
|
||||
local subname = name:sub(#expected_prefix+1)
|
||||
if subname:find("[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_]") then
|
||||
error("Name " .. name .. " does not follow naming conventions: " ..
|
||||
"contains unallowed characters")
|
||||
end
|
||||
return name
|
||||
end
|
||||
end
|
||||
|
||||
function core.register_abm(spec)
|
||||
-- Add to core.registered_abms
|
||||
core.registered_abms[#core.registered_abms+1] = spec
|
||||
spec.mod_origin = core.get_current_modname() or "??"
|
||||
end
|
||||
|
||||
function core.register_entity(name, prototype)
|
||||
-- Check name
|
||||
if name == nil then
|
||||
error("Unable to register entity: Name is nil")
|
||||
end
|
||||
name = check_modname_prefix(tostring(name))
|
||||
|
||||
prototype.name = name
|
||||
prototype.__index = prototype -- so that it can be used as a metatable
|
||||
|
||||
-- Add to core.registered_entities
|
||||
core.registered_entities[name] = prototype
|
||||
prototype.mod_origin = core.get_current_modname() or "??"
|
||||
end
|
||||
|
||||
function core.register_item(name, itemdef)
|
||||
-- Check name
|
||||
if name == nil then
|
||||
error("Unable to register item: Name is nil")
|
||||
end
|
||||
name = check_modname_prefix(tostring(name))
|
||||
if forbidden_item_names[name] then
|
||||
error("Unable to register item: Name is forbidden: " .. name)
|
||||
end
|
||||
itemdef.name = name
|
||||
|
||||
-- Apply defaults and add to registered_* table
|
||||
if itemdef.type == "node" then
|
||||
-- Use the nodebox as selection box if it's not set manually
|
||||
if itemdef.drawtype == "nodebox" and not itemdef.selection_box then
|
||||
itemdef.selection_box = itemdef.node_box
|
||||
elseif itemdef.drawtype == "fencelike" and not itemdef.selection_box then
|
||||
itemdef.selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-1/8, -1/2, -1/8, 1/8, 1/2, 1/8},
|
||||
}
|
||||
end
|
||||
setmetatable(itemdef, {__index = core.nodedef_default})
|
||||
core.registered_nodes[itemdef.name] = itemdef
|
||||
elseif itemdef.type == "craft" then
|
||||
setmetatable(itemdef, {__index = core.craftitemdef_default})
|
||||
core.registered_craftitems[itemdef.name] = itemdef
|
||||
elseif itemdef.type == "tool" then
|
||||
setmetatable(itemdef, {__index = core.tooldef_default})
|
||||
core.registered_tools[itemdef.name] = itemdef
|
||||
elseif itemdef.type == "none" then
|
||||
setmetatable(itemdef, {__index = core.noneitemdef_default})
|
||||
else
|
||||
error("Unable to register item: Type is invalid: " .. dump(itemdef))
|
||||
end
|
||||
|
||||
-- Flowing liquid uses param2
|
||||
if itemdef.type == "node" and itemdef.liquidtype == "flowing" then
|
||||
itemdef.paramtype2 = "flowingliquid"
|
||||
end
|
||||
|
||||
-- BEGIN Legacy stuff
|
||||
if itemdef.cookresult_itemstring ~= nil and itemdef.cookresult_itemstring ~= "" then
|
||||
core.register_craft({
|
||||
type="cooking",
|
||||
output=itemdef.cookresult_itemstring,
|
||||
recipe=itemdef.name,
|
||||
cooktime=itemdef.furnace_cooktime
|
||||
})
|
||||
end
|
||||
if itemdef.furnace_burntime ~= nil and itemdef.furnace_burntime >= 0 then
|
||||
core.register_craft({
|
||||
type="fuel",
|
||||
recipe=itemdef.name,
|
||||
burntime=itemdef.furnace_burntime
|
||||
})
|
||||
end
|
||||
-- END Legacy stuff
|
||||
|
||||
itemdef.mod_origin = core.get_current_modname() or "??"
|
||||
|
||||
-- Disable all further modifications
|
||||
getmetatable(itemdef).__newindex = {}
|
||||
|
||||
--core.log("Registering item: " .. itemdef.name)
|
||||
core.registered_items[itemdef.name] = itemdef
|
||||
core.registered_aliases[itemdef.name] = nil
|
||||
register_item_raw(itemdef)
|
||||
end
|
||||
|
||||
function core.register_node(name, nodedef)
|
||||
nodedef.type = "node"
|
||||
core.register_item(name, nodedef)
|
||||
end
|
||||
|
||||
function core.register_craftitem(name, craftitemdef)
|
||||
craftitemdef.type = "craft"
|
||||
|
||||
-- BEGIN Legacy stuff
|
||||
if craftitemdef.inventory_image == nil and craftitemdef.image ~= nil then
|
||||
craftitemdef.inventory_image = craftitemdef.image
|
||||
end
|
||||
-- END Legacy stuff
|
||||
|
||||
core.register_item(name, craftitemdef)
|
||||
end
|
||||
|
||||
function core.register_tool(name, tooldef)
|
||||
tooldef.type = "tool"
|
||||
tooldef.stack_max = 1
|
||||
|
||||
-- BEGIN Legacy stuff
|
||||
if tooldef.inventory_image == nil and tooldef.image ~= nil then
|
||||
tooldef.inventory_image = tooldef.image
|
||||
end
|
||||
if tooldef.tool_capabilities == nil and
|
||||
(tooldef.full_punch_interval ~= nil or
|
||||
tooldef.basetime ~= nil or
|
||||
tooldef.dt_weight ~= nil or
|
||||
tooldef.dt_crackiness ~= nil or
|
||||
tooldef.dt_crumbliness ~= nil or
|
||||
tooldef.dt_cuttability ~= nil or
|
||||
tooldef.basedurability ~= nil or
|
||||
tooldef.dd_weight ~= nil or
|
||||
tooldef.dd_crackiness ~= nil or
|
||||
tooldef.dd_crumbliness ~= nil or
|
||||
tooldef.dd_cuttability ~= nil) then
|
||||
tooldef.tool_capabilities = {
|
||||
full_punch_interval = tooldef.full_punch_interval,
|
||||
basetime = tooldef.basetime,
|
||||
dt_weight = tooldef.dt_weight,
|
||||
dt_crackiness = tooldef.dt_crackiness,
|
||||
dt_crumbliness = tooldef.dt_crumbliness,
|
||||
dt_cuttability = tooldef.dt_cuttability,
|
||||
basedurability = tooldef.basedurability,
|
||||
dd_weight = tooldef.dd_weight,
|
||||
dd_crackiness = tooldef.dd_crackiness,
|
||||
dd_crumbliness = tooldef.dd_crumbliness,
|
||||
dd_cuttability = tooldef.dd_cuttability,
|
||||
}
|
||||
end
|
||||
-- END Legacy stuff
|
||||
|
||||
core.register_item(name, tooldef)
|
||||
end
|
||||
|
||||
function core.register_alias(name, convert_to)
|
||||
if forbidden_item_names[name] then
|
||||
error("Unable to register alias: Name is forbidden: " .. name)
|
||||
end
|
||||
if core.registered_items[name] ~= nil then
|
||||
core.log("WARNING: Not registering alias, item with same name" ..
|
||||
" is already defined: " .. name .. " -> " .. convert_to)
|
||||
else
|
||||
--core.log("Registering alias: " .. name .. " -> " .. convert_to)
|
||||
core.registered_aliases[name] = convert_to
|
||||
register_alias_raw(name, convert_to)
|
||||
end
|
||||
end
|
||||
|
||||
function core.on_craft(itemstack, player, old_craft_list, craft_inv)
|
||||
for _, func in ipairs(core.registered_on_crafts) do
|
||||
itemstack = func(itemstack, player, old_craft_list, craft_inv) or itemstack
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
|
||||
function core.craft_predict(itemstack, player, old_craft_list, craft_inv)
|
||||
for _, func in ipairs(core.registered_craft_predicts) do
|
||||
itemstack = func(itemstack, player, old_craft_list, craft_inv) or itemstack
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
|
||||
-- Alias the forbidden item names to "" so they can't be
|
||||
-- created via itemstrings (e.g. /give)
|
||||
local name
|
||||
for name in pairs(forbidden_item_names) do
|
||||
core.registered_aliases[name] = ""
|
||||
register_alias_raw(name, "")
|
||||
end
|
||||
|
||||
|
||||
-- Deprecated:
|
||||
-- Aliases for core.register_alias (how ironic...)
|
||||
--core.alias_node = core.register_alias
|
||||
--core.alias_tool = core.register_alias
|
||||
--core.alias_craftitem = core.register_alias
|
||||
|
||||
--
|
||||
-- Built-in node definitions. Also defined in C.
|
||||
--
|
||||
|
||||
core.register_item(":unknown", {
|
||||
type = "none",
|
||||
description = "Unknown Item",
|
||||
inventory_image = "unknown_item.png",
|
||||
on_place = core.item_place,
|
||||
on_drop = core.item_drop,
|
||||
groups = {not_in_creative_inventory=1},
|
||||
diggable = true,
|
||||
})
|
||||
|
||||
core.register_node(":air", {
|
||||
description = "Air (you hacker you!)",
|
||||
inventory_image = "unknown_node.png",
|
||||
wield_image = "unknown_node.png",
|
||||
drawtype = "airlike",
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
pointable = false,
|
||||
diggable = false,
|
||||
buildable_to = true,
|
||||
air_equivalent = true,
|
||||
drop = "",
|
||||
groups = {not_in_creative_inventory=1},
|
||||
})
|
||||
|
||||
core.register_node(":ignore", {
|
||||
description = "Ignore (you hacker you!)",
|
||||
inventory_image = "unknown_node.png",
|
||||
wield_image = "unknown_node.png",
|
||||
drawtype = "airlike",
|
||||
paramtype = "none",
|
||||
sunlight_propagates = false,
|
||||
walkable = false,
|
||||
pointable = false,
|
||||
diggable = false,
|
||||
buildable_to = true, -- A way to remove accidentally placed ignores
|
||||
air_equivalent = true,
|
||||
drop = "",
|
||||
groups = {not_in_creative_inventory=1},
|
||||
})
|
||||
|
||||
-- The hand (bare definition)
|
||||
core.register_item(":", {
|
||||
type = "none",
|
||||
groups = {not_in_creative_inventory=1},
|
||||
})
|
||||
|
||||
|
||||
function core.override_item(name, redefinition)
|
||||
if redefinition.name ~= nil then
|
||||
error("Attempt to redefine name of "..name.." to "..dump(redefinition.name), 2)
|
||||
end
|
||||
if redefinition.type ~= nil then
|
||||
error("Attempt to redefine type of "..name.." to "..dump(redefinition.type), 2)
|
||||
end
|
||||
local item = core.registered_items[name]
|
||||
if not item then
|
||||
error("Attempt to override non-existent item "..name, 2)
|
||||
end
|
||||
for k, v in pairs(redefinition) do
|
||||
rawset(item, k, v)
|
||||
end
|
||||
register_item_raw(item)
|
||||
end
|
||||
|
||||
|
||||
core.callback_origins = {}
|
||||
|
||||
function core.run_callbacks(callbacks, mode, ...)
|
||||
assert(type(callbacks) == "table")
|
||||
local cb_len = #callbacks
|
||||
if cb_len == 0 then
|
||||
if mode == 2 or mode == 3 then
|
||||
return true
|
||||
elseif mode == 4 or mode == 5 then
|
||||
return false
|
||||
end
|
||||
end
|
||||
local ret = nil
|
||||
for i = 1, cb_len do
|
||||
local origin = core.callback_origins[callbacks[i]]
|
||||
if origin then
|
||||
core.set_last_run_mod(origin.mod)
|
||||
--print("Running " .. tostring(callbacks[i]) ..
|
||||
-- " (a " .. origin.name .. " callback in " .. origin.mod .. ")")
|
||||
else
|
||||
--print("No data associated with callback")
|
||||
end
|
||||
local cb_ret = callbacks[i](...)
|
||||
|
||||
if mode == 0 and i == 1 then
|
||||
ret = cb_ret
|
||||
elseif mode == 1 and i == cb_len then
|
||||
ret = cb_ret
|
||||
elseif mode == 2 then
|
||||
if not cb_ret or i == 1 then
|
||||
ret = cb_ret
|
||||
end
|
||||
elseif mode == 3 then
|
||||
if cb_ret then
|
||||
return cb_ret
|
||||
end
|
||||
ret = cb_ret
|
||||
elseif mode == 4 then
|
||||
if (cb_ret and not ret) or i == 1 then
|
||||
ret = cb_ret
|
||||
end
|
||||
elseif mode == 5 and cb_ret then
|
||||
return cb_ret
|
||||
end
|
||||
end
|
||||
return ret
|
||||
end
|
||||
|
||||
--
|
||||
-- Callback registration
|
||||
--
|
||||
|
||||
local function make_registration()
|
||||
local t = {}
|
||||
local registerfunc = function(func)
|
||||
table.insert(t, func)
|
||||
core.callback_origins[func] = {
|
||||
mod = core.get_current_modname() or "??",
|
||||
name = debug.getinfo(1, "n").name or "??"
|
||||
}
|
||||
--local origin = core.callback_origins[func]
|
||||
--print(origin.name .. ": " .. origin.mod .. " registering cbk " .. tostring(func))
|
||||
end
|
||||
return t, registerfunc
|
||||
end
|
||||
|
||||
local function make_registration_reverse()
|
||||
local t = {}
|
||||
local registerfunc = function(func)
|
||||
table.insert(t, 1, func)
|
||||
core.callback_origins[func] = {
|
||||
mod = core.get_current_modname() or "??",
|
||||
name = debug.getinfo(1, "n").name or "??"
|
||||
}
|
||||
--local origin = core.callback_origins[func]
|
||||
--print(origin.name .. ": " .. origin.mod .. " registering cbk " .. tostring(func))
|
||||
end
|
||||
return t, registerfunc
|
||||
end
|
||||
|
||||
local function make_registration_wrap(reg_fn_name, clear_fn_name)
|
||||
local list = {}
|
||||
|
||||
local orig_reg_fn = core[reg_fn_name]
|
||||
core[reg_fn_name] = function(def)
|
||||
local retval = orig_reg_fn(def)
|
||||
if retval ~= nil then
|
||||
if def.name ~= nil then
|
||||
list[def.name] = def
|
||||
else
|
||||
list[retval] = def
|
||||
end
|
||||
end
|
||||
return retval
|
||||
end
|
||||
|
||||
local orig_clear_fn = core[clear_fn_name]
|
||||
core[clear_fn_name] = function()
|
||||
for k in pairs(list) do
|
||||
list[k] = nil
|
||||
end
|
||||
return orig_clear_fn()
|
||||
end
|
||||
|
||||
return list
|
||||
end
|
||||
|
||||
core.registered_on_player_hpchanges = { modifiers = { }, loggers = { } }
|
||||
|
||||
function core.registered_on_player_hpchange(player, hp_change)
|
||||
local last = false
|
||||
for i = #core.registered_on_player_hpchanges.modifiers, 1, -1 do
|
||||
local func = core.registered_on_player_hpchanges.modifiers[i]
|
||||
hp_change, last = func(player, hp_change)
|
||||
if type(hp_change) ~= "number" then
|
||||
local debuginfo = debug.getinfo(func)
|
||||
error("The register_on_hp_changes function has to return a number at " ..
|
||||
debuginfo.short_src .. " line " .. debuginfo.linedefined)
|
||||
end
|
||||
if last then
|
||||
break
|
||||
end
|
||||
end
|
||||
for i, func in ipairs(core.registered_on_player_hpchanges.loggers) do
|
||||
func(player, hp_change)
|
||||
end
|
||||
return hp_change
|
||||
end
|
||||
|
||||
function core.register_on_player_hpchange(func, modifier)
|
||||
if modifier then
|
||||
table.insert(core.registered_on_player_hpchanges.modifiers, func)
|
||||
else
|
||||
table.insert(core.registered_on_player_hpchanges.loggers, func)
|
||||
end
|
||||
core.callback_origins[func] = {
|
||||
mod = core.get_current_modname() or "??",
|
||||
name = debug.getinfo(1, "n").name or "??"
|
||||
}
|
||||
end
|
||||
|
||||
core.registered_biomes = make_registration_wrap("register_biome", "clear_registered_biomes")
|
||||
core.registered_ores = make_registration_wrap("register_ore", "clear_registered_ores")
|
||||
core.registered_decorations = make_registration_wrap("register_decoration", "clear_registered_decorations")
|
||||
|
||||
core.registered_on_chat_messages, core.register_on_chat_message = make_registration()
|
||||
core.registered_globalsteps, core.register_globalstep = make_registration()
|
||||
core.registered_playerevents, core.register_playerevent = make_registration()
|
||||
core.registered_on_shutdown, core.register_on_shutdown = make_registration()
|
||||
core.registered_on_punchnodes, core.register_on_punchnode = make_registration()
|
||||
core.registered_on_placenodes, core.register_on_placenode = make_registration()
|
||||
core.registered_on_dignodes, core.register_on_dignode = make_registration()
|
||||
core.registered_on_generateds, core.register_on_generated = make_registration()
|
||||
core.registered_on_newplayers, core.register_on_newplayer = make_registration()
|
||||
core.registered_on_dieplayers, core.register_on_dieplayer = make_registration()
|
||||
core.registered_on_respawnplayers, core.register_on_respawnplayer = make_registration()
|
||||
core.registered_on_prejoinplayers, core.register_on_prejoinplayer = make_registration()
|
||||
core.registered_on_joinplayers, core.register_on_joinplayer = make_registration()
|
||||
core.registered_on_leaveplayers, core.register_on_leaveplayer = make_registration()
|
||||
core.registered_on_player_receive_fields, core.register_on_player_receive_fields = make_registration_reverse()
|
||||
core.registered_on_cheats, core.register_on_cheat = make_registration()
|
||||
core.registered_on_crafts, core.register_on_craft = make_registration()
|
||||
core.registered_craft_predicts, core.register_craft_predict = make_registration()
|
||||
core.registered_on_protection_violation, core.register_on_protection_violation = make_registration()
|
||||
core.registered_on_item_eats, core.register_on_item_eat = make_registration()
|
||||
core.registered_on_punchplayers, core.register_on_punchplayer = make_registration()
|
||||
|
||||
--
|
||||
-- Compatibility for on_mapgen_init()
|
||||
--
|
||||
|
||||
core.register_on_mapgen_init = function(func) func(core.get_mapgen_params()) end
|
||||
|
||||
165
builtin/game/statbars.lua
Normal file
165
builtin/game/statbars.lua
Normal file
@@ -0,0 +1,165 @@
|
||||
|
||||
local health_bar_definition =
|
||||
{
|
||||
hud_elem_type = "statbar",
|
||||
position = { x=0.5, y=1 },
|
||||
text = "heart.png",
|
||||
number = 20,
|
||||
direction = 0,
|
||||
size = { x=24, y=24 },
|
||||
offset = { x=(-10*24)-25, y=-(48+24+16)},
|
||||
}
|
||||
|
||||
local breath_bar_definition =
|
||||
{
|
||||
hud_elem_type = "statbar",
|
||||
position = { x=0.5, y=1 },
|
||||
text = "bubble.png",
|
||||
number = 20,
|
||||
direction = 0,
|
||||
size = { x=24, y=24 },
|
||||
offset = {x=25,y=-(48+24+16)},
|
||||
}
|
||||
|
||||
local hud_ids = {}
|
||||
|
||||
local function initialize_builtin_statbars(player)
|
||||
|
||||
if not player:is_player() then
|
||||
return
|
||||
end
|
||||
|
||||
local name = player:get_player_name()
|
||||
|
||||
if name == "" then
|
||||
return
|
||||
end
|
||||
|
||||
if (hud_ids[name] == nil) then
|
||||
hud_ids[name] = {}
|
||||
-- flags are not transmitted to client on connect, we need to make sure
|
||||
-- our current flags are transmitted by sending them actively
|
||||
player:hud_set_flags(player:hud_get_flags())
|
||||
end
|
||||
|
||||
if player:hud_get_flags().healthbar and
|
||||
core.is_yes(core.setting_get("enable_damage")) then
|
||||
if hud_ids[name].id_healthbar == nil then
|
||||
health_bar_definition.number = player:get_hp()
|
||||
hud_ids[name].id_healthbar = player:hud_add(health_bar_definition)
|
||||
end
|
||||
else
|
||||
if hud_ids[name].id_healthbar ~= nil then
|
||||
player:hud_remove(hud_ids[name].id_healthbar)
|
||||
hud_ids[name].id_healthbar = nil
|
||||
end
|
||||
end
|
||||
|
||||
if (player:get_breath() < 11) then
|
||||
if player:hud_get_flags().breathbar and
|
||||
core.is_yes(core.setting_get("enable_damage")) then
|
||||
if hud_ids[name].id_breathbar == nil then
|
||||
hud_ids[name].id_breathbar = player:hud_add(breath_bar_definition)
|
||||
end
|
||||
else
|
||||
if hud_ids[name].id_breathbar ~= nil then
|
||||
player:hud_remove(hud_ids[name].id_breathbar)
|
||||
hud_ids[name].id_breathbar = nil
|
||||
end
|
||||
end
|
||||
elseif hud_ids[name].id_breathbar ~= nil then
|
||||
player:hud_remove(hud_ids[name].id_breathbar)
|
||||
hud_ids[name].id_breathbar = nil
|
||||
end
|
||||
end
|
||||
|
||||
local function cleanup_builtin_statbars(player)
|
||||
|
||||
if not player:is_player() then
|
||||
return
|
||||
end
|
||||
|
||||
local name = player:get_player_name()
|
||||
|
||||
if name == "" then
|
||||
return
|
||||
end
|
||||
|
||||
hud_ids[name] = nil
|
||||
end
|
||||
|
||||
local function player_event_handler(player,eventname)
|
||||
assert(player:is_player())
|
||||
|
||||
local name = player:get_player_name()
|
||||
|
||||
if name == "" then
|
||||
return
|
||||
end
|
||||
|
||||
if eventname == "health_changed" then
|
||||
initialize_builtin_statbars(player)
|
||||
|
||||
if hud_ids[name].id_healthbar ~= nil then
|
||||
player:hud_change(hud_ids[name].id_healthbar,"number",player:get_hp())
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
if eventname == "breath_changed" then
|
||||
initialize_builtin_statbars(player)
|
||||
|
||||
if hud_ids[name].id_breathbar ~= nil then
|
||||
player:hud_change(hud_ids[name].id_breathbar,"number",player:get_breath()*2)
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
if eventname == "hud_changed" then
|
||||
initialize_builtin_statbars(player)
|
||||
return true
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
function core.hud_replace_builtin(name, definition)
|
||||
|
||||
if definition == nil or
|
||||
type(definition) ~= "table" or
|
||||
definition.hud_elem_type ~= "statbar" then
|
||||
return false
|
||||
end
|
||||
|
||||
if name == "health" then
|
||||
health_bar_definition = definition
|
||||
|
||||
for name,ids in pairs(hud_ids) do
|
||||
local player = core.get_player_by_name(name)
|
||||
if player and hud_ids[name].id_healthbar then
|
||||
player:hud_remove(hud_ids[name].id_healthbar)
|
||||
initialize_builtin_statbars(player)
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
if name == "breath" then
|
||||
breath_bar_definition = definition
|
||||
|
||||
for name,ids in pairs(hud_ids) do
|
||||
local player = core.get_player_by_name(name)
|
||||
if player and hud_ids[name].id_breathbar then
|
||||
player:hud_remove(hud_ids[name].id_breathbar)
|
||||
initialize_builtin_statbars(player)
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
core.register_on_joinplayer(initialize_builtin_statbars)
|
||||
core.register_on_leaveplayer(cleanup_builtin_statbars)
|
||||
core.register_playerevent(player_event_handler)
|
||||
33
builtin/game/static_spawn.lua
Normal file
33
builtin/game/static_spawn.lua
Normal file
@@ -0,0 +1,33 @@
|
||||
-- Minetest: builtin/static_spawn.lua
|
||||
|
||||
local function warn_invalid_static_spawnpoint()
|
||||
if core.setting_get("static_spawnpoint") and
|
||||
not core.setting_get_pos("static_spawnpoint") then
|
||||
core.log('error', "The static_spawnpoint setting is invalid: \""..
|
||||
core.setting_get("static_spawnpoint").."\"")
|
||||
end
|
||||
end
|
||||
|
||||
warn_invalid_static_spawnpoint()
|
||||
|
||||
local function put_player_in_spawn(obj)
|
||||
warn_invalid_static_spawnpoint()
|
||||
local static_spawnpoint = core.setting_get_pos("static_spawnpoint")
|
||||
if not static_spawnpoint then
|
||||
return false
|
||||
end
|
||||
core.log('action', "Moving "..obj:get_player_name()..
|
||||
" to static spawnpoint at "..
|
||||
core.pos_to_string(static_spawnpoint))
|
||||
obj:setpos(static_spawnpoint)
|
||||
return true
|
||||
end
|
||||
|
||||
core.register_on_newplayer(function(obj)
|
||||
put_player_in_spawn(obj)
|
||||
end)
|
||||
|
||||
core.register_on_respawnplayer(function(obj)
|
||||
return put_player_in_spawn(obj)
|
||||
end)
|
||||
|
||||
109
builtin/game/voxelarea.lua
Normal file
109
builtin/game/voxelarea.lua
Normal file
@@ -0,0 +1,109 @@
|
||||
VoxelArea = {
|
||||
MinEdge = {x=1, y=1, z=1},
|
||||
MaxEdge = {x=0, y=0, z=0},
|
||||
ystride = 0,
|
||||
zstride = 0,
|
||||
}
|
||||
|
||||
function VoxelArea:new(o)
|
||||
o = o or {}
|
||||
setmetatable(o, self)
|
||||
self.__index = self
|
||||
|
||||
local e = o:getExtent()
|
||||
o.ystride = e.x
|
||||
o.zstride = e.x * e.y
|
||||
|
||||
return o
|
||||
end
|
||||
|
||||
function VoxelArea:getExtent()
|
||||
local MaxEdge, MinEdge = self.MaxEdge, self.MinEdge
|
||||
return {
|
||||
x = MaxEdge.x - MinEdge.x + 1,
|
||||
y = MaxEdge.y - MinEdge.y + 1,
|
||||
z = MaxEdge.z - MinEdge.z + 1,
|
||||
}
|
||||
end
|
||||
|
||||
function VoxelArea:getVolume()
|
||||
local e = self:getExtent()
|
||||
return e.x * e.y * e.z
|
||||
end
|
||||
|
||||
function VoxelArea:index(x, y, z)
|
||||
local MinEdge = self.MinEdge
|
||||
local i = (z - MinEdge.z) * self.zstride +
|
||||
(y - MinEdge.y) * self.ystride +
|
||||
(x - MinEdge.x) + 1
|
||||
return math.floor(i)
|
||||
end
|
||||
|
||||
function VoxelArea:indexp(p)
|
||||
local MinEdge = self.MinEdge
|
||||
local i = (p.z - MinEdge.z) * self.zstride +
|
||||
(p.y - MinEdge.y) * self.ystride +
|
||||
(p.x - MinEdge.x) + 1
|
||||
return math.floor(i)
|
||||
end
|
||||
|
||||
function VoxelArea:position(i)
|
||||
local p = {}
|
||||
local MinEdge = self.MinEdge
|
||||
|
||||
i = i - 1
|
||||
|
||||
p.z = math.floor(i / self.zstride) + MinEdge.z
|
||||
i = i % self.zstride
|
||||
|
||||
p.y = math.floor(i / self.ystride) + MinEdge.y
|
||||
i = i % self.ystride
|
||||
|
||||
p.x = math.floor(i) + MinEdge.x
|
||||
|
||||
return p
|
||||
end
|
||||
|
||||
function VoxelArea:contains(x, y, z)
|
||||
local MaxEdge, MinEdge = self.MaxEdge, self.MinEdge
|
||||
return (x >= MinEdge.x) and (x <= MaxEdge.x) and
|
||||
(y >= MinEdge.y) and (y <= MaxEdge.y) and
|
||||
(z >= MinEdge.z) and (z <= MaxEdge.z)
|
||||
end
|
||||
|
||||
function VoxelArea:containsp(p)
|
||||
local MaxEdge, MinEdge = self.MaxEdge, self.MinEdge
|
||||
return (p.x >= MinEdge.x) and (p.x <= MaxEdge.x) and
|
||||
(p.y >= MinEdge.y) and (p.y <= MaxEdge.y) and
|
||||
(p.z >= MinEdge.z) and (p.z <= MaxEdge.z)
|
||||
end
|
||||
|
||||
function VoxelArea:containsi(i)
|
||||
return (i >= 1) and (i <= self:getVolume())
|
||||
end
|
||||
|
||||
function VoxelArea:iter(minx, miny, minz, maxx, maxy, maxz)
|
||||
local i = self:index(minx, miny, minz) - 1
|
||||
local last = self:index(maxx, maxy, maxz)
|
||||
local ystride = self.ystride
|
||||
local zstride = self.zstride
|
||||
local yoff = (last+1) % ystride
|
||||
local zoff = (last+1) % zstride
|
||||
local ystridediff = (i - last) % ystride
|
||||
local zstridediff = (i - last) % zstride
|
||||
return function()
|
||||
i = i + 1
|
||||
if i % zstride == zoff then
|
||||
i = i + zstridediff
|
||||
elseif i % ystride == yoff then
|
||||
i = i + ystridediff
|
||||
end
|
||||
if i <= last then
|
||||
return i
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function VoxelArea:iterp(minp, maxp)
|
||||
return self:iter(minp.x, minp.y, minp.z, maxp.x, maxp.y, maxp.z)
|
||||
end
|
||||
38
builtin/init.lua
Normal file
38
builtin/init.lua
Normal file
@@ -0,0 +1,38 @@
|
||||
--
|
||||
-- This file contains built-in stuff in Minetest implemented in Lua.
|
||||
--
|
||||
-- It is always loaded and executed after registration of the C API,
|
||||
-- before loading and running any mods.
|
||||
--
|
||||
|
||||
-- Initialize some very basic things
|
||||
print = core.debug
|
||||
math.randomseed(os.time())
|
||||
os.setlocale("C", "numeric")
|
||||
minetest = core
|
||||
|
||||
-- Load other files
|
||||
local scriptdir = core.get_builtin_path()..DIR_DELIM
|
||||
local gamepath = scriptdir.."game"..DIR_DELIM
|
||||
local commonpath = scriptdir.."common"..DIR_DELIM
|
||||
local asyncpath = scriptdir.."async"..DIR_DELIM
|
||||
|
||||
dofile(commonpath.."strict.lua")
|
||||
dofile(commonpath.."serialize.lua")
|
||||
dofile(commonpath.."misc_helpers.lua")
|
||||
|
||||
if INIT == "game" then
|
||||
dofile(gamepath.."init.lua")
|
||||
elseif INIT == "mainmenu" then
|
||||
local mainmenuscript = core.setting_get("main_menu_script")
|
||||
if mainmenuscript ~= nil and mainmenuscript ~= "" then
|
||||
dofile(mainmenuscript)
|
||||
else
|
||||
dofile(core.get_mainmenu_path()..DIR_DELIM.."init.lua")
|
||||
end
|
||||
elseif INIT == "async" then
|
||||
dofile(asyncpath.."init.lua")
|
||||
else
|
||||
error(("Unrecognized builtin initialization type %s!"):format(tostring(INIT)))
|
||||
end
|
||||
|
||||
334
builtin/mainmenu/common.lua
Normal file
334
builtin/mainmenu/common.lua
Normal file
@@ -0,0 +1,334 @@
|
||||
--Minetest
|
||||
--Copyright (C) 2014 sapier
|
||||
--
|
||||
--This program is free software; you can redistribute it and/or modify
|
||||
--it under the terms of the GNU Lesser General Public License as published by
|
||||
--the Free Software Foundation; either version 2.1 of the License, or
|
||||
--(at your option) any later version.
|
||||
--
|
||||
--This program is distributed in the hope that it will be useful,
|
||||
--but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
--GNU Lesser General Public License for more details.
|
||||
--
|
||||
--You should have received a copy of the GNU Lesser General Public License along
|
||||
--with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
--51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
--------------------------------------------------------------------------------
|
||||
-- Global menu data
|
||||
--------------------------------------------------------------------------------
|
||||
menudata = {}
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- Local cached values
|
||||
--------------------------------------------------------------------------------
|
||||
local min_supp_proto = core.get_min_supp_proto()
|
||||
local max_supp_proto = core.get_max_supp_proto()
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- Menu helper functions
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
local function render_client_count(n)
|
||||
if n > 99 then
|
||||
return '99+'
|
||||
elseif n >= 0 then
|
||||
return tostring(n)
|
||||
else
|
||||
return '?'
|
||||
end
|
||||
end
|
||||
|
||||
local function configure_selected_world_params(idx)
|
||||
local worldconfig = modmgr.get_worldconfig(
|
||||
menudata.worldlist:get_list()[idx].path)
|
||||
|
||||
if worldconfig.creative_mode ~= nil then
|
||||
core.setting_set("creative_mode", worldconfig.creative_mode)
|
||||
end
|
||||
if worldconfig.enable_damage ~= nil then
|
||||
core.setting_set("enable_damage", worldconfig.enable_damage)
|
||||
end
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function image_column(tooltip, flagname)
|
||||
return "image," ..
|
||||
"tooltip=" .. core.formspec_escape(tooltip) .. "," ..
|
||||
"0=" .. core.formspec_escape(defaulttexturedir .. "blank.png") .. "," ..
|
||||
"1=" .. core.formspec_escape(defaulttexturedir .. "server_flags_" .. flagname .. ".png")
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function order_favorite_list(list)
|
||||
local res = {}
|
||||
--orders the favorite list after support
|
||||
for i=1,#list,1 do
|
||||
local fav = list[i]
|
||||
if is_server_protocol_compat(fav.proto_min, fav.proto_max) then
|
||||
table.insert(res, fav)
|
||||
end
|
||||
end
|
||||
for i=1,#list,1 do
|
||||
local fav = list[i]
|
||||
if not is_server_protocol_compat(fav.proto_min, fav.proto_max) then
|
||||
table.insert(res, fav)
|
||||
end
|
||||
end
|
||||
return res
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function render_favorite(spec,render_details)
|
||||
local text = ""
|
||||
|
||||
if spec.name ~= nil then
|
||||
text = text .. core.formspec_escape(spec.name:trim())
|
||||
|
||||
-- if spec.description ~= nil and
|
||||
-- core.formspec_escape(spec.description):trim() ~= "" then
|
||||
-- text = text .. " (" .. core.formspec_escape(spec.description) .. ")"
|
||||
-- end
|
||||
else
|
||||
if spec.address ~= nil then
|
||||
text = text .. spec.address:trim()
|
||||
|
||||
if spec.port ~= nil then
|
||||
text = text .. ":" .. spec.port
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if not render_details then
|
||||
return text
|
||||
end
|
||||
|
||||
local details = ""
|
||||
local grey_out = not is_server_protocol_compat(spec.proto_max, spec.proto_min)
|
||||
|
||||
if spec.clients ~= nil and spec.clients_max ~= nil then
|
||||
local clients_color = ''
|
||||
local clients_percent = 100 * spec.clients / spec.clients_max
|
||||
|
||||
-- Choose a color depending on how many clients are connected
|
||||
-- (relatively to clients_max)
|
||||
if spec.clients == 0 then
|
||||
clients_color = '' -- 0 players: default/white
|
||||
elseif spec.clients == spec.clients_max then
|
||||
clients_color = '#dd5b5b' -- full server: red (darker)
|
||||
elseif clients_percent <= 60 then
|
||||
clients_color = '#a1e587' -- 0-60%: green
|
||||
elseif clients_percent <= 90 then
|
||||
clients_color = '#ffdc97' -- 60-90%: yellow
|
||||
else
|
||||
clients_color = '#ffba97' -- 90-100%: orange
|
||||
end
|
||||
|
||||
if grey_out then
|
||||
clients_color = '#aaaaaa'
|
||||
end
|
||||
|
||||
details = details ..
|
||||
clients_color .. ',' ..
|
||||
render_client_count(spec.clients) .. ',' ..
|
||||
'/,' ..
|
||||
render_client_count(spec.clients_max) .. ','
|
||||
elseif grey_out then
|
||||
details = details .. '#aaaaaa,?,/,?,'
|
||||
else
|
||||
details = details .. ',?,/,?,'
|
||||
end
|
||||
|
||||
if spec.creative then
|
||||
details = details .. "1,"
|
||||
else
|
||||
details = details .. "0,"
|
||||
end
|
||||
|
||||
if spec.damage then
|
||||
details = details .. "1,"
|
||||
else
|
||||
details = details .. "0,"
|
||||
end
|
||||
|
||||
if spec.pvp then
|
||||
details = details .. "1,"
|
||||
else
|
||||
details = details .. "0,"
|
||||
end
|
||||
|
||||
return details .. (grey_out and '#aaaaaa,' or ',') .. text
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
os.tempfolder = function()
|
||||
if core.setting_get("TMPFolder") then
|
||||
return core.setting_get("TMPFolder") .. DIR_DELIM .. "MT_" .. math.random(0,10000)
|
||||
end
|
||||
|
||||
local filetocheck = os.tmpname()
|
||||
os.remove(filetocheck)
|
||||
|
||||
local randname = "MTTempModFolder_" .. math.random(0,10000)
|
||||
if DIR_DELIM == "\\" then
|
||||
local tempfolder = os.getenv("TEMP")
|
||||
return tempfolder .. filetocheck
|
||||
else
|
||||
local backstring = filetocheck:reverse()
|
||||
return filetocheck:sub(0,filetocheck:len()-backstring:find(DIR_DELIM)+1) ..randname
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function menu_render_worldlist()
|
||||
local retval = ""
|
||||
|
||||
local current_worldlist = menudata.worldlist:get_list()
|
||||
|
||||
for i,v in ipairs(current_worldlist) do
|
||||
if retval ~= "" then
|
||||
retval = retval ..","
|
||||
end
|
||||
|
||||
retval = retval .. core.formspec_escape(v.name) ..
|
||||
" \\[" .. core.formspec_escape(v.gameid) .. "\\]"
|
||||
end
|
||||
|
||||
return retval
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function menu_handle_key_up_down(fields,textlist,settingname)
|
||||
if fields["key_up"] then
|
||||
local oldidx = core.get_textlist_index(textlist)
|
||||
|
||||
if oldidx ~= nil and oldidx > 1 then
|
||||
local newidx = oldidx -1
|
||||
core.setting_set(settingname,
|
||||
menudata.worldlist:get_raw_index(newidx))
|
||||
|
||||
configure_selected_world_params(newidx)
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
if fields["key_down"] then
|
||||
local oldidx = core.get_textlist_index(textlist)
|
||||
|
||||
if oldidx ~= nil and oldidx < menudata.worldlist:size() then
|
||||
local newidx = oldidx + 1
|
||||
core.setting_set(settingname,
|
||||
menudata.worldlist:get_raw_index(newidx))
|
||||
|
||||
configure_selected_world_params(newidx)
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function asyncOnlineFavourites()
|
||||
|
||||
if not menudata.public_known then
|
||||
menudata.public_known = {{
|
||||
name = fgettext("Loading..."),
|
||||
description = fgettext_ne("Try reenabling public serverlist and check your internet connection.")
|
||||
}}
|
||||
end
|
||||
menudata.favorites = menudata.public_known
|
||||
core.handle_async(
|
||||
function(param)
|
||||
return core.get_favorites("online")
|
||||
end,
|
||||
nil,
|
||||
function(result)
|
||||
if core.setting_getbool("public_serverlist") then
|
||||
local favs = order_favorite_list(result)
|
||||
if favs[1] then
|
||||
menudata.public_known = favs
|
||||
menudata.favorites = menudata.public_known
|
||||
end
|
||||
core.event_handler("Refresh")
|
||||
end
|
||||
end
|
||||
)
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function text2textlist(xpos,ypos,width,height,tl_name,textlen,text,transparency)
|
||||
local textlines = core.splittext(text,textlen)
|
||||
|
||||
local retval = "textlist[" .. xpos .. "," .. ypos .. ";"
|
||||
.. width .. "," .. height .. ";"
|
||||
.. tl_name .. ";"
|
||||
|
||||
for i=1, #textlines, 1 do
|
||||
textlines[i] = textlines[i]:gsub("\r","")
|
||||
retval = retval .. core.formspec_escape(textlines[i]) .. ","
|
||||
end
|
||||
|
||||
retval = retval .. ";0;"
|
||||
|
||||
if transparency then
|
||||
retval = retval .. "true"
|
||||
end
|
||||
|
||||
retval = retval .. "]"
|
||||
|
||||
return retval
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function is_server_protocol_compat(proto_min, proto_max)
|
||||
return not ((min_supp_proto > (proto_max or 24)) or (max_supp_proto < (proto_min or 13)))
|
||||
end
|
||||
--------------------------------------------------------------------------------
|
||||
function is_server_protocol_compat_or_error(proto_min, proto_max)
|
||||
if not is_server_protocol_compat(proto_min, proto_max) then
|
||||
gamedata.errormessage = fgettext_ne("Protocol version mismatch, server " ..
|
||||
((proto_min ~= proto_max) and "supports protocols between $1 and $2" or "enforces protocol version $1") ..
|
||||
", we " ..
|
||||
((min_supp_proto ~= max_supp_proto) and "support protocols between version $3 and $4." or "only support protocol version $3"),
|
||||
proto_min or 13, proto_max or 24, min_supp_proto, max_supp_proto)
|
||||
return false
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
--------------------------------------------------------------------------------
|
||||
function menu_worldmt(selected, setting, value)
|
||||
local world = menudata.worldlist:get_list()[selected]
|
||||
if world then
|
||||
local filename = world.path .. DIR_DELIM .. "world.mt"
|
||||
local world_conf = Settings(filename)
|
||||
|
||||
if value ~= nil then
|
||||
if not world_conf:write() then
|
||||
core.log("error", "Failed to write world config file")
|
||||
end
|
||||
world_conf:set(setting, value)
|
||||
world_conf:write()
|
||||
else
|
||||
return world_conf:get(setting)
|
||||
end
|
||||
else
|
||||
return nil
|
||||
end
|
||||
end
|
||||
|
||||
function menu_worldmt_legacy(selected)
|
||||
local modes_names = {"creative_mode", "enable_damage", "server_announce"}
|
||||
for _, mode_name in pairs(modes_names) do
|
||||
local mode_val = menu_worldmt(selected, mode_name)
|
||||
if mode_val ~= nil then
|
||||
core.setting_set(mode_name, mode_val)
|
||||
else
|
||||
menu_worldmt(selected, mode_name, core.setting_get(mode_name))
|
||||
end
|
||||
end
|
||||
end
|
||||
311
builtin/mainmenu/dlg_config_world.lua
Normal file
311
builtin/mainmenu/dlg_config_world.lua
Normal file
@@ -0,0 +1,311 @@
|
||||
--Minetest
|
||||
--Copyright (C) 2013 sapier
|
||||
--
|
||||
--This program is free software; you can redistribute it and/or modify
|
||||
--it under the terms of the GNU Lesser General Public License as published by
|
||||
--the Free Software Foundation; either version 2.1 of the License, or
|
||||
--(at your option) any later version.
|
||||
--
|
||||
--This program is distributed in the hope that it will be useful,
|
||||
--but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
--GNU Lesser General Public License for more details.
|
||||
--
|
||||
--You should have received a copy of the GNU Lesser General Public License along
|
||||
--with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
--51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
local function modname_valid(name)
|
||||
return not name:find("[^a-z0-9_]")
|
||||
end
|
||||
|
||||
local function get_formspec(data)
|
||||
|
||||
local mod = data.list:get_list()[data.selected_mod]
|
||||
|
||||
local retval =
|
||||
"size[11,6.5,true]" ..
|
||||
"label[0.5,-0.25;" .. fgettext("World:") .. "]" ..
|
||||
"label[1.75,-0.25;" .. data.worldspec.name .. "]"
|
||||
|
||||
if data.hide_gamemods then
|
||||
retval = retval .. "checkbox[0,5.75;cb_hide_gamemods;" .. fgettext("Hide Game") .. ";true]"
|
||||
else
|
||||
retval = retval .. "checkbox[0,5.75;cb_hide_gamemods;" .. fgettext("Hide Game") .. ";false]"
|
||||
end
|
||||
|
||||
if data.hide_modpackcontents then
|
||||
retval = retval .. "checkbox[2,5.75;cb_hide_mpcontent;" .. fgettext("Hide mp content") .. ";true]"
|
||||
else
|
||||
retval = retval .. "checkbox[2,5.75;cb_hide_mpcontent;" .. fgettext("Hide mp content") .. ";false]"
|
||||
end
|
||||
|
||||
if mod == nil then
|
||||
mod = {name=""}
|
||||
end
|
||||
|
||||
retval = retval ..
|
||||
"label[0,0.45;" .. fgettext("Mod:") .. "]" ..
|
||||
"label[0.75,0.45;" .. mod.name .. "]" ..
|
||||
"label[0,1;" .. fgettext("Depends:") .. "]" ..
|
||||
"textlist[0,1.5;5,4.25;world_config_depends;" ..
|
||||
modmgr.get_dependencies(mod.path) .. ";0]" ..
|
||||
"button[9.25,6.35;2,0.5;btn_config_world_save;" .. fgettext("Save") .. "]" ..
|
||||
"button[7.4,6.35;2,0.5;btn_config_world_cancel;" .. fgettext("Cancel") .. "]"
|
||||
|
||||
if mod ~= nil and mod.name ~= "" and mod.typ ~= "game_mod" then
|
||||
if mod.is_modpack then
|
||||
local rawlist = data.list:get_raw_list()
|
||||
|
||||
local all_enabled = true
|
||||
for j=1,#rawlist,1 do
|
||||
if rawlist[j].modpack == mod.name and
|
||||
rawlist[j].enabled ~= true then
|
||||
all_enabled = false
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
if all_enabled == false then
|
||||
retval = retval .. "button[5.5,-0.125;2,0.5;btn_mp_enable;" .. fgettext("Enable MP") .. "]"
|
||||
else
|
||||
retval = retval .. "button[5.5,-0.125;2,0.5;btn_mp_disable;" .. fgettext("Disable MP") .. "]"
|
||||
end
|
||||
else
|
||||
if mod.enabled then
|
||||
retval = retval .. "checkbox[5.5,-0.375;cb_mod_enable;" .. fgettext("enabled") .. ";true]"
|
||||
else
|
||||
retval = retval .. "checkbox[5.5,-0.375;cb_mod_enable;" .. fgettext("enabled") .. ";false]"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
retval = retval ..
|
||||
"button[8.5,-0.125;2.5,0.5;btn_all_mods;" .. fgettext("Enable all") .. "]" ..
|
||||
"textlist[5.5,0.5;5.5,5.75;world_config_modlist;"
|
||||
|
||||
retval = retval .. modmgr.render_modlist(data.list)
|
||||
retval = retval .. ";" .. data.selected_mod .."]"
|
||||
|
||||
return retval
|
||||
end
|
||||
|
||||
local function enable_mod(this, toset)
|
||||
local mod = this.data.list:get_list()[this.data.selected_mod]
|
||||
|
||||
if mod.typ == "game_mod" then
|
||||
-- game mods can't be enabled or disabled
|
||||
elseif not mod.is_modpack then
|
||||
if toset == nil then
|
||||
mod.enabled = not mod.enabled
|
||||
else
|
||||
mod.enabled = toset
|
||||
end
|
||||
else
|
||||
local list = this.data.list:get_raw_list()
|
||||
for i=1,#list,1 do
|
||||
if list[i].modpack == mod.name then
|
||||
if toset == nil then
|
||||
toset = not list[i].enabled
|
||||
end
|
||||
list[i].enabled = toset
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
local function handle_buttons(this, fields)
|
||||
|
||||
if fields["world_config_modlist"] ~= nil then
|
||||
local event = core.explode_textlist_event(fields["world_config_modlist"])
|
||||
this.data.selected_mod = event.index
|
||||
core.setting_set("world_config_selected_mod", event.index)
|
||||
|
||||
if event.type == "DCL" then
|
||||
enable_mod(this)
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
if fields["key_enter"] ~= nil then
|
||||
enable_mod(this)
|
||||
return true
|
||||
end
|
||||
|
||||
if fields["cb_mod_enable"] ~= nil then
|
||||
local toset = core.is_yes(fields["cb_mod_enable"])
|
||||
enable_mod(this,toset)
|
||||
return true
|
||||
end
|
||||
|
||||
if fields["btn_mp_enable"] ~= nil or
|
||||
fields["btn_mp_disable"] then
|
||||
local toset = (fields["btn_mp_enable"] ~= nil)
|
||||
enable_mod(this,toset)
|
||||
return true
|
||||
end
|
||||
|
||||
if fields["cb_hide_gamemods"] ~= nil or
|
||||
fields["cb_hide_mpcontent"] ~= nil then
|
||||
local current = this.data.list:get_filtercriteria()
|
||||
|
||||
if current == nil then
|
||||
current = {}
|
||||
end
|
||||
|
||||
if fields["cb_hide_gamemods"] ~= nil then
|
||||
if core.is_yes(fields["cb_hide_gamemods"]) then
|
||||
current.hide_game = true
|
||||
this.data.hide_gamemods = true
|
||||
core.setting_set("world_config_hide_gamemods", "true")
|
||||
else
|
||||
current.hide_game = false
|
||||
this.data.hide_gamemods = false
|
||||
core.setting_set("world_config_hide_gamemods", "false")
|
||||
end
|
||||
end
|
||||
|
||||
if fields["cb_hide_mpcontent"] ~= nil then
|
||||
if core.is_yes(fields["cb_hide_mpcontent"]) then
|
||||
current.hide_modpackcontents = true
|
||||
this.data.hide_modpackcontents = true
|
||||
core.setting_set("world_config_hide_modpackcontents", "true")
|
||||
else
|
||||
current.hide_modpackcontents = false
|
||||
this.data.hide_modpackcontents = false
|
||||
core.setting_set("world_config_hide_modpackcontents", "false")
|
||||
end
|
||||
end
|
||||
|
||||
this.data.list:set_filtercriteria(current)
|
||||
return true
|
||||
end
|
||||
|
||||
if fields["btn_config_world_save"] then
|
||||
|
||||
local filename = this.data.worldspec.path ..
|
||||
DIR_DELIM .. "world.mt"
|
||||
|
||||
local worldfile = Settings(filename)
|
||||
local mods = worldfile:to_table()
|
||||
|
||||
local rawlist = this.data.list:get_raw_list()
|
||||
|
||||
local i,mod
|
||||
for i,mod in ipairs(rawlist) do
|
||||
if not mod.is_modpack and
|
||||
mod.typ ~= "game_mod" then
|
||||
if modname_valid(mod.name) then
|
||||
worldfile:set("load_mod_"..mod.name, tostring(mod.enabled))
|
||||
else
|
||||
if mod.enabled then
|
||||
gamedata.errormessage = fgettext_ne("Failed to enable mod \"$1\" as it contains disallowed characters. Only chararacters [a-z0-9_] are allowed.", mod.name)
|
||||
end
|
||||
end
|
||||
mods["load_mod_"..mod.name] = nil
|
||||
end
|
||||
end
|
||||
|
||||
-- Remove mods that are not present anymore
|
||||
for key,value in pairs(mods) do
|
||||
if key:sub(1,9) == "load_mod_" then
|
||||
worldfile:remove(key)
|
||||
end
|
||||
end
|
||||
|
||||
if not worldfile:write() then
|
||||
core.log("error", "Failed to write world config file")
|
||||
end
|
||||
|
||||
this:delete()
|
||||
return true
|
||||
end
|
||||
|
||||
if fields["btn_config_world_cancel"] then
|
||||
this:delete()
|
||||
return true
|
||||
end
|
||||
|
||||
if fields["btn_all_mods"] then
|
||||
local list = this.data.list:get_raw_list()
|
||||
|
||||
for i=1,#list,1 do
|
||||
if list[i].typ ~= "game_mod" and
|
||||
not list[i].is_modpack then
|
||||
list[i].enabled = true
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
function create_configure_world_dlg(worldidx)
|
||||
|
||||
local dlg = dialog_create("sp_config_world",
|
||||
get_formspec,
|
||||
handle_buttons,
|
||||
nil)
|
||||
|
||||
dlg.data.hide_gamemods = core.setting_getbool("world_config_hide_gamemods")
|
||||
dlg.data.hide_modpackcontents = core.setting_getbool("world_config_hide_modpackcontents")
|
||||
dlg.data.selected_mod = tonumber(core.setting_get("world_config_selected_mod"))
|
||||
if dlg.data.selected_mod == nil then
|
||||
dlg.data.selected_mod = 0
|
||||
end
|
||||
|
||||
dlg.data.worldspec = core.get_worlds()[worldidx]
|
||||
if dlg.data.worldspec == nil then dlg:delete() return nil end
|
||||
|
||||
dlg.data.worldconfig = modmgr.get_worldconfig(dlg.data.worldspec.path)
|
||||
|
||||
if dlg.data.worldconfig == nil or dlg.data.worldconfig.id == nil or
|
||||
dlg.data.worldconfig.id == "" then
|
||||
|
||||
dlg:delete()
|
||||
return nil
|
||||
end
|
||||
|
||||
dlg.data.list = filterlist.create(
|
||||
modmgr.preparemodlist, --refresh
|
||||
modmgr.comparemod, --compare
|
||||
function(element,uid) --uid match
|
||||
if element.name == uid then
|
||||
return true
|
||||
end
|
||||
end,
|
||||
function(element,criteria)
|
||||
if criteria.hide_game and
|
||||
element.typ == "game_mod" then
|
||||
return false
|
||||
end
|
||||
|
||||
if criteria.hide_modpackcontents and
|
||||
element.modpack ~= nil then
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end, --filter
|
||||
{ worldpath= dlg.data.worldspec.path,
|
||||
gameid = dlg.data.worldspec.gameid }
|
||||
)
|
||||
|
||||
|
||||
if dlg.data.selected_mod > dlg.data.list:size() then
|
||||
dlg.data.selected_mod = 0
|
||||
end
|
||||
|
||||
dlg.data.list:set_filtercriteria(
|
||||
{
|
||||
hide_game=dlg.data.hide_gamemods,
|
||||
hide_modpackcontents= dlg.data.hide_modpackcontents
|
||||
})
|
||||
dlg.data.list:add_sort_mechanism("alphabetic", sort_mod_list)
|
||||
dlg.data.list:set_sortmode("alphabetic")
|
||||
|
||||
return dlg
|
||||
end
|
||||
143
builtin/mainmenu/dlg_create_world.lua
Normal file
143
builtin/mainmenu/dlg_create_world.lua
Normal file
@@ -0,0 +1,143 @@
|
||||
--Minetest
|
||||
--Copyright (C) 2014 sapier
|
||||
--
|
||||
--This program is free software; you can redistribute it and/or modify
|
||||
--it under the terms of the GNU Lesser General Public License as published by
|
||||
--the Free Software Foundation; either version 2.1 of the License, or
|
||||
--(at your option) any later version.
|
||||
--
|
||||
--This program is distributed in the hope that it will be useful,
|
||||
--but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
--GNU Lesser General Public License for more details.
|
||||
--
|
||||
--You should have received a copy of the GNU Lesser General Public License along
|
||||
--with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
--51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
local function create_world_formspec(dialogdata)
|
||||
local mapgens = core.get_mapgen_names()
|
||||
|
||||
local current_seed = core.setting_get("fixed_map_seed") or ""
|
||||
local current_mg = core.setting_get("mg_name")
|
||||
|
||||
local mglist = ""
|
||||
local selindex = 1
|
||||
local i = 1
|
||||
for k,v in pairs(mapgens) do
|
||||
if current_mg == v then
|
||||
selindex = i
|
||||
end
|
||||
i = i + 1
|
||||
mglist = mglist .. v .. ","
|
||||
end
|
||||
mglist = mglist:sub(1, -2)
|
||||
|
||||
local gameid = core.setting_get("menu_last_game")
|
||||
|
||||
local game, gameidx = nil , 0
|
||||
if gameid ~= nil then
|
||||
game, gameidx = gamemgr.find_by_gameid(gameid)
|
||||
|
||||
if gameidx == nil then
|
||||
gameidx = 0
|
||||
end
|
||||
end
|
||||
|
||||
current_seed = core.formspec_escape(current_seed)
|
||||
local retval =
|
||||
"size[12,6,true]" ..
|
||||
"label[2,0;" .. fgettext("World name") .. "]"..
|
||||
"field[4.5,0.4;6,0.5;te_world_name;;]" ..
|
||||
|
||||
"label[2,1;" .. fgettext("Seed") .. "]"..
|
||||
"field[4.5,1.4;6,0.5;te_seed;;".. current_seed .. "]" ..
|
||||
|
||||
"label[2,2;" .. fgettext("Mapgen") .. "]"..
|
||||
"dropdown[4.2,2;6.3;dd_mapgen;" .. mglist .. ";" .. selindex .. "]" ..
|
||||
|
||||
"label[2,3;" .. fgettext("Game") .. "]"..
|
||||
"textlist[4.2,3;5.8,2.3;games;" .. gamemgr.gamelist() ..
|
||||
";" .. gameidx .. ";true]" ..
|
||||
|
||||
"button[5,5.5;2.6,0.5;world_create_confirm;" .. fgettext("Create") .. "]" ..
|
||||
"button[7.5,5.5;2.8,0.5;world_create_cancel;" .. fgettext("Cancel") .. "]"
|
||||
|
||||
if #gamemgr.games == 0 then
|
||||
retval = retval .. "box[2,4;8,1;#ff8800]label[2.25,4;" ..
|
||||
fgettext("You have no subgames installed.") .. "]label[2.25,4.4;" ..
|
||||
fgettext("Download one from minetest.net") .. "]"
|
||||
elseif #gamemgr.games == 1 and gamemgr.games[1].id == "minimal" then
|
||||
retval = retval .. "box[1.75,4;8.7,1;#ff8800]label[2,4;" ..
|
||||
fgettext("Warning: The minimal development test is meant for developers.") .. "]label[2,4.4;" ..
|
||||
fgettext("Download a subgame, such as minetest_game, from minetest.net") .. "]"
|
||||
end
|
||||
|
||||
return retval
|
||||
|
||||
end
|
||||
|
||||
local function create_world_buttonhandler(this, fields)
|
||||
|
||||
if fields["world_create_confirm"] or
|
||||
fields["key_enter"] then
|
||||
|
||||
local worldname = fields["te_world_name"]
|
||||
local gameindex = core.get_textlist_index("games")
|
||||
|
||||
if gameindex ~= nil and
|
||||
worldname ~= "" then
|
||||
|
||||
local message = nil
|
||||
|
||||
core.setting_set("fixed_map_seed", fields["te_seed"])
|
||||
|
||||
if not menudata.worldlist:uid_exists_raw(worldname) then
|
||||
core.setting_set("mg_name",fields["dd_mapgen"])
|
||||
message = core.create_world(worldname,gameindex)
|
||||
else
|
||||
message = fgettext("A world named \"$1\" already exists", worldname)
|
||||
end
|
||||
|
||||
if message ~= nil then
|
||||
gamedata.errormessage = message
|
||||
else
|
||||
core.setting_set("menu_last_game",gamemgr.games[gameindex].id)
|
||||
if this.data.update_worldlist_filter then
|
||||
menudata.worldlist:set_filtercriteria(gamemgr.games[gameindex].id)
|
||||
mm_texture.update("singleplayer", gamemgr.games[gameindex].id)
|
||||
end
|
||||
menudata.worldlist:refresh()
|
||||
core.setting_set("mainmenu_last_selected_world",
|
||||
menudata.worldlist:raw_index_by_uid(worldname))
|
||||
end
|
||||
else
|
||||
gamedata.errormessage =
|
||||
fgettext("No worldname given or no game selected")
|
||||
end
|
||||
this:delete()
|
||||
return true
|
||||
end
|
||||
|
||||
if fields["games"] then
|
||||
return true
|
||||
end
|
||||
|
||||
if fields["world_create_cancel"] then
|
||||
this:delete()
|
||||
return true
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
|
||||
function create_create_world_dlg(update_worldlistfilter)
|
||||
local retval = dialog_create("sp_create_world",
|
||||
create_world_formspec,
|
||||
create_world_buttonhandler,
|
||||
nil)
|
||||
retval.update_worldlist_filter = update_worldlistfilter
|
||||
|
||||
return retval
|
||||
end
|
||||
68
builtin/mainmenu/dlg_delete_mod.lua
Normal file
68
builtin/mainmenu/dlg_delete_mod.lua
Normal file
@@ -0,0 +1,68 @@
|
||||
--Minetest
|
||||
--Copyright (C) 2014 sapier
|
||||
--
|
||||
--This program is free software; you can redistribute it and/or modify
|
||||
--it under the terms of the GNU Lesser General Public License as published by
|
||||
--the Free Software Foundation; either version 2.1 of the License, or
|
||||
--(at your option) any later version.
|
||||
--
|
||||
--This program is distributed in the hope that it will be useful,
|
||||
--but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
--GNU Lesser General Public License for more details.
|
||||
--
|
||||
--You should have received a copy of the GNU Lesser General Public License along
|
||||
--with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
--51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
local function delete_mod_formspec(dialogdata)
|
||||
|
||||
dialogdata.mod = modmgr.global_mods:get_list()[dialogdata.selected]
|
||||
|
||||
local retval =
|
||||
"size[12.4,5,true]" ..
|
||||
"field[1.75,1;10,3;;" .. fgettext("Are you sure you want to delete \"$1\"?", dialogdata.mod.name) .. ";]"..
|
||||
"button[4,4.2;1,0.5;dlg_delete_mod_confirm;" .. fgettext("Yes") .. "]" ..
|
||||
"button[6.5,4.2;3,0.5;dlg_delete_mod_cancel;" .. fgettext("No of course not!") .. "]"
|
||||
|
||||
return retval
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
local function delete_mod_buttonhandler(this, fields)
|
||||
if fields["dlg_delete_mod_confirm"] ~= nil then
|
||||
|
||||
if this.data.mod.path ~= nil and
|
||||
this.data.mod.path ~= "" and
|
||||
this.data.mod.path ~= core.get_modpath() then
|
||||
if not core.delete_dir(this.data.mod.path) then
|
||||
gamedata.errormessage = fgettext("Modmgr: failed to delete \"$1\"", this.data.mod.path)
|
||||
end
|
||||
modmgr.refresh_globals()
|
||||
else
|
||||
gamedata.errormessage = fgettext("Modmgr: invalid modpath \"$1\"", this.data.mod.path)
|
||||
end
|
||||
this:delete()
|
||||
return true
|
||||
end
|
||||
|
||||
if fields["dlg_delete_mod_cancel"] then
|
||||
this:delete()
|
||||
return true
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function create_delete_mod_dlg(selected_index)
|
||||
|
||||
local retval = dialog_create("dlg_delete_mod",
|
||||
delete_mod_formspec,
|
||||
delete_mod_buttonhandler,
|
||||
nil)
|
||||
retval.data.selected = selected_index
|
||||
return retval
|
||||
end
|
||||
64
builtin/mainmenu/dlg_delete_world.lua
Normal file
64
builtin/mainmenu/dlg_delete_world.lua
Normal file
@@ -0,0 +1,64 @@
|
||||
--Minetest
|
||||
--Copyright (C) 2014 sapier
|
||||
--
|
||||
--This program is free software; you can redistribute it and/or modify
|
||||
--it under the terms of the GNU Lesser General Public License as published by
|
||||
--the Free Software Foundation; either version 2.1 of the License, or
|
||||
--(at your option) any later version.
|
||||
--
|
||||
--This program is distributed in the hope that it will be useful,
|
||||
--but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
--GNU Lesser General Public License for more details.
|
||||
--
|
||||
--You should have received a copy of the GNU Lesser General Public License along
|
||||
--with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
--51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
|
||||
local function delete_world_formspec(dialogdata)
|
||||
|
||||
local retval =
|
||||
"size[12,6,true]" ..
|
||||
"label[2,2;" ..
|
||||
fgettext("Delete World \"$1\"?", dialogdata.delete_name) .. "]"..
|
||||
"button[3.5,4.2;2.6,0.5;world_delete_confirm;" .. fgettext("Yes").. "]" ..
|
||||
"button[6,4.2;2.8,0.5;world_delete_cancel;" .. fgettext("No") .. "]"
|
||||
return retval
|
||||
end
|
||||
|
||||
local function delete_world_buttonhandler(this, fields)
|
||||
if fields["world_delete_confirm"] then
|
||||
|
||||
if this.data.delete_index > 0 and
|
||||
this.data.delete_index <= #menudata.worldlist:get_raw_list() then
|
||||
core.delete_world(this.data.delete_index)
|
||||
menudata.worldlist:refresh()
|
||||
end
|
||||
this:delete()
|
||||
return true
|
||||
end
|
||||
|
||||
if fields["world_delete_cancel"] then
|
||||
this:delete()
|
||||
return true
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
|
||||
function create_delete_world_dlg(name_to_del,index_to_del)
|
||||
|
||||
assert(name_to_del ~= nil and type(name_to_del) == "string" and name_to_del ~= "")
|
||||
assert(index_to_del ~= nil and type(index_to_del) == "number")
|
||||
|
||||
local retval = dialog_create("delete_world",
|
||||
delete_world_formspec,
|
||||
delete_world_buttonhandler,
|
||||
nil)
|
||||
retval.data.delete_name = name_to_del
|
||||
retval.data.delete_index = index_to_del
|
||||
|
||||
return retval
|
||||
end
|
||||
69
builtin/mainmenu/dlg_rename_modpack.lua
Normal file
69
builtin/mainmenu/dlg_rename_modpack.lua
Normal file
@@ -0,0 +1,69 @@
|
||||
--Minetest
|
||||
--Copyright (C) 2014 sapier
|
||||
--
|
||||
--This program is free software; you can redistribute it and/or modify
|
||||
--it under the terms of the GNU Lesser General Public License as published by
|
||||
--the Free Software Foundation; either version 2.1 of the License, or
|
||||
--(at your option) any later version.
|
||||
--
|
||||
--This program is distributed in the hope that it will be useful,
|
||||
--but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
--GNU Lesser General Public License for more details.
|
||||
--
|
||||
--You should have received a copy of the GNU Lesser General Public License along
|
||||
--with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
--51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
local function rename_modpack_formspec(dialogdata)
|
||||
|
||||
dialogdata.mod = modmgr.global_mods:get_list()[dialogdata.selected]
|
||||
|
||||
local retval =
|
||||
"size[12.4,5,true]" ..
|
||||
"label[1.75,1;".. fgettext("Rename Modpack:") .. "]"..
|
||||
"field[4.5,1.4;6,0.5;te_modpack_name;;" ..
|
||||
dialogdata.mod.name ..
|
||||
"]" ..
|
||||
"button[5,4.2;2.6,0.5;dlg_rename_modpack_confirm;"..
|
||||
fgettext("Accept") .. "]" ..
|
||||
"button[7.5,4.2;2.8,0.5;dlg_rename_modpack_cancel;"..
|
||||
fgettext("Cancel") .. "]"
|
||||
|
||||
return retval
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
local function rename_modpack_buttonhandler(this, fields)
|
||||
if fields["dlg_rename_modpack_confirm"] ~= nil then
|
||||
local oldpath = core.get_modpath() .. DIR_DELIM .. this.data.mod.name
|
||||
local targetpath = core.get_modpath() .. DIR_DELIM .. fields["te_modpack_name"]
|
||||
core.copy_dir(oldpath,targetpath,false)
|
||||
modmgr.refresh_globals()
|
||||
modmgr.selected_mod = modmgr.global_mods:get_current_index(
|
||||
modmgr.global_mods:raw_index_by_uid(fields["te_modpack_name"]))
|
||||
|
||||
this:delete()
|
||||
return true
|
||||
end
|
||||
|
||||
if fields["dlg_rename_modpack_cancel"] then
|
||||
this:delete()
|
||||
return true
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function create_rename_modpack_dlg(selected_index)
|
||||
|
||||
local retval = dialog_create("dlg_delete_mod",
|
||||
rename_modpack_formspec,
|
||||
rename_modpack_buttonhandler,
|
||||
nil)
|
||||
retval.data.selected = selected_index
|
||||
return retval
|
||||
end
|
||||
83
builtin/mainmenu/gamemgr.lua
Normal file
83
builtin/mainmenu/gamemgr.lua
Normal file
@@ -0,0 +1,83 @@
|
||||
--Minetest
|
||||
--Copyright (C) 2013 sapier
|
||||
--
|
||||
--This program is free software; you can redistribute it and/or modify
|
||||
--it under the terms of the GNU Lesser General Public License as published by
|
||||
--the Free Software Foundation; either version 2.1 of the License, or
|
||||
--(at your option) any later version.
|
||||
--
|
||||
--This program is distributed in the hope that it will be useful,
|
||||
--but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
--GNU Lesser General Public License for more details.
|
||||
--
|
||||
--You should have received a copy of the GNU Lesser General Public License along
|
||||
--with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
--51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
gamemgr = {}
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function gamemgr.find_by_gameid(gameid)
|
||||
for i=1,#gamemgr.games,1 do
|
||||
if gamemgr.games[i].id == gameid then
|
||||
return gamemgr.games[i], i
|
||||
end
|
||||
end
|
||||
return nil, nil
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function gamemgr.get_game_mods(gamespec, retval)
|
||||
if gamespec ~= nil and
|
||||
gamespec.gamemods_path ~= nil and
|
||||
gamespec.gamemods_path ~= "" then
|
||||
get_mods(gamespec.gamemods_path, retval)
|
||||
end
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function gamemgr.get_game_modlist(gamespec)
|
||||
local retval = ""
|
||||
local game_mods = {}
|
||||
gamemgr.get_game_mods(gamespec, game_mods)
|
||||
for i=1,#game_mods,1 do
|
||||
if retval ~= "" then
|
||||
retval = retval..","
|
||||
end
|
||||
retval = retval .. game_mods[i].name
|
||||
end
|
||||
return retval
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function gamemgr.get_game(index)
|
||||
if index > 0 and index <= #gamemgr.games then
|
||||
return gamemgr.games[index]
|
||||
end
|
||||
|
||||
return nil
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function gamemgr.update_gamelist()
|
||||
gamemgr.games = core.get_games()
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function gamemgr.gamelist()
|
||||
local retval = ""
|
||||
if #gamemgr.games > 0 then
|
||||
retval = retval .. gamemgr.games[1].name
|
||||
|
||||
for i=2,#gamemgr.games,1 do
|
||||
retval = retval .. "," .. gamemgr.games[i].name
|
||||
end
|
||||
end
|
||||
return retval
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- read initial data
|
||||
--------------------------------------------------------------------------------
|
||||
gamemgr.update_gamelist()
|
||||
164
builtin/mainmenu/init.lua
Normal file
164
builtin/mainmenu/init.lua
Normal file
@@ -0,0 +1,164 @@
|
||||
--Minetest
|
||||
--Copyright (C) 2014 sapier
|
||||
--
|
||||
--This program is free software; you can redistribute it and/or modify
|
||||
--it under the terms of the GNU Lesser General Public License as published by
|
||||
--the Free Software Foundation; either version 2.1 of the License, or
|
||||
--(at your option) any later version.
|
||||
--
|
||||
--This program is distributed in the hope that it will be useful,
|
||||
--but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
--GNU Lesser General Public License for more details.
|
||||
--
|
||||
--You should have received a copy of the GNU Lesser General Public License along
|
||||
--with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
--51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
mt_color_grey = "#AAAAAA"
|
||||
mt_color_blue = "#0000DD"
|
||||
mt_color_green = "#00DD00"
|
||||
mt_color_dark_green = "#003300"
|
||||
|
||||
--for all other colors ask sfan5 to complete his work!
|
||||
|
||||
local menupath = core.get_mainmenu_path()
|
||||
local basepath = core.get_builtin_path()
|
||||
defaulttexturedir = core.get_texturepath_share() .. DIR_DELIM .. "base" ..
|
||||
DIR_DELIM .. "pack" .. DIR_DELIM
|
||||
|
||||
dofile(basepath .. DIR_DELIM .. "common" .. DIR_DELIM .. "async_event.lua")
|
||||
dofile(basepath .. DIR_DELIM .. "common" .. DIR_DELIM .. "filterlist.lua")
|
||||
dofile(basepath .. DIR_DELIM .. "fstk" .. DIR_DELIM .. "buttonbar.lua")
|
||||
dofile(basepath .. DIR_DELIM .. "fstk" .. DIR_DELIM .. "dialog.lua")
|
||||
dofile(basepath .. DIR_DELIM .. "fstk" .. DIR_DELIM .. "tabview.lua")
|
||||
dofile(basepath .. DIR_DELIM .. "fstk" .. DIR_DELIM .. "ui.lua")
|
||||
dofile(menupath .. DIR_DELIM .. "common.lua")
|
||||
dofile(menupath .. DIR_DELIM .. "gamemgr.lua")
|
||||
dofile(menupath .. DIR_DELIM .. "modmgr.lua")
|
||||
dofile(menupath .. DIR_DELIM .. "store.lua")
|
||||
dofile(menupath .. DIR_DELIM .. "dlg_config_world.lua")
|
||||
dofile(menupath .. DIR_DELIM .. "tab_credits.lua")
|
||||
dofile(menupath .. DIR_DELIM .. "tab_mods.lua")
|
||||
dofile(menupath .. DIR_DELIM .. "tab_settings.lua")
|
||||
if PLATFORM ~= "Android" then
|
||||
dofile(menupath .. DIR_DELIM .. "dlg_create_world.lua")
|
||||
dofile(menupath .. DIR_DELIM .. "dlg_delete_mod.lua")
|
||||
dofile(menupath .. DIR_DELIM .. "dlg_delete_world.lua")
|
||||
dofile(menupath .. DIR_DELIM .. "dlg_rename_modpack.lua")
|
||||
dofile(menupath .. DIR_DELIM .. "tab_multiplayer.lua")
|
||||
dofile(menupath .. DIR_DELIM .. "tab_server.lua")
|
||||
dofile(menupath .. DIR_DELIM .. "tab_singleplayer.lua")
|
||||
dofile(menupath .. DIR_DELIM .. "tab_texturepacks.lua")
|
||||
dofile(menupath .. DIR_DELIM .. "textures.lua")
|
||||
else
|
||||
dofile(menupath .. DIR_DELIM .. "tab_simple_main.lua")
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
local function main_event_handler(tabview, event)
|
||||
if event == "MenuQuit" then
|
||||
core.close()
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
local function init_globals()
|
||||
-- Init gamedata
|
||||
gamedata.worldindex = 0
|
||||
|
||||
|
||||
if PLATFORM ~= "Android" then
|
||||
menudata.worldlist = filterlist.create(
|
||||
core.get_worlds,
|
||||
compare_worlds,
|
||||
-- Unique id comparison function
|
||||
function(element, uid)
|
||||
return element.name == uid
|
||||
end,
|
||||
-- Filter function
|
||||
function(element, gameid)
|
||||
return element.gameid == gameid
|
||||
end
|
||||
)
|
||||
|
||||
menudata.worldlist:add_sort_mechanism("alphabetic", sort_worlds_alphabetic)
|
||||
menudata.worldlist:set_sortmode("alphabetic")
|
||||
|
||||
if not core.setting_get("menu_last_game") then
|
||||
local default_game = core.setting_get("default_game") or "minetest"
|
||||
core.setting_set("menu_last_game", default_game )
|
||||
end
|
||||
|
||||
mm_texture.init()
|
||||
else
|
||||
local world_list = core.get_worlds()
|
||||
|
||||
local found_singleplayerworld = false
|
||||
|
||||
for i,world in pairs(world_list) do
|
||||
if world.name == "singleplayerworld" then
|
||||
found_singleplayerworld = true
|
||||
gamedata.worldindex = i
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
if not found_singleplayerworld then
|
||||
core.create_world("singleplayerworld", 1)
|
||||
|
||||
local world_list = core.get_worlds()
|
||||
|
||||
for i,world in pairs(world_list) do
|
||||
if world.name == "singleplayerworld" then
|
||||
gamedata.worldindex = i
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Create main tabview
|
||||
local tv_main = tabview_create("maintab",{x=12,y=5.2},{x=0,y=0})
|
||||
if PLATFORM ~= "Android" then
|
||||
tv_main:set_autosave_tab(true)
|
||||
end
|
||||
if PLATFORM ~= "Android" then
|
||||
tv_main:add(tab_singleplayer)
|
||||
tv_main:add(tab_multiplayer)
|
||||
tv_main:add(tab_server)
|
||||
else
|
||||
tv_main:add(tab_simple_main)
|
||||
end
|
||||
tv_main:add(tab_settings)
|
||||
if PLATFORM ~= "Android" then
|
||||
tv_main:add(tab_texturepacks)
|
||||
end
|
||||
tv_main:add(tab_mods)
|
||||
tv_main:add(tab_credits)
|
||||
|
||||
tv_main:set_global_event_handler(main_event_handler)
|
||||
|
||||
tv_main:set_fixed_size(false)
|
||||
|
||||
if not (PLATFORM == "Android") then
|
||||
tv_main:set_tab(core.setting_get("maintab_LAST"))
|
||||
end
|
||||
ui.set_default("maintab")
|
||||
tv_main:show()
|
||||
|
||||
-- Create modstore ui
|
||||
if PLATFORM == "Android" then
|
||||
modstore.init({x=12, y=6}, 3, 2)
|
||||
else
|
||||
modstore.init({x=12, y=8}, 4, 3)
|
||||
end
|
||||
|
||||
ui.update()
|
||||
|
||||
core.sound_play("main_menu", true)
|
||||
end
|
||||
|
||||
init_globals()
|
||||
|
||||
4
builtin/mainmenu/init_simple.lua
Normal file
4
builtin/mainmenu/init_simple.lua
Normal file
@@ -0,0 +1,4 @@
|
||||
-- helper file to be able to debug the simple menu on PC
|
||||
-- without messing around with actual menu code!
|
||||
PLATFORM="Android"
|
||||
dofile("builtin/mainmenu/init.lua")
|
||||
566
builtin/mainmenu/modmgr.lua
Normal file
566
builtin/mainmenu/modmgr.lua
Normal file
@@ -0,0 +1,566 @@
|
||||
--Minetest
|
||||
--Copyright (C) 2013 sapier
|
||||
--
|
||||
--This program is free software; you can redistribute it and/or modify
|
||||
--it under the terms of the GNU Lesser General Public License as published by
|
||||
--the Free Software Foundation; either version 2.1 of the License, or
|
||||
--(at your option) any later version.
|
||||
--
|
||||
--This program is distributed in the hope that it will be useful,
|
||||
--but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
--GNU Lesser General Public License for more details.
|
||||
--
|
||||
--You should have received a copy of the GNU Lesser General Public License along
|
||||
--with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
--51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function get_mods(path,retval,modpack)
|
||||
local mods = core.get_dir_list(path, true)
|
||||
|
||||
for i=1, #mods, 1 do
|
||||
if mods[i]:sub(1,1) ~= "." then
|
||||
local toadd = {}
|
||||
local modpackfile = nil
|
||||
|
||||
toadd.name = mods[i]
|
||||
toadd.path = path .. DIR_DELIM .. mods[i] .. DIR_DELIM
|
||||
if modpack ~= nil and
|
||||
modpack ~= "" then
|
||||
toadd.modpack = modpack
|
||||
else
|
||||
local filename = path .. DIR_DELIM .. mods[i] .. DIR_DELIM .. "modpack.txt"
|
||||
local error = nil
|
||||
modpackfile,error = io.open(filename,"r")
|
||||
end
|
||||
|
||||
if modpackfile ~= nil then
|
||||
modpackfile:close()
|
||||
toadd.is_modpack = true
|
||||
table.insert(retval,toadd)
|
||||
get_mods(path .. DIR_DELIM .. mods[i],retval,mods[i])
|
||||
else
|
||||
table.insert(retval,toadd)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--modmanager implementation
|
||||
modmgr = {}
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function modmgr.extract(modfile)
|
||||
if modfile.type == "zip" then
|
||||
local tempfolder = os.tempfolder()
|
||||
|
||||
if tempfolder ~= nil and
|
||||
tempfolder ~= "" then
|
||||
core.create_dir(tempfolder)
|
||||
if core.extract_zip(modfile.name,tempfolder) then
|
||||
return tempfolder
|
||||
end
|
||||
end
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
function modmgr.getbasefolder(temppath)
|
||||
|
||||
if temppath == nil then
|
||||
return {
|
||||
type = "invalid",
|
||||
path = ""
|
||||
}
|
||||
end
|
||||
|
||||
local testfile = io.open(temppath .. DIR_DELIM .. "init.lua","r")
|
||||
if testfile ~= nil then
|
||||
testfile:close()
|
||||
return {
|
||||
type="mod",
|
||||
path=temppath
|
||||
}
|
||||
end
|
||||
|
||||
testfile = io.open(temppath .. DIR_DELIM .. "modpack.txt","r")
|
||||
if testfile ~= nil then
|
||||
testfile:close()
|
||||
return {
|
||||
type="modpack",
|
||||
path=temppath
|
||||
}
|
||||
end
|
||||
|
||||
local subdirs = core.get_dir_list(temppath, true)
|
||||
|
||||
--only single mod or modpack allowed
|
||||
if #subdirs ~= 1 then
|
||||
return {
|
||||
type = "invalid",
|
||||
path = ""
|
||||
}
|
||||
end
|
||||
|
||||
testfile =
|
||||
io.open(temppath .. DIR_DELIM .. subdirs[1] ..DIR_DELIM .."init.lua","r")
|
||||
if testfile ~= nil then
|
||||
testfile:close()
|
||||
return {
|
||||
type="mod",
|
||||
path= temppath .. DIR_DELIM .. subdirs[1]
|
||||
}
|
||||
end
|
||||
|
||||
testfile =
|
||||
io.open(temppath .. DIR_DELIM .. subdirs[1] ..DIR_DELIM .."modpack.txt","r")
|
||||
if testfile ~= nil then
|
||||
testfile:close()
|
||||
return {
|
||||
type="modpack",
|
||||
path=temppath .. DIR_DELIM .. subdirs[1]
|
||||
}
|
||||
end
|
||||
|
||||
return {
|
||||
type = "invalid",
|
||||
path = ""
|
||||
}
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function modmgr.isValidModname(modpath)
|
||||
if modpath:find("-") ~= nil then
|
||||
return false
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function modmgr.parse_register_line(line)
|
||||
local pos1 = line:find("\"")
|
||||
local pos2 = nil
|
||||
if pos1 ~= nil then
|
||||
pos2 = line:find("\"",pos1+1)
|
||||
end
|
||||
|
||||
if pos1 ~= nil and pos2 ~= nil then
|
||||
local item = line:sub(pos1+1,pos2-1)
|
||||
|
||||
if item ~= nil and
|
||||
item ~= "" then
|
||||
local pos3 = item:find(":")
|
||||
|
||||
if pos3 ~= nil then
|
||||
local retval = item:sub(1,pos3-1)
|
||||
if retval ~= nil and
|
||||
retval ~= "" then
|
||||
return retval
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function modmgr.parse_dofile_line(modpath,line)
|
||||
local pos1 = line:find("\"")
|
||||
local pos2 = nil
|
||||
if pos1 ~= nil then
|
||||
pos2 = line:find("\"",pos1+1)
|
||||
end
|
||||
|
||||
if pos1 ~= nil and pos2 ~= nil then
|
||||
local filename = line:sub(pos1+1,pos2-1)
|
||||
|
||||
if filename ~= nil and
|
||||
filename ~= "" and
|
||||
filename:find(".lua") then
|
||||
return modmgr.identify_modname(modpath,filename)
|
||||
end
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function modmgr.identify_modname(modpath,filename)
|
||||
local testfile = io.open(modpath .. DIR_DELIM .. filename,"r")
|
||||
if testfile ~= nil then
|
||||
local line = testfile:read()
|
||||
|
||||
while line~= nil do
|
||||
local modname = nil
|
||||
|
||||
if line:find("minetest.register_tool") then
|
||||
modname = modmgr.parse_register_line(line)
|
||||
end
|
||||
|
||||
if line:find("minetest.register_craftitem") then
|
||||
modname = modmgr.parse_register_line(line)
|
||||
end
|
||||
|
||||
|
||||
if line:find("minetest.register_node") then
|
||||
modname = modmgr.parse_register_line(line)
|
||||
end
|
||||
|
||||
if line:find("dofile") then
|
||||
modname = modmgr.parse_dofile_line(modpath,line)
|
||||
end
|
||||
|
||||
if modname ~= nil then
|
||||
testfile:close()
|
||||
return modname
|
||||
end
|
||||
|
||||
line = testfile:read()
|
||||
end
|
||||
testfile:close()
|
||||
end
|
||||
|
||||
return nil
|
||||
end
|
||||
--------------------------------------------------------------------------------
|
||||
function modmgr.render_modlist(render_list)
|
||||
local retval = ""
|
||||
|
||||
if render_list == nil then
|
||||
if modmgr.global_mods == nil then
|
||||
modmgr.refresh_globals()
|
||||
end
|
||||
render_list = modmgr.global_mods
|
||||
end
|
||||
|
||||
local list = render_list:get_list()
|
||||
local last_modpack = nil
|
||||
|
||||
for i,v in ipairs(list) do
|
||||
if retval ~= "" then
|
||||
retval = retval ..","
|
||||
end
|
||||
|
||||
local color = ""
|
||||
|
||||
if v.is_modpack then
|
||||
local rawlist = render_list:get_raw_list()
|
||||
|
||||
local all_enabled = true
|
||||
for j=1,#rawlist,1 do
|
||||
if rawlist[j].modpack == list[i].name and
|
||||
rawlist[j].enabled ~= true then
|
||||
all_enabled = false
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
if all_enabled == false then
|
||||
color = mt_color_grey
|
||||
else
|
||||
color = mt_color_dark_green
|
||||
end
|
||||
end
|
||||
|
||||
if v.typ == "game_mod" then
|
||||
color = mt_color_blue
|
||||
else
|
||||
if v.enabled then
|
||||
color = mt_color_green
|
||||
end
|
||||
end
|
||||
|
||||
retval = retval .. color
|
||||
if v.modpack ~= nil then
|
||||
retval = retval .. " "
|
||||
end
|
||||
retval = retval .. v.name
|
||||
end
|
||||
|
||||
return retval
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function modmgr.get_dependencies(modfolder)
|
||||
local toadd = ""
|
||||
if modfolder ~= nil then
|
||||
local filename = modfolder ..
|
||||
DIR_DELIM .. "depends.txt"
|
||||
|
||||
local dependencyfile = io.open(filename,"r")
|
||||
|
||||
if dependencyfile then
|
||||
local dependency = dependencyfile:read("*l")
|
||||
while dependency do
|
||||
if toadd ~= "" then
|
||||
toadd = toadd .. ","
|
||||
end
|
||||
toadd = toadd .. dependency
|
||||
dependency = dependencyfile:read()
|
||||
end
|
||||
dependencyfile:close()
|
||||
end
|
||||
end
|
||||
|
||||
return toadd
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function modmgr.get_worldconfig(worldpath)
|
||||
local filename = worldpath ..
|
||||
DIR_DELIM .. "world.mt"
|
||||
|
||||
local worldfile = Settings(filename)
|
||||
|
||||
local worldconfig = {}
|
||||
worldconfig.global_mods = {}
|
||||
worldconfig.game_mods = {}
|
||||
|
||||
for key,value in pairs(worldfile:to_table()) do
|
||||
if key == "gameid" then
|
||||
worldconfig.id = value
|
||||
elseif key:sub(0, 9) == "load_mod_" then
|
||||
worldconfig.global_mods[key] = core.is_yes(value)
|
||||
else
|
||||
worldconfig[key] = value
|
||||
end
|
||||
end
|
||||
|
||||
--read gamemods
|
||||
local gamespec = gamemgr.find_by_gameid(worldconfig.id)
|
||||
gamemgr.get_game_mods(gamespec, worldconfig.game_mods)
|
||||
|
||||
return worldconfig
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function modmgr.installmod(modfilename,basename)
|
||||
local modfile = modmgr.identify_filetype(modfilename)
|
||||
local modpath = modmgr.extract(modfile)
|
||||
|
||||
if modpath == nil then
|
||||
gamedata.errormessage = fgettext("Install Mod: file: \"$1\"", modfile.name) ..
|
||||
fgettext("\nInstall Mod: unsupported filetype \"$1\" or broken archive", modfile.type)
|
||||
return
|
||||
end
|
||||
|
||||
local basefolder = modmgr.getbasefolder(modpath)
|
||||
|
||||
if basefolder.type == "modpack" then
|
||||
local clean_path = nil
|
||||
|
||||
if basename ~= nil then
|
||||
clean_path = "mp_" .. basename
|
||||
end
|
||||
|
||||
if clean_path == nil then
|
||||
clean_path = get_last_folder(cleanup_path(basefolder.path))
|
||||
end
|
||||
|
||||
if clean_path ~= nil then
|
||||
local targetpath = core.get_modpath() .. DIR_DELIM .. clean_path
|
||||
if not core.copy_dir(basefolder.path,targetpath) then
|
||||
gamedata.errormessage = fgettext("Failed to install $1 to $2", basename, targetpath)
|
||||
end
|
||||
else
|
||||
gamedata.errormessage = fgettext("Install Mod: unable to find suitable foldername for modpack $1", modfilename)
|
||||
end
|
||||
end
|
||||
|
||||
if basefolder.type == "mod" then
|
||||
local targetfolder = basename
|
||||
|
||||
if targetfolder == nil then
|
||||
targetfolder = modmgr.identify_modname(basefolder.path,"init.lua")
|
||||
end
|
||||
|
||||
--if heuristic failed try to use current foldername
|
||||
if targetfolder == nil then
|
||||
targetfolder = get_last_folder(basefolder.path)
|
||||
end
|
||||
|
||||
if targetfolder ~= nil and modmgr.isValidModname(targetfolder) then
|
||||
local targetpath = core.get_modpath() .. DIR_DELIM .. targetfolder
|
||||
core.copy_dir(basefolder.path,targetpath)
|
||||
else
|
||||
gamedata.errormessage = fgettext("Install Mod: unable to find real modname for: $1", modfilename)
|
||||
end
|
||||
end
|
||||
|
||||
core.delete_dir(modpath)
|
||||
|
||||
modmgr.refresh_globals()
|
||||
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function modmgr.preparemodlist(data)
|
||||
local retval = {}
|
||||
|
||||
local global_mods = {}
|
||||
local game_mods = {}
|
||||
|
||||
--read global mods
|
||||
local modpath = core.get_modpath()
|
||||
|
||||
if modpath ~= nil and
|
||||
modpath ~= "" then
|
||||
get_mods(modpath,global_mods)
|
||||
end
|
||||
|
||||
for i=1,#global_mods,1 do
|
||||
global_mods[i].typ = "global_mod"
|
||||
table.insert(retval,global_mods[i])
|
||||
end
|
||||
|
||||
--read game mods
|
||||
local gamespec = gamemgr.find_by_gameid(data.gameid)
|
||||
gamemgr.get_game_mods(gamespec, game_mods)
|
||||
|
||||
for i=1,#game_mods,1 do
|
||||
game_mods[i].typ = "game_mod"
|
||||
table.insert(retval,game_mods[i])
|
||||
end
|
||||
|
||||
if data.worldpath == nil then
|
||||
return retval
|
||||
end
|
||||
|
||||
--read world mod configuration
|
||||
local filename = data.worldpath ..
|
||||
DIR_DELIM .. "world.mt"
|
||||
|
||||
local worldfile = Settings(filename)
|
||||
|
||||
for key,value in pairs(worldfile:to_table()) do
|
||||
if key:sub(1, 9) == "load_mod_" then
|
||||
key = key:sub(10)
|
||||
local element = nil
|
||||
for i=1,#retval,1 do
|
||||
if retval[i].name == key and
|
||||
not retval[i].is_modpack then
|
||||
element = retval[i]
|
||||
break
|
||||
end
|
||||
end
|
||||
if element ~= nil then
|
||||
element.enabled = core.is_yes(value)
|
||||
else
|
||||
core.log("info", "Mod: " .. key .. " " .. dump(value) .. " but not found")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return retval
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function modmgr.comparemod(elem1,elem2)
|
||||
if elem1 == nil or elem2 == nil then
|
||||
return false
|
||||
end
|
||||
if elem1.name ~= elem2.name then
|
||||
return false
|
||||
end
|
||||
if elem1.is_modpack ~= elem2.is_modpack then
|
||||
return false
|
||||
end
|
||||
if elem1.typ ~= elem2.typ then
|
||||
return false
|
||||
end
|
||||
if elem1.modpack ~= elem2.modpack then
|
||||
return false
|
||||
end
|
||||
|
||||
if elem1.path ~= elem2.path then
|
||||
return false
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function modmgr.mod_exists(basename)
|
||||
|
||||
if modmgr.global_mods == nil then
|
||||
modmgr.refresh_globals()
|
||||
end
|
||||
|
||||
if modmgr.global_mods:raw_index_by_uid(basename) > 0 then
|
||||
return true
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function modmgr.get_global_mod(idx)
|
||||
|
||||
if modmgr.global_mods == nil then
|
||||
return nil
|
||||
end
|
||||
|
||||
if idx == nil or idx < 1 or
|
||||
idx > modmgr.global_mods:size() then
|
||||
return nil
|
||||
end
|
||||
|
||||
return modmgr.global_mods:get_list()[idx]
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function modmgr.refresh_globals()
|
||||
modmgr.global_mods = filterlist.create(
|
||||
modmgr.preparemodlist, --refresh
|
||||
modmgr.comparemod, --compare
|
||||
function(element,uid) --uid match
|
||||
if element.name == uid then
|
||||
return true
|
||||
end
|
||||
end,
|
||||
nil, --filter
|
||||
{}
|
||||
)
|
||||
modmgr.global_mods:add_sort_mechanism("alphabetic", sort_mod_list)
|
||||
modmgr.global_mods:set_sortmode("alphabetic")
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function modmgr.identify_filetype(name)
|
||||
|
||||
if name:sub(-3):lower() == "zip" then
|
||||
return {
|
||||
name = name,
|
||||
type = "zip"
|
||||
}
|
||||
end
|
||||
|
||||
if name:sub(-6):lower() == "tar.gz" or
|
||||
name:sub(-3):lower() == "tgz"then
|
||||
return {
|
||||
name = name,
|
||||
type = "tgz"
|
||||
}
|
||||
end
|
||||
|
||||
if name:sub(-6):lower() == "tar.bz2" then
|
||||
return {
|
||||
name = name,
|
||||
type = "tbz"
|
||||
}
|
||||
end
|
||||
|
||||
if name:sub(-2):lower() == "7z" then
|
||||
return {
|
||||
name = name,
|
||||
type = "7z"
|
||||
}
|
||||
end
|
||||
|
||||
return {
|
||||
name = name,
|
||||
type = "ukn"
|
||||
}
|
||||
end
|
||||
614
builtin/mainmenu/store.lua
Normal file
614
builtin/mainmenu/store.lua
Normal file
@@ -0,0 +1,614 @@
|
||||
--Minetest
|
||||
--Copyright (C) 2013 sapier
|
||||
--
|
||||
--This program is free software; you can redistribute it and/or modify
|
||||
--it under the terms of the GNU Lesser General Public License as published by
|
||||
--the Free Software Foundation; either version 2.1 of the License, or
|
||||
--(at your option) any later version.
|
||||
--
|
||||
--This program is distributed in the hope that it will be useful,
|
||||
--but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
--GNU Lesser General Public License for more details.
|
||||
--
|
||||
--You should have received a copy of the GNU Lesser General Public License along
|
||||
--with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
--51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
--modstore implementation
|
||||
modstore = {}
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- @function [parent=#modstore] init
|
||||
function modstore.init(size, unsortedmods, searchmods)
|
||||
|
||||
modstore.mods_on_unsorted_page = unsortedmods
|
||||
modstore.mods_on_search_page = searchmods
|
||||
modstore.modsperpage = modstore.mods_on_unsorted_page
|
||||
|
||||
modstore.basetexturedir = core.get_texturepath() .. DIR_DELIM .. "base" ..
|
||||
DIR_DELIM .. "pack" .. DIR_DELIM
|
||||
|
||||
modstore.lastmodtitle = ""
|
||||
modstore.last_search = ""
|
||||
|
||||
modstore.searchlist = filterlist.create(
|
||||
function()
|
||||
if modstore.modlist_unsorted ~= nil and
|
||||
modstore.modlist_unsorted.data ~= nil then
|
||||
return modstore.modlist_unsorted.data
|
||||
end
|
||||
return {}
|
||||
end,
|
||||
function(element,modid)
|
||||
if element.id == modid then
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end, --compare fct
|
||||
nil, --uid match fct
|
||||
function(element,substring)
|
||||
if substring == nil or
|
||||
substring == "" then
|
||||
return false
|
||||
end
|
||||
substring = substring:upper()
|
||||
|
||||
if element.title ~= nil and
|
||||
element.title:upper():find(substring) ~= nil then
|
||||
return true
|
||||
end
|
||||
|
||||
if element.details ~= nil and
|
||||
element.details.author ~= nil and
|
||||
element.details.author:upper():find(substring) ~= nil then
|
||||
return true
|
||||
end
|
||||
|
||||
if element.details ~= nil and
|
||||
element.details.description ~= nil and
|
||||
element.details.description:upper():find(substring) ~= nil then
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end --filter fct
|
||||
)
|
||||
|
||||
modstore.current_list = nil
|
||||
|
||||
modstore.tv_store = tabview_create("modstore",size,{x=0,y=0})
|
||||
|
||||
modstore.tv_store:set_global_event_handler(modstore.handle_events)
|
||||
|
||||
modstore.tv_store:add(
|
||||
{
|
||||
name = "unsorted",
|
||||
caption = fgettext("Unsorted"),
|
||||
cbf_formspec = modstore.unsorted_tab,
|
||||
cbf_button_handler = modstore.handle_buttons,
|
||||
on_change =
|
||||
function() modstore.modsperpage = modstore.mods_on_unsorted_page end
|
||||
}
|
||||
)
|
||||
|
||||
modstore.tv_store:add(
|
||||
{
|
||||
name = "search",
|
||||
caption = fgettext("Search"),
|
||||
cbf_formspec = modstore.getsearchpage,
|
||||
cbf_button_handler = modstore.handle_buttons,
|
||||
on_change = modstore.activate_search_tab
|
||||
}
|
||||
)
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- @function [parent=#modstore] nametoindex
|
||||
function modstore.nametoindex(name)
|
||||
|
||||
for i=1,#modstore.tabnames,1 do
|
||||
if modstore.tabnames[i] == name then
|
||||
return i
|
||||
end
|
||||
end
|
||||
|
||||
return 1
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- @function [parent=#modstore] showdownloading
|
||||
function modstore.showdownloading(title)
|
||||
local new_dlg = dialog_create("store_downloading",
|
||||
function(data)
|
||||
return "size[6,2]label[0.25,0.75;" ..
|
||||
fgettext("Downloading $1, please wait...", data.title) .. "]"
|
||||
end,
|
||||
function(this,fields)
|
||||
if fields["btn_hidden_close_download"] ~= nil then
|
||||
if fields["btn_hidden_close_download"].successfull then
|
||||
modstore.lastmodentry = fields["btn_hidden_close_download"]
|
||||
modstore.successfulldialog(this)
|
||||
else
|
||||
this.parent:show()
|
||||
this:delete()
|
||||
modstore.lastmodtitle = ""
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
return false
|
||||
end,
|
||||
nil)
|
||||
|
||||
new_dlg:set_parent(modstore.tv_store)
|
||||
modstore.tv_store:hide()
|
||||
new_dlg.data.title = title
|
||||
new_dlg:show()
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- @function [parent=#modstore] successfulldialog
|
||||
function modstore.successfulldialog(downloading_dlg)
|
||||
local new_dlg = dialog_create("store_downloading",
|
||||
function(data)
|
||||
local retval = ""
|
||||
retval = retval .. "size[6,2,true]"
|
||||
if modstore.lastmodentry ~= nil then
|
||||
retval = retval .. "label[0,0.25;" .. fgettext("Successfully installed:") .. "]"
|
||||
retval = retval .. "label[3,0.25;" .. modstore.lastmodentry.moddetails.title .. "]"
|
||||
retval = retval .. "label[0,0.75;" .. fgettext("Shortname:") .. "]"
|
||||
retval = retval .. "label[3,0.75;" .. core.formspec_escape(modstore.lastmodentry.moddetails.basename) .. "]"
|
||||
end
|
||||
retval = retval .. "button[2.2,1.5;1.5,0.5;btn_confirm_mod_successfull;" .. fgettext("Ok") .. "]"
|
||||
return retval
|
||||
end,
|
||||
function(this,fields)
|
||||
if fields["btn_confirm_mod_successfull"] ~= nil then
|
||||
this.parent:show()
|
||||
downloading_dlg:delete()
|
||||
this:delete()
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
return false
|
||||
end,
|
||||
nil)
|
||||
|
||||
new_dlg:set_parent(modstore.tv_store)
|
||||
modstore.tv_store:hide()
|
||||
new_dlg:show()
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- @function [parent=#modstore] handle_buttons
|
||||
function modstore.handle_buttons(parent, fields, name, data)
|
||||
|
||||
if fields["btn_modstore_page_up"] then
|
||||
if modstore.current_list ~= nil and modstore.current_list.page > 0 then
|
||||
modstore.current_list.page = modstore.current_list.page - 1
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
if fields["btn_modstore_page_down"] then
|
||||
if modstore.current_list ~= nil and
|
||||
modstore.current_list.page <modstore.current_list.pagecount-1 then
|
||||
modstore.current_list.page = modstore.current_list.page +1
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
if fields["btn_modstore_search"] or
|
||||
(fields["key_enter"] and fields["te_modstore_search"] ~= nil) then
|
||||
modstore.last_search = fields["te_modstore_search"]
|
||||
filterlist.set_filtercriteria(modstore.searchlist,fields["te_modstore_search"])
|
||||
filterlist.refresh(modstore.searchlist)
|
||||
modstore.currentlist = {
|
||||
page = 0,
|
||||
pagecount = math.ceil(filterlist.size(modstore.searchlist) / modstore.modsperpage),
|
||||
data = filterlist.get_list(modstore.searchlist),
|
||||
}
|
||||
return true
|
||||
end
|
||||
|
||||
if fields["btn_modstore_close"] then
|
||||
local maintab = ui.find_by_name("maintab")
|
||||
parent:hide()
|
||||
maintab:show()
|
||||
return true
|
||||
end
|
||||
|
||||
for key,value in pairs(fields) do
|
||||
local foundat = key:find("btn_install_mod_")
|
||||
if ( foundat == 1) then
|
||||
local modid = tonumber(key:sub(17))
|
||||
for i=1,#modstore.modlist_unsorted.data,1 do
|
||||
if modstore.modlist_unsorted.data[i].id == modid then
|
||||
local moddetails = modstore.modlist_unsorted.data[i].details
|
||||
modstore.lastmodtitle = moddetails.title
|
||||
|
||||
if not core.handle_async(
|
||||
function(param)
|
||||
local fullurl = core.setting_get("modstore_download_url") ..
|
||||
param.moddetails.download_url
|
||||
|
||||
if param.version ~= nil then
|
||||
local found = false
|
||||
for i=1,#param.moddetails.versions, 1 do
|
||||
if param.moddetails.versions[i].date:sub(1,10) == param.version then
|
||||
fullurl = core.setting_get("modstore_download_url") ..
|
||||
param.moddetails.versions[i].download_url
|
||||
found = true
|
||||
end
|
||||
end
|
||||
|
||||
if not found then
|
||||
core.log("error","no download url found for version " .. dump(param.version))
|
||||
return {
|
||||
moddetails = param.moddetails,
|
||||
successfull = false
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
if core.download_file(fullurl,param.filename) then
|
||||
return {
|
||||
texturename = param.texturename,
|
||||
moddetails = param.moddetails,
|
||||
filename = param.filename,
|
||||
successfull = true
|
||||
}
|
||||
else
|
||||
core.log("error","downloading " .. dump(fullurl) .. " failed")
|
||||
return {
|
||||
moddetails = param.moddetails,
|
||||
successfull = false
|
||||
}
|
||||
end
|
||||
end,
|
||||
{
|
||||
moddetails = moddetails,
|
||||
version = fields["dd_version" .. modid],
|
||||
filename = os.tempfolder() .. "_MODNAME_" .. moddetails.basename .. ".zip",
|
||||
texturename = modstore.modlist_unsorted.data[i].texturename
|
||||
},
|
||||
function(result)
|
||||
--print("Result from async: " .. dump(result.successfull))
|
||||
if result.successfull then
|
||||
modmgr.installmod(result.filename,result.moddetails.basename)
|
||||
os.remove(result.filename)
|
||||
else
|
||||
gamedata.errormessage = "Failed to download " .. result.moddetails.title
|
||||
end
|
||||
|
||||
if gamedata.errormessage == nil then
|
||||
core.button_handler({btn_hidden_close_download=result})
|
||||
else
|
||||
core.button_handler({btn_hidden_close_download={successfull=false}})
|
||||
end
|
||||
end
|
||||
) then
|
||||
print("ERROR: async event failed")
|
||||
gamedata.errormessage = "Failed to download " .. modstore.lastmodtitle
|
||||
end
|
||||
|
||||
modstore.showdownloading(modstore.lastmodtitle)
|
||||
return true
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- @function [parent=#modstore] handle_events
|
||||
function modstore.handle_events(this,event)
|
||||
if (event == "MenuQuit") then
|
||||
this:hide()
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- @function [parent=#modstore] update_modlist
|
||||
function modstore.update_modlist()
|
||||
modstore.modlist_unsorted = {}
|
||||
modstore.modlist_unsorted.data = {}
|
||||
modstore.modlist_unsorted.pagecount = 1
|
||||
modstore.modlist_unsorted.page = 0
|
||||
|
||||
core.handle_async(
|
||||
function(param)
|
||||
return core.get_modstore_list()
|
||||
end,
|
||||
nil,
|
||||
function(result)
|
||||
if result ~= nil then
|
||||
modstore.modlist_unsorted = {}
|
||||
modstore.modlist_unsorted.data = result
|
||||
|
||||
if modstore.modlist_unsorted.data ~= nil then
|
||||
modstore.modlist_unsorted.pagecount =
|
||||
math.ceil((#modstore.modlist_unsorted.data / modstore.modsperpage))
|
||||
else
|
||||
modstore.modlist_unsorted.data = {}
|
||||
modstore.modlist_unsorted.pagecount = 1
|
||||
end
|
||||
modstore.modlist_unsorted.page = 0
|
||||
modstore.fetchdetails()
|
||||
core.event_handler("Refresh")
|
||||
end
|
||||
end
|
||||
)
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- @function [parent=#modstore] fetchdetails
|
||||
function modstore.fetchdetails()
|
||||
|
||||
for i=1,#modstore.modlist_unsorted.data,1 do
|
||||
core.handle_async(
|
||||
function(param)
|
||||
param.details = core.get_modstore_details(tostring(param.modid))
|
||||
return param
|
||||
end,
|
||||
{
|
||||
modid=modstore.modlist_unsorted.data[i].id,
|
||||
listindex=i
|
||||
},
|
||||
function(result)
|
||||
if result ~= nil and
|
||||
modstore.modlist_unsorted ~= nil
|
||||
and modstore.modlist_unsorted.data ~= nil and
|
||||
modstore.modlist_unsorted.data[result.listindex] ~= nil and
|
||||
modstore.modlist_unsorted.data[result.listindex].id ~= nil then
|
||||
|
||||
modstore.modlist_unsorted.data[result.listindex].details = result.details
|
||||
core.event_handler("Refresh")
|
||||
end
|
||||
end
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- @function [parent=#modstore] getscreenshot
|
||||
function modstore.getscreenshot(ypos,listentry)
|
||||
|
||||
if listentry.details ~= nil and
|
||||
(listentry.details.screenshot_url == nil or
|
||||
listentry.details.screenshot_url == "") then
|
||||
|
||||
if listentry.texturename == nil then
|
||||
listentry.texturename = defaulttexturedir .. "no_screenshot.png"
|
||||
end
|
||||
|
||||
return "image[0,".. ypos .. ";3,2;" ..
|
||||
core.formspec_escape(listentry.texturename) .. "]"
|
||||
end
|
||||
|
||||
if listentry.details ~= nil and
|
||||
listentry.texturename == nil then
|
||||
--make sure we don't download multiple times
|
||||
listentry.texturename = "in progress"
|
||||
|
||||
--prepare url and filename
|
||||
local fullurl = core.setting_get("modstore_download_url") ..
|
||||
listentry.details.screenshot_url
|
||||
local filename = os.tempfolder() .. "_MID_" .. listentry.id
|
||||
|
||||
--trigger download
|
||||
core.handle_async(
|
||||
--first param is downloadfct
|
||||
function(param)
|
||||
param.successfull = core.download_file(param.fullurl,param.filename)
|
||||
return param
|
||||
end,
|
||||
--second parameter is data passed to async job
|
||||
{
|
||||
fullurl = fullurl,
|
||||
filename = filename,
|
||||
modid = listentry.id
|
||||
},
|
||||
--integrate result to raw list
|
||||
function(result)
|
||||
if result.successfull then
|
||||
local found = false
|
||||
for i=1,#modstore.modlist_unsorted.data,1 do
|
||||
if modstore.modlist_unsorted.data[i].id == result.modid then
|
||||
found = true
|
||||
modstore.modlist_unsorted.data[i].texturename = result.filename
|
||||
break
|
||||
end
|
||||
end
|
||||
if found then
|
||||
core.event_handler("Refresh")
|
||||
else
|
||||
core.log("error","got screenshot but didn't find matching mod: " .. result.modid)
|
||||
end
|
||||
end
|
||||
end
|
||||
)
|
||||
end
|
||||
|
||||
if listentry.texturename ~= nil and
|
||||
listentry.texturename ~= "in progress" then
|
||||
return "image[0,".. ypos .. ";3,2;" ..
|
||||
core.formspec_escape(listentry.texturename) .. "]"
|
||||
end
|
||||
|
||||
return ""
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
--@function [parent=#modstore] getshortmodinfo
|
||||
function modstore.getshortmodinfo(ypos,listentry,details)
|
||||
local retval = ""
|
||||
|
||||
retval = retval .. "box[0," .. ypos .. ";11.4,1.75;#FFFFFF]"
|
||||
|
||||
--screenshot
|
||||
retval = retval .. modstore.getscreenshot(ypos,listentry)
|
||||
|
||||
--title + author
|
||||
retval = retval .."label[2.75," .. ypos .. ";" ..
|
||||
core.formspec_escape(details.title) .. " (" .. details.author .. ")]"
|
||||
|
||||
--description
|
||||
local descriptiony = ypos + 0.5
|
||||
retval = retval .. "textarea[3," .. descriptiony .. ";6.5,1.55;;" ..
|
||||
core.formspec_escape(details.description) .. ";]"
|
||||
|
||||
--rating
|
||||
local ratingy = ypos
|
||||
retval = retval .."label[7," .. ratingy .. ";" ..
|
||||
fgettext("Rating") .. ":]"
|
||||
retval = retval .. "label[8.7," .. ratingy .. ";" .. details.rating .."]"
|
||||
|
||||
--versions (IMPORTANT has to be defined AFTER rating)
|
||||
if details.versions ~= nil and
|
||||
#details.versions > 1 then
|
||||
local versiony = ypos + 0.05
|
||||
retval = retval .. "dropdown[9.1," .. versiony .. ";2.48,0.25;dd_version" .. details.id .. ";"
|
||||
local versions = ""
|
||||
for i=1,#details.versions , 1 do
|
||||
if versions ~= "" then
|
||||
versions = versions .. ","
|
||||
end
|
||||
|
||||
versions = versions .. details.versions[i].date:sub(1,10)
|
||||
end
|
||||
retval = retval .. versions .. ";1]"
|
||||
end
|
||||
|
||||
if details.basename then
|
||||
--install button
|
||||
local buttony = ypos + 1.2
|
||||
retval = retval .."button[9.1," .. buttony .. ";2.5,0.5;btn_install_mod_" .. details.id .. ";"
|
||||
|
||||
if modmgr.mod_exists(details.basename) then
|
||||
retval = retval .. fgettext("re-Install") .."]"
|
||||
else
|
||||
retval = retval .. fgettext("Install") .."]"
|
||||
end
|
||||
end
|
||||
|
||||
return retval
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
--@function [parent=#modstore] getmodlist
|
||||
function modstore.getmodlist(list,yoffset)
|
||||
modstore.current_list = list
|
||||
|
||||
if yoffset == nil then
|
||||
yoffset = 0
|
||||
end
|
||||
|
||||
local sb_y_start = 0.2 + yoffset
|
||||
local sb_y_end = (modstore.modsperpage * 1.75) + ((modstore.modsperpage-1) * 0.15)
|
||||
local close_button = "button[4," .. (sb_y_end + 0.3 + yoffset) ..
|
||||
";4,0.5;btn_modstore_close;" .. fgettext("Close store") .. "]"
|
||||
|
||||
if #list.data == 0 then
|
||||
return close_button
|
||||
end
|
||||
|
||||
local scrollbar = ""
|
||||
scrollbar = scrollbar .. "label[0.1,".. (sb_y_end + 0.25 + yoffset) ..";"
|
||||
.. fgettext("Page $1 of $2", list.page+1, list.pagecount) .. "]"
|
||||
scrollbar = scrollbar .. "box[11.6," .. sb_y_start .. ";0.28," .. sb_y_end .. ";#000000]"
|
||||
local scrollbarpos = (sb_y_start + 0.5) +
|
||||
((sb_y_end -1.6)/(list.pagecount-1)) * list.page
|
||||
scrollbar = scrollbar .. "box[11.6," ..scrollbarpos .. ";0.28,0.5;#32CD32]"
|
||||
scrollbar = scrollbar .. "button[11.6," .. (sb_y_start)
|
||||
.. ";0.5,0.5;btn_modstore_page_up;^]"
|
||||
scrollbar = scrollbar .. "button[11.6," .. (sb_y_start + sb_y_end - 0.5)
|
||||
.. ";0.5,0.5;btn_modstore_page_down;v]"
|
||||
|
||||
local retval = ""
|
||||
|
||||
local endmod = (list.page * modstore.modsperpage) + modstore.modsperpage
|
||||
|
||||
if (endmod > #list.data) then
|
||||
endmod = #list.data
|
||||
end
|
||||
|
||||
for i=(list.page * modstore.modsperpage) +1, endmod, 1 do
|
||||
--getmoddetails
|
||||
local details = list.data[i].details
|
||||
|
||||
if details == nil then
|
||||
details = {}
|
||||
details.title = list.data[i].title
|
||||
details.author = ""
|
||||
details.rating = -1
|
||||
details.description = ""
|
||||
end
|
||||
|
||||
if details ~= nil then
|
||||
local screenshot_ypos =
|
||||
yoffset +(i-1 - (list.page * modstore.modsperpage))*1.9 +0.2
|
||||
|
||||
retval = retval .. modstore.getshortmodinfo(screenshot_ypos,
|
||||
list.data[i],
|
||||
details)
|
||||
end
|
||||
end
|
||||
|
||||
return retval .. scrollbar .. close_button
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
--@function [parent=#modstore] getsearchpage
|
||||
function modstore.getsearchpage(tabview, name, tabdata)
|
||||
local retval = ""
|
||||
local search = ""
|
||||
|
||||
if modstore.last_search ~= nil then
|
||||
search = modstore.last_search
|
||||
end
|
||||
|
||||
retval = retval ..
|
||||
"button[9.5,0.2;2.5,0.5;btn_modstore_search;".. fgettext("Search") .. "]" ..
|
||||
"field[0.5,0.5;9,0.5;te_modstore_search;;" .. search .. "]"
|
||||
|
||||
retval = retval ..
|
||||
modstore.getmodlist(
|
||||
modstore.currentlist,
|
||||
1.75)
|
||||
|
||||
return retval;
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
--@function [parent=#modstore] unsorted_tab
|
||||
function modstore.unsorted_tab()
|
||||
return modstore.getmodlist(modstore.modlist_unsorted)
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
--@function [parent=#modstore] activate_search_tab
|
||||
function modstore.activate_search_tab(type, old_tab, new_tab)
|
||||
|
||||
if old_tab == new_tab then
|
||||
return
|
||||
end
|
||||
filterlist.set_filtercriteria(modstore.searchlist,modstore.last_search)
|
||||
filterlist.refresh(modstore.searchlist)
|
||||
modstore.modsperpage = modstore.mods_on_search_page
|
||||
modstore.currentlist = {
|
||||
page = 0,
|
||||
pagecount =
|
||||
math.ceil(filterlist.size(modstore.searchlist) / modstore.modsperpage),
|
||||
data = filterlist.get_list(modstore.searchlist),
|
||||
}
|
||||
end
|
||||
|
||||
80
builtin/mainmenu/tab_credits.lua
Normal file
80
builtin/mainmenu/tab_credits.lua
Normal file
@@ -0,0 +1,80 @@
|
||||
--Minetest
|
||||
--Copyright (C) 2013 sapier
|
||||
--
|
||||
--This program is free software; you can redistribute it and/or modify
|
||||
--it under the terms of the GNU Lesser General Public License as published by
|
||||
--the Free Software Foundation; either version 2.1 of the License, or
|
||||
--(at your option) any later version.
|
||||
--
|
||||
--This program is distributed in the hope that it will be useful,
|
||||
--but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
--GNU Lesser General Public License for more details.
|
||||
--
|
||||
--You should have received a copy of the GNU Lesser General Public License along
|
||||
--with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
--51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
tab_credits = {
|
||||
name = "credits",
|
||||
caption = fgettext("Credits"),
|
||||
cbf_formspec = function (tabview, name, tabdata)
|
||||
local logofile = defaulttexturedir .. "logo.png"
|
||||
return "label[0.5,3.2;Minetest " .. core.get_version() .. "]" ..
|
||||
"label[0.5,3.5;http://minetest.net]" ..
|
||||
"image[0.5,1;" .. core.formspec_escape(logofile) .. "]" ..
|
||||
"tablecolumns[color;text]" ..
|
||||
"tableoptions[background=#00000000;highlight=#00000000;border=false]" ..
|
||||
"table[3.5,-0.25;8.5,5.8;list_credits;" ..
|
||||
"#FFFF00," .. fgettext("Core Developers") .."," ..
|
||||
",Perttu Ahola (celeron55) <celeron55@gmail.com>,"..
|
||||
",Ryan Kwolek (kwolekr) <kwolekr@minetest.net>,"..
|
||||
",PilzAdam <pilzadam@minetest.net>," ..
|
||||
",sfan5 <sfan5@live.de>,"..
|
||||
",kahrl <kahrl@gmx.net>,"..
|
||||
",sapier,"..
|
||||
",ShadowNinja <shadowninja@minetest.net>,"..
|
||||
",Nathanael Courant (Nore/Ekdohibs) <nore@mesecons.net>,"..
|
||||
",BlockMen,"..
|
||||
",Craig Robbins (Zeno),"..
|
||||
",Loic Blot (nerzhul/nrz) <loic.blot@unix-experience.fr>,"..
|
||||
",Mat Gregory (paramat),"..
|
||||
",est31 <MTest31@outlook.com>," ..
|
||||
",,"..
|
||||
"#FFFF00," .. fgettext("Active Contributors") .. "," ..
|
||||
",SmallJoker <mk939@ymail.com>," ..
|
||||
",Andrew Ward (rubenwardy) <rubenwardy@gmail.com>," ..
|
||||
",Aaron Suen <warr1024@gmail.com>," ..
|
||||
",Sokomine <wegwerf@anarres.dyndns.org>," ..
|
||||
",Břetislav Štec (TeTpaAka)," ..
|
||||
",Jean-Patrick G (kilbith) <jeanpatrick.guerrero@gmail.com>," ..
|
||||
",Rui <mrrst0914@gmail.com>," ..
|
||||
",Diego Martinez (kaeza) <kaeza@users.sf.net>," ..
|
||||
",," ..
|
||||
"#FFFF00," .. fgettext("Previous Core Developers") .."," ..
|
||||
",Maciej Kasatkin (RealBadAngel) <maciej.kasatkin@o2.pl>,"..
|
||||
",Lisa Milne (darkrose) <lisa@ltmnet.com>," ..
|
||||
",proller," ..
|
||||
",Ilya Zhuravlev (xyz) <xyz@minetest.net>," ..
|
||||
",," ..
|
||||
"#FFFF00," .. fgettext("Previous Contributors") .. "," ..
|
||||
",Vanessa Ezekowitz (VanessaE) <vanessaezekowitz@gmail.com>,"..
|
||||
",Jurgen Doser (doserj) <jurgen.doser@gmail.com>,"..
|
||||
",Gregory Currie (gregorycu)," ..
|
||||
",Jeija <jeija@mesecons.net>,"..
|
||||
",MirceaKitsune <mirceakitsune@gmail.com>,"..
|
||||
",dannydark <the_skeleton_of_a_child@yahoo.co.uk>,"..
|
||||
",0gb.us <0gb.us@0gb.us>,"..
|
||||
",Guiseppe Bilotta (Oblomov) <guiseppe.bilotta@gmail.com>,"..
|
||||
",Jonathan Neuschafer <j.neuschaefer@gmx.net>,"..
|
||||
",Nils Dagsson Moskopp (erlehmann) <nils@dieweltistgarnichtso.net>,"..
|
||||
",Constantin Wenger (SpeedProg) <constantin.wenger@googlemail.com>,"..
|
||||
",matttpt <matttpt@gmail.com>,"..
|
||||
",JacobF <queatz@gmail.com>,"..
|
||||
",TriBlade9 <triblade9@mail.com>,"..
|
||||
",Zefram <zefram@fysh.org>,"..
|
||||
";1]"
|
||||
end
|
||||
}
|
||||
172
builtin/mainmenu/tab_mods.lua
Normal file
172
builtin/mainmenu/tab_mods.lua
Normal file
@@ -0,0 +1,172 @@
|
||||
--Minetest
|
||||
--Copyright (C) 2014 sapier
|
||||
--
|
||||
--This program is free software; you can redistribute it and/or modify
|
||||
--it under the terms of the GNU Lesser General Public License as published by
|
||||
--the Free Software Foundation; either version 2.1 of the License, or
|
||||
--(at your option) any later version.
|
||||
--
|
||||
--This program is distributed in the hope that it will be useful,
|
||||
--but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
--GNU Lesser General Public License for more details.
|
||||
--
|
||||
--You should have received a copy of the GNU Lesser General Public License along
|
||||
--with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
--51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
local function get_formspec(tabview, name, tabdata)
|
||||
|
||||
if modmgr.global_mods == nil then
|
||||
modmgr.refresh_globals()
|
||||
end
|
||||
|
||||
if tabdata.selected_mod == nil then
|
||||
tabdata.selected_mod = 1
|
||||
end
|
||||
|
||||
local retval =
|
||||
"label[0.05,-0.25;".. fgettext("Installed Mods:") .. "]" ..
|
||||
"textlist[0,0.25;5.1,4.35;modlist;" ..
|
||||
modmgr.render_modlist(modmgr.global_mods) ..
|
||||
";" .. tabdata.selected_mod .. "]"
|
||||
|
||||
retval = retval ..
|
||||
-- "label[0.8,4.2;" .. fgettext("Add mod:") .. "]" ..
|
||||
-- TODO Disabled due to upcoming release 0.4.8 and irrlicht messing up localization
|
||||
-- "button[0.75,4.85;1.8,0.5;btn_mod_mgr_install_local;".. fgettext("Local install") .. "]" ..
|
||||
|
||||
-- TODO Disabled due to service being offline, and not likely to come online again, in this form
|
||||
-- "button[0,4.85;5.25,0.5;btn_modstore;".. fgettext("Online mod repository") .. "]"
|
||||
""
|
||||
|
||||
local selected_mod = nil
|
||||
|
||||
if filterlist.size(modmgr.global_mods) >= tabdata.selected_mod then
|
||||
selected_mod = modmgr.global_mods:get_list()[tabdata.selected_mod]
|
||||
end
|
||||
|
||||
if selected_mod ~= nil then
|
||||
local modscreenshot = nil
|
||||
|
||||
--check for screenshot beeing available
|
||||
local screenshotfilename = selected_mod.path .. DIR_DELIM .. "screenshot.png"
|
||||
local error = nil
|
||||
local screenshotfile,error = io.open(screenshotfilename,"r")
|
||||
if error == nil then
|
||||
screenshotfile:close()
|
||||
modscreenshot = screenshotfilename
|
||||
end
|
||||
|
||||
if modscreenshot == nil then
|
||||
modscreenshot = defaulttexturedir .. "no_screenshot.png"
|
||||
end
|
||||
|
||||
retval = retval
|
||||
.. "image[5.5,0;3,2;" .. core.formspec_escape(modscreenshot) .. "]"
|
||||
.. "label[8.25,0.6;" .. selected_mod.name .. "]"
|
||||
|
||||
local descriptionlines = nil
|
||||
error = nil
|
||||
local descriptionfilename = selected_mod.path .. "description.txt"
|
||||
local descriptionfile,error = io.open(descriptionfilename,"r")
|
||||
if error == nil then
|
||||
local descriptiontext = descriptionfile:read("*all")
|
||||
|
||||
descriptionlines = core.splittext(descriptiontext,42)
|
||||
descriptionfile:close()
|
||||
else
|
||||
descriptionlines = {}
|
||||
table.insert(descriptionlines,fgettext("No mod description available"))
|
||||
end
|
||||
|
||||
retval = retval ..
|
||||
"label[5.5,1.7;".. fgettext("Mod information:") .. "]" ..
|
||||
"textlist[5.5,2.2;6.2,2.4;description;"
|
||||
|
||||
for i=1,#descriptionlines,1 do
|
||||
retval = retval .. core.formspec_escape(descriptionlines[i]) .. ","
|
||||
end
|
||||
|
||||
|
||||
if selected_mod.is_modpack then
|
||||
retval = retval .. ";0]" ..
|
||||
"button[10,4.85;2,0.5;btn_mod_mgr_rename_modpack;" ..
|
||||
fgettext("Rename") .. "]"
|
||||
retval = retval .. "button[5.5,4.85;4.5,0.5;btn_mod_mgr_delete_mod;"
|
||||
.. fgettext("Uninstall selected modpack") .. "]"
|
||||
else
|
||||
--show dependencies
|
||||
|
||||
retval = retval .. "," .. fgettext("Depends:") .. ","
|
||||
|
||||
local toadd = modmgr.get_dependencies(selected_mod.path)
|
||||
|
||||
retval = retval .. toadd .. ";0]"
|
||||
|
||||
retval = retval .. "button[5.5,4.85;4.5,0.5;btn_mod_mgr_delete_mod;"
|
||||
.. fgettext("Uninstall selected mod") .. "]"
|
||||
end
|
||||
end
|
||||
return retval
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
local function handle_buttons(tabview, fields, tabname, tabdata)
|
||||
if fields["modlist"] ~= nil then
|
||||
local event = core.explode_textlist_event(fields["modlist"])
|
||||
tabdata.selected_mod = event.index
|
||||
return true
|
||||
end
|
||||
|
||||
if fields["btn_mod_mgr_install_local"] ~= nil then
|
||||
core.show_file_open_dialog("mod_mgt_open_dlg",fgettext("Select Mod File:"))
|
||||
return true
|
||||
end
|
||||
|
||||
if fields["btn_modstore"] ~= nil then
|
||||
local modstore_ui = ui.find_by_name("modstore")
|
||||
if modstore_ui ~= nil then
|
||||
tabview:hide()
|
||||
modstore.update_modlist()
|
||||
modstore_ui:show()
|
||||
else
|
||||
print("modstore ui element not found")
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
if fields["btn_mod_mgr_rename_modpack"] ~= nil then
|
||||
local dlg_renamemp = create_rename_modpack_dlg(tabdata.selected_mod)
|
||||
dlg_renamemp:set_parent(tabview)
|
||||
tabview:hide()
|
||||
dlg_renamemp:show()
|
||||
return true
|
||||
end
|
||||
|
||||
if fields["btn_mod_mgr_delete_mod"] ~= nil then
|
||||
local dlg_delmod = create_delete_mod_dlg(tabdata.selected_mod)
|
||||
dlg_delmod:set_parent(tabview)
|
||||
tabview:hide()
|
||||
dlg_delmod:show()
|
||||
return true
|
||||
end
|
||||
|
||||
if fields["mod_mgt_open_dlg_accepted"] ~= nil and
|
||||
fields["mod_mgt_open_dlg_accepted"] ~= "" then
|
||||
modmgr.installmod(fields["mod_mgt_open_dlg_accepted"],nil)
|
||||
return true
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
tab_mods = {
|
||||
name = "mods",
|
||||
caption = fgettext("Mods"),
|
||||
cbf_formspec = get_formspec,
|
||||
cbf_button_handler = handle_buttons,
|
||||
on_change = gamemgr.update_gamelist
|
||||
}
|
||||
261
builtin/mainmenu/tab_multiplayer.lua
Normal file
261
builtin/mainmenu/tab_multiplayer.lua
Normal file
@@ -0,0 +1,261 @@
|
||||
--Minetest
|
||||
--Copyright (C) 2014 sapier
|
||||
--
|
||||
--This program is free software; you can redistribute it and/or modify
|
||||
--it under the terms of the GNU Lesser General Public License as published by
|
||||
--the Free Software Foundation; either version 2.1 of the License, or
|
||||
--(at your option) any later version.
|
||||
--
|
||||
--This program is distributed in the hope that it will be useful,
|
||||
--but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
--GNU Lesser General Public License for more details.
|
||||
--
|
||||
--You should have received a copy of the GNU Lesser General Public License along
|
||||
--with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
--51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
local function get_formspec(tabview, name, tabdata)
|
||||
local render_details = core.is_yes(core.setting_getbool("public_serverlist"))
|
||||
|
||||
local retval =
|
||||
"label[7.75,-0.15;" .. fgettext("Address / Port :") .. "]" ..
|
||||
"label[7.75,1.05;" .. fgettext("Name / Password :") .. "]" ..
|
||||
"field[8,0.75;3.4,0.5;te_address;;" ..
|
||||
core.formspec_escape(core.setting_get("address")) .. "]" ..
|
||||
"field[11.25,0.75;1.3,0.5;te_port;;" ..
|
||||
core.formspec_escape(core.setting_get("remote_port")) .. "]" ..
|
||||
"checkbox[0,4.85;cb_public_serverlist;" .. fgettext("Public Serverlist") .. ";" ..
|
||||
dump(core.setting_getbool("public_serverlist")) .. "]"
|
||||
|
||||
if not core.setting_getbool("public_serverlist") then
|
||||
retval = retval ..
|
||||
"button[8,4.9;2,0.5;btn_delete_favorite;" .. fgettext("Delete") .. "]"
|
||||
end
|
||||
|
||||
retval = retval ..
|
||||
"button[10,4.9;2,0.5;btn_mp_connect;" .. fgettext("Connect") .. "]" ..
|
||||
"field[8,1.95;2.95,0.5;te_name;;" ..
|
||||
core.formspec_escape(core.setting_get("name")) .. "]" ..
|
||||
"pwdfield[10.78,1.95;1.77,0.5;te_pwd;]" ..
|
||||
"box[7.73,2.35;4.3,2.28;#999999]" ..
|
||||
"textarea[8.1,2.4;4.26,2.6;;"
|
||||
|
||||
if tabdata.fav_selected ~= nil and
|
||||
menudata.favorites[tabdata.fav_selected] ~= nil and
|
||||
menudata.favorites[tabdata.fav_selected].description ~= nil then
|
||||
retval = retval ..
|
||||
core.formspec_escape(menudata.favorites[tabdata.fav_selected].description,true)
|
||||
end
|
||||
|
||||
retval = retval ..
|
||||
";]"
|
||||
|
||||
--favourites
|
||||
if render_details then
|
||||
retval = retval .. "tablecolumns[" ..
|
||||
"color,span=3;" ..
|
||||
"text,align=right;" .. -- clients
|
||||
"text,align=center,padding=0.25;" .. -- "/"
|
||||
"text,align=right,padding=0.25;" .. -- clients_max
|
||||
image_column(fgettext("Creative mode"), "creative") .. ",padding=1;" ..
|
||||
image_column(fgettext("Damage enabled"), "damage") .. ",padding=0.25;" ..
|
||||
image_column(fgettext("PvP enabled"), "pvp") .. ",padding=0.25;" ..
|
||||
"color,span=1;" ..
|
||||
"text,padding=1]" -- name
|
||||
else
|
||||
retval = retval .. "tablecolumns[text]"
|
||||
end
|
||||
retval = retval ..
|
||||
"table[-0.15,-0.1;7.75,5;favourites;"
|
||||
|
||||
if #menudata.favorites > 0 then
|
||||
retval = retval .. render_favorite(menudata.favorites[1],render_details)
|
||||
|
||||
for i=2,#menudata.favorites,1 do
|
||||
retval = retval .. "," .. render_favorite(menudata.favorites[i],render_details)
|
||||
end
|
||||
end
|
||||
|
||||
if tabdata.fav_selected ~= nil then
|
||||
retval = retval .. ";" .. tabdata.fav_selected .. "]"
|
||||
else
|
||||
retval = retval .. ";0]"
|
||||
end
|
||||
|
||||
return retval
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
local function main_button_handler(tabview, fields, name, tabdata)
|
||||
if fields["te_name"] ~= nil then
|
||||
gamedata.playername = fields["te_name"]
|
||||
core.setting_set("name", fields["te_name"])
|
||||
end
|
||||
|
||||
if fields["favourites"] ~= nil then
|
||||
local event = core.explode_table_event(fields["favourites"])
|
||||
if event.type == "DCL" then
|
||||
if event.row <= #menudata.favorites then
|
||||
if not is_server_protocol_compat_or_error(menudata.favorites[event.row].proto_min,
|
||||
menudata.favorites[event.row].proto_max) then
|
||||
return true
|
||||
end
|
||||
gamedata.address = menudata.favorites[event.row].address
|
||||
gamedata.port = menudata.favorites[event.row].port
|
||||
gamedata.playername = fields["te_name"]
|
||||
if fields["te_pwd"] ~= nil then
|
||||
gamedata.password = fields["te_pwd"]
|
||||
end
|
||||
gamedata.selected_world = 0
|
||||
|
||||
if menudata.favorites ~= nil then
|
||||
gamedata.servername = menudata.favorites[event.row].name
|
||||
gamedata.serverdescription = menudata.favorites[event.row].description
|
||||
end
|
||||
|
||||
if gamedata.address ~= nil and
|
||||
gamedata.port ~= nil then
|
||||
core.setting_set("address",gamedata.address)
|
||||
core.setting_set("remote_port",gamedata.port)
|
||||
core.start()
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
if event.type == "CHG" then
|
||||
if event.row <= #menudata.favorites then
|
||||
local address = menudata.favorites[event.row].address
|
||||
local port = menudata.favorites[event.row].port
|
||||
|
||||
if address ~= nil and
|
||||
port ~= nil then
|
||||
core.setting_set("address",address)
|
||||
core.setting_set("remote_port",port)
|
||||
end
|
||||
|
||||
tabdata.fav_selected = event.row
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
if fields["key_up"] ~= nil or
|
||||
fields["key_down"] ~= nil then
|
||||
|
||||
local fav_idx = core.get_table_index("favourites")
|
||||
|
||||
if fav_idx ~= nil then
|
||||
if fields["key_up"] ~= nil and fav_idx > 1 then
|
||||
fav_idx = fav_idx -1
|
||||
else if fields["key_down"] and fav_idx < #menudata.favorites then
|
||||
fav_idx = fav_idx +1
|
||||
end end
|
||||
else
|
||||
fav_idx = 1
|
||||
end
|
||||
|
||||
if menudata.favorites == nil or
|
||||
menudata.favorites[fav_idx] == nil then
|
||||
tabdata.fav_selected = 0
|
||||
return true
|
||||
end
|
||||
|
||||
local address = menudata.favorites[fav_idx].address
|
||||
local port = menudata.favorites[fav_idx].port
|
||||
|
||||
if address ~= nil and
|
||||
port ~= nil then
|
||||
core.setting_set("address",address)
|
||||
core.setting_set("remote_port",port)
|
||||
end
|
||||
|
||||
tabdata.fav_selected = fav_idx
|
||||
return true
|
||||
end
|
||||
|
||||
if fields["cb_public_serverlist"] ~= nil then
|
||||
core.setting_set("public_serverlist", fields["cb_public_serverlist"])
|
||||
|
||||
if core.setting_getbool("public_serverlist") then
|
||||
asyncOnlineFavourites()
|
||||
else
|
||||
menudata.favorites = core.get_favorites("local")
|
||||
end
|
||||
tabdata.fav_selected = nil
|
||||
return true
|
||||
end
|
||||
|
||||
if fields["btn_delete_favorite"] ~= nil then
|
||||
local current_favourite = core.get_table_index("favourites")
|
||||
if current_favourite == nil then return end
|
||||
core.delete_favorite(current_favourite)
|
||||
menudata.favorites = order_favorite_list(core.get_favorites())
|
||||
tabdata.fav_selected = nil
|
||||
|
||||
core.setting_set("address","")
|
||||
core.setting_set("remote_port","30000")
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
if (fields["btn_mp_connect"] ~= nil or
|
||||
fields["key_enter"] ~= nil) and fields["te_address"] ~= nil and
|
||||
fields["te_port"] ~= nil then
|
||||
|
||||
gamedata.playername = fields["te_name"]
|
||||
gamedata.password = fields["te_pwd"]
|
||||
gamedata.address = fields["te_address"]
|
||||
gamedata.port = fields["te_port"]
|
||||
|
||||
local fav_idx = core.get_table_index("favourites")
|
||||
|
||||
if fav_idx ~= nil and fav_idx <= #menudata.favorites and
|
||||
menudata.favorites[fav_idx].address == fields["te_address"] and
|
||||
menudata.favorites[fav_idx].port == fields["te_port"] then
|
||||
|
||||
gamedata.servername = menudata.favorites[fav_idx].name
|
||||
gamedata.serverdescription = menudata.favorites[fav_idx].description
|
||||
|
||||
if not is_server_protocol_compat_or_error(menudata.favorites[fav_idx].proto_min,
|
||||
menudata.favorites[fav_idx].proto_max)then
|
||||
return true
|
||||
end
|
||||
else
|
||||
gamedata.servername = ""
|
||||
gamedata.serverdescription = ""
|
||||
end
|
||||
|
||||
gamedata.selected_world = 0
|
||||
|
||||
core.setting_set("address", fields["te_address"])
|
||||
core.setting_set("remote_port",fields["te_port"])
|
||||
|
||||
core.start()
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
local function on_change(type,old_tab,new_tab)
|
||||
if type == "LEAVE" then
|
||||
return
|
||||
end
|
||||
if core.setting_getbool("public_serverlist") then
|
||||
asyncOnlineFavourites()
|
||||
else
|
||||
menudata.favorites = core.get_favorites("local")
|
||||
end
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
tab_multiplayer = {
|
||||
name = "multiplayer",
|
||||
caption = fgettext("Client"),
|
||||
cbf_formspec = get_formspec,
|
||||
cbf_button_handler = main_button_handler,
|
||||
on_change = on_change
|
||||
}
|
||||
195
builtin/mainmenu/tab_server.lua
Normal file
195
builtin/mainmenu/tab_server.lua
Normal file
@@ -0,0 +1,195 @@
|
||||
--Minetest
|
||||
--Copyright (C) 2014 sapier
|
||||
--
|
||||
--This program is free software; you can redistribute it and/or modify
|
||||
--it under the terms of the GNU Lesser General Public License as published by
|
||||
--the Free Software Foundation; either version 2.1 of the License, or
|
||||
--(at your option) any later version.
|
||||
--
|
||||
--This program is distributed in the hope that it will be useful,
|
||||
--but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
--GNU Lesser General Public License for more details.
|
||||
--
|
||||
--You should have received a copy of the GNU Lesser General Public License along
|
||||
--with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
--51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
local function get_formspec(tabview, name, tabdata)
|
||||
|
||||
local index = menudata.worldlist:get_current_index(
|
||||
tonumber(core.setting_get("mainmenu_last_selected_world"))
|
||||
)
|
||||
|
||||
local retval =
|
||||
"button[4,4.15;2.6,0.5;world_delete;" .. fgettext("Delete") .. "]" ..
|
||||
"button[6.5,4.15;2.8,0.5;world_create;" .. fgettext("New") .. "]" ..
|
||||
"button[9.2,4.15;2.55,0.5;world_configure;" .. fgettext("Configure") .. "]" ..
|
||||
"button[8.5,4.95;3.25,0.5;start_server;" .. fgettext("Start Game") .. "]" ..
|
||||
"label[4,-0.25;" .. fgettext("Select World:") .. "]" ..
|
||||
"checkbox[0.25,0.25;cb_creative_mode;" .. fgettext("Creative Mode") .. ";" ..
|
||||
dump(core.setting_getbool("creative_mode")) .. "]" ..
|
||||
"checkbox[0.25,0.7;cb_enable_damage;" .. fgettext("Enable Damage") .. ";" ..
|
||||
dump(core.setting_getbool("enable_damage")) .. "]" ..
|
||||
"checkbox[0.25,1.15;cb_server_announce;" .. fgettext("Public") .. ";" ..
|
||||
dump(core.setting_getbool("server_announce")) .. "]" ..
|
||||
"label[0.25,2.2;" .. fgettext("Name/Password") .. "]" ..
|
||||
"field[0.55,3.2;3.5,0.5;te_playername;;" ..
|
||||
core.formspec_escape(core.setting_get("name")) .. "]" ..
|
||||
"pwdfield[0.55,4;3.5,0.5;te_passwd;]"
|
||||
|
||||
local bind_addr = core.setting_get("bind_address")
|
||||
if bind_addr ~= nil and bind_addr ~= "" then
|
||||
retval = retval ..
|
||||
"field[0.55,5.2;2.25,0.5;te_serveraddr;" .. fgettext("Bind Address") .. ";" ..
|
||||
core.formspec_escape(core.setting_get("bind_address")) .. "]" ..
|
||||
"field[2.8,5.2;1.25,0.5;te_serverport;" .. fgettext("Port") .. ";" ..
|
||||
core.formspec_escape(core.setting_get("port")) .. "]"
|
||||
else
|
||||
retval = retval ..
|
||||
"field[0.55,5.2;3.5,0.5;te_serverport;" .. fgettext("Server Port") .. ";" ..
|
||||
core.formspec_escape(core.setting_get("port")) .. "]"
|
||||
end
|
||||
|
||||
retval = retval ..
|
||||
"textlist[4,0.25;7.5,3.7;srv_worlds;" ..
|
||||
menu_render_worldlist() ..
|
||||
";" .. index .. "]"
|
||||
|
||||
return retval
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
local function main_button_handler(this, fields, name, tabdata)
|
||||
|
||||
local world_doubleclick = false
|
||||
|
||||
if fields["srv_worlds"] ~= nil then
|
||||
local event = core.explode_textlist_event(fields["srv_worlds"])
|
||||
local selected = core.get_textlist_index("srv_worlds")
|
||||
|
||||
menu_worldmt_legacy(selected)
|
||||
|
||||
if event.type == "DCL" then
|
||||
world_doubleclick = true
|
||||
end
|
||||
if event.type == "CHG" then
|
||||
core.setting_set("mainmenu_last_selected_world",
|
||||
menudata.worldlist:get_raw_index(core.get_textlist_index("srv_worlds")))
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
if menu_handle_key_up_down(fields,"srv_worlds","mainmenu_last_selected_world") then
|
||||
return true
|
||||
end
|
||||
|
||||
if fields["cb_creative_mode"] then
|
||||
core.setting_set("creative_mode", fields["cb_creative_mode"])
|
||||
local selected = core.get_textlist_index("srv_worlds")
|
||||
menu_worldmt(selected, "creative_mode", fields["cb_creative_mode"])
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
if fields["cb_enable_damage"] then
|
||||
core.setting_set("enable_damage", fields["cb_enable_damage"])
|
||||
local selected = core.get_textlist_index("srv_worlds")
|
||||
menu_worldmt(selected, "enable_damage", fields["cb_enable_damage"])
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
if fields["cb_server_announce"] then
|
||||
core.setting_set("server_announce", fields["cb_server_announce"])
|
||||
local selected = core.get_textlist_index("srv_worlds")
|
||||
menu_worldmt(selected, "server_announce", fields["cb_server_announce"])
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
if fields["start_server"] ~= nil or
|
||||
world_doubleclick or
|
||||
fields["key_enter"] then
|
||||
local selected = core.get_textlist_index("srv_worlds")
|
||||
gamedata.selected_world = menudata.worldlist:get_raw_index(selected)
|
||||
if selected ~= nil and gamedata.selected_world ~= 0 then
|
||||
gamedata.playername = fields["te_playername"]
|
||||
gamedata.password = fields["te_passwd"]
|
||||
gamedata.port = fields["te_serverport"]
|
||||
gamedata.address = ""
|
||||
|
||||
core.setting_set("port",gamedata.port)
|
||||
if fields["te_serveraddr"] ~= nil then
|
||||
core.setting_set("bind_address",fields["te_serveraddr"])
|
||||
end
|
||||
|
||||
--update last game
|
||||
local world = menudata.worldlist:get_raw_element(gamedata.selected_world)
|
||||
if world then
|
||||
local game, index = gamemgr.find_by_gameid(world.gameid)
|
||||
core.setting_set("menu_last_game", game.id)
|
||||
end
|
||||
|
||||
core.start()
|
||||
else
|
||||
gamedata.errormessage =
|
||||
fgettext("No world created or selected!")
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
if fields["world_create"] ~= nil then
|
||||
local create_world_dlg = create_create_world_dlg(true)
|
||||
create_world_dlg:set_parent(this)
|
||||
create_world_dlg:show()
|
||||
this:hide()
|
||||
return true
|
||||
end
|
||||
|
||||
if fields["world_delete"] ~= nil then
|
||||
local selected = core.get_textlist_index("srv_worlds")
|
||||
if selected ~= nil and
|
||||
selected <= menudata.worldlist:size() then
|
||||
local world = menudata.worldlist:get_list()[selected]
|
||||
if world ~= nil and
|
||||
world.name ~= nil and
|
||||
world.name ~= "" then
|
||||
local index = menudata.worldlist:get_raw_index(selected)
|
||||
local delete_world_dlg = create_delete_world_dlg(world.name,index)
|
||||
delete_world_dlg:set_parent(this)
|
||||
delete_world_dlg:show()
|
||||
this:hide()
|
||||
end
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
if fields["world_configure"] ~= nil then
|
||||
local selected = core.get_textlist_index("srv_worlds")
|
||||
if selected ~= nil then
|
||||
local configdialog =
|
||||
create_configure_world_dlg(
|
||||
menudata.worldlist:get_raw_index(selected))
|
||||
|
||||
if (configdialog ~= nil) then
|
||||
configdialog:set_parent(this)
|
||||
configdialog:show()
|
||||
this:hide()
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
tab_server = {
|
||||
name = "server",
|
||||
caption = fgettext("Server"),
|
||||
cbf_formspec = get_formspec,
|
||||
cbf_button_handler = main_button_handler,
|
||||
on_change = nil
|
||||
}
|
||||
434
builtin/mainmenu/tab_settings.lua
Normal file
434
builtin/mainmenu/tab_settings.lua
Normal file
@@ -0,0 +1,434 @@
|
||||
--Minetest
|
||||
--Copyright (C) 2013 sapier
|
||||
--
|
||||
--This program is free software; you can redistribute it and/or modify
|
||||
--it under the terms of the GNU Lesser General Public License as published by
|
||||
--the Free Software Foundation; either version 2.1 of the License, or
|
||||
--(at your option) any later version.
|
||||
--
|
||||
--This program is distributed in the hope that it will be useful,
|
||||
--but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
--GNU Lesser General Public License for more details.
|
||||
--
|
||||
--You should have received a copy of the GNU Lesser General Public License along
|
||||
--with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
--51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
local leaves_style_labels = {
|
||||
fgettext("Opaque Leaves"),
|
||||
fgettext("Simple Leaves"),
|
||||
fgettext("Fancy Leaves")
|
||||
}
|
||||
|
||||
local leaves_style = {
|
||||
{leaves_style_labels[1]..","..leaves_style_labels[2]..","..leaves_style_labels[3]},
|
||||
{"opaque", "simple", "fancy"},
|
||||
}
|
||||
|
||||
local dd_filter_labels = {
|
||||
fgettext("No Filter"),
|
||||
fgettext("Bilinear Filter"),
|
||||
fgettext("Trilinear Filter")
|
||||
}
|
||||
|
||||
local filters = {
|
||||
{dd_filter_labels[1]..","..dd_filter_labels[2]..","..dd_filter_labels[3]},
|
||||
{"", "bilinear_filter", "trilinear_filter"},
|
||||
}
|
||||
|
||||
local dd_mipmap_labels = {
|
||||
fgettext("No Mipmap"),
|
||||
fgettext("Mipmap"),
|
||||
fgettext("Mipmap + Aniso. Filter")
|
||||
}
|
||||
|
||||
local mipmap = {
|
||||
{dd_mipmap_labels[1]..","..dd_mipmap_labels[2]..","..dd_mipmap_labels[3]},
|
||||
{"", "mip_map", "anisotropic_filter"},
|
||||
}
|
||||
|
||||
local function getLeavesStyleSettingIndex()
|
||||
local style = core.setting_get("leaves_style")
|
||||
if (style == leaves_style[2][3]) then
|
||||
return 3
|
||||
elseif (style == leaves_style[2][2]) then
|
||||
return 2
|
||||
end
|
||||
return 1
|
||||
end
|
||||
|
||||
local dd_antialiasing_labels = {
|
||||
fgettext("None"),
|
||||
fgettext("2x"),
|
||||
fgettext("4x"),
|
||||
fgettext("8x"),
|
||||
}
|
||||
|
||||
local antialiasing = {
|
||||
{dd_antialiasing_labels[1]..","..dd_antialiasing_labels[2]..","..
|
||||
dd_antialiasing_labels[3]..","..dd_antialiasing_labels[4]},
|
||||
{"0", "2", "4", "8"}
|
||||
}
|
||||
|
||||
local function getFilterSettingIndex()
|
||||
if (core.setting_get(filters[2][3]) == "true") then
|
||||
return 3
|
||||
end
|
||||
if (core.setting_get(filters[2][3]) == "false" and core.setting_get(filters[2][2]) == "true") then
|
||||
return 2
|
||||
end
|
||||
return 1
|
||||
end
|
||||
|
||||
local function getMipmapSettingIndex()
|
||||
if (core.setting_get(mipmap[2][3]) == "true") then
|
||||
return 3
|
||||
end
|
||||
if (core.setting_get(mipmap[2][3]) == "false" and core.setting_get(mipmap[2][2]) == "true") then
|
||||
return 2
|
||||
end
|
||||
return 1
|
||||
end
|
||||
|
||||
local function getAntialiasingSettingIndex()
|
||||
local antialiasing_setting = core.setting_get("fsaa")
|
||||
for i = 1, #(antialiasing[2]) do
|
||||
if antialiasing_setting == antialiasing[2][i] then
|
||||
return i
|
||||
end
|
||||
end
|
||||
return 1
|
||||
end
|
||||
|
||||
local function antialiasing_fname_to_name(fname)
|
||||
for i = 1, #(dd_antialiasing_labels) do
|
||||
if fname == dd_antialiasing_labels[i] then
|
||||
return antialiasing[2][i]
|
||||
end
|
||||
end
|
||||
return 0
|
||||
end
|
||||
|
||||
local function dlg_confirm_reset_formspec(data)
|
||||
local retval =
|
||||
"size[8,3]" ..
|
||||
"label[1,1;".. fgettext("Are you sure to reset your singleplayer world?") .. "]"..
|
||||
"button[1,2;2.6,0.5;dlg_reset_singleplayer_confirm;"..
|
||||
fgettext("Yes") .. "]" ..
|
||||
"button[4,2;2.8,0.5;dlg_reset_singleplayer_cancel;"..
|
||||
fgettext("No!!!") .. "]"
|
||||
return retval
|
||||
end
|
||||
|
||||
local function dlg_confirm_reset_btnhandler(this, fields, dialogdata)
|
||||
|
||||
if fields["dlg_reset_singleplayer_confirm"] ~= nil then
|
||||
local worldlist = core.get_worlds()
|
||||
local found_singleplayerworld = false
|
||||
|
||||
for i=1,#worldlist,1 do
|
||||
if worldlist[i].name == "singleplayerworld" then
|
||||
found_singleplayerworld = true
|
||||
gamedata.worldindex = i
|
||||
end
|
||||
end
|
||||
|
||||
if found_singleplayerworld then
|
||||
core.delete_world(gamedata.worldindex)
|
||||
end
|
||||
|
||||
core.create_world("singleplayerworld", 1)
|
||||
|
||||
worldlist = core.get_worlds()
|
||||
|
||||
found_singleplayerworld = false
|
||||
|
||||
for i=1,#worldlist,1 do
|
||||
if worldlist[i].name == "singleplayerworld" then
|
||||
found_singleplayerworld = true
|
||||
gamedata.worldindex = i
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
this.parent:show()
|
||||
this:hide()
|
||||
this:delete()
|
||||
return true
|
||||
end
|
||||
|
||||
local function showconfirm_reset(tabview)
|
||||
local new_dlg = dialog_create("reset_spworld",
|
||||
dlg_confirm_reset_formspec,
|
||||
dlg_confirm_reset_btnhandler,
|
||||
nil)
|
||||
new_dlg:set_parent(tabview)
|
||||
tabview:hide()
|
||||
new_dlg:show()
|
||||
end
|
||||
|
||||
local function gui_scale_to_scrollbar()
|
||||
local current_value = tonumber(core.setting_get("gui_scaling"))
|
||||
|
||||
if (current_value == nil) or current_value < 0.25 then
|
||||
return 0
|
||||
end
|
||||
if current_value <= 1.25 then
|
||||
return ((current_value - 0.25)/ 1.0) * 700
|
||||
end
|
||||
if current_value <= 6 then
|
||||
return ((current_value -1.25) * 100) + 700
|
||||
end
|
||||
|
||||
return 1000
|
||||
end
|
||||
|
||||
local function scrollbar_to_gui_scale(value)
|
||||
value = tonumber(value)
|
||||
|
||||
if (value <= 700) then
|
||||
return ((value / 700) * 1.0) + 0.25
|
||||
end
|
||||
if (value <=1000) then
|
||||
return ((value - 700) / 100) + 1.25
|
||||
end
|
||||
|
||||
return 1
|
||||
end
|
||||
|
||||
local function formspec(tabview, name, tabdata)
|
||||
local tab_string =
|
||||
"box[0,0;3.5,4.0;#999999]" ..
|
||||
"checkbox[0.25,0;cb_smooth_lighting;".. fgettext("Smooth Lighting")
|
||||
.. ";".. dump(core.setting_getbool("smooth_lighting")) .. "]"..
|
||||
"checkbox[0.25,0.5;cb_particles;".. fgettext("Enable Particles") .. ";"
|
||||
.. dump(core.setting_getbool("enable_particles")) .. "]"..
|
||||
"checkbox[0.25,1;cb_3d_clouds;".. fgettext("3D Clouds") .. ";"
|
||||
.. dump(core.setting_getbool("enable_3d_clouds")) .. "]"..
|
||||
"checkbox[0.25,1.5;cb_opaque_water;".. fgettext("Opaque Water") .. ";"
|
||||
.. dump(core.setting_getbool("opaque_water")) .. "]"..
|
||||
"checkbox[0.25,2.0;cb_connected_glass;".. fgettext("Connected Glass") .. ";"
|
||||
.. dump(core.setting_getbool("connected_glass")) .. "]"..
|
||||
"checkbox[0.25,2.5;cb_node_highlighting;".. fgettext("Node Highlighting") .. ";"
|
||||
.. dump(core.setting_getbool("enable_node_highlighting")) .. "]"..
|
||||
"dropdown[0.25,3.2;3.3;dd_leaves_style;" .. leaves_style[1][1] .. ";"
|
||||
.. getLeavesStyleSettingIndex() .. "]" ..
|
||||
"box[3.75,0;3.75,3.45;#999999]" ..
|
||||
"label[3.85,0.1;".. fgettext("Texturing:") .. "]"..
|
||||
"dropdown[3.85,0.55;3.85;dd_filters;" .. filters[1][1] .. ";"
|
||||
.. getFilterSettingIndex() .. "]" ..
|
||||
"dropdown[3.85,1.35;3.85;dd_mipmap;" .. mipmap[1][1] .. ";"
|
||||
.. getMipmapSettingIndex() .. "]" ..
|
||||
"label[3.85,2.15;".. fgettext("Antialiasing:") .. "]"..
|
||||
"dropdown[3.85,2.6;3.85;dd_antialiasing;" .. antialiasing[1][1] .. ";"
|
||||
.. getAntialiasingSettingIndex() .. "]" ..
|
||||
"box[7.75,0;4,4;#999999]" ..
|
||||
"checkbox[8,0;cb_shaders;".. fgettext("Shaders") .. ";"
|
||||
.. dump(core.setting_getbool("enable_shaders")) .. "]"
|
||||
|
||||
if PLATFORM ~= "Android" then
|
||||
tab_string = tab_string ..
|
||||
"button[8,4.75;3.75,0.5;btn_change_keys;".. fgettext("Change keys") .. "]"
|
||||
else
|
||||
tab_string = tab_string ..
|
||||
"button[8,4.75;3.75,0.5;btn_reset_singleplayer;".. fgettext("Reset singleplayer world") .. "]"
|
||||
end
|
||||
tab_string = tab_string ..
|
||||
"box[0,4.25;3.5,1.1;#999999]" ..
|
||||
"label[0.25,4.25;" .. fgettext("GUI scale factor") .. "]" ..
|
||||
"scrollbar[0.25,4.75;3,0.4;sb_gui_scaling;horizontal;" ..
|
||||
gui_scale_to_scrollbar() .. "]" ..
|
||||
"tooltip[sb_gui_scaling;" ..
|
||||
fgettext("Scaling factor applied to menu elements: ") ..
|
||||
dump(core.setting_get("gui_scaling")) .. "]"
|
||||
|
||||
if PLATFORM == "Android" then
|
||||
tab_string = tab_string ..
|
||||
"box[3.75,3.55;3.75,1.8;#999999]" ..
|
||||
"checkbox[3.9,3.45;cb_touchscreen_target;".. fgettext("Touch free target") .. ";"
|
||||
.. dump(core.setting_getbool("touchtarget")) .. "]"
|
||||
end
|
||||
|
||||
if core.setting_get("touchscreen_threshold") ~= nil then
|
||||
tab_string = tab_string ..
|
||||
"label[4.3,4.1;" .. fgettext("Touchthreshold (px)") .. "]" ..
|
||||
"dropdown[3.85,4.55;3.85;dd_touchthreshold;0,10,20,30,40,50;" ..
|
||||
((tonumber(core.setting_get("touchscreen_threshold"))/10)+1) .. "]"
|
||||
end
|
||||
|
||||
if core.setting_getbool("enable_shaders") then
|
||||
tab_string = tab_string ..
|
||||
"checkbox[8,0.5;cb_bumpmapping;".. fgettext("Bumpmapping") .. ";"
|
||||
.. dump(core.setting_getbool("enable_bumpmapping")) .. "]"..
|
||||
"checkbox[8,1.0;cb_generate_normalmaps;".. fgettext("Generate Normalmaps") .. ";"
|
||||
.. dump(core.setting_getbool("generate_normalmaps")) .. "]"..
|
||||
"checkbox[8,1.5;cb_parallax;".. fgettext("Parallax Occlusion") .. ";"
|
||||
.. dump(core.setting_getbool("enable_parallax_occlusion")) .. "]"..
|
||||
"checkbox[8,2.0;cb_waving_water;".. fgettext("Waving Water") .. ";"
|
||||
.. dump(core.setting_getbool("enable_waving_water")) .. "]"..
|
||||
"checkbox[8,2.5;cb_waving_leaves;".. fgettext("Waving Leaves") .. ";"
|
||||
.. dump(core.setting_getbool("enable_waving_leaves")) .. "]"..
|
||||
"checkbox[8,3.0;cb_waving_plants;".. fgettext("Waving Plants") .. ";"
|
||||
.. dump(core.setting_getbool("enable_waving_plants")) .. "]"
|
||||
else
|
||||
tab_string = tab_string ..
|
||||
"textlist[8.33,0.7;4,1;;#888888" .. fgettext("Bumpmapping") .. ";0;true]" ..
|
||||
"textlist[8.33,1.2;4,1;;#888888" .. fgettext("Generate Normalmaps") .. ";0;true]" ..
|
||||
"textlist[8.33,1.7;4,1;;#888888" .. fgettext("Parallax Occlusion") .. ";0;true]" ..
|
||||
"textlist[8.33,2.2;4,1;;#888888" .. fgettext("Waving Water") .. ";0;true]" ..
|
||||
"textlist[8.33,2.7;4,1;;#888888" .. fgettext("Waving Leaves") .. ";0;true]" ..
|
||||
"textlist[8.33,3.2;4,1;;#888888" .. fgettext("Waving Plants") .. ";0;true]"
|
||||
end
|
||||
return tab_string
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
local function handle_settings_buttons(this, fields, tabname, tabdata)
|
||||
if fields["cb_fancy_trees"] then
|
||||
core.setting_set("new_style_leaves", fields["cb_fancy_trees"])
|
||||
return true
|
||||
end
|
||||
if fields["cb_smooth_lighting"] then
|
||||
core.setting_set("smooth_lighting", fields["cb_smooth_lighting"])
|
||||
return true
|
||||
end
|
||||
if fields["cb_3d_clouds"] then
|
||||
core.setting_set("enable_3d_clouds", fields["cb_3d_clouds"])
|
||||
return true
|
||||
end
|
||||
if fields["cb_opaque_water"] then
|
||||
core.setting_set("opaque_water", fields["cb_opaque_water"])
|
||||
return true
|
||||
end
|
||||
if fields["cb_shaders"] then
|
||||
if (core.setting_get("video_driver") == "direct3d8" or core.setting_get("video_driver") == "direct3d9") then
|
||||
core.setting_set("enable_shaders", "false")
|
||||
gamedata.errormessage = fgettext("To enable shaders the OpenGL driver needs to be used.")
|
||||
else
|
||||
core.setting_set("enable_shaders", fields["cb_shaders"])
|
||||
end
|
||||
return true
|
||||
end
|
||||
if fields["cb_connected_glass"] then
|
||||
core.setting_set("connected_glass", fields["cb_connected_glass"])
|
||||
return true
|
||||
end
|
||||
if fields["cb_node_highlighting"] then
|
||||
core.setting_set("enable_node_highlighting", fields["cb_node_highlighting"])
|
||||
return true
|
||||
end
|
||||
if fields["cb_particles"] then
|
||||
core.setting_set("enable_particles", fields["cb_particles"])
|
||||
return true
|
||||
end
|
||||
if fields["cb_bumpmapping"] then
|
||||
core.setting_set("enable_bumpmapping", fields["cb_bumpmapping"])
|
||||
end
|
||||
if fields["cb_generate_normalmaps"] then
|
||||
core.setting_set("generate_normalmaps", fields["cb_generate_normalmaps"])
|
||||
end
|
||||
if fields["cb_parallax"] then
|
||||
core.setting_set("enable_parallax_occlusion", fields["cb_parallax"])
|
||||
return true
|
||||
end
|
||||
if fields["cb_waving_water"] then
|
||||
core.setting_set("enable_waving_water", fields["cb_waving_water"])
|
||||
return true
|
||||
end
|
||||
if fields["cb_waving_leaves"] then
|
||||
core.setting_set("enable_waving_leaves", fields["cb_waving_leaves"])
|
||||
end
|
||||
if fields["cb_waving_plants"] then
|
||||
core.setting_set("enable_waving_plants", fields["cb_waving_plants"])
|
||||
return true
|
||||
end
|
||||
if fields["btn_change_keys"] ~= nil then
|
||||
core.show_keys_menu()
|
||||
return true
|
||||
end
|
||||
|
||||
if fields["sb_gui_scaling"] then
|
||||
local event = core.explode_scrollbar_event(fields["sb_gui_scaling"])
|
||||
|
||||
if event.type == "CHG" then
|
||||
local tosave = string.format("%.2f",scrollbar_to_gui_scale(event.value))
|
||||
core.setting_set("gui_scaling",tosave)
|
||||
return true
|
||||
end
|
||||
end
|
||||
if fields["cb_touchscreen_target"] then
|
||||
core.setting_set("touchtarget", fields["cb_touchscreen_target"])
|
||||
return true
|
||||
end
|
||||
if fields["btn_reset_singleplayer"] then
|
||||
showconfirm_reset(this)
|
||||
return true
|
||||
end
|
||||
|
||||
--Note dropdowns have to be handled LAST!
|
||||
local ddhandled = false
|
||||
|
||||
if fields["dd_touchthreshold"] then
|
||||
core.setting_set("touchscreen_threshold",fields["dd_touchthreshold"])
|
||||
ddhandled = true
|
||||
end
|
||||
if fields["dd_leaves_style"] == leaves_style_labels[3] then
|
||||
core.setting_set("leaves_style", leaves_style[2][3])
|
||||
ddhandled = true
|
||||
end
|
||||
if fields["dd_leaves_style"] == leaves_style_labels[2] then
|
||||
core.setting_set("leaves_style", leaves_style[2][2])
|
||||
ddhandled = true
|
||||
end
|
||||
if fields["dd_leaves_style"] == leaves_style_labels[1] then
|
||||
core.setting_set("leaves_style", leaves_style[2][1])
|
||||
ddhandled = true
|
||||
end
|
||||
if fields["dd_filters"] == dd_filter_labels[1] then
|
||||
core.setting_set("bilinear_filter", "false")
|
||||
core.setting_set("trilinear_filter", "false")
|
||||
ddhandled = true
|
||||
end
|
||||
if fields["dd_filters"] == dd_filter_labels[2] then
|
||||
core.setting_set("bilinear_filter", "true")
|
||||
core.setting_set("trilinear_filter", "false")
|
||||
ddhandled = true
|
||||
end
|
||||
if fields["dd_filters"] == dd_filter_labels[3] then
|
||||
core.setting_set("bilinear_filter", "false")
|
||||
core.setting_set("trilinear_filter", "true")
|
||||
ddhandled = true
|
||||
end
|
||||
if fields["dd_mipmap"] == dd_mipmap_labels[1] then
|
||||
core.setting_set("mip_map", "false")
|
||||
core.setting_set("anisotropic_filter", "false")
|
||||
ddhandled = true
|
||||
end
|
||||
if fields["dd_mipmap"] == dd_mipmap_labels[2] then
|
||||
core.setting_set("mip_map", "true")
|
||||
core.setting_set("anisotropic_filter", "false")
|
||||
ddhandled = true
|
||||
end
|
||||
if fields["dd_mipmap"] == dd_mipmap_labels[3] then
|
||||
core.setting_set("mip_map", "true")
|
||||
core.setting_set("anisotropic_filter", "true")
|
||||
ddhandled = true
|
||||
end
|
||||
if fields["dd_antialiasing"] then
|
||||
core.setting_set("fsaa",
|
||||
antialiasing_fname_to_name(fields["dd_antialiasing"]))
|
||||
ddhandled = true
|
||||
end
|
||||
|
||||
return ddhandled
|
||||
end
|
||||
|
||||
tab_settings = {
|
||||
name = "settings",
|
||||
caption = fgettext("Settings"),
|
||||
cbf_formspec = formspec,
|
||||
cbf_button_handler = handle_settings_buttons
|
||||
}
|
||||
205
builtin/mainmenu/tab_simple_main.lua
Normal file
205
builtin/mainmenu/tab_simple_main.lua
Normal file
@@ -0,0 +1,205 @@
|
||||
--Minetest
|
||||
--Copyright (C) 2013 sapier
|
||||
--
|
||||
--This program is free software; you can redistribute it and/or modify
|
||||
--it under the terms of the GNU Lesser General Public License as published by
|
||||
--the Free Software Foundation; either version 2.1 of the License, or
|
||||
--(at your option) any later version.
|
||||
--
|
||||
--This program is distributed in the hope that it will be useful,
|
||||
--but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
--GNU Lesser General Public License for more details.
|
||||
--
|
||||
--You should have received a copy of the GNU Lesser General Public License along
|
||||
--with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
--51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
local function get_formspec(tabview, name, tabdata)
|
||||
local retval = ""
|
||||
|
||||
local render_details = dump(core.setting_getbool("public_serverlist"))
|
||||
|
||||
retval = retval ..
|
||||
"label[8,0.5;".. fgettext("Name/Password") .. "]" ..
|
||||
"field[0.25,3.25;5.5,0.5;te_address;;" ..
|
||||
core.formspec_escape(core.setting_get("address")) .."]" ..
|
||||
"field[5.75,3.25;2.25,0.5;te_port;;" ..
|
||||
core.formspec_escape(core.setting_get("remote_port")) .."]" ..
|
||||
"checkbox[8,-0.25;cb_public_serverlist;".. fgettext("Public Serverlist") .. ";" ..
|
||||
render_details .. "]"
|
||||
|
||||
retval = retval ..
|
||||
"button[8,2.5;4,1.5;btn_mp_connect;".. fgettext("Connect") .. "]" ..
|
||||
"field[8.75,1.5;3.5,0.5;te_name;;" ..
|
||||
core.formspec_escape(core.setting_get("name")) .."]" ..
|
||||
"pwdfield[8.75,2.3;3.5,0.5;te_pwd;]"
|
||||
|
||||
if render_details then
|
||||
retval = retval .. "tablecolumns[" ..
|
||||
"color,span=3;" ..
|
||||
"text,align=right;" .. -- clients
|
||||
"text,align=center,padding=0.25;" .. -- "/"
|
||||
"text,align=right,padding=0.25;" .. -- clients_max
|
||||
image_column(fgettext("Creative mode"), "creative") .. ",padding=1;" ..
|
||||
image_column(fgettext("Damage enabled"), "damage") .. ",padding=0.25;" ..
|
||||
image_column(fgettext("PvP enabled"), "pvp") .. ",padding=0.25;" ..
|
||||
"color,span=1;" ..
|
||||
"text,padding=1]" -- name
|
||||
else
|
||||
retval = retval .. "tablecolumns[text]"
|
||||
end
|
||||
retval = retval ..
|
||||
"table[-0.05,0;7.55,2.75;favourites;"
|
||||
|
||||
if #menudata.favorites > 0 then
|
||||
retval = retval .. render_favorite(menudata.favorites[1],render_details)
|
||||
|
||||
for i=2,#menudata.favorites,1 do
|
||||
retval = retval .. "," .. render_favorite(menudata.favorites[i],render_details)
|
||||
end
|
||||
end
|
||||
|
||||
if tabdata.fav_selected ~= nil then
|
||||
retval = retval .. ";" .. tabdata.fav_selected .. "]"
|
||||
else
|
||||
retval = retval .. ";0]"
|
||||
end
|
||||
|
||||
-- separator
|
||||
retval = retval ..
|
||||
"box[-0.28,3.75;12.4,0.1;#FFFFFF]"
|
||||
|
||||
-- checkboxes
|
||||
retval = retval ..
|
||||
"checkbox[8.0,3.9;cb_creative;".. fgettext("Creative Mode") .. ";" ..
|
||||
dump(core.setting_getbool("creative_mode")) .. "]"..
|
||||
"checkbox[8.0,4.4;cb_damage;".. fgettext("Enable Damage") .. ";" ..
|
||||
dump(core.setting_getbool("enable_damage")) .. "]"
|
||||
-- buttons
|
||||
retval = retval ..
|
||||
"button[0,3.7;8,1.5;btn_start_singleplayer;" .. fgettext("Start Singleplayer") .. "]" ..
|
||||
"button[0,4.5;8,1.5;btn_config_sp_world;" .. fgettext("Config mods") .. "]"
|
||||
|
||||
return retval
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
local function main_button_handler(tabview, fields, name, tabdata)
|
||||
|
||||
if fields["btn_start_singleplayer"] then
|
||||
gamedata.selected_world = gamedata.worldindex
|
||||
gamedata.singleplayer = true
|
||||
core.start()
|
||||
return true
|
||||
end
|
||||
|
||||
if fields["favourites"] ~= nil then
|
||||
local event = core.explode_table_event(fields["favourites"])
|
||||
|
||||
if event.type == "CHG" then
|
||||
if event.row <= #menudata.favorites then
|
||||
local address = menudata.favorites[event.row].address
|
||||
local port = menudata.favorites[event.row].port
|
||||
|
||||
if address ~= nil and
|
||||
port ~= nil then
|
||||
core.setting_set("address",address)
|
||||
core.setting_set("remote_port",port)
|
||||
end
|
||||
|
||||
tabdata.fav_selected = event.row
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
if fields["cb_public_serverlist"] ~= nil then
|
||||
core.setting_set("public_serverlist", fields["cb_public_serverlist"])
|
||||
|
||||
if core.setting_getbool("public_serverlist") then
|
||||
asyncOnlineFavourites()
|
||||
else
|
||||
menudata.favorites = core.get_favorites("local")
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
if fields["cb_creative"] then
|
||||
core.setting_set("creative_mode", fields["cb_creative"])
|
||||
return true
|
||||
end
|
||||
|
||||
if fields["cb_damage"] then
|
||||
core.setting_set("enable_damage", fields["cb_damage"])
|
||||
return true
|
||||
end
|
||||
|
||||
if fields["btn_mp_connect"] ~= nil or
|
||||
fields["key_enter"] ~= nil then
|
||||
|
||||
gamedata.playername = fields["te_name"]
|
||||
gamedata.password = fields["te_pwd"]
|
||||
gamedata.address = fields["te_address"]
|
||||
gamedata.port = fields["te_port"]
|
||||
|
||||
local fav_idx = core.get_textlist_index("favourites")
|
||||
|
||||
if fav_idx ~= nil and fav_idx <= #menudata.favorites and
|
||||
menudata.favorites[fav_idx].address == fields["te_address"] and
|
||||
menudata.favorites[fav_idx].port == fields["te_port"] then
|
||||
|
||||
gamedata.servername = menudata.favorites[fav_idx].name
|
||||
gamedata.serverdescription = menudata.favorites[fav_idx].description
|
||||
|
||||
if not is_server_protocol_compat_or_error(menudata.favorites[fav_idx].proto_min,
|
||||
menudata.favorites[fav_idx].proto_max) then
|
||||
return true
|
||||
end
|
||||
else
|
||||
gamedata.servername = ""
|
||||
gamedata.serverdescription = ""
|
||||
end
|
||||
|
||||
gamedata.selected_world = 0
|
||||
|
||||
core.setting_set("address",fields["te_address"])
|
||||
core.setting_set("remote_port",fields["te_port"])
|
||||
|
||||
core.start()
|
||||
return true
|
||||
end
|
||||
|
||||
if fields["btn_config_sp_world"] ~= nil then
|
||||
local configdialog = create_configure_world_dlg(1)
|
||||
|
||||
if (configdialog ~= nil) then
|
||||
configdialog:set_parent(tabview)
|
||||
tabview:hide()
|
||||
configdialog:show()
|
||||
end
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
local function on_activate(type,old_tab,new_tab)
|
||||
if type == "LEAVE" then
|
||||
return
|
||||
end
|
||||
if core.setting_getbool("public_serverlist") then
|
||||
asyncOnlineFavourites()
|
||||
else
|
||||
menudata.favorites = core.get_favorites("local")
|
||||
end
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
tab_simple_main = {
|
||||
name = "main",
|
||||
caption = fgettext("Main"),
|
||||
cbf_formspec = get_formspec,
|
||||
cbf_button_handler = main_button_handler,
|
||||
on_change = on_activate
|
||||
}
|
||||
250
builtin/mainmenu/tab_singleplayer.lua
Normal file
250
builtin/mainmenu/tab_singleplayer.lua
Normal file
@@ -0,0 +1,250 @@
|
||||
--Minetest
|
||||
--Copyright (C) 2014 sapier
|
||||
--
|
||||
--This program is free software; you can redistribute it and/or modify
|
||||
--it under the terms of the GNU Lesser General Public License as published by
|
||||
--the Free Software Foundation; either version 2.1 of the License, or
|
||||
--(at your option) any later version.
|
||||
--
|
||||
--This program is distributed in the hope that it will be useful,
|
||||
--but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
--GNU Lesser General Public License for more details.
|
||||
--
|
||||
--You should have received a copy of the GNU Lesser General Public License along
|
||||
--with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
--51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
local function current_game()
|
||||
local last_game_id = core.setting_get("menu_last_game")
|
||||
local game, index = gamemgr.find_by_gameid(last_game_id)
|
||||
|
||||
return game
|
||||
end
|
||||
|
||||
local function singleplayer_refresh_gamebar()
|
||||
|
||||
local old_bar = ui.find_by_name("game_button_bar")
|
||||
|
||||
if old_bar ~= nil then
|
||||
old_bar:delete()
|
||||
end
|
||||
|
||||
local function game_buttonbar_button_handler(fields)
|
||||
for key,value in pairs(fields) do
|
||||
for j=1,#gamemgr.games,1 do
|
||||
if ("game_btnbar_" .. gamemgr.games[j].id == key) then
|
||||
mm_texture.update("singleplayer", gamemgr.games[j])
|
||||
core.set_topleft_text(gamemgr.games[j].name)
|
||||
core.setting_set("menu_last_game",gamemgr.games[j].id)
|
||||
menudata.worldlist:set_filtercriteria(gamemgr.games[j].id)
|
||||
local index = filterlist.get_current_index(menudata.worldlist,
|
||||
tonumber(core.setting_get("mainmenu_last_selected_world")))
|
||||
if not index or index < 1 then
|
||||
local selected = core.get_textlist_index("sp_worlds")
|
||||
if selected ~= nil and selected < #menudata.worldlist:get_list() then
|
||||
index = selected
|
||||
else
|
||||
index = #menudata.worldlist:get_list()
|
||||
end
|
||||
end
|
||||
menu_worldmt_legacy(index)
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local btnbar = buttonbar_create("game_button_bar",
|
||||
game_buttonbar_button_handler,
|
||||
{x=-0.3,y=5.65}, "horizontal", {x=12.4,y=1.15})
|
||||
|
||||
for i=1,#gamemgr.games,1 do
|
||||
local btn_name = "game_btnbar_" .. gamemgr.games[i].id
|
||||
|
||||
local image = nil
|
||||
local text = nil
|
||||
local tooltip = core.formspec_escape(gamemgr.games[i].name)
|
||||
|
||||
if gamemgr.games[i].menuicon_path ~= nil and
|
||||
gamemgr.games[i].menuicon_path ~= "" then
|
||||
image = core.formspec_escape(gamemgr.games[i].menuicon_path)
|
||||
else
|
||||
|
||||
local part1 = gamemgr.games[i].id:sub(1,5)
|
||||
local part2 = gamemgr.games[i].id:sub(6,10)
|
||||
local part3 = gamemgr.games[i].id:sub(11)
|
||||
|
||||
text = part1 .. "\n" .. part2
|
||||
if part3 ~= nil and
|
||||
part3 ~= "" then
|
||||
text = text .. "\n" .. part3
|
||||
end
|
||||
end
|
||||
btnbar:add_button(btn_name, text, image, tooltip)
|
||||
end
|
||||
end
|
||||
|
||||
local function get_formspec(tabview, name, tabdata)
|
||||
local retval = ""
|
||||
|
||||
local index = filterlist.get_current_index(menudata.worldlist,
|
||||
tonumber(core.setting_get("mainmenu_last_selected_world"))
|
||||
)
|
||||
|
||||
retval = retval ..
|
||||
"button[4,4.15;2.6,0.5;world_delete;".. fgettext("Delete") .. "]" ..
|
||||
"button[6.5,4.15;2.8,0.5;world_create;".. fgettext("New") .. "]" ..
|
||||
"button[9.2,4.15;2.55,0.5;world_configure;".. fgettext("Configure") .. "]" ..
|
||||
"button[8.5,4.95;3.25,0.5;play;".. fgettext("Play") .. "]" ..
|
||||
"label[4,-0.25;".. fgettext("Select World:") .. "]"..
|
||||
"checkbox[0.25,0.25;cb_creative_mode;".. fgettext("Creative Mode") .. ";" ..
|
||||
dump(core.setting_getbool("creative_mode")) .. "]"..
|
||||
"checkbox[0.25,0.7;cb_enable_damage;".. fgettext("Enable Damage") .. ";" ..
|
||||
dump(core.setting_getbool("enable_damage")) .. "]"..
|
||||
"textlist[4,0.25;7.5,3.7;sp_worlds;" ..
|
||||
menu_render_worldlist() ..
|
||||
";" .. index .. "]"
|
||||
return retval
|
||||
end
|
||||
|
||||
local function main_button_handler(this, fields, name, tabdata)
|
||||
|
||||
assert(name == "singleplayer")
|
||||
|
||||
local world_doubleclick = false
|
||||
|
||||
if fields["sp_worlds"] ~= nil then
|
||||
local event = core.explode_textlist_event(fields["sp_worlds"])
|
||||
local selected = core.get_textlist_index("sp_worlds")
|
||||
|
||||
menu_worldmt_legacy(selected)
|
||||
|
||||
if event.type == "DCL" then
|
||||
world_doubleclick = true
|
||||
end
|
||||
|
||||
if event.type == "CHG" and selected ~= nil then
|
||||
core.setting_set("mainmenu_last_selected_world",
|
||||
menudata.worldlist:get_raw_index(selected))
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
if menu_handle_key_up_down(fields,"sp_worlds","mainmenu_last_selected_world") then
|
||||
return true
|
||||
end
|
||||
|
||||
if fields["cb_creative_mode"] then
|
||||
core.setting_set("creative_mode", fields["cb_creative_mode"])
|
||||
local selected = core.get_textlist_index("sp_worlds")
|
||||
menu_worldmt(selected, "creative_mode", fields["cb_creative_mode"])
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
if fields["cb_enable_damage"] then
|
||||
core.setting_set("enable_damage", fields["cb_enable_damage"])
|
||||
local selected = core.get_textlist_index("sp_worlds")
|
||||
menu_worldmt(selected, "enable_damage", fields["cb_enable_damage"])
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
if fields["play"] ~= nil or
|
||||
world_doubleclick or
|
||||
fields["key_enter"] then
|
||||
local selected = core.get_textlist_index("sp_worlds")
|
||||
gamedata.selected_world = menudata.worldlist:get_raw_index(selected)
|
||||
|
||||
if selected ~= nil and gamedata.selected_world ~= 0 then
|
||||
gamedata.singleplayer = true
|
||||
core.start()
|
||||
else
|
||||
gamedata.errormessage =
|
||||
fgettext("No world created or selected!")
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
if fields["world_create"] ~= nil then
|
||||
local create_world_dlg = create_create_world_dlg(true)
|
||||
create_world_dlg:set_parent(this)
|
||||
this:hide()
|
||||
create_world_dlg:show()
|
||||
mm_texture.update("singleplayer",current_game())
|
||||
return true
|
||||
end
|
||||
|
||||
if fields["world_delete"] ~= nil then
|
||||
local selected = core.get_textlist_index("sp_worlds")
|
||||
if selected ~= nil and
|
||||
selected <= menudata.worldlist:size() then
|
||||
local world = menudata.worldlist:get_list()[selected]
|
||||
if world ~= nil and
|
||||
world.name ~= nil and
|
||||
world.name ~= "" then
|
||||
local index = menudata.worldlist:get_raw_index(selected)
|
||||
local delete_world_dlg = create_delete_world_dlg(world.name,index)
|
||||
delete_world_dlg:set_parent(this)
|
||||
this:hide()
|
||||
delete_world_dlg:show()
|
||||
mm_texture.update("singleplayer",current_game())
|
||||
end
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
if fields["world_configure"] ~= nil then
|
||||
local selected = core.get_textlist_index("sp_worlds")
|
||||
if selected ~= nil then
|
||||
local configdialog =
|
||||
create_configure_world_dlg(
|
||||
menudata.worldlist:get_raw_index(selected))
|
||||
|
||||
if (configdialog ~= nil) then
|
||||
configdialog:set_parent(this)
|
||||
this:hide()
|
||||
configdialog:show()
|
||||
mm_texture.update("singleplayer",current_game())
|
||||
end
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
local function on_change(type, old_tab, new_tab)
|
||||
local buttonbar = ui.find_by_name("game_button_bar")
|
||||
|
||||
if ( buttonbar == nil ) then
|
||||
singleplayer_refresh_gamebar()
|
||||
buttonbar = ui.find_by_name("game_button_bar")
|
||||
end
|
||||
|
||||
if (type == "ENTER") then
|
||||
local game = current_game()
|
||||
|
||||
if game then
|
||||
menudata.worldlist:set_filtercriteria(game.id)
|
||||
core.set_topleft_text(game.name)
|
||||
mm_texture.update("singleplayer",game)
|
||||
end
|
||||
buttonbar:show()
|
||||
else
|
||||
menudata.worldlist:set_filtercriteria(nil)
|
||||
buttonbar:hide()
|
||||
core.set_topleft_text("")
|
||||
mm_texture.update(new_tab,nil)
|
||||
end
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
tab_singleplayer = {
|
||||
name = "singleplayer",
|
||||
caption = fgettext("Singleplayer"),
|
||||
cbf_formspec = get_formspec,
|
||||
cbf_button_handler = main_button_handler,
|
||||
on_change = on_change
|
||||
}
|
||||
126
builtin/mainmenu/tab_texturepacks.lua
Normal file
126
builtin/mainmenu/tab_texturepacks.lua
Normal file
@@ -0,0 +1,126 @@
|
||||
--Minetest
|
||||
--Copyright (C) 2014 sapier
|
||||
--
|
||||
--This program is free software; you can redistribute it and/or modify
|
||||
--it under the terms of the GNU Lesser General Public License as published by
|
||||
--the Free Software Foundation; either version 2.1 of the License, or
|
||||
--(at your option) any later version.
|
||||
--
|
||||
--This program is distributed in the hope that it will be useful,
|
||||
--but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
--GNU Lesser General Public License for more details.
|
||||
--
|
||||
--You should have received a copy of the GNU Lesser General Public License along
|
||||
--with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
--51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
local function filter_texture_pack_list(list)
|
||||
local retval = {"None"}
|
||||
for _, item in ipairs(list) do
|
||||
if item ~= "base" then
|
||||
table.insert(retval, item)
|
||||
end
|
||||
end
|
||||
return retval
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
local function render_texture_pack_list(list)
|
||||
local retval = ""
|
||||
|
||||
for i, v in ipairs(list) do
|
||||
if v:sub(1,1) ~= "." then
|
||||
if retval ~= "" then
|
||||
retval = retval ..","
|
||||
end
|
||||
|
||||
retval = retval .. core.formspec_escape(v)
|
||||
end
|
||||
end
|
||||
|
||||
return retval
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
local function get_formspec(tabview, name, tabdata)
|
||||
|
||||
local retval = "label[4,-0.25;".. fgettext("Select texture pack:") .. "]"..
|
||||
"textlist[4,0.25;7.5,5.0;TPs;"
|
||||
|
||||
local current_texture_path = core.setting_get("texture_path")
|
||||
local list = filter_texture_pack_list(core.get_dir_list(core.get_texturepath(), true))
|
||||
local index = tonumber(core.setting_get("mainmenu_last_selected_TP"))
|
||||
|
||||
if index == nil then index = 1 end
|
||||
|
||||
if current_texture_path == "" then
|
||||
retval = retval ..
|
||||
render_texture_pack_list(list) ..
|
||||
";" .. index .. "]"
|
||||
return retval
|
||||
end
|
||||
|
||||
local infofile = current_texture_path ..DIR_DELIM.."description.txt"
|
||||
-- This adds backwards compatibility for old texture pack description files named
|
||||
-- "info.txt", and should be removed once all such texture packs have been updated
|
||||
if not file_exists(infofile) then
|
||||
infofile = current_texture_path ..DIR_DELIM.."info.txt"
|
||||
if file_exists(infofile) then
|
||||
minetest.log("info.txt is depreciated. description.txt should be used instead.");
|
||||
end
|
||||
end
|
||||
local infotext = ""
|
||||
local f = io.open(infofile, "r")
|
||||
if not f then
|
||||
infotext = fgettext("No information available")
|
||||
else
|
||||
infotext = f:read("*all")
|
||||
f:close()
|
||||
end
|
||||
|
||||
local screenfile = current_texture_path..DIR_DELIM.."screenshot.png"
|
||||
local no_screenshot = nil
|
||||
if not file_exists(screenfile) then
|
||||
screenfile = nil
|
||||
no_screenshot = defaulttexturedir .. "no_screenshot.png"
|
||||
end
|
||||
|
||||
return retval ..
|
||||
render_texture_pack_list(list) ..
|
||||
";" .. index .. "]" ..
|
||||
"image[0.25,0.25;4.0,3.7;"..core.formspec_escape(screenfile or no_screenshot).."]"..
|
||||
"textarea[0.6,3.25;3.7,1.5;;"..core.formspec_escape(infotext or "")..";]"
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
local function main_button_handler(tabview, fields, name, tabdata)
|
||||
if fields["TPs"] ~= nil then
|
||||
local event = core.explode_textlist_event(fields["TPs"])
|
||||
if event.type == "CHG" or event.type == "DCL" then
|
||||
local index = core.get_textlist_index("TPs")
|
||||
core.setting_set("mainmenu_last_selected_TP",
|
||||
index)
|
||||
local list = filter_texture_pack_list(core.get_dir_list(core.get_texturepath(), true))
|
||||
local current_index = core.get_textlist_index("TPs")
|
||||
if current_index ~= nil and #list >= current_index then
|
||||
local new_path = core.get_texturepath()..DIR_DELIM..list[current_index]
|
||||
if list[current_index] == "None" then new_path = "" end
|
||||
|
||||
core.setting_set("texture_path", new_path)
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
tab_texturepacks = {
|
||||
name = "texturepacks",
|
||||
caption = fgettext("Texturepacks"),
|
||||
cbf_formspec = get_formspec,
|
||||
cbf_button_handler = main_button_handler,
|
||||
on_change = nil
|
||||
}
|
||||
185
builtin/mainmenu/textures.lua
Normal file
185
builtin/mainmenu/textures.lua
Normal file
@@ -0,0 +1,185 @@
|
||||
--Minetest
|
||||
--Copyright (C) 2013 sapier
|
||||
--
|
||||
--This program is free software; you can redistribute it and/or modify
|
||||
--it under the terms of the GNU Lesser General Public License as published by
|
||||
--the Free Software Foundation; either version 2.1 of the License, or
|
||||
--(at your option) any later version.
|
||||
--
|
||||
--This program is distributed in the hope that it will be useful,
|
||||
--but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
--GNU Lesser General Public License for more details.
|
||||
--
|
||||
--You should have received a copy of the GNU Lesser General Public License along
|
||||
--with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
--51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
|
||||
mm_texture = {}
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function mm_texture.init()
|
||||
mm_texture.defaulttexturedir = core.get_texturepath() .. DIR_DELIM .. "base" ..
|
||||
DIR_DELIM .. "pack" .. DIR_DELIM
|
||||
mm_texture.basetexturedir = mm_texture.defaulttexturedir
|
||||
|
||||
mm_texture.texturepack = core.setting_get("texture_path")
|
||||
|
||||
mm_texture.gameid = nil
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function mm_texture.update(tab,gamedetails)
|
||||
if tab ~= "singleplayer" then
|
||||
mm_texture.reset()
|
||||
return
|
||||
end
|
||||
|
||||
if gamedetails == nil then
|
||||
return
|
||||
end
|
||||
|
||||
mm_texture.update_game(gamedetails)
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function mm_texture.reset()
|
||||
mm_texture.gameid = nil
|
||||
local have_bg = false
|
||||
local have_overlay = mm_texture.set_generic("overlay")
|
||||
|
||||
if not have_overlay then
|
||||
have_bg = mm_texture.set_generic("background")
|
||||
end
|
||||
|
||||
mm_texture.clear("header")
|
||||
mm_texture.clear("footer")
|
||||
core.set_clouds(false)
|
||||
|
||||
mm_texture.set_generic("footer")
|
||||
mm_texture.set_generic("header")
|
||||
|
||||
if not have_bg then
|
||||
if core.setting_getbool("menu_clouds") then
|
||||
core.set_clouds(true)
|
||||
else
|
||||
mm_texture.set_dirt_bg()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function mm_texture.update_game(gamedetails)
|
||||
if mm_texture.gameid == gamedetails.id then
|
||||
return
|
||||
end
|
||||
|
||||
local have_bg = false
|
||||
local have_overlay = mm_texture.set_game("overlay",gamedetails)
|
||||
|
||||
if not have_overlay then
|
||||
have_bg = mm_texture.set_game("background",gamedetails)
|
||||
end
|
||||
|
||||
mm_texture.clear("header")
|
||||
mm_texture.clear("footer")
|
||||
core.set_clouds(false)
|
||||
|
||||
if not have_bg then
|
||||
|
||||
if core.setting_getbool("menu_clouds") then
|
||||
core.set_clouds(true)
|
||||
else
|
||||
mm_texture.set_dirt_bg()
|
||||
end
|
||||
end
|
||||
|
||||
mm_texture.set_game("footer",gamedetails)
|
||||
mm_texture.set_game("header",gamedetails)
|
||||
|
||||
mm_texture.gameid = gamedetails.id
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function mm_texture.clear(identifier)
|
||||
core.set_background(identifier,"")
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function mm_texture.set_generic(identifier)
|
||||
--try texture pack first
|
||||
if mm_texture.texturepack ~= nil then
|
||||
local path = mm_texture.texturepack .. DIR_DELIM .."menu_" ..
|
||||
identifier .. ".png"
|
||||
if core.set_background(identifier,path) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
if mm_texture.defaulttexturedir ~= nil then
|
||||
local path = mm_texture.defaulttexturedir .. DIR_DELIM .."menu_" ..
|
||||
identifier .. ".png"
|
||||
if core.set_background(identifier,path) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function mm_texture.set_game(identifier, gamedetails)
|
||||
|
||||
if gamedetails == nil then
|
||||
return false
|
||||
end
|
||||
|
||||
if mm_texture.texturepack ~= nil then
|
||||
local path = mm_texture.texturepack .. DIR_DELIM ..
|
||||
gamedetails.id .. "_menu_" .. identifier .. ".png"
|
||||
if core.set_background(identifier, path) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
-- Find out how many randomized textures the subgame provides
|
||||
local n = 0
|
||||
local filename
|
||||
local menu_files = core.get_dir_list(gamedetails.path .. DIR_DELIM .. "menu", false)
|
||||
for i = 1, #menu_files do
|
||||
filename = identifier .. "." .. i .. ".png"
|
||||
if table.indexof(menu_files, filename) == -1 then
|
||||
n = i - 1
|
||||
break
|
||||
end
|
||||
end
|
||||
-- Select random texture, 0 means standard texture
|
||||
n = math.random(0, n)
|
||||
if n == 0 then
|
||||
filename = identifier .. ".png"
|
||||
else
|
||||
filename = identifier .. "." .. n .. ".png"
|
||||
end
|
||||
|
||||
local path = gamedetails.path .. DIR_DELIM .. "menu" ..
|
||||
DIR_DELIM .. filename
|
||||
if core.set_background(identifier, path) then
|
||||
return true
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
function mm_texture.set_dirt_bg()
|
||||
if mm_texture.texturepack ~= nil then
|
||||
local path = mm_texture.texturepack .. DIR_DELIM .."default_dirt.png"
|
||||
if core.set_background("background", path, true, 128) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
--use base pack
|
||||
local minimalpath = defaulttexturedir .. "dirt_bg.png"
|
||||
core.set_background("background", minimalpath, true, 128)
|
||||
end
|
||||
2
client/serverlist/.gitignore
vendored
Normal file
2
client/serverlist/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
*
|
||||
!.gitignore
|
||||
32
client/shaders/minimap_shader/opengl_fragment.glsl
Normal file
32
client/shaders/minimap_shader/opengl_fragment.glsl
Normal file
@@ -0,0 +1,32 @@
|
||||
uniform sampler2D baseTexture;
|
||||
uniform sampler2D normalTexture;
|
||||
uniform vec3 yawVec;
|
||||
|
||||
void main (void)
|
||||
{
|
||||
vec2 uv = gl_TexCoord[0].st;
|
||||
|
||||
//texture sampling rate
|
||||
const float step = 1.0 / 256.0;
|
||||
float tl = texture2D(normalTexture, vec2(uv.x - step, uv.y + step)).r;
|
||||
float t = texture2D(normalTexture, vec2(uv.x - step, uv.y - step)).r;
|
||||
float tr = texture2D(normalTexture, vec2(uv.x + step, uv.y + step)).r;
|
||||
float r = texture2D(normalTexture, vec2(uv.x + step, uv.y)).r;
|
||||
float br = texture2D(normalTexture, vec2(uv.x + step, uv.y - step)).r;
|
||||
float b = texture2D(normalTexture, vec2(uv.x, uv.y - step)).r;
|
||||
float bl = texture2D(normalTexture, vec2(uv.x - step, uv.y - step)).r;
|
||||
float l = texture2D(normalTexture, vec2(uv.x - step, uv.y)).r;
|
||||
float dX = (tr + 2.0 * r + br) - (tl + 2.0 * l + bl);
|
||||
float dY = (bl + 2.0 * b + br) - (tl + 2.0 * t + tr);
|
||||
vec4 bump = vec4 (normalize(vec3 (dX, dY, 0.1)),1.0);
|
||||
float height = 2.0 * texture2D(normalTexture, vec2(uv.x, uv.y)).r - 1.0;
|
||||
vec4 base = texture2D(baseTexture, uv).rgba;
|
||||
vec3 L = normalize(vec3(0.0, 0.75, 1.0));
|
||||
float specular = pow(clamp(dot(reflect(L, bump.xyz), yawVec), 0.0, 1.0), 1.0);
|
||||
float diffuse = dot(yawVec, bump.xyz);
|
||||
|
||||
vec3 color = (1.1 * diffuse + 0.05 * height + 0.5 * specular) * base.rgb;
|
||||
vec4 col = vec4(color.rgb, base.a);
|
||||
col *= gl_Color;
|
||||
gl_FragColor = vec4(col.rgb, base.a);
|
||||
}
|
||||
11
client/shaders/minimap_shader/opengl_vertex.glsl
Normal file
11
client/shaders/minimap_shader/opengl_vertex.glsl
Normal file
@@ -0,0 +1,11 @@
|
||||
uniform mat4 mWorldViewProj;
|
||||
uniform mat4 mInvWorld;
|
||||
uniform mat4 mTransWorld;
|
||||
uniform mat4 mWorld;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
gl_TexCoord[0] = gl_MultiTexCoord0;
|
||||
gl_Position = mWorldViewProj * gl_Vertex;
|
||||
gl_FrontColor = gl_BackColor = gl_Color;
|
||||
}
|
||||
167
client/shaders/nodes_shader/opengl_fragment.glsl
Normal file
167
client/shaders/nodes_shader/opengl_fragment.glsl
Normal file
@@ -0,0 +1,167 @@
|
||||
uniform sampler2D baseTexture;
|
||||
uniform sampler2D normalTexture;
|
||||
uniform sampler2D textureFlags;
|
||||
|
||||
uniform vec4 skyBgColor;
|
||||
uniform float fogDistance;
|
||||
uniform vec3 eyePosition;
|
||||
|
||||
varying vec3 vPosition;
|
||||
varying vec3 worldPosition;
|
||||
varying float area_enable_parallax;
|
||||
|
||||
varying vec3 eyeVec;
|
||||
varying vec3 tsEyeVec;
|
||||
varying vec3 lightVec;
|
||||
varying vec3 tsLightVec;
|
||||
|
||||
bool normalTexturePresent = false;
|
||||
|
||||
const float e = 2.718281828459;
|
||||
const float BS = 10.0;
|
||||
|
||||
void get_texture_flags()
|
||||
{
|
||||
vec4 flags = texture2D(textureFlags, vec2(0.0, 0.0));
|
||||
if (flags.r > 0.5) {
|
||||
normalTexturePresent = true;
|
||||
}
|
||||
}
|
||||
|
||||
float intensity(vec3 color)
|
||||
{
|
||||
return (color.r + color.g + color.b) / 3.0;
|
||||
}
|
||||
|
||||
float get_rgb_height(vec2 uv)
|
||||
{
|
||||
return intensity(texture2D(baseTexture, uv).rgb);
|
||||
}
|
||||
|
||||
vec4 get_normal_map(vec2 uv)
|
||||
{
|
||||
vec4 bump = texture2D(normalTexture, uv).rgba;
|
||||
bump.xyz = normalize(bump.xyz * 2.0 - 1.0);
|
||||
return bump;
|
||||
}
|
||||
|
||||
float find_intersection(vec2 dp, vec2 ds)
|
||||
{
|
||||
const float depth_step = 1.0 / 24.0;
|
||||
float depth = 1.0;
|
||||
for (int i = 0 ; i < 24 ; i++) {
|
||||
float h = texture2D(normalTexture, dp + ds * depth).a;
|
||||
if (h >= depth)
|
||||
break;
|
||||
depth -= depth_step;
|
||||
}
|
||||
return depth;
|
||||
}
|
||||
|
||||
float find_intersectionRGB(vec2 dp, vec2 ds)
|
||||
{
|
||||
const float depth_step = 1.0 / 24.0;
|
||||
float depth = 1.0;
|
||||
for (int i = 0 ; i < 24 ; i++) {
|
||||
float h = get_rgb_height(dp + ds * depth);
|
||||
if (h >= depth)
|
||||
break;
|
||||
depth -= depth_step;
|
||||
}
|
||||
return depth;
|
||||
}
|
||||
|
||||
void main(void)
|
||||
{
|
||||
vec3 color;
|
||||
vec4 bump;
|
||||
vec2 uv = gl_TexCoord[0].st;
|
||||
bool use_normalmap = false;
|
||||
get_texture_flags();
|
||||
|
||||
#ifdef ENABLE_PARALLAX_OCCLUSION
|
||||
vec2 eyeRay = vec2 (tsEyeVec.x, -tsEyeVec.y);
|
||||
const float scale = PARALLAX_OCCLUSION_SCALE / PARALLAX_OCCLUSION_ITERATIONS;
|
||||
const float bias = PARALLAX_OCCLUSION_BIAS / PARALLAX_OCCLUSION_ITERATIONS;
|
||||
|
||||
#if PARALLAX_OCCLUSION_MODE == 0
|
||||
// Parallax occlusion with slope information
|
||||
if (normalTexturePresent && area_enable_parallax > 0.0) {
|
||||
for (int i = 0; i < PARALLAX_OCCLUSION_ITERATIONS; i++) {
|
||||
vec4 normal = texture2D(normalTexture, uv.xy);
|
||||
float h = normal.a * scale - bias;
|
||||
uv += h * normal.z * eyeRay;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if PARALLAX_OCCLUSION_MODE == 1
|
||||
// Relief mapping
|
||||
if (normalTexturePresent && area_enable_parallax > 0.0) {
|
||||
vec2 ds = eyeRay * PARALLAX_OCCLUSION_SCALE;
|
||||
float dist = find_intersection(uv, ds);
|
||||
uv += dist * ds;
|
||||
#endif
|
||||
} else if (GENERATE_NORMALMAPS == 1 && area_enable_parallax > 0.0) {
|
||||
vec2 ds = eyeRay * PARALLAX_OCCLUSION_SCALE;
|
||||
float dist = find_intersectionRGB(uv, ds);
|
||||
uv += dist * ds;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if USE_NORMALMAPS == 1
|
||||
if (normalTexturePresent) {
|
||||
bump = get_normal_map(uv);
|
||||
use_normalmap = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (GENERATE_NORMALMAPS == 1 && normalTexturePresent == false) {
|
||||
float tl = get_rgb_height(vec2(uv.x - SAMPLE_STEP, uv.y + SAMPLE_STEP));
|
||||
float t = get_rgb_height(vec2(uv.x - SAMPLE_STEP, uv.y - SAMPLE_STEP));
|
||||
float tr = get_rgb_height(vec2(uv.x + SAMPLE_STEP, uv.y + SAMPLE_STEP));
|
||||
float r = get_rgb_height(vec2(uv.x + SAMPLE_STEP, uv.y));
|
||||
float br = get_rgb_height(vec2(uv.x + SAMPLE_STEP, uv.y - SAMPLE_STEP));
|
||||
float b = get_rgb_height(vec2(uv.x, uv.y - SAMPLE_STEP));
|
||||
float bl = get_rgb_height(vec2(uv.x -SAMPLE_STEP, uv.y - SAMPLE_STEP));
|
||||
float l = get_rgb_height(vec2(uv.x - SAMPLE_STEP, uv.y));
|
||||
float dX = (tr + 2.0 * r + br) - (tl + 2.0 * l + bl);
|
||||
float dY = (bl + 2.0 * b + br) - (tl + 2.0 * t + tr);
|
||||
bump = vec4(normalize(vec3 (dX, dY, NORMALMAPS_STRENGTH)), 1.0);
|
||||
use_normalmap = true;
|
||||
}
|
||||
|
||||
vec4 base = texture2D(baseTexture, uv).rgba;
|
||||
|
||||
#ifdef ENABLE_BUMPMAPPING
|
||||
if (use_normalmap) {
|
||||
vec3 L = normalize(lightVec);
|
||||
vec3 E = normalize(eyeVec);
|
||||
float specular = pow(clamp(dot(reflect(L, bump.xyz), E), 0.0, 1.0), 1.0);
|
||||
float diffuse = dot(-E,bump.xyz);
|
||||
color = (diffuse + 0.1 * specular) * base.rgb;
|
||||
} else {
|
||||
color = base.rgb;
|
||||
}
|
||||
#else
|
||||
color = base.rgb;
|
||||
#endif
|
||||
|
||||
#if MATERIAL_TYPE == TILE_MATERIAL_LIQUID_TRANSPARENT || MATERIAL_TYPE == TILE_MATERIAL_LIQUID_OPAQUE
|
||||
float alpha = gl_Color.a;
|
||||
vec4 col = vec4(color.rgb, alpha);
|
||||
col *= gl_Color;
|
||||
if (fogDistance != 0.0) {
|
||||
float d = max(0.0, min(vPosition.z / fogDistance * 1.5 - 0.6, 1.0));
|
||||
alpha = mix(alpha, 0.0, d);
|
||||
}
|
||||
gl_FragColor = vec4(col.rgb, alpha);
|
||||
#else
|
||||
vec4 col = vec4(color.rgb, base.a);
|
||||
col *= gl_Color;
|
||||
if (fogDistance != 0.0) {
|
||||
float d = max(0.0, min(vPosition.z / fogDistance * 1.5 - 0.6, 1.0));
|
||||
col = mix(col, skyBgColor, d);
|
||||
}
|
||||
gl_FragColor = vec4(col.rgb, base.a);
|
||||
#endif
|
||||
}
|
||||
149
client/shaders/nodes_shader/opengl_vertex.glsl
Normal file
149
client/shaders/nodes_shader/opengl_vertex.glsl
Normal file
@@ -0,0 +1,149 @@
|
||||
uniform mat4 mWorldViewProj;
|
||||
uniform mat4 mInvWorld;
|
||||
uniform mat4 mTransWorld;
|
||||
uniform mat4 mWorld;
|
||||
|
||||
uniform float dayNightRatio;
|
||||
uniform vec3 eyePosition;
|
||||
uniform float animationTimer;
|
||||
|
||||
varying vec3 vPosition;
|
||||
varying vec3 worldPosition;
|
||||
|
||||
varying vec3 eyeVec;
|
||||
varying vec3 lightVec;
|
||||
varying vec3 tsEyeVec;
|
||||
varying vec3 tsLightVec;
|
||||
varying float area_enable_parallax;
|
||||
|
||||
const float e = 2.718281828459;
|
||||
const float BS = 10.0;
|
||||
|
||||
float smoothCurve(float x)
|
||||
{
|
||||
return x * x * (3.0 - 2.0 * x);
|
||||
}
|
||||
float triangleWave(float x)
|
||||
{
|
||||
return abs(fract(x + 0.5) * 2.0 - 1.0);
|
||||
}
|
||||
float smoothTriangleWave(float x)
|
||||
{
|
||||
return smoothCurve(triangleWave(x)) * 2.0 - 1.0;
|
||||
}
|
||||
|
||||
void main(void)
|
||||
{
|
||||
gl_TexCoord[0] = gl_MultiTexCoord0;
|
||||
//TODO: make offset depending on view angle and parallax uv displacement
|
||||
//thats for textures that doesnt align vertically, like dirt with grass
|
||||
//gl_TexCoord[0].y += 0.008;
|
||||
|
||||
//Allow parallax/relief mapping only for certain kind of nodes
|
||||
//Variable is also used to control area of the effect
|
||||
#if (DRAW_TYPE == NDT_NORMAL || DRAW_TYPE == NDT_LIQUID || DRAW_TYPE == NDT_FLOWINGLIQUID)
|
||||
area_enable_parallax = 1.0;
|
||||
#else
|
||||
area_enable_parallax = 0.0;
|
||||
#endif
|
||||
|
||||
#if ((MATERIAL_TYPE == TILE_MATERIAL_LIQUID_TRANSPARENT || MATERIAL_TYPE == TILE_MATERIAL_LIQUID_OPAQUE) && ENABLE_WAVING_WATER)
|
||||
vec4 pos = gl_Vertex;
|
||||
pos.y -= 2.0;
|
||||
|
||||
float posYbuf = (pos.z / WATER_WAVE_LENGTH + animationTimer * WATER_WAVE_SPEED * WATER_WAVE_LENGTH);
|
||||
|
||||
pos.y -= sin(posYbuf) * WATER_WAVE_HEIGHT + sin(posYbuf / 7.0) * WATER_WAVE_HEIGHT;
|
||||
gl_Position = mWorldViewProj * pos;
|
||||
#elif MATERIAL_TYPE == TILE_MATERIAL_WAVING_LEAVES && ENABLE_WAVING_LEAVES
|
||||
vec4 pos = gl_Vertex;
|
||||
vec4 pos2 = mWorld * gl_Vertex;
|
||||
|
||||
/*
|
||||
* Mathematic optimization: pos2.x * A + pos2.z * A (2 multiplications + 1 addition)
|
||||
* replaced with: (pos2.x + pos2.z) * A (1 addition + 1 multiplication)
|
||||
* And bufferize calcul to a float
|
||||
*/
|
||||
float pos2XpZ = pos2.x + pos2.z;
|
||||
|
||||
pos.x += (smoothTriangleWave(animationTimer*10.0 + pos2XpZ * 0.01) * 2.0 - 1.0) * 0.4;
|
||||
pos.y += (smoothTriangleWave(animationTimer*15.0 + pos2XpZ * -0.01) * 2.0 - 1.0) * 0.2;
|
||||
pos.z += (smoothTriangleWave(animationTimer*10.0 + pos2XpZ * -0.01) * 2.0 - 1.0) * 0.4;
|
||||
gl_Position = mWorldViewProj * pos;
|
||||
#elif MATERIAL_TYPE == TILE_MATERIAL_WAVING_PLANTS && ENABLE_WAVING_PLANTS
|
||||
vec4 pos = gl_Vertex;
|
||||
vec4 pos2 = mWorld * gl_Vertex;
|
||||
if (gl_TexCoord[0].y < 0.05) {
|
||||
/*
|
||||
* Mathematic optimization: pos2.x * A + pos2.z * A (2 multiplications + 1 addition)
|
||||
* replaced with: (pos2.x + pos2.z) * A (1 addition + 1 multiplication)
|
||||
* And bufferize calcul to a float
|
||||
*/
|
||||
float pos2XpZ = pos2.x + pos2.z;
|
||||
|
||||
pos.x += (smoothTriangleWave(animationTimer * 20.0 + pos2XpZ * 0.1) * 2.0 - 1.0) * 0.8;
|
||||
pos.y -= (smoothTriangleWave(animationTimer * 10.0 + pos2XpZ * -0.5) * 2.0 - 1.0) * 0.4;
|
||||
}
|
||||
gl_Position = mWorldViewProj * pos;
|
||||
#else
|
||||
gl_Position = mWorldViewProj * gl_Vertex;
|
||||
#endif
|
||||
|
||||
vPosition = gl_Position.xyz;
|
||||
worldPosition = (mWorld * gl_Vertex).xyz;
|
||||
|
||||
// Don't generate heightmaps when too far from the eye
|
||||
float dist = distance (vec3(0.0, 0.0 ,0.0), vPosition);
|
||||
if (dist > 150.0) {
|
||||
area_enable_parallax = 0.0;
|
||||
}
|
||||
|
||||
vec3 sunPosition = vec3 (0.0, eyePosition.y * BS + 900.0, 0.0);
|
||||
|
||||
vec3 normal, tangent, binormal;
|
||||
normal = normalize(gl_NormalMatrix * gl_Normal);
|
||||
tangent = normalize(gl_NormalMatrix * gl_MultiTexCoord1.xyz);
|
||||
binormal = normalize(gl_NormalMatrix * gl_MultiTexCoord2.xyz);
|
||||
|
||||
vec3 v;
|
||||
|
||||
lightVec = sunPosition - worldPosition;
|
||||
v.x = dot(lightVec, tangent);
|
||||
v.y = dot(lightVec, binormal);
|
||||
v.z = dot(lightVec, normal);
|
||||
tsLightVec = normalize (v);
|
||||
|
||||
eyeVec = -(gl_ModelViewMatrix * gl_Vertex).xyz;
|
||||
v.x = dot(eyeVec, tangent);
|
||||
v.y = dot(eyeVec, binormal);
|
||||
v.z = dot(eyeVec, normal);
|
||||
tsEyeVec = normalize (v);
|
||||
|
||||
vec4 color;
|
||||
float day = gl_Color.r;
|
||||
float night = gl_Color.g;
|
||||
float light_source = gl_Color.b;
|
||||
|
||||
float rg = mix(night, day, dayNightRatio);
|
||||
rg += light_source * 2.5; // Make light sources brighter
|
||||
float b = rg;
|
||||
|
||||
// Moonlight is blue
|
||||
b += (day - night) / 13.0;
|
||||
rg -= (day - night) / 23.0;
|
||||
|
||||
// Emphase blue a bit in darker places
|
||||
// See C++ implementation in mapblock_mesh.cpp finalColorBlend()
|
||||
b += max(0.0, (1.0 - abs(b - 0.13)/0.17) * 0.025);
|
||||
|
||||
// Artificial light is yellow-ish
|
||||
// See C++ implementation in mapblock_mesh.cpp finalColorBlend()
|
||||
rg += max(0.0, (1.0 - abs(rg - 0.85)/0.15) * 0.065);
|
||||
|
||||
color.r = rg;
|
||||
color.g = rg;
|
||||
color.b = b;
|
||||
|
||||
color.a = gl_Color.a;
|
||||
gl_FrontColor = gl_BackColor = clamp(color,0.0,1.0);
|
||||
}
|
||||
137
client/shaders/water_surface_shader/opengl_fragment.glsl
Normal file
137
client/shaders/water_surface_shader/opengl_fragment.glsl
Normal file
@@ -0,0 +1,137 @@
|
||||
uniform sampler2D baseTexture;
|
||||
uniform sampler2D normalTexture;
|
||||
uniform sampler2D textureFlags;
|
||||
|
||||
uniform vec4 skyBgColor;
|
||||
uniform float fogDistance;
|
||||
uniform vec3 eyePosition;
|
||||
|
||||
varying vec3 vPosition;
|
||||
varying vec3 worldPosition;
|
||||
|
||||
varying vec3 eyeVec;
|
||||
varying vec3 tsEyeVec;
|
||||
varying vec3 lightVec;
|
||||
varying vec3 tsLightVec;
|
||||
|
||||
bool normalTexturePresent = false;
|
||||
bool texTileableHorizontal = false;
|
||||
bool texTileableVertical = false;
|
||||
bool texSeamless = false;
|
||||
|
||||
const float e = 2.718281828459;
|
||||
const float BS = 10.0;
|
||||
|
||||
void get_texture_flags()
|
||||
{
|
||||
vec4 flags = texture2D(textureFlags, vec2(0.0, 0.0));
|
||||
if (flags.r > 0.5) {
|
||||
normalTexturePresent = true;
|
||||
}
|
||||
if (flags.g > 0.5) {
|
||||
texTileableHorizontal = true;
|
||||
}
|
||||
if (flags.b > 0.5) {
|
||||
texTileableVertical = true;
|
||||
}
|
||||
if (texTileableHorizontal && texTileableVertical) {
|
||||
texSeamless = true;
|
||||
}
|
||||
}
|
||||
|
||||
float intensity(vec3 color)
|
||||
{
|
||||
return (color.r + color.g + color.b) / 3.0;
|
||||
}
|
||||
|
||||
float get_rgb_height(vec2 uv)
|
||||
{
|
||||
return intensity(texture2D(baseTexture,uv).rgb);
|
||||
}
|
||||
|
||||
vec4 get_normal_map(vec2 uv)
|
||||
{
|
||||
vec4 bump = texture2D(normalTexture, uv).rgba;
|
||||
bump.xyz = normalize(bump.xyz * 2.0 -1.0);
|
||||
bump.y = -bump.y;
|
||||
return bump;
|
||||
}
|
||||
|
||||
void main(void)
|
||||
{
|
||||
vec3 color;
|
||||
vec4 bump;
|
||||
vec2 uv = gl_TexCoord[0].st;
|
||||
bool use_normalmap = false;
|
||||
get_texture_flags();
|
||||
|
||||
#ifdef ENABLE_PARALLAX_OCCLUSION
|
||||
if (normalTexturePresent) {
|
||||
vec3 tsEye = normalize(tsEyeVec);
|
||||
float height = PARALLAX_OCCLUSION_SCALE * texture2D(normalTexture, uv).a - PARALLAX_OCCLUSION_BIAS;
|
||||
uv = uv + texture2D(normalTexture, uv).z * height * vec2(tsEye.x,-tsEye.y);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef USE_NORMALMAPS
|
||||
if (normalTexturePresent) {
|
||||
bump = get_normal_map(uv);
|
||||
use_normalmap = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (GENERATE_NORMALMAPS == 1 && use_normalmap == false) {
|
||||
float tl = get_rgb_height (vec2(uv.x-SAMPLE_STEP,uv.y+SAMPLE_STEP));
|
||||
float t = get_rgb_height (vec2(uv.x-SAMPLE_STEP,uv.y-SAMPLE_STEP));
|
||||
float tr = get_rgb_height (vec2(uv.x+SAMPLE_STEP,uv.y+SAMPLE_STEP));
|
||||
float r = get_rgb_height (vec2(uv.x+SAMPLE_STEP,uv.y));
|
||||
float br = get_rgb_height (vec2(uv.x+SAMPLE_STEP,uv.y-SAMPLE_STEP));
|
||||
float b = get_rgb_height (vec2(uv.x,uv.y-SAMPLE_STEP));
|
||||
float bl = get_rgb_height (vec2(uv.x-SAMPLE_STEP,uv.y-SAMPLE_STEP));
|
||||
float l = get_rgb_height (vec2(uv.x-SAMPLE_STEP,uv.y));
|
||||
float dX = (tr + 2.0 * r + br) - (tl + 2.0 * l + bl);
|
||||
float dY = (bl + 2.0 * b + br) - (tl + 2.0 * t + tr);
|
||||
bump = vec4 (normalize(vec3 (dX, -dY, NORMALMAPS_STRENGTH)),1.0);
|
||||
use_normalmap = true;
|
||||
}
|
||||
|
||||
vec4 base = texture2D(baseTexture, uv).rgba;
|
||||
|
||||
#ifdef ENABLE_BUMPMAPPING
|
||||
if (use_normalmap) {
|
||||
vec3 L = normalize(lightVec);
|
||||
vec3 E = normalize(eyeVec);
|
||||
float specular = pow(clamp(dot(reflect(L, bump.xyz), E), 0.0, 1.0),0.5);
|
||||
float diffuse = dot(E,bump.xyz);
|
||||
/* Mathematic optimization
|
||||
* Original: color = 0.05*base.rgb + diffuse*base.rgb + 0.2*specular*base.rgb;
|
||||
* This optimization save 2 multiplications (orig: 4 multiplications + 3 additions
|
||||
* end: 2 multiplications + 3 additions)
|
||||
*/
|
||||
color = (0.05 + diffuse + 0.2 * specular) * base.rgb;
|
||||
} else {
|
||||
color = base.rgb;
|
||||
}
|
||||
#else
|
||||
color = base.rgb;
|
||||
#endif
|
||||
|
||||
#if MATERIAL_TYPE == TILE_MATERIAL_LIQUID_TRANSPARENT || MATERIAL_TYPE == TILE_MATERIAL_LIQUID_OPAQUE
|
||||
float alpha = gl_Color.a;
|
||||
vec4 col = vec4(color.rgb, alpha);
|
||||
col *= gl_Color;
|
||||
if(fogDistance != 0.0){
|
||||
float d = max(0.0, min(vPosition.z / fogDistance * 1.5 - 0.6, 1.0));
|
||||
alpha = mix(alpha, 0.0, d);
|
||||
}
|
||||
gl_FragColor = vec4(col.rgb, alpha);
|
||||
#else
|
||||
vec4 col = vec4(color.rgb, base.a);
|
||||
col *= gl_Color;
|
||||
if(fogDistance != 0.0){
|
||||
float d = max(0.0, min(vPosition.z / fogDistance * 1.5 - 0.6, 1.0));
|
||||
col = mix(col, skyBgColor, d);
|
||||
}
|
||||
gl_FragColor = vec4(col.rgb, base.a);
|
||||
#endif
|
||||
}
|
||||
144
client/shaders/water_surface_shader/opengl_vertex.glsl
Normal file
144
client/shaders/water_surface_shader/opengl_vertex.glsl
Normal file
@@ -0,0 +1,144 @@
|
||||
uniform mat4 mWorldViewProj;
|
||||
uniform mat4 mInvWorld;
|
||||
uniform mat4 mTransWorld;
|
||||
uniform mat4 mWorld;
|
||||
|
||||
uniform float dayNightRatio;
|
||||
uniform vec3 eyePosition;
|
||||
uniform float animationTimer;
|
||||
|
||||
varying vec3 vPosition;
|
||||
varying vec3 worldPosition;
|
||||
|
||||
varying vec3 eyeVec;
|
||||
varying vec3 lightVec;
|
||||
varying vec3 tsEyeVec;
|
||||
varying vec3 tsLightVec;
|
||||
|
||||
const float e = 2.718281828459;
|
||||
const float BS = 10.0;
|
||||
|
||||
float smoothCurve(float x)
|
||||
{
|
||||
return x * x * (3.0 - 2.0 * x);
|
||||
}
|
||||
float triangleWave(float x)
|
||||
{
|
||||
return abs(fract( x + 0.5 ) * 2.0 - 1.0);
|
||||
}
|
||||
float smoothTriangleWave(float x)
|
||||
{
|
||||
return smoothCurve(triangleWave( x )) * 2.0 - 1.0;
|
||||
}
|
||||
|
||||
void main(void)
|
||||
{
|
||||
gl_TexCoord[0] = gl_MultiTexCoord0;
|
||||
|
||||
#if (MATERIAL_TYPE == TILE_MATERIAL_LIQUID_TRANSPARENT || MATERIAL_TYPE == TILE_MATERIAL_LIQUID_OPAQUE) && ENABLE_WAVING_WATER
|
||||
vec4 pos = gl_Vertex;
|
||||
pos.y -= 2.0;
|
||||
|
||||
float posYbuf = (pos.z / WATER_WAVE_LENGTH + animationTimer * WATER_WAVE_SPEED * WATER_WAVE_LENGTH);
|
||||
|
||||
pos.y -= sin(posYbuf) * WATER_WAVE_HEIGHT + sin(posYbuf / 7.0) * WATER_WAVE_HEIGHT;
|
||||
gl_Position = mWorldViewProj * pos;
|
||||
#elif MATERIAL_TYPE == TILE_MATERIAL_WAVING_LEAVES && ENABLE_WAVING_LEAVES
|
||||
vec4 pos = gl_Vertex;
|
||||
vec4 pos2 = mWorld * gl_Vertex;
|
||||
/*
|
||||
* Mathematic optimization: pos2.x * A + pos2.z * A (2 multiplications + 1 addition)
|
||||
* replaced with: (pos2.x + pos2.z) * A (1 addition + 1 multiplication)
|
||||
* And bufferize calcul to a float
|
||||
*/
|
||||
float pos2XpZ = pos2.x + pos2.z;
|
||||
pos.x += (smoothTriangleWave(animationTimer*10.0 + pos2XpZ * 0.01) * 2.0 - 1.0) * 0.4;
|
||||
pos.y += (smoothTriangleWave(animationTimer*15.0 + pos2XpZ * -0.01) * 2.0 - 1.0) * 0.2;
|
||||
pos.z += (smoothTriangleWave(animationTimer*10.0 + pos2XpZ * -0.01) * 2.0 - 1.0) * 0.4;
|
||||
gl_Position = mWorldViewProj * pos;
|
||||
#elif MATERIAL_TYPE == TILE_MATERIAL_WAVING_PLANTS && ENABLE_WAVING_PLANTS
|
||||
vec4 pos = gl_Vertex;
|
||||
vec4 pos2 = mWorld * gl_Vertex;
|
||||
if (gl_TexCoord[0].y < 0.05) {
|
||||
/*
|
||||
* Mathematic optimization: pos2.x * A + pos2.z * A (2 multiplications + 1 addition)
|
||||
* replaced with: (pos2.x + pos2.z) * A (1 addition + 1 multiplication)
|
||||
* And bufferize calcul to a float
|
||||
*/
|
||||
float pos2XpZ = pos2.x + pos2.z;
|
||||
pos.x += (smoothTriangleWave(animationTimer * 20.0 + pos2XpZ * 0.1) * 2.0 - 1.0) * 0.8;
|
||||
pos.y -= (smoothTriangleWave(animationTimer * 10.0 + pos2XpZ * -0.5) * 2.0 - 1.0) * 0.4;
|
||||
}
|
||||
gl_Position = mWorldViewProj * pos;
|
||||
#else
|
||||
gl_Position = mWorldViewProj * gl_Vertex;
|
||||
#endif
|
||||
|
||||
vPosition = gl_Position.xyz;
|
||||
worldPosition = (mWorld * gl_Vertex).xyz;
|
||||
vec3 sunPosition = vec3 (0.0, eyePosition.y * BS + 900.0, 0.0);
|
||||
|
||||
vec3 normal, tangent, binormal;
|
||||
normal = normalize(gl_NormalMatrix * gl_Normal);
|
||||
if (gl_Normal.x > 0.5) {
|
||||
// 1.0, 0.0, 0.0
|
||||
tangent = normalize(gl_NormalMatrix * vec3( 0.0, 0.0, -1.0));
|
||||
binormal = normalize(gl_NormalMatrix * vec3( 0.0, -1.0, 0.0));
|
||||
} else if (gl_Normal.x < -0.5) {
|
||||
// -1.0, 0.0, 0.0
|
||||
tangent = normalize(gl_NormalMatrix * vec3( 0.0, 0.0, 1.0));
|
||||
binormal = normalize(gl_NormalMatrix * vec3( 0.0, -1.0, 0.0));
|
||||
} else if (gl_Normal.y > 0.5) {
|
||||
// 0.0, 1.0, 0.0
|
||||
tangent = normalize(gl_NormalMatrix * vec3( 1.0, 0.0, 0.0));
|
||||
binormal = normalize(gl_NormalMatrix * vec3( 0.0, 0.0, 1.0));
|
||||
} else if (gl_Normal.y < -0.5) {
|
||||
// 0.0, -1.0, 0.0
|
||||
tangent = normalize(gl_NormalMatrix * vec3( 1.0, 0.0, 0.0));
|
||||
binormal = normalize(gl_NormalMatrix * vec3( 0.0, 0.0, 1.0));
|
||||
} else if (gl_Normal.z > 0.5) {
|
||||
// 0.0, 0.0, 1.0
|
||||
tangent = normalize(gl_NormalMatrix * vec3( 1.0, 0.0, 0.0));
|
||||
binormal = normalize(gl_NormalMatrix * vec3( 0.0, -1.0, 0.0));
|
||||
} else if (gl_Normal.z < -0.5) {
|
||||
// 0.0, 0.0, -1.0
|
||||
tangent = normalize(gl_NormalMatrix * vec3(-1.0, 0.0, 0.0));
|
||||
binormal = normalize(gl_NormalMatrix * vec3( 0.0, -1.0, 0.0));
|
||||
}
|
||||
mat3 tbnMatrix = mat3(tangent.x, binormal.x, normal.x,
|
||||
tangent.y, binormal.y, normal.y,
|
||||
tangent.z, binormal.z, normal.z);
|
||||
|
||||
lightVec = sunPosition - worldPosition;
|
||||
tsLightVec = lightVec * tbnMatrix;
|
||||
eyeVec = (gl_ModelViewMatrix * gl_Vertex).xyz;
|
||||
tsEyeVec = eyeVec * tbnMatrix;
|
||||
|
||||
vec4 color;
|
||||
float day = gl_Color.r;
|
||||
float night = gl_Color.g;
|
||||
float light_source = gl_Color.b;
|
||||
|
||||
float rg = mix(night, day, dayNightRatio);
|
||||
rg += light_source * 2.5; // Make light sources brighter
|
||||
float b = rg;
|
||||
|
||||
// Moonlight is blue
|
||||
b += (day - night) / 13.0;
|
||||
rg -= (day - night) / 23.0;
|
||||
|
||||
// Emphase blue a bit in darker places
|
||||
// See C++ implementation in mapblock_mesh.cpp finalColorBlend()
|
||||
b += max(0.0, (1.0 - abs(b - 0.13)/0.17) * 0.025);
|
||||
|
||||
// Artificial light is yellow-ish
|
||||
// See C++ implementation in mapblock_mesh.cpp finalColorBlend()
|
||||
rg += max(0.0, (1.0 - abs(rg - 0.85)/0.15) * 0.065);
|
||||
|
||||
color.r = rg;
|
||||
color.g = rg;
|
||||
color.b = b;
|
||||
|
||||
color.a = gl_Color.a;
|
||||
gl_FrontColor = gl_BackColor = clamp(color,0.0,1.0);
|
||||
}
|
||||
114
client/shaders/wielded_shader/opengl_fragment.glsl
Normal file
114
client/shaders/wielded_shader/opengl_fragment.glsl
Normal file
@@ -0,0 +1,114 @@
|
||||
uniform sampler2D baseTexture;
|
||||
uniform sampler2D normalTexture;
|
||||
uniform sampler2D textureFlags;
|
||||
|
||||
uniform vec4 skyBgColor;
|
||||
uniform float fogDistance;
|
||||
uniform vec3 eyePosition;
|
||||
|
||||
varying vec3 vPosition;
|
||||
varying vec3 worldPosition;
|
||||
|
||||
varying vec3 eyeVec;
|
||||
varying vec3 lightVec;
|
||||
|
||||
bool normalTexturePresent = false;
|
||||
bool texTileableHorizontal = false;
|
||||
bool texTileableVertical = false;
|
||||
bool texSeamless = false;
|
||||
|
||||
const float e = 2.718281828459;
|
||||
const float BS = 10.0;
|
||||
|
||||
void get_texture_flags()
|
||||
{
|
||||
vec4 flags = texture2D(textureFlags, vec2(0.0, 0.0));
|
||||
if (flags.r > 0.5) {
|
||||
normalTexturePresent = true;
|
||||
}
|
||||
if (flags.g > 0.5) {
|
||||
texTileableHorizontal = true;
|
||||
}
|
||||
if (flags.b > 0.5) {
|
||||
texTileableVertical = true;
|
||||
}
|
||||
if (texTileableHorizontal && texTileableVertical) {
|
||||
texSeamless = true;
|
||||
}
|
||||
}
|
||||
|
||||
float intensity(vec3 color)
|
||||
{
|
||||
return (color.r + color.g + color.b) / 3.0;
|
||||
}
|
||||
|
||||
float get_rgb_height(vec2 uv)
|
||||
{
|
||||
if (texSeamless) {
|
||||
return intensity(texture2D(baseTexture, uv).rgb);
|
||||
} else {
|
||||
return intensity(texture2D(baseTexture, clamp(uv, 0.0, 0.999)).rgb);
|
||||
}
|
||||
}
|
||||
|
||||
vec4 get_normal_map(vec2 uv)
|
||||
{
|
||||
vec4 bump = texture2D(normalTexture, uv).rgba;
|
||||
bump.xyz = normalize(bump.xyz * 2.0 - 1.0);
|
||||
return bump;
|
||||
}
|
||||
|
||||
void main(void)
|
||||
{
|
||||
vec3 color;
|
||||
vec4 bump;
|
||||
vec2 uv = gl_TexCoord[0].st;
|
||||
bool use_normalmap = false;
|
||||
get_texture_flags();
|
||||
|
||||
#if USE_NORMALMAPS == 1
|
||||
if (normalTexturePresent) {
|
||||
bump = get_normal_map(uv);
|
||||
use_normalmap = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (GENERATE_NORMALMAPS == 1 && normalTexturePresent == false) {
|
||||
float tl = get_rgb_height(vec2(uv.x - SAMPLE_STEP, uv.y + SAMPLE_STEP));
|
||||
float t = get_rgb_height(vec2(uv.x - SAMPLE_STEP, uv.y - SAMPLE_STEP));
|
||||
float tr = get_rgb_height(vec2(uv.x + SAMPLE_STEP, uv.y + SAMPLE_STEP));
|
||||
float r = get_rgb_height(vec2(uv.x + SAMPLE_STEP, uv.y));
|
||||
float br = get_rgb_height(vec2(uv.x + SAMPLE_STEP, uv.y - SAMPLE_STEP));
|
||||
float b = get_rgb_height(vec2(uv.x, uv.y - SAMPLE_STEP));
|
||||
float bl = get_rgb_height(vec2(uv.x -SAMPLE_STEP, uv.y - SAMPLE_STEP));
|
||||
float l = get_rgb_height(vec2(uv.x - SAMPLE_STEP, uv.y));
|
||||
float dX = (tr + 2.0 * r + br) - (tl + 2.0 * l + bl);
|
||||
float dY = (bl + 2.0 * b + br) - (tl + 2.0 * t + tr);
|
||||
bump = vec4(normalize(vec3 (dX, dY, NORMALMAPS_STRENGTH)), 1.0);
|
||||
use_normalmap = true;
|
||||
}
|
||||
|
||||
vec4 base = texture2D(baseTexture, uv).rgba;
|
||||
|
||||
#ifdef ENABLE_BUMPMAPPING
|
||||
if (use_normalmap) {
|
||||
vec3 L = normalize(lightVec);
|
||||
vec3 E = normalize(eyeVec);
|
||||
float specular = pow(clamp(dot(reflect(L, bump.xyz), E), 0.0, 1.0), 1.0);
|
||||
float diffuse = dot(-E,bump.xyz);
|
||||
color = (diffuse + 0.1 * specular) * base.rgb;
|
||||
} else {
|
||||
color = base.rgb;
|
||||
}
|
||||
#else
|
||||
color = base.rgb;
|
||||
#endif
|
||||
|
||||
vec4 col = vec4(color.rgb, base.a);
|
||||
col *= gl_Color;
|
||||
if (fogDistance != 0.0) {
|
||||
float d = max(0.0, min(vPosition.z / fogDistance * 1.5 - 0.6, 1.0));
|
||||
col = mix(col, skyBgColor, d);
|
||||
}
|
||||
gl_FragColor = vec4(col.rgb, base.a);
|
||||
}
|
||||
35
client/shaders/wielded_shader/opengl_vertex.glsl
Normal file
35
client/shaders/wielded_shader/opengl_vertex.glsl
Normal file
@@ -0,0 +1,35 @@
|
||||
uniform mat4 mWorldViewProj;
|
||||
uniform mat4 mInvWorld;
|
||||
uniform mat4 mTransWorld;
|
||||
uniform mat4 mWorld;
|
||||
|
||||
uniform float dayNightRatio;
|
||||
uniform vec3 eyePosition;
|
||||
uniform float animationTimer;
|
||||
|
||||
varying vec3 vPosition;
|
||||
varying vec3 worldPosition;
|
||||
|
||||
varying vec3 eyeVec;
|
||||
varying vec3 lightVec;
|
||||
varying vec3 tsEyeVec;
|
||||
varying vec3 tsLightVec;
|
||||
|
||||
const float e = 2.718281828459;
|
||||
const float BS = 10.0;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
gl_TexCoord[0] = gl_MultiTexCoord0;
|
||||
gl_Position = mWorldViewProj * gl_Vertex;
|
||||
|
||||
vPosition = gl_Position.xyz;
|
||||
worldPosition = (mWorld * gl_Vertex).xyz;
|
||||
|
||||
vec3 sunPosition = vec3 (0.0, eyePosition.y * BS + 900.0, 0.0);
|
||||
|
||||
lightVec = sunPosition - worldPosition;
|
||||
eyeVec = -(gl_ModelViewMatrix * gl_Vertex).xyz;
|
||||
|
||||
gl_FrontColor = gl_BackColor = gl_Color;
|
||||
}
|
||||
19
cmake/Modules/FindCURL.cmake
Normal file
19
cmake/Modules/FindCURL.cmake
Normal file
@@ -0,0 +1,19 @@
|
||||
mark_as_advanced(CURL_LIBRARY CURL_INCLUDE_DIR)
|
||||
|
||||
find_library(CURL_LIBRARY NAMES curl)
|
||||
find_path(CURL_INCLUDE_DIR NAMES curl/curl.h)
|
||||
|
||||
set(CURL_REQUIRED_VARS CURL_LIBRARY CURL_INCLUDE_DIR)
|
||||
|
||||
if(WIN32)
|
||||
find_file(CURL_DLL NAMES libcurl-4.dll
|
||||
PATHS
|
||||
"C:/Windows/System32"
|
||||
DOC "Path to the cURL DLL (for installation)")
|
||||
mark_as_advanced(CURL_DLL)
|
||||
set(CURL_REQUIRED_VARS ${CURL_REQUIRED_VARS} CURL_DLL)
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(CURL DEFAULT_MSG ${CURL_REQUIRED_VARS})
|
||||
|
||||
28
cmake/Modules/FindGMP.cmake
Normal file
28
cmake/Modules/FindGMP.cmake
Normal file
@@ -0,0 +1,28 @@
|
||||
|
||||
option(ENABLE_SYSTEM_GMP "Use GMP from system" TRUE)
|
||||
mark_as_advanced(GMP_LIBRARY GMP_INCLUDE_DIR)
|
||||
set(USE_SYSTEM_GMP FALSE)
|
||||
|
||||
if(ENABLE_SYSTEM_GMP)
|
||||
find_library(GMP_LIBRARY NAMES libgmp.so)
|
||||
find_path(GMP_INCLUDE_DIR NAMES gmp.h)
|
||||
|
||||
if(GMP_LIBRARY AND GMP_INCLUDE_DIR)
|
||||
message (STATUS "Using GMP provided by system.")
|
||||
set(USE_SYSTEM_GMP TRUE)
|
||||
else()
|
||||
message (STATUS "Detecting GMP from system failed.")
|
||||
endif()
|
||||
else()
|
||||
message (STATUS "Detecting GMP from system disabled! (ENABLE_SYSTEM_GMP=0)")
|
||||
endif()
|
||||
|
||||
if(NOT USE_SYSTEM_GMP)
|
||||
message(STATUS "Using bundled mini-gmp library.")
|
||||
set(GMP_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/gmp)
|
||||
set(GMP_LIBRARY gmp)
|
||||
add_subdirectory(gmp)
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(GMP DEFAULT_MSG GMP_LIBRARY GMP_INCLUDE_DIR)
|
||||
@@ -1,80 +1,78 @@
|
||||
# Package finder for gettext libs and include files
|
||||
|
||||
SET(CUSTOM_GETTEXT_PATH "${PROJECT_SOURCE_DIR}/../../gettext"
|
||||
set(CUSTOM_GETTEXT_PATH "${PROJECT_SOURCE_DIR}/../../gettext"
|
||||
CACHE FILEPATH "path to custom gettext")
|
||||
|
||||
# by default
|
||||
SET(GETTEXT_FOUND FALSE)
|
||||
|
||||
FIND_PATH(GETTEXT_INCLUDE_DIR
|
||||
find_path(GETTEXT_INCLUDE_DIR
|
||||
NAMES libintl.h
|
||||
PATHS "${CUSTOM_GETTEXT_PATH}/include"
|
||||
DOC "gettext include directory")
|
||||
DOC "GetText include directory")
|
||||
|
||||
FIND_PROGRAM(GETTEXT_MSGFMT
|
||||
find_program(GETTEXT_MSGFMT
|
||||
NAMES msgfmt
|
||||
PATHS "${CUSTOM_GETTEXT_PATH}/bin"
|
||||
DOC "path to msgfmt")
|
||||
DOC "Path to msgfmt")
|
||||
|
||||
FIND_PROGRAM(GETTEXT_MSGMERGE
|
||||
NAMES msgmerge
|
||||
PATHS "${CUSTOM_GETTEXT_PATH}/bin"
|
||||
DOC "path to msgmerge")
|
||||
set(GETTEXT_REQUIRED_VARS GETTEXT_INCLUDE_DIR GETTEXT_MSGFMT)
|
||||
|
||||
FIND_PROGRAM(GETTEXT_MSGEN
|
||||
NAMES msgen
|
||||
PATHS "${CUSTOM_GETTEXT_PATH}/bin"
|
||||
DOC "path to msgen")
|
||||
if(APPLE)
|
||||
find_library(GETTEXT_LIBRARY
|
||||
NAMES libintl.a
|
||||
PATHS "${CUSTOM_GETTEXT_PATH}/lib"
|
||||
DOC "GetText library")
|
||||
|
||||
FIND_PROGRAM(GETTEXT_EXTRACT
|
||||
NAMES xgettext
|
||||
PATHS "${CUSTOM_GETTEXT_PATH}/bin"
|
||||
DOC "path to xgettext")
|
||||
find_library(ICONV_LIBRARY
|
||||
NAMES libiconv.dylib
|
||||
PATHS "/usr/lib"
|
||||
DOC "IConv library")
|
||||
set(GETTEXT_REQUIRED_VARS ${GETTEXT_REQUIRED_VARS} GETTEXT_LIBRARY ICONV_LIBRARY)
|
||||
endif(APPLE)
|
||||
|
||||
# modern Linux, as well as Mac, seem to not need require special linking
|
||||
# they do not because gettext is part of glibc
|
||||
# TODO check the requirements on other BSDs and older Linux
|
||||
IF (WIN32)
|
||||
IF(MSVC)
|
||||
SET(GETTEXT_LIB_NAMES
|
||||
# Modern Linux, as well as OSX, does not require special linking because
|
||||
# GetText is part of glibc.
|
||||
# TODO: check the requirements on other BSDs and older Linux
|
||||
if(WIN32)
|
||||
if(MSVC)
|
||||
set(GETTEXT_LIB_NAMES
|
||||
libintl.lib intl.lib libintl3.lib intl3.lib)
|
||||
ELSE()
|
||||
SET(GETTEXT_LIB_NAMES
|
||||
else()
|
||||
set(GETTEXT_LIB_NAMES
|
||||
libintl.dll.a intl.dll.a libintl3.dll.a intl3.dll.a)
|
||||
ENDIF()
|
||||
FIND_LIBRARY(GETTEXT_LIBRARY
|
||||
endif()
|
||||
find_library(GETTEXT_LIBRARY
|
||||
NAMES ${GETTEXT_LIB_NAMES}
|
||||
PATHS "${CUSTOM_GETTEXT_PATH}/lib"
|
||||
DOC "gettext *intl*.lib")
|
||||
FIND_FILE(GETTEXT_DLL
|
||||
DOC "GetText library")
|
||||
find_file(GETTEXT_DLL
|
||||
NAMES libintl.dll intl.dll libintl3.dll intl3.dll
|
||||
PATHS "${CUSTOM_GETTEXT_PATH}/bin" "${CUSTOM_GETTEXT_PATH}/lib"
|
||||
DOC "gettext *intl*.dll")
|
||||
FIND_FILE(GETTEXT_ICONV_DLL
|
||||
find_file(GETTEXT_ICONV_DLL
|
||||
NAMES libiconv2.dll
|
||||
PATHS "${CUSTOM_GETTEXT_PATH}/bin" "${CUSTOM_GETTEXT_PATH}/lib"
|
||||
DOC "gettext *iconv*.lib")
|
||||
ENDIF(WIN32)
|
||||
set(GETTEXT_REQUIRED_VARS ${GETTEXT_REQUIRED_VARS} GETTEXT_DLL GETTEXT_ICONV_DLL)
|
||||
endif(WIN32)
|
||||
|
||||
|
||||
IF(GETTEXT_INCLUDE_DIR AND GETTEXT_MSGFMT)
|
||||
IF (WIN32)
|
||||
# in the Win32 case check also for the extra linking requirements
|
||||
IF(GETTEXT_LIBRARY AND GETTEXT_DLL AND GETTEXT_ICONV_DLL)
|
||||
SET(GETTEXT_FOUND TRUE)
|
||||
ENDIF()
|
||||
ELSE(WIN32)
|
||||
SET(GETTEXT_FOUND TRUE)
|
||||
ENDIF(WIN32)
|
||||
ENDIF()
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(GetText DEFAULT_MSG ${GETTEXT_REQUIRED_VARS})
|
||||
|
||||
|
||||
if(GETTEXT_FOUND)
|
||||
# BSD variants require special linkage as they don't use glibc
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "BSD")
|
||||
set(GETTEXT_LIBRARY "intl")
|
||||
endif()
|
||||
|
||||
set(GETTEXT_PO_PATH ${CMAKE_SOURCE_DIR}/po)
|
||||
set(GETTEXT_MO_BUILD_PATH ${CMAKE_BINARY_DIR}/locale/<locale>/LC_MESSAGES)
|
||||
set(GETTEXT_MO_DEST_PATH ${LOCALEDIR}/<locale>/LC_MESSAGES)
|
||||
file(GLOB GETTEXT_AVAILABLE_LOCALES RELATIVE ${GETTEXT_PO_PATH} "${GETTEXT_PO_PATH}/*")
|
||||
list(REMOVE_ITEM GETTEXT_AVAILABLE_LOCALES minetest.pot)
|
||||
list(REMOVE_ITEM GETTEXT_AVAILABLE_LOCALES timestamp)
|
||||
macro(SET_MO_PATHS _buildvar _destvar _locale)
|
||||
string(REPLACE "<locale>" ${_locale} ${_buildvar} ${GETTEXT_MO_BUILD_PATH})
|
||||
string(REPLACE "<locale>" ${_locale} ${_destvar} ${GETTEXT_MO_DEST_PATH})
|
||||
endmacro()
|
||||
endif()
|
||||
|
||||
IF(GETTEXT_FOUND)
|
||||
SET(GETTEXT_PO_PATH ${CMAKE_SOURCE_DIR}/po)
|
||||
SET(GETTEXT_MO_BUILD_PATH ${CMAKE_BINARY_DIR}/locale/<locale>/LC_MESSAGES)
|
||||
SET(GETTEXT_MO_DEST_PATH locale/<locale>/LC_MESSAGES)
|
||||
FILE(GLOB GETTEXT_AVAILABLE_LOCALES RELATIVE ${GETTEXT_PO_PATH} "${GETTEXT_PO_PATH}/*")
|
||||
MACRO(SET_MO_PATHS _buildvar _destvar _locale)
|
||||
STRING(REPLACE "<locale>" ${_locale} ${_buildvar} ${GETTEXT_MO_BUILD_PATH})
|
||||
STRING(REPLACE "<locale>" ${_locale} ${_destvar} ${GETTEXT_MO_DEST_PATH})
|
||||
ENDMACRO(SET_MO_PATHS)
|
||||
ENDIF()
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
#FindIrrlicht.cmake
|
||||
|
||||
mark_as_advanced(IRRLICHT_LIBRARY IRRLICHT_INCLUDE_DIR IRRLICHT_DLL)
|
||||
set(IRRLICHT_SOURCE_DIR "" CACHE PATH "Path to irrlicht source directory (optional)")
|
||||
|
||||
if( UNIX )
|
||||
# Unix
|
||||
else( UNIX )
|
||||
# Windows
|
||||
endif( UNIX )
|
||||
|
||||
# Find include directory
|
||||
|
||||
@@ -30,65 +25,47 @@ if(NOT IRRLICHT_SOURCE_DIR STREQUAL "")
|
||||
set(IRRLICHT_LIBRARY_NAMES libIrrlicht.a)
|
||||
endif()
|
||||
|
||||
FIND_PATH(IRRLICHT_INCLUDE_DIR NAMES irrlicht.h
|
||||
find_path(IRRLICHT_INCLUDE_DIR NAMES irrlicht.h
|
||||
PATHS
|
||||
${IRRLICHT_SOURCE_DIR_INCLUDE}
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
FIND_LIBRARY(IRRLICHT_LIBRARY NAMES ${IRRLICHT_LIBRARY_NAMES}
|
||||
find_library(IRRLICHT_LIBRARY NAMES ${IRRLICHT_LIBRARY_NAMES}
|
||||
PATHS
|
||||
${IRRLICHT_SOURCE_DIR_LIBS}
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
else()
|
||||
|
||||
FIND_PATH(IRRLICHT_INCLUDE_DIR NAMES irrlicht.h
|
||||
find_path(IRRLICHT_INCLUDE_DIR NAMES irrlicht.h
|
||||
PATHS
|
||||
/usr/local/include/irrlicht
|
||||
/usr/include/irrlicht
|
||||
)
|
||||
|
||||
FIND_LIBRARY(IRRLICHT_LIBRARY NAMES libIrrlicht.a Irrlicht
|
||||
find_library(IRRLICHT_LIBRARY NAMES libIrrlicht.so libIrrlicht.a Irrlicht
|
||||
PATHS
|
||||
/usr/local/lib
|
||||
/usr/lib
|
||||
)
|
||||
endif()
|
||||
|
||||
MESSAGE(STATUS "IRRLICHT_SOURCE_DIR = ${IRRLICHT_SOURCE_DIR}")
|
||||
MESSAGE(STATUS "IRRLICHT_INCLUDE_DIR = ${IRRLICHT_INCLUDE_DIR}")
|
||||
MESSAGE(STATUS "IRRLICHT_LIBRARY = ${IRRLICHT_LIBRARY}")
|
||||
|
||||
# On windows, find the dll for installation
|
||||
# On Windows, find the DLL for installation
|
||||
if(WIN32)
|
||||
if(MSVC)
|
||||
FIND_FILE(IRRLICHT_DLL NAMES Irrlicht.dll
|
||||
PATHS
|
||||
"${IRRLICHT_SOURCE_DIR}/bin/Win32-VisualStudio"
|
||||
DOC "Path of the Irrlicht dll (for installation)"
|
||||
)
|
||||
set(IRRLICHT_COMPILER "VisualStudio")
|
||||
else()
|
||||
FIND_FILE(IRRLICHT_DLL NAMES Irrlicht.dll
|
||||
PATHS
|
||||
"${IRRLICHT_SOURCE_DIR}/bin/Win32-gcc"
|
||||
DOC "Path of the Irrlicht dll (for installation)"
|
||||
)
|
||||
set(IRRLICHT_COMPILER "gcc")
|
||||
endif()
|
||||
MESSAGE(STATUS "IRRLICHT_DLL = ${IRRLICHT_DLL}")
|
||||
find_file(IRRLICHT_DLL NAMES Irrlicht.dll
|
||||
PATHS
|
||||
"${IRRLICHT_SOURCE_DIR}/bin/Win32-${IRRLICHT_COMPILER}"
|
||||
DOC "Path of the Irrlicht dll (for installation)"
|
||||
)
|
||||
endif(WIN32)
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and set IRRLICHT_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(IRRLICHT DEFAULT_MSG IRRLICHT_LIBRARY IRRLICHT_INCLUDE_DIR)
|
||||
|
||||
IF(IRRLICHT_FOUND)
|
||||
SET(IRRLICHT_LIBRARIES ${IRRLICHT_LIBRARY})
|
||||
ELSE(IRRLICHT_FOUND)
|
||||
SET(IRRLICHT_LIBRARIES)
|
||||
ENDIF(IRRLICHT_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(IRRLICHT_LIBRARY IRRLICHT_INCLUDE_DIR IRRLICHT_DLL)
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Irrlicht DEFAULT_MSG IRRLICHT_LIBRARY IRRLICHT_INCLUDE_DIR)
|
||||
|
||||
|
||||
27
cmake/Modules/FindJson.cmake
Normal file
27
cmake/Modules/FindJson.cmake
Normal file
@@ -0,0 +1,27 @@
|
||||
# Look for JSONCPP if asked to.
|
||||
# We use a bundled version by default because some distros ship versions of
|
||||
# JSONCPP that cause segfaults and other memory errors when we link with them.
|
||||
# See https://github.com/minetest/minetest/issues/1793
|
||||
|
||||
mark_as_advanced(JSON_LIBRARY JSON_INCLUDE_DIR)
|
||||
option(ENABLE_SYSTEM_JSONCPP "Enable using a system-wide JSONCPP. May cause segfaults and other memory errors!" FALSE)
|
||||
|
||||
if(ENABLE_SYSTEM_JSONCPP)
|
||||
find_library(JSON_LIBRARY NAMES jsoncpp)
|
||||
find_path(JSON_INCLUDE_DIR json/features.h)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(JSONCPP DEFAULT_MSG JSON_LIBRARY JSON_INCLUDE_DIR)
|
||||
|
||||
if(JSONCPP_FOUND)
|
||||
message(STATUS "Using system JSONCPP library.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT JSONCPP_FOUND)
|
||||
message(STATUS "Using bundled JSONCPP library.")
|
||||
set(JSON_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/json)
|
||||
set(JSON_LIBRARY jsoncpp)
|
||||
add_subdirectory(json)
|
||||
endif()
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
# Look for jthread, use our own if not found
|
||||
|
||||
FIND_PATH(JTHREAD_INCLUDE_DIR jthread.h)
|
||||
|
||||
FIND_LIBRARY(JTHREAD_LIBRARY NAMES jthread)
|
||||
|
||||
IF(JTHREAD_LIBRARY AND JTHREAD_INCLUDE_DIR)
|
||||
SET( JTHREAD_FOUND TRUE )
|
||||
ENDIF(JTHREAD_LIBRARY AND JTHREAD_INCLUDE_DIR)
|
||||
|
||||
IF(JTHREAD_FOUND)
|
||||
MESSAGE(STATUS "Found system jthread header file in ${JTHREAD_INCLUDE_DIR}")
|
||||
MESSAGE(STATUS "Found system jthread library ${JTHREAD_LIBRARY}")
|
||||
ELSE(JTHREAD_FOUND)
|
||||
SET(JTHREAD_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/jthread)
|
||||
SET(JTHREAD_LIBRARY jthread)
|
||||
MESSAGE(STATUS "Using project jthread library")
|
||||
ENDIF(JTHREAD_FOUND)
|
||||
25
cmake/Modules/FindLua.cmake
Normal file
25
cmake/Modules/FindLua.cmake
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
option(ENABLE_LUAJIT "Enable LuaJIT support" TRUE)
|
||||
mark_as_advanced(LUA_LIBRARY LUA_INCLUDE_DIR)
|
||||
set(USE_LUAJIT FALSE)
|
||||
|
||||
if(ENABLE_LUAJIT)
|
||||
find_library(LUA_LIBRARY luajit
|
||||
NAMES luajit-5.1)
|
||||
find_path(LUA_INCLUDE_DIR luajit.h
|
||||
NAMES luajit.h
|
||||
PATH_SUFFIXES luajit-2.0)
|
||||
if(LUA_LIBRARY AND LUA_INCLUDE_DIR)
|
||||
set(USE_LUAJIT TRUE)
|
||||
endif()
|
||||
else()
|
||||
message (STATUS "LuaJIT detection disabled! (ENABLE_LUAJIT=0)")
|
||||
endif()
|
||||
|
||||
if(NOT USE_LUAJIT)
|
||||
message(STATUS "LuaJIT not found, using bundled Lua.")
|
||||
set(LUA_LIBRARY "lua")
|
||||
set(LUA_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/lua/src")
|
||||
add_subdirectory(lua)
|
||||
endif()
|
||||
|
||||
112
cmake/Modules/FindOpenGLES2.cmake
Normal file
112
cmake/Modules/FindOpenGLES2.cmake
Normal file
@@ -0,0 +1,112 @@
|
||||
#-------------------------------------------------------------------
|
||||
# This file is stolen from part of the CMake build system for OGRE (Object-oriented Graphics Rendering Engine) http://www.ogre3d.org/
|
||||
#
|
||||
# The contents of this file are placed in the public domain. Feel
|
||||
# free to make use of it in any way you like.
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
# - Try to find OpenGLES and EGL
|
||||
# Once done this will define
|
||||
#
|
||||
# OPENGLES2_FOUND - system has OpenGLES
|
||||
# OPENGLES2_INCLUDE_DIR - the GL include directory
|
||||
# OPENGLES2_LIBRARIES - Link these to use OpenGLES
|
||||
#
|
||||
# EGL_FOUND - system has EGL
|
||||
# EGL_INCLUDE_DIR - the EGL include directory
|
||||
# EGL_LIBRARIES - Link these to use EGL
|
||||
|
||||
# Win32, Apple, and Android are not tested!
|
||||
# Linux tested and works
|
||||
|
||||
if(WIN32)
|
||||
if(CYGWIN)
|
||||
find_path(OPENGLES2_INCLUDE_DIR GLES2/gl2.h)
|
||||
find_library(OPENGLES2_LIBRARY libGLESv2)
|
||||
else()
|
||||
if(BORLAND)
|
||||
set(OPENGLES2_LIBRARY import32 CACHE STRING "OpenGL ES 2.x library for Win32")
|
||||
else()
|
||||
# TODO
|
||||
# set(OPENGLES_LIBRARY ${SOURCE_DIR}/Dependencies/lib/release/libGLESv2.lib CACHE STRING "OpenGL ES 2.x library for win32"
|
||||
endif()
|
||||
endif()
|
||||
elseif(APPLE)
|
||||
create_search_paths(/Developer/Platforms)
|
||||
findpkg_framework(OpenGLES2)
|
||||
set(OPENGLES2_LIBRARY "-framework OpenGLES")
|
||||
else()
|
||||
find_path(OPENGLES2_INCLUDE_DIR GLES2/gl2.h
|
||||
PATHS /usr/openwin/share/include
|
||||
/opt/graphics/OpenGL/include
|
||||
/usr/X11R6/include
|
||||
/usr/include
|
||||
)
|
||||
|
||||
find_library(OPENGLES2_LIBRARY
|
||||
NAMES GLESv2
|
||||
PATHS /opt/graphics/OpenGL/lib
|
||||
/usr/openwin/lib
|
||||
/usr/shlib /usr/X11R6/lib
|
||||
/usr/lib
|
||||
)
|
||||
|
||||
if(NOT BUILD_ANDROID)
|
||||
find_path(EGL_INCLUDE_DIR EGL/egl.h
|
||||
PATHS /usr/openwin/share/include
|
||||
/opt/graphics/OpenGL/include
|
||||
/usr/X11R6/include
|
||||
/usr/include
|
||||
)
|
||||
|
||||
find_library(EGL_LIBRARY
|
||||
NAMES EGL
|
||||
PATHS /opt/graphics/OpenGL/lib
|
||||
/usr/openwin/lib
|
||||
/usr/shlib
|
||||
/usr/X11R6/lib
|
||||
/usr/lib
|
||||
)
|
||||
|
||||
# On Unix OpenGL usually requires X11.
|
||||
# It doesn't require X11 on OSX.
|
||||
|
||||
if(OPENGLES2_LIBRARY)
|
||||
if(NOT X11_FOUND)
|
||||
include(FindX11)
|
||||
endif()
|
||||
if(X11_FOUND)
|
||||
set(OPENGLES2_LIBRARIES ${X11_LIBRARIES})
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(OPENGLES2_LIBRARIES ${OPENGLES2_LIBRARIES} ${OPENGLES2_LIBRARY})
|
||||
|
||||
if(BUILD_ANDROID)
|
||||
if(OPENGLES2_LIBRARY)
|
||||
set(EGL_LIBRARIES)
|
||||
set(OPENGLES2_FOUND TRUE)
|
||||
endif()
|
||||
else()
|
||||
if(OPENGLES2_LIBRARY AND EGL_LIBRARY)
|
||||
set(OPENGLES2_LIBRARIES ${OPENGLES2_LIBRARY} ${OPENGLES2_LIBRARIES})
|
||||
set(EGL_LIBRARIES ${EGL_LIBRARY} ${EGL_LIBRARIES})
|
||||
set(OPENGLES2_FOUND TRUE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
mark_as_advanced(
|
||||
OPENGLES2_INCLUDE_DIR
|
||||
OPENGLES2_LIBRARY
|
||||
EGL_INCLUDE_DIR
|
||||
EGL_LIBRARY
|
||||
)
|
||||
|
||||
if(OPENGLES2_FOUND)
|
||||
message(STATUS "Found system OpenGL ES 2 library: ${OPENGLES2_LIBRARIES}")
|
||||
else()
|
||||
set(OPENGLES2_LIBRARIES "")
|
||||
endif()
|
||||
|
||||
9
cmake/Modules/FindSQLite3.cmake
Normal file
9
cmake/Modules/FindSQLite3.cmake
Normal file
@@ -0,0 +1,9 @@
|
||||
mark_as_advanced(SQLITE3_LIBRARY SQLITE3_INCLUDE_DIR)
|
||||
|
||||
find_path(SQLITE3_INCLUDE_DIR sqlite3.h)
|
||||
|
||||
find_library(SQLITE3_LIBRARY NAMES sqlite3)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(SQLite3 DEFAULT_MSG SQLITE3_LIBRARY SQLITE3_INCLUDE_DIR)
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
# Look for sqlite3, use our own if not found
|
||||
|
||||
FIND_PATH(SQLITE3_INCLUDE_DIR sqlite3.h)
|
||||
|
||||
FIND_LIBRARY(SQLITE3_LIBRARY NAMES sqlite3)
|
||||
|
||||
IF(SQLITE3_LIBRARY AND SQLITE3_INCLUDE_DIR)
|
||||
SET( SQLITE3_FOUND TRUE )
|
||||
ENDIF(SQLITE3_LIBRARY AND SQLITE3_INCLUDE_DIR)
|
||||
|
||||
IF(SQLITE3_FOUND)
|
||||
MESSAGE(STATUS "Found system sqlite3 header file in ${SQLITE3_INCLUDE_DIR}")
|
||||
MESSAGE(STATUS "Found system sqlite3 library ${SQLITE3_LIBRARY}")
|
||||
ELSE(SQLITE3_FOUND)
|
||||
SET(SQLITE3_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/sqlite)
|
||||
SET(SQLITE3_LIBRARY sqlite3)
|
||||
MESSAGE(STATUS "Using project sqlite3 library")
|
||||
ENDIF(SQLITE3_FOUND)
|
||||
46
cmake/Modules/FindVorbis.cmake
Normal file
46
cmake/Modules/FindVorbis.cmake
Normal file
@@ -0,0 +1,46 @@
|
||||
# - Find vorbis
|
||||
# Find the native vorbis includes and libraries
|
||||
#
|
||||
# VORBIS_INCLUDE_DIR - where to find vorbis.h, etc.
|
||||
# OGG_INCLUDE_DIR - where to find ogg/ogg.h, etc.
|
||||
# VORBIS_LIBRARIES - List of libraries when using vorbis(file).
|
||||
# VORBIS_FOUND - True if vorbis found.
|
||||
|
||||
if(NOT GP2XWIZ)
|
||||
if(VORBIS_INCLUDE_DIR)
|
||||
# Already in cache, be silent
|
||||
set(VORBIS_FIND_QUIETLY TRUE)
|
||||
endif(VORBIS_INCLUDE_DIR)
|
||||
find_path(OGG_INCLUDE_DIR ogg/ogg.h)
|
||||
find_path(VORBIS_INCLUDE_DIR vorbis/vorbisfile.h)
|
||||
# MSVC built ogg/vorbis may be named ogg_static and vorbis_static
|
||||
find_library(OGG_LIBRARY NAMES ogg ogg_static)
|
||||
find_library(VORBIS_LIBRARY NAMES vorbis vorbis_static)
|
||||
find_library(VORBISFILE_LIBRARY NAMES vorbisfile vorbisfile_static)
|
||||
# Handle the QUIETLY and REQUIRED arguments and set VORBIS_FOUND
|
||||
# to TRUE if all listed variables are TRUE.
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(VORBIS DEFAULT_MSG
|
||||
OGG_INCLUDE_DIR VORBIS_INCLUDE_DIR
|
||||
OGG_LIBRARY VORBIS_LIBRARY VORBISFILE_LIBRARY)
|
||||
else(NOT GP2XWIZ)
|
||||
find_path(VORBIS_INCLUDE_DIR tremor/ivorbisfile.h)
|
||||
find_library(VORBIS_LIBRARY NAMES vorbis_dec)
|
||||
find_package_handle_standard_args(VORBIS DEFAULT_MSG
|
||||
VORBIS_INCLUDE_DIR VORBIS_LIBRARY)
|
||||
endif(NOT GP2XWIZ)
|
||||
|
||||
if(VORBIS_FOUND)
|
||||
if(NOT GP2XWIZ)
|
||||
set(VORBIS_LIBRARIES ${VORBISFILE_LIBRARY} ${VORBIS_LIBRARY}
|
||||
${OGG_LIBRARY})
|
||||
else(NOT GP2XWIZ)
|
||||
set(VORBIS_LIBRARIES ${VORBIS_LIBRARY})
|
||||
endif(NOT GP2XWIZ)
|
||||
else(VORBIS_FOUND)
|
||||
set(VORBIS_LIBRARIES)
|
||||
endif(VORBIS_FOUND)
|
||||
|
||||
mark_as_advanced(OGG_INCLUDE_DIR VORBIS_INCLUDE_DIR)
|
||||
mark_as_advanced(OGG_LIBRARY VORBIS_LIBRARY VORBISFILE_LIBRARY)
|
||||
|
||||
26
cmake/Modules/GenerateVersion.cmake
Normal file
26
cmake/Modules/GenerateVersion.cmake
Normal file
@@ -0,0 +1,26 @@
|
||||
# Always run during 'make'
|
||||
|
||||
if(DEVELOPMENT_BUILD)
|
||||
execute_process(COMMAND git rev-parse --short HEAD
|
||||
WORKING_DIRECTORY "${GENERATE_VERSION_SOURCE_DIR}"
|
||||
OUTPUT_VARIABLE VERSION_GITHASH OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
ERROR_QUIET)
|
||||
if(VERSION_GITHASH)
|
||||
set(VERSION_GITHASH "${VERSION_STRING}-${VERSION_GITHASH}")
|
||||
execute_process(COMMAND git diff-index --quiet HEAD
|
||||
WORKING_DIRECTORY "${GENERATE_VERSION_SOURCE_DIR}"
|
||||
RESULT_VARIABLE IS_DIRTY)
|
||||
if(IS_DIRTY)
|
||||
set(VERSION_GITHASH "${VERSION_GITHASH}-dirty")
|
||||
endif()
|
||||
message(STATUS "*** Detected Git version ${VERSION_GITHASH} ***")
|
||||
endif()
|
||||
endif()
|
||||
if(NOT VERSION_GITHASH)
|
||||
set(VERSION_GITHASH "${VERSION_STRING}")
|
||||
endif()
|
||||
|
||||
configure_file(
|
||||
${GENERATE_VERSION_SOURCE_DIR}/cmake_config_githash.h.in
|
||||
${GENERATE_VERSION_BINARY_DIR}/cmake_config_githash.h)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user