Compare commits
1594 Commits
Barotrauma
...
CBT
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9d6cb5225a | ||
|
|
8b6da6b033 | ||
|
|
02689d0d86 | ||
|
|
099d664731 | ||
|
|
1f7d695bba | ||
|
|
50327a4d83 | ||
|
|
9b35f6b23f | ||
|
|
928cfb4fde | ||
|
|
a9634988e9 | ||
|
|
87e0191a97 | ||
|
|
790378d2a5 | ||
|
|
a4607dffad | ||
|
|
ef66d27ffe | ||
|
|
84cb7cfeb7 | ||
|
|
53be3f0073 | ||
|
|
89aa818c0b | ||
|
|
3a5fbfde1e | ||
|
|
b9b457262f | ||
|
|
e161d92117 | ||
|
|
2e656509a8 | ||
|
|
b0b4acf392 | ||
|
|
e9673bf7f5 | ||
|
|
eeeb3d9db3 | ||
|
|
c882b0bb45 | ||
|
|
6c32873d4e | ||
|
|
bdd4dcfb9e | ||
|
|
ebe8ec455f | ||
|
|
d440ccbce2 | ||
|
|
1294ba6dec | ||
|
|
4c8e016dea | ||
|
|
232f7203e2 | ||
|
|
df0a4e62f5 | ||
|
|
7055480015 | ||
|
|
0e14983e88 | ||
|
|
9b05c51ae5 | ||
|
|
5e003bcf11 | ||
|
|
121f670c8b | ||
|
|
f05d4ef129 | ||
|
|
4167448279 | ||
|
|
413cc3ed4c | ||
|
|
4f2da55a8e | ||
|
|
f1808d9231 | ||
|
|
bcec409618 | ||
|
|
14c610e6c7 | ||
|
|
958335a01c | ||
|
|
b358882016 | ||
|
|
b8f1642d9d | ||
|
|
64818775cb | ||
|
|
5bfa15564a | ||
|
|
2ea97d3d5e | ||
|
|
bb2490eb13 | ||
|
|
57daa3ccb7 | ||
|
|
c1fdedf955 | ||
|
|
b70b6bf326 | ||
|
|
28acf02de0 | ||
|
|
1e76377b63 | ||
|
|
3dd9cfa741 | ||
|
|
26ac37ed46 | ||
|
|
5c136aab41 | ||
|
|
cf6104f630 | ||
|
|
7c8dd452cf | ||
|
|
cf3a50d6b5 | ||
|
|
ac329a70a4 | ||
|
|
e62450c763 | ||
|
|
44a9ce2417 | ||
|
|
23e0ff7aa6 | ||
|
|
de53b4514e | ||
|
|
994610869d | ||
|
|
b0e3faa2ad | ||
|
|
fe34dcb0bd | ||
|
|
8717706b1c | ||
|
|
b402e09b82 | ||
|
|
80832459b9 | ||
|
|
cf2c8b8e0e | ||
|
|
f802356b0a | ||
|
|
ecc4d8a6c1 | ||
|
|
d4b774642b | ||
|
|
103f28481d | ||
|
|
dd51bdae3f | ||
|
|
5207b381b7 | ||
|
|
e5aa381e38 | ||
|
|
8190b3f312 | ||
|
|
e26cfa2e52 | ||
|
|
5b52d22b1f | ||
|
|
5a452709c3 | ||
|
|
8470e81dc7 | ||
|
|
947a481400 | ||
|
|
368b18d440 | ||
|
|
1fe68aa861 | ||
|
|
f38a7bd574 | ||
|
|
ce8b984542 | ||
|
|
d0969cc723 | ||
|
|
a66b9041ec | ||
|
|
83c198bc26 | ||
|
|
26b3827210 | ||
|
|
4b04131fe3 | ||
|
|
168ce83820 | ||
|
|
5cbb635e54 | ||
|
|
0452c1fc2d | ||
|
|
800dec3b84 | ||
|
|
580f26b526 | ||
|
|
f8ff97d2b7 | ||
|
|
9ee4728e2a | ||
|
|
22a74bf1fd | ||
|
|
845fcefad7 | ||
|
|
9b55bf4847 | ||
|
|
e74f083300 | ||
|
|
09bc2d0891 | ||
|
|
28b355911d | ||
|
|
e2c4282477 | ||
|
|
3192cc8b00 | ||
|
|
de73a18637 | ||
|
|
8e8b8eb8aa | ||
|
|
c676233dfd | ||
|
|
9b61cda6cf | ||
|
|
ebf2935fb4 | ||
|
|
6e556a02d4 | ||
|
|
94556fd6e7 | ||
|
|
d9d980122d | ||
|
|
679ffd380b | ||
|
|
394856fa04 | ||
|
|
a28333ff4e | ||
|
|
f4138d2398 | ||
|
|
91992194a9 | ||
|
|
a7e9dc8c9c | ||
|
|
da5b9389db | ||
|
|
ddd9dac2fb | ||
|
|
124b1e545d | ||
|
|
f52617deab | ||
|
|
c8657caefa | ||
|
|
de1f1c599f | ||
|
|
c28a08a713 | ||
|
|
a0287b8561 | ||
|
|
6ac49a10f4 | ||
|
|
f70251fa3b | ||
|
|
13bfffa777 | ||
|
|
a50dce8fc2 | ||
|
|
a36bd70505 | ||
|
|
36471f2239 | ||
|
|
d16707a2f3 | ||
|
|
dff38f7609 | ||
|
|
5f38b4a43a | ||
|
|
07d838eee0 | ||
|
|
5747d896eb | ||
|
|
ad152ee747 | ||
|
|
471e256353 | ||
|
|
59584fefc1 | ||
|
|
948b7c48c5 | ||
|
|
5e33a908d2 | ||
|
|
9e2fc13460 | ||
|
|
6bbe5be5e6 | ||
|
|
9dde5cac7d | ||
|
|
6b9e48f96a | ||
|
|
30149b504d | ||
|
|
fb4648d759 | ||
|
|
d14c353115 | ||
|
|
f1bae4c1ca | ||
|
|
a61e705dbf | ||
|
|
64831bd580 | ||
|
|
dc1093eeed | ||
|
|
95376622fa | ||
|
|
511f98ec18 | ||
|
|
740ace88f0 | ||
|
|
70e98467e8 | ||
|
|
e8bec96970 | ||
|
|
a505d48a4c | ||
|
|
bcc4357a16 | ||
|
|
668197ad6f | ||
|
|
0a91b89694 | ||
|
|
5b10661874 | ||
|
|
36a126774a | ||
|
|
705137e993 | ||
|
|
ce4cd1fefd | ||
|
|
224e32ccf1 | ||
|
|
f01ee61278 | ||
|
|
c637e34b48 | ||
|
|
67c195034d | ||
|
|
02b1f524b6 | ||
|
|
e76aaf5a34 | ||
|
|
422e8a6185 | ||
|
|
ba10d9d031 | ||
|
|
87dc9be10e | ||
|
|
d47b75c778 | ||
|
|
2c29969bfb | ||
|
|
c84d9660e2 | ||
|
|
dcd7df4860 | ||
|
|
b3d0fbeb5d | ||
|
|
fa340e91de | ||
|
|
771e73a798 | ||
|
|
e75208507d | ||
|
|
863ee23583 | ||
|
|
9cc20a03c0 | ||
|
|
cae3741953 | ||
|
|
80555ef933 | ||
|
|
cf251451ed | ||
|
|
4cf4b1604b | ||
|
|
fd037153ee | ||
|
|
02a7338ab8 | ||
|
|
70dd602bcf | ||
|
|
ea602f6d2f | ||
|
|
06348d3ba5 | ||
|
|
2eb593f461 | ||
|
|
244c0fbec3 | ||
|
|
7b529bce57 | ||
|
|
36bed09bde | ||
|
|
024b07d5f4 | ||
|
|
0cab7954f8 | ||
|
|
b325a01eea | ||
|
|
7e541cef3d | ||
|
|
bb8869268e | ||
|
|
cb171d350d | ||
|
|
5777b64a18 | ||
|
|
9b9529107c | ||
|
|
5421c7df4f | ||
|
|
4f02cb4967 | ||
|
|
6b8a0a7dca | ||
|
|
dfb31eef16 | ||
|
|
c6c0aadb00 | ||
|
|
3b65ea9008 | ||
|
|
708fe93efe | ||
|
|
13a9bc443e | ||
|
|
37e3a195dc | ||
|
|
a28a6f3320 | ||
|
|
67d3d5f587 | ||
|
|
f0f09c20fa | ||
|
|
f28749d455 | ||
|
|
ab2638b2cb | ||
|
|
22f587b7b9 | ||
|
|
92232d114b | ||
|
|
6619def365 | ||
|
|
c776a5424d | ||
|
|
2a1d7760e6 | ||
|
|
009957e3b6 | ||
|
|
297f6a38cb | ||
|
|
440cbed76a | ||
|
|
b36224f480 | ||
|
|
f9a467453a | ||
|
|
60ed549605 | ||
|
|
3d51abc56b | ||
|
|
295c365a8f | ||
|
|
adf9303a7e | ||
|
|
b626fd1e47 | ||
|
|
ed09908c3b | ||
|
|
0a9c673753 | ||
|
|
c2aa7dd948 | ||
|
|
25081466be | ||
|
|
8dedc54468 | ||
|
|
d0f5cb87e7 | ||
|
|
8dc58445f9 | ||
|
|
6faf1a0fcb | ||
|
|
ee0988588f | ||
|
|
6e66a3114a | ||
|
|
15e0a2bd10 | ||
|
|
09faa8403a | ||
|
|
7e0e671539 | ||
|
|
cc07db941f | ||
|
|
f1e1b9238d | ||
|
|
dda26df250 | ||
|
|
6e7b7c804c | ||
|
|
6a21255a38 | ||
|
|
6362a9c34f | ||
|
|
3ddaceb5ac | ||
|
|
055a508901 | ||
|
|
0bfceacaf3 | ||
|
|
0438d3c4ba | ||
|
|
3e81e27160 | ||
|
|
42acb32c69 | ||
|
|
d6968f4ea9 | ||
|
|
75da3a398d | ||
|
|
1dad2babb7 | ||
|
|
fe982b15b0 | ||
|
|
595470ccfb | ||
|
|
7d39c092c6 | ||
|
|
6a6be3caa4 | ||
|
|
1daf68dea1 | ||
|
|
4f8531332e | ||
|
|
d70885711b | ||
|
|
6499e7608c | ||
|
|
569e14f50f | ||
|
|
71c2e54afd | ||
|
|
bd5d04f5ab | ||
|
|
26b657a96f | ||
|
|
cce5bf26c8 | ||
|
|
4d97a427f9 | ||
|
|
aa7e825e70 | ||
|
|
2778df0fe7 | ||
|
|
c6713f37bb | ||
|
|
52d920d969 | ||
|
|
cb88d215fa | ||
|
|
7436ea3e8c | ||
|
|
d2b9ca4c1b | ||
|
|
4b2bac7cd8 | ||
|
|
1da82cdec2 | ||
|
|
76fc52e042 | ||
|
|
6880e5e9ee | ||
|
|
01cc1d331b | ||
|
|
9e957a75b0 | ||
|
|
a546615f69 | ||
|
|
9f1c3fa823 | ||
|
|
8bfe8a2c37 | ||
|
|
f3c22315a1 | ||
|
|
59da9211f6 | ||
|
|
82d26b5bb8 | ||
|
|
4c151a4cf1 | ||
|
|
85b71f1dd6 | ||
|
|
24484496d2 | ||
|
|
190c98d8f2 | ||
|
|
046483b9da | ||
|
|
177cf89756 | ||
|
|
e167a34f32 | ||
|
|
bd1e624eb1 | ||
|
|
1db14631df | ||
|
|
59bf2749dd | ||
|
|
ad0bcddaa4 | ||
|
|
f485583621 | ||
|
|
49355fe32b | ||
|
|
356ae6cf74 | ||
|
|
770f76a658 | ||
|
|
42ba733cd4 | ||
|
|
45312af297 | ||
|
|
baee73e132 | ||
|
|
279f40c82e | ||
|
|
aaf0763e09 | ||
|
|
c5fa49405f | ||
|
|
3d96e4adb6 | ||
|
|
42af6f2ec0 | ||
|
|
31812d524d | ||
|
|
21a2863a1a | ||
|
|
bd643503b3 | ||
|
|
51a1fb1235 | ||
|
|
8f0eec7031 | ||
|
|
6dd36a1575 | ||
|
|
46595b1399 | ||
|
|
90962b2328 | ||
|
|
edd50ef181 | ||
|
|
ced6dca7a3 | ||
|
|
559aeb3c3f | ||
|
|
16131e0acc | ||
|
|
e8f377c20d | ||
|
|
27896d53ef | ||
|
|
a44d89f953 | ||
|
|
75465f2f21 | ||
|
|
3aadff7a3c | ||
|
|
c65101537d | ||
|
|
b35eee5561 | ||
|
|
cdfe87c81b | ||
|
|
7e899d900a | ||
|
|
a037e616bf | ||
|
|
f7650bd6df | ||
|
|
716a35701c | ||
|
|
6032010847 | ||
|
|
5446795196 | ||
|
|
31ed540939 | ||
|
|
e715fdc835 | ||
|
|
81f44969ee | ||
|
|
886eebdbb2 | ||
|
|
fc35d888fc | ||
|
|
eb01597dd3 | ||
|
|
572430cc2b | ||
|
|
7b263676e0 | ||
|
|
c8123383d5 | ||
|
|
bdd6c52e4e | ||
|
|
de65cd88bc | ||
|
|
83ca51a99b | ||
|
|
1def7b7b8d | ||
|
|
dadd6c598f | ||
|
|
b891ec7793 | ||
|
|
5b823d8684 | ||
|
|
b146fa326d | ||
|
|
bab02fca8a | ||
|
|
0b6882c37f | ||
|
|
b1072b7a50 | ||
|
|
70a039da83 | ||
|
|
7efb112058 | ||
|
|
9c2f300325 | ||
|
|
4d4f1f8351 | ||
|
|
9dc98192f4 | ||
|
|
b1a9757b40 | ||
|
|
522f58511c | ||
|
|
d98f9de5d4 | ||
|
|
7d9642a5b1 | ||
|
|
dc08b6b92a | ||
|
|
220ccb2eac | ||
|
|
eb8c59efb5 | ||
|
|
f87e943a1a | ||
|
|
2f845b40ca | ||
|
|
d0a5d13a0e | ||
|
|
fff157d5ca | ||
|
|
c38d519ee6 | ||
|
|
352625af28 | ||
|
|
0d223636f6 | ||
|
|
9799a2a97b | ||
|
|
e902ba673d | ||
|
|
da13162c60 | ||
|
|
a88ad75645 | ||
|
|
cfab935b75 | ||
|
|
ad837423a8 | ||
|
|
b8fd8980a7 | ||
|
|
f8b02b372c | ||
|
|
a5d4d0c88e | ||
|
|
2368640841 | ||
|
|
8af2267c53 | ||
|
|
90a1453755 | ||
|
|
64faf5c967 | ||
|
|
4916de359c | ||
|
|
5e321a5abd | ||
|
|
3ac4ae992c | ||
|
|
126253d81d | ||
|
|
5158f53786 | ||
|
|
9679880059 | ||
|
|
ca3e99a095 | ||
|
|
546450712d | ||
|
|
103871a4e9 | ||
|
|
fdfc3a77f3 | ||
|
|
6da26ffa93 | ||
|
|
b4f264df04 | ||
|
|
9e9ac6cd32 | ||
|
|
6ab0e7bee4 | ||
|
|
d906066425 | ||
|
|
0daaaf9fca | ||
|
|
0cf0fce4d9 | ||
|
|
32525b5676 | ||
|
|
14d3402b8d | ||
|
|
30a8f0c561 | ||
|
|
3e4b649162 | ||
|
|
068d49f9c5 | ||
|
|
01207c86ff | ||
|
|
307c81c3bd | ||
|
|
911fff14e9 | ||
|
|
09cd745765 | ||
|
|
1394e52635 | ||
|
|
0657efce21 | ||
|
|
d71ced9d05 | ||
|
|
a823eabea2 | ||
|
|
03b8efc95f | ||
|
|
303f1cfb0b | ||
|
|
7455b5b1c1 | ||
|
|
4e9ef97fac | ||
|
|
fd29b395a7 | ||
|
|
5e02b3e082 | ||
|
|
3788e4641c | ||
|
|
74d27d8fd3 | ||
|
|
8d3d01c9e3 | ||
|
|
496ce0fb91 | ||
|
|
6e622162e9 | ||
|
|
071bfa2032 | ||
|
|
bfd5c2ac8c | ||
|
|
fa7bd754cf | ||
|
|
e0ee2779d3 | ||
|
|
2ae31cac3f | ||
|
|
2bd862fd3c | ||
|
|
03f1ec4c1d | ||
|
|
490ff655f3 | ||
|
|
55e97a8baa | ||
|
|
f4219b0c75 | ||
|
|
91cc7dd1cd | ||
|
|
e163f7ed73 | ||
|
|
60d0a8d453 | ||
|
|
feb6ebb432 | ||
|
|
04989c33f5 | ||
|
|
15c6f0fd53 | ||
|
|
6e876b38b0 | ||
|
|
757a7a1c37 | ||
|
|
c518b696f6 | ||
|
|
b98dec4c3b | ||
|
|
bfca2816c3 | ||
|
|
079b0c3648 | ||
|
|
0a9ff43986 | ||
|
|
10ad5d296e | ||
|
|
38f8e26635 | ||
|
|
fb725f9433 | ||
|
|
968de086ed | ||
|
|
10cb862269 | ||
|
|
54e1c62fc5 | ||
|
|
c562982b05 | ||
|
|
71376cfe5f | ||
|
|
123a212251 | ||
|
|
ac69537784 | ||
|
|
5e89e2ea11 | ||
|
|
895924b537 | ||
|
|
3f014660cc | ||
|
|
077cd0bec3 | ||
|
|
7dc75c6dd2 | ||
|
|
ee337e4f18 | ||
|
|
06a226a26e | ||
|
|
85a6a26fcd | ||
|
|
5a4a85564a | ||
|
|
8b4f5d1d04 | ||
|
|
19af26ddbe | ||
|
|
a55b165d9e | ||
|
|
bf34934e9c | ||
|
|
a95ef7ac08 | ||
|
|
eabbf92c16 | ||
|
|
7a74cd052f | ||
|
|
b3ac01cb22 | ||
|
|
4079e0ef65 | ||
|
|
4b9325bdc8 | ||
|
|
3538f9c954 | ||
|
|
f41c1a6e2c | ||
|
|
9419e2f79f | ||
|
|
038f4b57cd | ||
|
|
a159c4188b | ||
|
|
1a651372f6 | ||
|
|
40beade15a | ||
|
|
8b3d8ba027 | ||
|
|
40f21c6f5b | ||
|
|
d313ba2f4a | ||
|
|
2ebaa72a12 | ||
|
|
2043f6411c | ||
|
|
a0044d03c2 | ||
|
|
a846ff2ea5 | ||
|
|
b8d238618f | ||
|
|
7c890b158c | ||
|
|
448e4cdfbb | ||
|
|
283d9db518 | ||
|
|
5d27d6d2ab | ||
|
|
8eee3b070b | ||
|
|
d45a320b42 | ||
|
|
4fa52406a0 | ||
|
|
9149fcbdc4 | ||
|
|
c7b8cda902 | ||
|
|
e5e85e948b | ||
|
|
e544105a3e | ||
|
|
eeb7e3080f | ||
|
|
e67b2c8121 | ||
|
|
b841dee7ad | ||
|
|
46a841b5c1 | ||
|
|
759f66cf9f | ||
|
|
17b304a349 | ||
|
|
09ed9d60fb | ||
|
|
e2695db011 | ||
|
|
2a931142a0 | ||
|
|
342a6bbcf9 | ||
|
|
e237389ad9 | ||
|
|
36f767f388 | ||
|
|
79dd55836f | ||
|
|
9a7ddd2e18 | ||
|
|
aaa4a91e01 | ||
|
|
9e48dda739 | ||
|
|
e984633ca5 | ||
|
|
ac068aa3f9 | ||
|
|
d0dd49b70b | ||
|
|
92e1469e8b | ||
|
|
39005ca32c | ||
|
|
f6bac4f484 | ||
|
|
b5d89c8c7b | ||
|
|
3af538bd87 | ||
|
|
465b800471 | ||
|
|
b89f3fdd79 | ||
|
|
7f311a6526 | ||
|
|
a65d99021c | ||
|
|
ea1111cd6e | ||
|
|
9838cc59ee | ||
|
|
8e10ca08ec | ||
|
|
fc236be769 | ||
|
|
064e3ca207 | ||
|
|
ceb9579b07 | ||
|
|
966236652a | ||
|
|
3c4810264c | ||
|
|
523ee8d641 | ||
|
|
40c8f3e666 | ||
|
|
3708e837e7 | ||
|
|
a62b62185f | ||
|
|
27c8a3ca2e | ||
|
|
5e03954afe | ||
|
|
9bd23efd3c | ||
|
|
414d46b33e | ||
|
|
a58cb8251f | ||
|
|
b8e8fbd3b3 | ||
|
|
711b745145 | ||
|
|
8724254247 | ||
|
|
1e385e9ed3 | ||
|
|
5d0fdd5900 | ||
|
|
90e2105bc8 | ||
|
|
c9c6ca410b | ||
|
|
6b149e0498 | ||
|
|
fd74c08a8f | ||
|
|
da670e791c | ||
|
|
a318e2a0c4 | ||
|
|
15daa64f66 | ||
|
|
6b461e1026 | ||
|
|
3bc8f06e58 | ||
|
|
b606cc770f | ||
|
|
8cfb698c67 | ||
|
|
c7123aeec2 | ||
|
|
0496e4ab75 | ||
|
|
4ea50ee0f6 | ||
|
|
2006294c94 | ||
|
|
296feca265 | ||
|
|
c769ecf693 | ||
|
|
cf386943a5 | ||
|
|
560ebed848 | ||
|
|
5e84d65cdc | ||
|
|
c6b9c753fe | ||
|
|
6348ddae63 | ||
|
|
a36157e40f | ||
|
|
a26b00a5d8 | ||
|
|
f08ec51640 | ||
|
|
b7c152df52 | ||
|
|
1309a9a273 | ||
|
|
abb9e1eb1d | ||
|
|
be178715a8 | ||
|
|
8890607c53 | ||
|
|
a5baf9cfba | ||
|
|
f32da0bff7 | ||
|
|
4017feca6d | ||
|
|
3836ed40d6 | ||
|
|
2093e7ca7f | ||
|
|
6b96927b23 | ||
|
|
09c36a9213 | ||
|
|
9f84941792 | ||
|
|
2c45c3d020 | ||
|
|
768a1f309c | ||
|
|
0219b3de73 | ||
|
|
eb3c126aea | ||
|
|
0a8fa6f5d4 | ||
|
|
4c1557e7fd | ||
|
|
32645c0dd2 | ||
|
|
886fa9ed80 | ||
|
|
836e5daca6 | ||
|
|
e9e0e852ba | ||
|
|
9974c33c89 | ||
|
|
1b4cc62bcc | ||
|
|
bf988aa9ef | ||
|
|
8e6f8cc5e6 | ||
|
|
8df9f7798e | ||
|
|
29a2e07b1f | ||
|
|
5de8d0293f | ||
|
|
93a5065171 | ||
|
|
9415219141 | ||
|
|
828cb99644 | ||
|
|
fa9b9baf68 | ||
|
|
1186719e62 | ||
|
|
aa0be735f9 | ||
|
|
20cb4bf320 | ||
|
|
e2a70f3b4a | ||
|
|
ee7ca80d88 | ||
|
|
80f79864f5 | ||
|
|
f2a3c38c79 | ||
|
|
d0519cb982 | ||
|
|
0f49932604 | ||
|
|
675b4f349c | ||
|
|
8b225abea6 | ||
|
|
df79d22e93 | ||
|
|
ca1c294c7a | ||
|
|
728796494e | ||
|
|
2b37abf264 | ||
|
|
4303cf3111 | ||
|
|
9dc87c34f3 | ||
|
|
5fc25c2453 | ||
|
|
e5043e79ea | ||
|
|
64215c5722 | ||
|
|
6974c5338a | ||
|
|
cf88aa4c5d | ||
|
|
fa6b6a590f | ||
|
|
05c325ac02 | ||
|
|
5a3f9ebc80 | ||
|
|
4a229c6427 | ||
|
|
3fe775405c | ||
|
|
ef28f7c5fe | ||
|
|
e8ca69dede | ||
|
|
4e0f2e1a49 | ||
|
|
d9789b8438 | ||
|
|
27cde50c08 | ||
|
|
fb374a9ae3 | ||
|
|
8d745e3e6b | ||
|
|
757998a1e4 | ||
|
|
4e4e6c5465 | ||
|
|
5003d0beb7 | ||
|
|
aaffb54141 | ||
|
|
3e1c0ca9af | ||
|
|
4b206ada3e | ||
|
|
cd5901f73a | ||
|
|
14c45e4900 | ||
|
|
81970b3fd4 | ||
|
|
1023ca2062 | ||
|
|
ca9f232aaf | ||
|
|
0c00839458 | ||
|
|
bd5811eb48 | ||
|
|
a8171bd4e4 | ||
|
|
d60efb17cd | ||
|
|
ba543aef2c | ||
|
|
5d552d9dd8 | ||
|
|
c0f7b1548a | ||
|
|
3ee27aaec3 | ||
|
|
8fcf0f7c8c | ||
|
|
2073cdf5e5 | ||
|
|
17d125e6d5 | ||
|
|
a8da4f9cd1 | ||
|
|
070d2c11a7 | ||
|
|
c9ea347789 | ||
|
|
c6f67ec01e | ||
|
|
5b44483600 | ||
|
|
3fe21dc782 | ||
|
|
94c68b9fe6 | ||
|
|
9fcab5ff60 | ||
|
|
90a68edb4e | ||
|
|
e9092d5620 | ||
|
|
f252fce6ef | ||
|
|
6de4a1bd09 | ||
|
|
82934cf9ed | ||
|
|
c665d3e9c7 | ||
|
|
8fdf2156dc | ||
|
|
5807900556 | ||
|
|
5288b58d47 | ||
|
|
dd71aacc49 | ||
|
|
2b871c8c48 | ||
|
|
fe2d0bdddb | ||
|
|
e8389beef9 | ||
|
|
f520260f42 | ||
|
|
5f4f0af89c | ||
|
|
9d83afe905 | ||
|
|
015caba66d | ||
|
|
c739ea3952 | ||
|
|
90c3cef977 | ||
|
|
83c9c25164 | ||
|
|
28225d880f | ||
|
|
505b6af2ee | ||
|
|
244dd8fad6 | ||
|
|
644238997b | ||
|
|
1ea26f1891 | ||
|
|
08f18e2e69 | ||
|
|
6f72df831e | ||
|
|
0e8990ef02 | ||
|
|
16426c2605 | ||
|
|
aee83bdf74 | ||
|
|
ee1a87be19 | ||
|
|
2931ef00ea | ||
|
|
3ba75e5c44 | ||
|
|
1533d07f23 | ||
|
|
6bc6e39e46 | ||
|
|
0853357300 | ||
|
|
a89840b4a7 | ||
|
|
217f7b63a2 | ||
|
|
f7b046e950 | ||
|
|
dbc67cc489 | ||
|
|
d250c439d0 | ||
|
|
4164e36ec4 | ||
|
|
ef0bb33def | ||
|
|
6e4d4b0950 | ||
|
|
3aff717600 | ||
|
|
ba1157b07d | ||
|
|
e7d98dc887 | ||
|
|
b77dde156b | ||
|
|
09979cb4c9 | ||
|
|
d88a6b5ef0 | ||
|
|
9502d70290 | ||
|
|
5e29d1d8ba | ||
|
|
43810a3509 | ||
|
|
79b4edf7a8 | ||
|
|
8158213471 | ||
|
|
c624ec6568 | ||
|
|
599db6be5e | ||
|
|
032572de52 | ||
|
|
4cf62f9fa5 | ||
|
|
6e70c9d094 | ||
|
|
942775570d | ||
|
|
591e3a71ea | ||
|
|
0ea644c6ca | ||
|
|
18ee41c610 | ||
|
|
8fef89a255 | ||
|
|
bbca25854c | ||
|
|
1eed13fcd0 | ||
|
|
1123211fe2 | ||
|
|
73720a07be | ||
|
|
abec71bcf8 | ||
|
|
41e3eb48ea | ||
|
|
729110484f | ||
|
|
011ac43226 | ||
|
|
a3eff91c1a | ||
|
|
6c38a555bb | ||
|
|
ada9a564f8 | ||
|
|
faad59f20d | ||
|
|
77c63541eb | ||
|
|
2d5cff1752 | ||
|
|
81701ae430 | ||
|
|
5a59b8204a | ||
|
|
1a026c90a9 | ||
|
|
91f212cb74 | ||
|
|
82b4e6877d | ||
|
|
245e76cd8d | ||
|
|
460a5f7a85 | ||
|
|
c261f0c205 | ||
|
|
cc414692be | ||
|
|
cd8316ea4c | ||
|
|
6da732e997 | ||
|
|
6add57aa62 | ||
|
|
2cdd3f3ec5 | ||
|
|
8774a33914 | ||
|
|
025b840625 | ||
|
|
32a96e39ee | ||
|
|
3914831921 | ||
|
|
ae3b68d417 | ||
|
|
35abb5d147 | ||
|
|
56d997624e | ||
|
|
f41962f75d | ||
|
|
e972777cf6 | ||
|
|
d6b82cd591 | ||
|
|
9ef581ecfb | ||
|
|
4d156b6509 | ||
|
|
f3b53afc3c | ||
|
|
ca89cbe418 | ||
|
|
5a38255ba7 | ||
|
|
a46c925858 | ||
|
|
199d9b78f0 | ||
|
|
f19228f366 | ||
|
|
13d0510d37 | ||
|
|
d547c97c80 | ||
|
|
9fb25252a6 | ||
|
|
0365956c9b | ||
|
|
da7ab6b205 | ||
|
|
860449aaed | ||
|
|
b8707c1f32 | ||
|
|
c43cd4f2b5 | ||
|
|
8d40a106dc | ||
|
|
53b92e3a44 | ||
|
|
52cb7ecfd7 | ||
|
|
9ba466a455 | ||
|
|
d73a8ac7e4 | ||
|
|
d8e2a52b0b | ||
|
|
d34cea51cf | ||
|
|
3a6ce4c219 | ||
|
|
5c3274153e | ||
|
|
1049296705 | ||
|
|
430dd9ae93 | ||
|
|
582d6a5c26 | ||
|
|
53c586b22f | ||
|
|
6c7a93d53e | ||
|
|
4bccc33c4f | ||
|
|
412a9e0055 | ||
|
|
40814a1723 | ||
|
|
93737e27ba | ||
|
|
eabc611a63 | ||
|
|
dd1b404c9b | ||
|
|
3de2d8e550 | ||
|
|
508f8d3dcd | ||
|
|
4f17a88781 | ||
|
|
267644695a | ||
|
|
4e41d5c4fb | ||
|
|
33a29741df | ||
|
|
c25f4df6bc | ||
|
|
014bddf5ee | ||
|
|
987907bd05 | ||
|
|
e0defa82e2 | ||
|
|
7e99cdef29 | ||
|
|
97021f127c | ||
|
|
477cbeccc6 | ||
|
|
843055a5dc | ||
|
|
4a6e13a0dc | ||
|
|
545c38c26c | ||
|
|
b393a4e00f | ||
|
|
2f5add1999 | ||
|
|
512b95d89c | ||
|
|
897466d295 | ||
|
|
1bb7843811 | ||
|
|
53ea2b8973 | ||
|
|
69c627b651 | ||
|
|
ca51130517 | ||
|
|
5d11c28db6 | ||
|
|
9a621237f0 | ||
|
|
d9dc84425d | ||
|
|
d98daf008e | ||
|
|
fb1005d255 | ||
|
|
08836088fb | ||
|
|
768abd5ce1 | ||
|
|
a5bffce33b | ||
|
|
7ce7e6e763 | ||
|
|
9386181fce | ||
|
|
0948c6dc35 | ||
|
|
9fd550e8f5 | ||
|
|
069567c681 | ||
|
|
1b020ff99e | ||
|
|
3fc6892571 | ||
|
|
d37bf9eef9 | ||
|
|
31b0bbd3d9 | ||
|
|
b9ebf04a6a | ||
|
|
a083f8f69e | ||
|
|
c5860d13d5 | ||
|
|
5540330295 | ||
|
|
275bb9204d | ||
|
|
646ef7fba1 | ||
|
|
09971905e1 | ||
|
|
32fb3c3317 | ||
|
|
8153e4af0c | ||
|
|
1af1fe45ca | ||
|
|
e73cd0f398 | ||
|
|
bf0ea54cdd | ||
|
|
583f7f7108 | ||
|
|
e5d4a38fd7 | ||
|
|
4b917625c0 | ||
|
|
aaa27229cf | ||
|
|
57032eeb11 | ||
|
|
316f1a5007 | ||
|
|
71b0410138 | ||
|
|
90c83edcb6 | ||
|
|
dc32ee6f08 | ||
|
|
a6f7a4aff8 | ||
|
|
4a706c504a | ||
|
|
3418132b90 | ||
|
|
20dabf502a | ||
|
|
4ad3b2cba0 | ||
|
|
47e0351403 | ||
|
|
95de8a721b | ||
|
|
986f010628 | ||
|
|
f64c7ff68c | ||
|
|
654e72fe6a | ||
|
|
33efc519a3 | ||
|
|
a154558f0b | ||
|
|
814870d80c | ||
|
|
9fec4e378f | ||
|
|
3976fc8f64 | ||
|
|
64c81146fb | ||
|
|
78716f4695 | ||
|
|
a2f8d0019f | ||
|
|
349cf89eb5 | ||
|
|
916fd7522e | ||
|
|
1136342b60 | ||
|
|
cfb6fc5fe1 | ||
|
|
66c97ad100 | ||
|
|
c647295ccb | ||
|
|
063853c0be | ||
|
|
7c662da164 | ||
|
|
a6948a09bd | ||
|
|
7a09711296 | ||
|
|
efd1243754 | ||
|
|
438f10f484 | ||
|
|
fa3eed52b3 | ||
|
|
9041f5ef0d | ||
|
|
ed1fbdbe5e | ||
|
|
23ad3ea00b | ||
|
|
bafbb73389 | ||
|
|
ffad50ae55 | ||
|
|
a778918fe3 | ||
|
|
7c073d5801 | ||
|
|
0f72df789b | ||
|
|
cac80c3d86 | ||
|
|
abc61e7728 | ||
|
|
d974791d1f | ||
|
|
59d4ec8ad7 | ||
|
|
7354e3fab2 | ||
|
|
38e990ddd2 | ||
|
|
4ddbe69ee5 | ||
|
|
c39bf9f800 | ||
|
|
88b19b2220 | ||
|
|
62c0dc0580 | ||
|
|
ebcbcae46d | ||
|
|
fb6c335f0f | ||
|
|
c9ad6efb54 | ||
|
|
6922900bf1 | ||
|
|
de1062df22 | ||
|
|
6ddfc985d3 | ||
|
|
60b8cd981d | ||
|
|
83bfc50c9e | ||
|
|
00da9ba10c | ||
|
|
6c22eea887 | ||
|
|
7951754203 | ||
|
|
3218f0a55b | ||
|
|
cf09acfd52 | ||
|
|
cf4774a6a7 | ||
|
|
05e9978671 | ||
|
|
1dad86b02f | ||
|
|
7ee81aca24 | ||
|
|
c9e13ad412 | ||
|
|
4078fe024b | ||
|
|
01168bd852 | ||
|
|
104983fd37 | ||
|
|
ca0da04ad0 | ||
|
|
6ee6b5cd15 | ||
|
|
144e731d5e | ||
|
|
6d239160e9 | ||
|
|
88dedcf9c1 | ||
|
|
74bf5d12ca | ||
|
|
cf500081d1 | ||
|
|
fd6b833c98 | ||
|
|
cb29c27752 | ||
|
|
73d5edfafa | ||
|
|
fbec2aa8b0 | ||
|
|
1ce8cb8cac | ||
|
|
264ed1f4de | ||
|
|
a9d605bffc | ||
|
|
003aeb2cec | ||
|
|
c6ced9bdc3 | ||
|
|
69d4b2c355 | ||
|
|
6c81532ffe | ||
|
|
f2ca5fa57d | ||
|
|
3c84a5a1a5 | ||
|
|
b830d87564 | ||
|
|
cf5a29e0c7 | ||
|
|
9378c901bf | ||
|
|
c289cbf94e | ||
|
|
2630c8354c | ||
|
|
45efbd8e08 | ||
|
|
56262a4655 | ||
|
|
bffb09cf54 | ||
|
|
0b49a790b6 | ||
|
|
e7510cad76 | ||
|
|
0d560a688c | ||
|
|
11220bcff2 | ||
|
|
4aa5c79edb | ||
|
|
789d728f7a | ||
|
|
c101711512 | ||
|
|
93a69d98c9 | ||
|
|
eb94a1bdcd | ||
|
|
f5b2268150 | ||
|
|
64f0e2f137 | ||
|
|
e890126d9f | ||
|
|
1484c75595 | ||
|
|
726399a87d | ||
|
|
5aef20aae2 | ||
|
|
d244869377 | ||
|
|
13274aecd6 | ||
|
|
8db1703709 | ||
|
|
9a43a87fc1 | ||
|
|
53e16c3586 | ||
|
|
c8ec13fb56 | ||
|
|
f132fdb36e | ||
|
|
87550af37d | ||
|
|
d0bcdd858f | ||
|
|
cc7d3b69f6 | ||
|
|
59d757c2fb | ||
|
|
bbea195e7d | ||
|
|
7a6ddccbb7 | ||
|
|
95a9c618e6 | ||
|
|
b322ba53be | ||
|
|
43f172a190 | ||
|
|
c5b6cc5f0d | ||
|
|
5d7d6fb276 | ||
|
|
7dc6d8a86f | ||
|
|
9b9bfa7440 | ||
|
|
4a07975ab8 | ||
|
|
79daf2ed32 | ||
|
|
4b024d525f | ||
|
|
776e6d8ffd | ||
|
|
fb079bf443 | ||
|
|
8acbb0dcd1 | ||
|
|
e08587523f | ||
|
|
5745afeb84 | ||
|
|
4010f73ea2 | ||
|
|
1e4b6cc595 | ||
|
|
0604a27efb | ||
|
|
3f221c0d23 | ||
|
|
6b886fe80e | ||
|
|
af47136bbd | ||
|
|
be76cd5f35 | ||
|
|
72b2492f0d | ||
|
|
96bdb143ee | ||
|
|
f1c7be0b4c | ||
|
|
a3ffc8c479 | ||
|
|
5ced4f9f5d | ||
|
|
14bcf946e2 | ||
|
|
5c34bc8db9 | ||
|
|
f815ebd1db | ||
|
|
36a2dafbd5 | ||
|
|
9b5932760c | ||
|
|
4277dd447c | ||
|
|
e5215fb976 | ||
|
|
cb50c69fc6 | ||
|
|
abe17df121 | ||
|
|
ed92a12db6 | ||
|
|
60ddfb831b | ||
|
|
27ec9f4928 | ||
|
|
818e4e9de1 | ||
|
|
6a23dece35 | ||
|
|
370c0e3288 | ||
|
|
7884c48c6e | ||
|
|
8a34ead2ef | ||
|
|
3aec67aa8e | ||
|
|
8a0c2d2166 | ||
|
|
ec3e8fecd1 | ||
|
|
7a4a8fc856 | ||
|
|
ac920a8da9 | ||
|
|
2c1329fa36 | ||
|
|
fe3d17d1d9 | ||
|
|
910118303a | ||
|
|
e799eed64e | ||
|
|
e77ef4de26 | ||
|
|
fd0c3ba19d | ||
|
|
58efac86c0 | ||
|
|
559a5fa20f | ||
|
|
9e03779f2d | ||
|
|
0aa2976697 | ||
|
|
5db4be7db5 | ||
|
|
fb159fd93d | ||
|
|
2e14ff79fc | ||
|
|
01eff8e434 | ||
|
|
a074e9d352 | ||
|
|
5946a4c043 | ||
|
|
7817116ec1 | ||
|
|
dc38ad266a | ||
|
|
e833099fb5 | ||
|
|
fef3e5812f | ||
|
|
6246588072 | ||
|
|
2b5d077d04 | ||
|
|
8d1990d878 | ||
|
|
0a747c42fd | ||
|
|
7c4d7d374b | ||
|
|
928428cabd | ||
|
|
7a440e009b | ||
|
|
edb6571aa2 | ||
|
|
df83b1904e | ||
|
|
da251099a3 | ||
|
|
ce85d50dbf | ||
|
|
8f79054537 | ||
|
|
099bd87167 | ||
|
|
de18b1c2c0 | ||
|
|
8f4d5c4410 | ||
|
|
592492a56f | ||
|
|
1b0c865459 | ||
|
|
4939121016 | ||
|
|
6e0eae141b | ||
|
|
e0fef433fd | ||
|
|
72063cdf93 | ||
|
|
767ff55604 | ||
|
|
8bcd19a4ff | ||
|
|
d7368475fe | ||
|
|
5c714ce124 | ||
|
|
bab2a88533 | ||
|
|
edb665a22c | ||
|
|
94f0068509 | ||
|
|
7458108fc0 | ||
|
|
6277a6ce5d | ||
|
|
22f82c7cb2 | ||
|
|
e52f762861 | ||
|
|
6da4481c83 | ||
|
|
03881f1240 | ||
|
|
a7b4004058 | ||
|
|
6aeac06112 | ||
|
|
7f3aac186d | ||
|
|
2f4485405b | ||
|
|
f439cabc9a | ||
|
|
0d8d88b7fb | ||
|
|
7400ceceda | ||
|
|
67767d5c9d | ||
|
|
9d9b8e7cee | ||
|
|
b7395bedea | ||
|
|
42df433d3e | ||
|
|
d71a06a465 | ||
|
|
6eb575ea81 | ||
|
|
56a0d4b1e1 | ||
|
|
e4ea88d598 | ||
|
|
2f0e83badd | ||
|
|
3eba20ecb7 | ||
|
|
891efb4c4f | ||
|
|
5d06df437e | ||
|
|
1e6ac68e86 | ||
|
|
ae2b84cceb | ||
|
|
0b501ab4a1 | ||
|
|
429557ad7d | ||
|
|
86a88c6e20 | ||
|
|
7a28df8fd3 | ||
|
|
58337222c2 | ||
|
|
8238e8058c | ||
|
|
c3c233c92f | ||
|
|
3549cadd12 | ||
|
|
5ceaa510eb | ||
|
|
eb20ff1a4e | ||
|
|
3517b4c3ce | ||
|
|
0ccac372a8 | ||
|
|
5dd44dacf3 | ||
|
|
e87e9341ef | ||
|
|
e8b308bf53 | ||
|
|
3dc7a4689d | ||
|
|
0cf4edbecf | ||
|
|
290a8bb5ae | ||
|
|
96fdefb9ed | ||
|
|
d5eb804de9 | ||
|
|
55752b592f | ||
|
|
e625c88939 | ||
|
|
b7d0376320 | ||
|
|
dc7a7bd74d | ||
|
|
454a0a22d1 | ||
|
|
e1d0b8235f | ||
|
|
dfdea02b89 | ||
|
|
e1e0fd6acf | ||
|
|
b37fd8d9c9 | ||
|
|
f6241048c0 | ||
|
|
ccf5600ad1 | ||
|
|
0702d41a73 | ||
|
|
1c6fa1a261 | ||
|
|
6cc0c9eb6e | ||
|
|
b20128b8cb | ||
|
|
c6439d3e41 | ||
|
|
34ffbea69d | ||
|
|
2520fe7268 | ||
|
|
4113b1ca2d | ||
|
|
a404ed1680 | ||
|
|
3bcf97201a | ||
|
|
d3a7795be7 | ||
|
|
97ed4cc9f3 | ||
|
|
d23627f0af | ||
|
|
0a41d083fa | ||
|
|
246c84d5d1 | ||
|
|
0164a776c7 | ||
|
|
bd0a5980fb | ||
|
|
f527f88d3a | ||
|
|
b2587f2307 | ||
|
|
e15d997df4 | ||
|
|
11bf1ea294 | ||
|
|
9307fc0219 | ||
|
|
5fe506b73a | ||
|
|
fe03f56217 | ||
|
|
05a65a1207 | ||
|
|
fd377454a3 | ||
|
|
91106ef7bd | ||
|
|
f9d7c0c2be | ||
|
|
469abd6e86 | ||
|
|
68124fa8a5 | ||
|
|
61b8c132eb | ||
|
|
d4dd6afec9 | ||
|
|
ab4f318806 | ||
|
|
6eed83f1ee | ||
|
|
267f65dcfd | ||
|
|
8986faebdb | ||
|
|
9b2b47ec28 | ||
|
|
a1ec0fc807 | ||
|
|
9694895b71 | ||
|
|
72cbbce35d | ||
|
|
a54c55004b | ||
|
|
ab7c6bbd43 | ||
|
|
26939d9052 | ||
|
|
caac190a05 | ||
|
|
d80d4d91a3 | ||
|
|
65dbc6fc00 | ||
|
|
a3263ce3eb | ||
|
|
7dfccab05d | ||
|
|
f7155c4fcc | ||
|
|
1d1747a2ca | ||
|
|
86066282cc | ||
|
|
6026a0246d | ||
|
|
53c7bcc6d5 | ||
|
|
cc2a4b1b7b | ||
|
|
33b181784a | ||
|
|
62c2769eb8 | ||
|
|
394dda97f3 | ||
|
|
2a7837138e | ||
|
|
631d434a8e | ||
|
|
a5228583d0 | ||
|
|
92dbca40a8 | ||
|
|
2237aaafb3 | ||
|
|
245619ab72 | ||
|
|
9dbab36575 | ||
|
|
e7ceaf9f78 | ||
|
|
509b35352f | ||
|
|
a2dc2c5ed0 | ||
|
|
422edc7fa4 | ||
|
|
9c0bcaa44f | ||
|
|
abf329dd21 | ||
|
|
a8fdc0f9c5 | ||
|
|
dd42269f31 | ||
|
|
7cfee859a1 | ||
|
|
ffeef7a0d3 | ||
|
|
08e0f72cbe | ||
|
|
6d00e210f0 | ||
|
|
acfec0986e | ||
|
|
4c6549a39c | ||
|
|
3d39a84850 | ||
|
|
f31142b754 | ||
|
|
147307c891 | ||
|
|
df55ad1902 | ||
|
|
6340304ae4 | ||
|
|
db7a6a0bea | ||
|
|
d3e0625ef4 | ||
|
|
0d5ba52a15 | ||
|
|
6a539be58e | ||
|
|
8f3ab34b50 | ||
|
|
21f314aed0 | ||
|
|
62cda52342 | ||
|
|
7a575e9b55 | ||
|
|
2482abda5c | ||
|
|
8dca5fa491 | ||
|
|
9d68458eb2 | ||
|
|
8ac7e08aac | ||
|
|
ffe544d406 | ||
|
|
4e73235276 | ||
|
|
0adcb7c3e2 | ||
|
|
1f751152db | ||
|
|
438070a81f | ||
|
|
53231347bb | ||
|
|
6b723c6fd0 | ||
|
|
15294a4a61 | ||
|
|
efc62387ff | ||
|
|
28b08becd1 | ||
|
|
aec4d5482e | ||
|
|
a728e1f209 | ||
|
|
48d6fd99cd | ||
|
|
6daf410e50 | ||
|
|
740e51ce48 | ||
|
|
6c5dddaae5 | ||
|
|
fe57d1eb87 | ||
|
|
0a47c85a72 | ||
|
|
33ca66fcae | ||
|
|
36f201692a | ||
|
|
994d881366 | ||
|
|
f5fe166e8c | ||
|
|
5049b2ecbd | ||
|
|
750d8948f1 | ||
|
|
0ef0a82f6c | ||
|
|
b3757b49ff | ||
|
|
fcd0b2cc6d | ||
|
|
afd58681d7 | ||
|
|
595f80e429 | ||
|
|
729cef7f3c | ||
|
|
c399da8038 | ||
|
|
8a6259b9a3 | ||
|
|
036b42ca7e | ||
|
|
fee9cf4fa3 | ||
|
|
d8d5bcb5fa | ||
|
|
370ee8f1b3 | ||
|
|
89cb0389d1 | ||
|
|
e6d170329a | ||
|
|
71e39f1422 | ||
|
|
f04d897370 | ||
|
|
d033a43fc7 | ||
|
|
d39d4c8297 | ||
|
|
350d4c6e6d | ||
|
|
6f6ceb4084 | ||
|
|
f71f598976 | ||
|
|
9927b5370e | ||
|
|
82ed9ff2fb | ||
|
|
368a037389 | ||
|
|
24f63c78cb | ||
|
|
bb1631a21c | ||
|
|
72f770d83b | ||
|
|
3b1cb7a265 | ||
|
|
803291669d | ||
|
|
26058a4632 | ||
|
|
b58d528502 | ||
|
|
d7655fa1a7 | ||
|
|
1f2eaf765f | ||
|
|
2144c89efb | ||
|
|
87e23db3cb | ||
|
|
907061ec00 | ||
|
|
cee62b3869 | ||
|
|
d078b3e2fe | ||
|
|
b4b5325c7b | ||
|
|
f2e4106a0c | ||
|
|
7ab00eb161 | ||
|
|
4ea4e4e0bd | ||
|
|
fe563a417c | ||
|
|
e70b0c9edc | ||
|
|
aaf049697e | ||
|
|
edc1b131b2 | ||
|
|
e4885bc525 | ||
|
|
d30fb74d9a | ||
|
|
7c8536127c | ||
|
|
1972772fb3 | ||
|
|
a65160dcbd | ||
|
|
878dbb30bc | ||
|
|
a5721295bc | ||
|
|
573806b823 | ||
|
|
72eb15248b | ||
|
|
83a40bad6f | ||
|
|
3127bfa037 | ||
|
|
4436dd5226 | ||
|
|
da5ddbc073 | ||
|
|
48aaca0fa7 | ||
|
|
9dcfc5f80d | ||
|
|
ec89822fb3 | ||
|
|
63fb9e3354 | ||
|
|
af3293ffbf | ||
|
|
8b312c0f65 | ||
|
|
1f84c0c801 | ||
|
|
9582052e7d | ||
|
|
b291624544 | ||
|
|
3a4f3cded4 | ||
|
|
2823f288ff | ||
|
|
46166f124a | ||
|
|
f723e29277 | ||
|
|
6f510137d9 | ||
|
|
f9302b36b5 | ||
|
|
02d0c14d00 | ||
|
|
50618c252d | ||
|
|
d1188a1ea5 | ||
|
|
9635db22fc | ||
|
|
6b1aca8efa | ||
|
|
6cda213441 | ||
|
|
5c6450c6a2 | ||
|
|
192c103597 | ||
|
|
89942fb8f5 | ||
|
|
50427390f2 | ||
|
|
07b6bcc32b | ||
|
|
83d1c29917 | ||
|
|
9d45eb7402 | ||
|
|
72fff4ab73 | ||
|
|
a8a0c96d57 | ||
|
|
2048389896 | ||
|
|
f4d6c686fe | ||
|
|
77bd8c3720 | ||
|
|
5712589ef3 | ||
|
|
07f7aba4f2 | ||
|
|
5d0dc39ee3 | ||
|
|
bae2390eb1 | ||
|
|
8ef6ec90ca | ||
|
|
16e90bea61 | ||
|
|
1f0f411d4f | ||
|
|
9d80de3ecf | ||
|
|
9c07262480 | ||
|
|
3a7355ed21 | ||
|
|
fad7d2d001 | ||
|
|
8ba8b7c0c6 | ||
|
|
65f956741f | ||
|
|
0000605186 | ||
|
|
8500525722 | ||
|
|
58dbfdb13b | ||
|
|
578bba38a2 | ||
|
|
33f74c4a73 | ||
|
|
da98c04927 | ||
|
|
1262c47e64 | ||
|
|
fc811c67fb | ||
|
|
8ff490bfee | ||
|
|
446686e18c | ||
|
|
a5233b4686 | ||
|
|
31fcb5a1e2 | ||
|
|
6345166742 | ||
|
|
1da9b5870c | ||
|
|
04f7fe2630 | ||
|
|
b34374ece4 | ||
|
|
1c4b124cf3 | ||
|
|
1fd68c02ea | ||
|
|
d1da7ce521 | ||
|
|
e4b3743bdb | ||
|
|
fc2095e7fb | ||
|
|
0ad10245f9 | ||
|
|
2387c6c2c7 | ||
|
|
ffcf220f1f | ||
|
|
c99df6b820 | ||
|
|
b65b84539c | ||
|
|
96747345e9 | ||
|
|
26352d744a | ||
|
|
8183ad60d6 | ||
|
|
26b8391ad4 | ||
|
|
17ecef8c67 | ||
|
|
a058d0a1bc | ||
|
|
d81684cd19 | ||
|
|
8d52f2d664 | ||
|
|
1f04fea3cc | ||
|
|
dac0734401 | ||
|
|
772edcfe5b | ||
|
|
88eb227284 | ||
|
|
b07e5d9b0b | ||
|
|
784baf550f | ||
|
|
c5d365eaa7 | ||
|
|
d6652fdaa9 | ||
|
|
6c1cd3c5d3 | ||
|
|
75c0dd7425 | ||
|
|
f7d62efc29 | ||
|
|
1496313fd8 | ||
|
|
b26a6d7ccc | ||
|
|
beb9b10eb3 | ||
|
|
a07ca2fd62 | ||
|
|
b0ed126891 | ||
|
|
d44d03fd9e | ||
|
|
4075e71f7a | ||
|
|
5678f81326 | ||
|
|
e25e77bcf6 | ||
|
|
6e5de74f37 | ||
|
|
b480e6797c | ||
|
|
265e2b84b6 | ||
|
|
d3dfe0e51b | ||
|
|
3555ddad79 | ||
|
|
0449b7b890 | ||
|
|
b4575864a9 | ||
|
|
8722890b97 | ||
|
|
7f750773ee | ||
|
|
5a2f8edf25 | ||
|
|
656af7df2f | ||
|
|
3cd5a23af7 | ||
|
|
748e3e39bc | ||
|
|
ffb24594bc | ||
|
|
813aaf29b8 | ||
|
|
176a24cb43 | ||
|
|
8d26ef859d | ||
|
|
01eec1e9ad | ||
|
|
eb28b3a7f1 | ||
|
|
a8fb910e8d | ||
|
|
2888383b8f | ||
|
|
76f389dff9 | ||
|
|
5df4207521 | ||
|
|
995d0d9488 | ||
|
|
4c137167da | ||
|
|
07114e52f8 | ||
|
|
f938607119 | ||
|
|
6fff9875da | ||
|
|
2512513561 | ||
|
|
ce0da8581a | ||
|
|
2ddedf16b3 | ||
|
|
f14b088cca | ||
|
|
a7f658b54f | ||
|
|
fc6a212fc4 | ||
|
|
02c16f5979 | ||
|
|
1fbd7ee7f8 | ||
|
|
d5e8d4fb07 | ||
|
|
7dd50987df | ||
|
|
8b54f93f66 | ||
|
|
169555b041 | ||
|
|
7359b1846a | ||
|
|
53fd4b1258 | ||
|
|
4d1297eca5 | ||
|
|
767f0d6b44 | ||
|
|
4d494ce9b2 | ||
|
|
0190c81a97 | ||
|
|
c98c37743f | ||
|
|
dd5ea6e4f8 | ||
|
|
67dd27f4fe | ||
|
|
f212631e1a | ||
|
|
63ef6c82cb | ||
|
|
e24797dd05 | ||
|
|
fdb9ca1d30 | ||
|
|
c248a192c9 | ||
|
|
b03638b6b6 | ||
|
|
327a287a0b | ||
|
|
83360b3b7e | ||
|
|
970ee8a93f | ||
|
|
5ffe372908 | ||
|
|
5d75b1c6f1 | ||
|
|
1ff03398d6 | ||
|
|
529c1643a8 | ||
|
|
b8fffad6c8 | ||
|
|
c11d889d51 | ||
|
|
9f2261827a | ||
|
|
98fd600696 | ||
|
|
a2cb256aa6 | ||
|
|
06f40fa368 | ||
|
|
694f7adcc6 | ||
|
|
64ed424a6b | ||
|
|
7f0fac3553 | ||
|
|
5caeee45ad | ||
|
|
31173567d1 | ||
|
|
933b6dcb8f | ||
|
|
bae0dbd0e5 | ||
|
|
199dde05d0 | ||
|
|
058b27af32 | ||
|
|
e5b1f1cf46 | ||
|
|
cdda8a2ffd | ||
|
|
49d162fb12 | ||
|
|
193b1207f8 | ||
|
|
eb7ae833b4 | ||
|
|
8a8018509d | ||
|
|
a241512857 | ||
|
|
1162375194 | ||
|
|
0e6eae600a | ||
|
|
52648d1a0e | ||
|
|
0e039515f6 | ||
|
|
4c94614526 | ||
|
|
4c157ded2b | ||
|
|
0b5505cb34 | ||
|
|
26b6ecf4dd | ||
|
|
0bfbe9a504 | ||
|
|
823af95742 | ||
|
|
16b0ea3625 | ||
|
|
9546c4e7c7 | ||
|
|
07658676c9 | ||
|
|
197e34ccd5 | ||
|
|
9dd746b92b | ||
|
|
a72d6f034e | ||
|
|
250163e1f5 | ||
|
|
b84d6a2872 | ||
|
|
17336ed9a4 | ||
|
|
54b49209ed | ||
|
|
08ecfb0098 | ||
|
|
5991eef8df | ||
|
|
e8c99c14eb | ||
|
|
756708b0d3 | ||
|
|
8fc389a108 | ||
|
|
5ea18c8d1e | ||
|
|
7f38b48a59 | ||
|
|
c143a275fe | ||
|
|
318333f466 | ||
|
|
585a629c6f | ||
|
|
93ba73c33f | ||
|
|
48326a11fd | ||
|
|
f97d92edea | ||
|
|
f412cf476e | ||
|
|
d85f01b779 | ||
|
|
8ab7b96d87 | ||
|
|
1b5fb6bccb | ||
|
|
bb0ea74961 | ||
|
|
d557b4491d | ||
|
|
df6332f020 | ||
|
|
76514cc758 | ||
|
|
4b207ebbf6 | ||
|
|
33be4802f0 | ||
|
|
2ddffa3308 | ||
|
|
e6a76c79b7 | ||
|
|
ec74cf912b | ||
|
|
ed2091a4ab | ||
|
|
05ea1d2a3a | ||
|
|
0e7feaf5c7 | ||
|
|
96d27d3c42 | ||
|
|
8b6bf92d56 | ||
|
|
93915963cd | ||
|
|
0f64196bdb | ||
|
|
084e47636e | ||
|
|
a0c6794b01 |
@@ -1,6 +1,41 @@
|
|||||||
[*.cs]
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
charset = utf-8
|
||||||
|
insert_final_newline = true
|
||||||
|
|
||||||
|
[*.{sln,cs}]
|
||||||
|
# VS defaults to utf-8 with BOM -- let's not create more merge conflicts
|
||||||
|
# XXX: csproj files dont't have a BOM for some reason?
|
||||||
|
charset = utf-8-bom
|
||||||
|
|
||||||
|
[*.cs]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 4
|
||||||
|
csharp_prefer_braces = when_multiline:warning
|
||||||
|
csharp_indent_case_contents_when_block = false
|
||||||
|
# CS1591: Missing XML comment for publicly visible type or member
|
||||||
|
dotnet_diagnostic.CS1591.severity = none
|
||||||
# IDE0090: Use 'new(...)'
|
# IDE0090: Use 'new(...)'
|
||||||
csharp_style_implicit_object_creation_when_type_is_apparent = false
|
csharp_style_implicit_object_creation_when_type_is_apparent = false
|
||||||
|
|
||||||
dotnet_diagnostic.CA1806.severity = silent
|
dotnet_diagnostic.CA1806.severity = silent
|
||||||
|
|
||||||
|
[*.{html,xml,csproj}]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
|
|
||||||
|
[*.{sh,ps1}]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
|
|
||||||
|
[*.py]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 4
|
||||||
|
|
||||||
|
[*.{js,json}]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
|
|
||||||
|
[*.lua]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
|
|||||||
2
.github/DISCUSSION_TEMPLATE/bug-reports.yml
vendored
2
.github/DISCUSSION_TEMPLATE/bug-reports.yml
vendored
@@ -73,7 +73,7 @@ body:
|
|||||||
label: Version
|
label: Version
|
||||||
description: Which version of the game did the bug happen in? You can see the current version number in the bottom left corner of your screen in the main menu.
|
description: Which version of the game did the bug happen in? You can see the current version number in the bottom left corner of your screen in the main menu.
|
||||||
options:
|
options:
|
||||||
- v1.11.5.0 (Winter Update 2025 Hotfix 1)
|
- v1.12.6.2 (Spring Update 2026)
|
||||||
- Other
|
- Other
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
|
|||||||
106
.github/ISSUE_TEMPLATE/config.yml
vendored
106
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -1,5 +1,101 @@
|
|||||||
blank_issues_enabled: false
|
name: Bug Report
|
||||||
contact_links:
|
description: Found a bug? Help us squash it by making a bug report!
|
||||||
- name: Bug reports
|
body:
|
||||||
url: https://github.com/FakeFishGames/Barotrauma/discussions/categories/bug-reports
|
- type: markdown
|
||||||
about: Please post your bug reports in the Discussions section.
|
attributes:
|
||||||
|
value: |
|
||||||
|
Thanks for taking the time to report a bug! Actionable reports are very important in identifying and fixing bugs, so please fill out all the fields carefully and provide as much information as you can while being concise. Please also note that we get lots of reports and may not always write back to each individually – that does not mean we have not read it.
|
||||||
|
- type: checkboxes
|
||||||
|
id: checks
|
||||||
|
attributes:
|
||||||
|
label: "Disclaimers"
|
||||||
|
options:
|
||||||
|
- label: "I have searched the issue tracker to check if the issue has already been reported."
|
||||||
|
required: true
|
||||||
|
- label: "My issue happened while using mods."
|
||||||
|
required: false
|
||||||
|
- type: textarea
|
||||||
|
id: what-happened
|
||||||
|
attributes:
|
||||||
|
label: What happened?
|
||||||
|
description: Please tell us also what you expected should have happened if the game was behaving correctly.
|
||||||
|
placeholder: "Using the bike horn crashes the game."
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: repro
|
||||||
|
attributes:
|
||||||
|
label: Reproduction steps
|
||||||
|
description: |
|
||||||
|
If possible, describe how the developers can get the bug to happen (or, in other words, what actions lead to you encountering the bug). **This is by far the most important part of the report** - it is often extremely difficult, or even impossible, to diagnose an issue if we don't know the conditions it occurs in.
|
||||||
|
If you have a save, a submarine file, screenshots or any other files that might help us diagnose the issue, you can attach them here. Note that GitHub doesn't support the .save or .sub file extensions, so you should .zip those types of files to allow them to be attached.
|
||||||
|
placeholder: |
|
||||||
|
1. Start a multiplayer campaign
|
||||||
|
2. Spawn a bike horn with console commands
|
||||||
|
3. Use the bike horn
|
||||||
|
4. Observe how the game crashes
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: dropdown
|
||||||
|
id: prevalence
|
||||||
|
attributes:
|
||||||
|
label: Bug prevalence
|
||||||
|
description: "How often do you or others encounter this bug?"
|
||||||
|
options:
|
||||||
|
- Just once
|
||||||
|
- Happens every now and then
|
||||||
|
- Happens regularly
|
||||||
|
- Happens every time I play
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: dropdown
|
||||||
|
id: mporsp
|
||||||
|
attributes:
|
||||||
|
label: Single player or multiplayer?
|
||||||
|
description: Did the issue happen in single player, multiplayer, or both? How was the server being hosted?
|
||||||
|
options:
|
||||||
|
- Single player
|
||||||
|
- Multiplayer hosted from the in-game menu (= using a listen server)
|
||||||
|
- Multiplayer hosted using a dedicated server
|
||||||
|
- Happens in both single player and multiplayer
|
||||||
|
- Happens outside single player or multiplayer game modes (e.g. game launches on startup, something broken in the main menu)
|
||||||
|
- Other
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: input
|
||||||
|
id: othermporsp
|
||||||
|
attributes:
|
||||||
|
label: "-"
|
||||||
|
description: If you selected "Other" in the above dropdown, please clarify here.
|
||||||
|
- type: dropdown
|
||||||
|
id: version
|
||||||
|
attributes:
|
||||||
|
label: Version
|
||||||
|
description: Which version of the game did the bug happen in? You can see the current version number in the bottom left corner of your screen in the main menu.
|
||||||
|
options:
|
||||||
|
- Latest Stable
|
||||||
|
- Unstable
|
||||||
|
- Other
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: input
|
||||||
|
id: otherversion
|
||||||
|
attributes:
|
||||||
|
label: "-"
|
||||||
|
description: If you selected "Other" in the above dropdown because you are e.g. using a custom build, please tell us more about it here.
|
||||||
|
- type: dropdown
|
||||||
|
id: operating-systems
|
||||||
|
attributes:
|
||||||
|
label: Which operating system did you encounter this bug on?
|
||||||
|
options:
|
||||||
|
- Windows
|
||||||
|
- MacOS
|
||||||
|
- Linux
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: errors
|
||||||
|
attributes:
|
||||||
|
label: Relevant error messages and crash reports
|
||||||
|
description: If the game produces any text relevant to your issue, please include those in full. You can copy error messages from the in-game console by right clicking the error and selecting "copy". Crash reports will be named crashreport.log or servercrashreport.log and they're automatically generated into the root of the game's installation folder on your computer. You can usually find the game files location through Steam (Right click Barotrauma in your Steam Library -> Properties -> Local files -> Browse local files).
|
||||||
|
render: shell
|
||||||
|
|||||||
9
.github/dependabot.yml
vendored
Normal file
9
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
# yaml-language-server: $schema=https://json.schemastore.org/dependabot-2.0.json
|
||||||
|
|
||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: github-actions
|
||||||
|
target-branch: develop
|
||||||
|
directory: /
|
||||||
|
schedule:
|
||||||
|
interval: daily
|
||||||
51
.github/workflows/build.yml
vendored
Normal file
51
.github/workflows/build.yml
vendored
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
|
||||||
|
|
||||||
|
name: Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
target:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
env:
|
||||||
|
CI_DIR: 717a3c49-f5dc-42eb-b332-fcf2988d00e3
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout branch
|
||||||
|
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||||
|
with:
|
||||||
|
ref: ${{ inputs.target }}
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
|
- name: Setup .NET
|
||||||
|
uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee # v4.0.1
|
||||||
|
with:
|
||||||
|
dotnet-version: |
|
||||||
|
8.0.x
|
||||||
|
|
||||||
|
- name: Run deploy script
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
shopt -s globstar nullglob
|
||||||
|
shopt -u dotglob
|
||||||
|
cd Deploy
|
||||||
|
git apply < ./patches/disable-interactivity.diff
|
||||||
|
git apply < ./patches/prevent-crash-on-missing-dir.diff
|
||||||
|
./DeployAll.sh
|
||||||
|
|
||||||
|
- name: Create tarball
|
||||||
|
run: |
|
||||||
|
mkdir -p "$CI_DIR"
|
||||||
|
tar -czf "$CI_DIR/build.tar.gz" -C Deploy/bin/content .
|
||||||
|
|
||||||
|
- name: Upload tarball
|
||||||
|
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
|
||||||
|
with:
|
||||||
|
name: build
|
||||||
|
path: ${{ env.CI_DIR }}/build.tar.gz
|
||||||
89
.github/workflows/create-prerelease.yml
vendored
Normal file
89
.github/workflows/create-prerelease.yml
vendored
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
|
||||||
|
|
||||||
|
name: Create pre-release
|
||||||
|
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: "0 0 * * *"
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check-if-release-needed:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
latest-commit-sha: ${{ steps.get-latest-commit.outputs.result }}
|
||||||
|
has-new-commits: ${{ steps.check-for-new-commits.outputs.has-new-commits }}
|
||||||
|
steps:
|
||||||
|
- name: Extract branch name
|
||||||
|
id: extract-branch-name
|
||||||
|
run: |
|
||||||
|
echo "result=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> "$GITHUB_OUTPUT"
|
||||||
|
- name: Sanity checks
|
||||||
|
if: ${{ github.event_name == 'workflow_dispatch' && steps.extract-branch-name.outputs.result != 'develop' }}
|
||||||
|
run: |
|
||||||
|
echo "::error::this workflow can only be run on the \"develop\" branch"
|
||||||
|
exit 1
|
||||||
|
|
||||||
|
- name: Get latest nightly-tagged commit
|
||||||
|
id: get-latest-tag
|
||||||
|
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
||||||
|
with:
|
||||||
|
result-encoding: string
|
||||||
|
script: |
|
||||||
|
try {
|
||||||
|
const ref = await github.rest.git.getRef({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
ref: "tags/nightly",
|
||||||
|
});
|
||||||
|
return ref.data.object.sha;
|
||||||
|
} catch (err) {
|
||||||
|
if (err.name === "HttpError" && err.status === 404) {
|
||||||
|
return "tag-doesnt-exist";
|
||||||
|
}
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
|
||||||
|
- name: Get latest commit on dev branch
|
||||||
|
id: get-latest-commit
|
||||||
|
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
||||||
|
with:
|
||||||
|
result-encoding: string
|
||||||
|
script: |
|
||||||
|
const ref = await github.rest.git.getRef({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
ref: "heads/develop",
|
||||||
|
});
|
||||||
|
return ref.data.object.sha;
|
||||||
|
|
||||||
|
- name: Check for new commits
|
||||||
|
id: check-for-new-commits
|
||||||
|
if: ${{ steps.get-latest-tag.outputs.result != 'tag-doesnt-exist' }}
|
||||||
|
env:
|
||||||
|
LATEST_TAGGED_SHA: "${{ steps.get-latest-tag.outputs.result }}"
|
||||||
|
LATEST_SHA: "${{ steps.get-latest-commit.outputs.result }}"
|
||||||
|
run: |
|
||||||
|
if [[ -z "$LATEST_TAGGED_SHA" ]]; then
|
||||||
|
echo "::error::LATEST_TAGGED_SHA env var is invalid"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [[ -z "$LATEST_SHA" ]]; then
|
||||||
|
echo "::error::LATEST_TAGGED_SHA env var is invalid"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$LATEST_TAGGED_SHA" == "$LATEST_SHA" ]]; then
|
||||||
|
echo "has-new-commits=false" >> "$GITHUB_OUTPUT"
|
||||||
|
else
|
||||||
|
echo "has-new-commits=true" >> "$GITHUB_OUTPUT"
|
||||||
|
fi
|
||||||
|
|
||||||
|
publish-release:
|
||||||
|
needs: [check-if-release-needed]
|
||||||
|
if: ${{ needs.check-if-release-needed.outputs.has-new-commits == 'true' }}
|
||||||
|
uses: ./.github/workflows/publish-release.yml
|
||||||
|
with:
|
||||||
|
target: ${{ needs.check-if-release-needed.outputs.latest-commit-sha }}
|
||||||
|
tag: nightly
|
||||||
|
prerelease: true
|
||||||
21
.github/workflows/harden-ci-security.yml
vendored
Normal file
21
.github/workflows/harden-ci-security.yml
vendored
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
|
||||||
|
|
||||||
|
name: Harden CI security
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
target:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
ensure-sha-pinned-actions:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||||
|
with:
|
||||||
|
ref: ${{ inputs.target }}
|
||||||
|
- name: Ensure all actions are pinned to a specific commit
|
||||||
|
uses: zgosalvez/github-actions-ensure-sha-pinned-actions@3c16e895bb662b4d7e284f032cbe8835a57773cc # v3.0.11
|
||||||
22
.github/workflows/on-push-master.yml
vendored
Normal file
22
.github/workflows/on-push-master.yml
vendored
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
|
||||||
|
|
||||||
|
name: On push to master branch
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [master]
|
||||||
|
paths-ignore:
|
||||||
|
- ".github/**"
|
||||||
|
- "*.md"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
run-tests:
|
||||||
|
uses: ./.github/workflows/run-tests.yml
|
||||||
|
with:
|
||||||
|
target: ${{ github.event.ref }}
|
||||||
|
|
||||||
|
publish-release:
|
||||||
|
uses: ./.github/workflows/publish-release.yml
|
||||||
|
with:
|
||||||
|
target: ${{ github.event.ref }}
|
||||||
|
tag: latest
|
||||||
16
.github/workflows/on-push-other-branch.yml
vendored
Normal file
16
.github/workflows/on-push-other-branch.yml
vendored
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
|
||||||
|
|
||||||
|
name: On push to a secondary branch
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches-ignore: [master]
|
||||||
|
paths-ignore:
|
||||||
|
- ".github/**"
|
||||||
|
- "*.md"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
run-tests:
|
||||||
|
uses: ./.github/workflows/run-tests.yml
|
||||||
|
with:
|
||||||
|
target: ${{ github.event.ref }}
|
||||||
17
.github/workflows/on-push-pr.yml
vendored
Normal file
17
.github/workflows/on-push-pr.yml
vendored
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
|
||||||
|
|
||||||
|
name: On push to a PR
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
harden-ci-security:
|
||||||
|
uses: ./.github/workflows/harden-ci-security.yml
|
||||||
|
with:
|
||||||
|
target: ${{ github.event.pull_request.head.sha }}
|
||||||
|
|
||||||
|
run-tests-for-pr:
|
||||||
|
uses: ./.github/workflows/run-tests.yml
|
||||||
|
with:
|
||||||
|
target: ${{ github.event.pull_request.head.sha }}
|
||||||
14
.github/workflows/on-update-dot-github.yml
vendored
Normal file
14
.github/workflows/on-update-dot-github.yml
vendored
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
|
||||||
|
|
||||||
|
name: On changes to .github
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
paths-ignore:
|
||||||
|
- "./.github/**"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
harden-ci-security:
|
||||||
|
uses: ./.github/workflows/harden-ci-security.yml
|
||||||
|
with:
|
||||||
|
target: ${{ github.event.ref }}
|
||||||
232
.github/workflows/publish-release.yml
vendored
Normal file
232
.github/workflows/publish-release.yml
vendored
Normal file
@@ -0,0 +1,232 @@
|
|||||||
|
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
|
||||||
|
|
||||||
|
name: Publish release
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
target:
|
||||||
|
description: "The git ref to checkout, build from and release"
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
tag:
|
||||||
|
description: "The tag of the release"
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
prerelease:
|
||||||
|
description: "Prerelease"
|
||||||
|
required: false
|
||||||
|
default: false
|
||||||
|
type: boolean
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
target:
|
||||||
|
description: "The git ref to checkout, build from and release"
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
tag:
|
||||||
|
description: "The tag of the release"
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
prerelease:
|
||||||
|
description: "Prerelease"
|
||||||
|
required: false
|
||||||
|
default: false
|
||||||
|
type: boolean
|
||||||
|
|
||||||
|
env:
|
||||||
|
CI_DIR: 2049ef39-42a2-46d2-b513-ee6d2e3a7b15
|
||||||
|
RELEASES: |
|
||||||
|
windows:server:Windows/Server
|
||||||
|
linux:server:Linux/Server
|
||||||
|
mac:server:Mac/Server
|
||||||
|
windows:client:Windows/Client
|
||||||
|
linux:client:Linux/Client
|
||||||
|
mac:client:Mac/Client/Barotrauma.app/Contents/MacOS
|
||||||
|
ARCHIVE_BASE_NAME: luacsforbarotraumaEP
|
||||||
|
# XXX: these file names are subject to shell expansion.
|
||||||
|
# Be careful when using special characters.
|
||||||
|
ARCHIVE_FILES_SERVER: |
|
||||||
|
DedicatedServer.deps.json
|
||||||
|
DedicatedServer.dll
|
||||||
|
DedicatedServer.pdb
|
||||||
|
Publicized/DedicatedServer.dll
|
||||||
|
ARCHIVE_FILES_CLIENT: |
|
||||||
|
Barotrauma.deps.json
|
||||||
|
Barotrauma.dll
|
||||||
|
Barotrauma.pdb
|
||||||
|
DedicatedServer.deps.json
|
||||||
|
DedicatedServer.dll
|
||||||
|
DedicatedServer.pdb
|
||||||
|
Publicized/Barotrauma.dll
|
||||||
|
Publicized/DedicatedServer.dll
|
||||||
|
ARCHIVE_FILES_SHARED: |
|
||||||
|
BarotraumaCore.dll
|
||||||
|
BarotraumaCore.pdb
|
||||||
|
Publicized/BarotraumaCore.dll
|
||||||
|
0Harmony.dll
|
||||||
|
Sigil.dll
|
||||||
|
MoonSharp.Interpreter.dll
|
||||||
|
MoonSharp.VsCodeDebugger.dll
|
||||||
|
MonoMod.Backports.dll
|
||||||
|
MonoMod.Core.dll
|
||||||
|
MonoMod.RuntimeDetour.dll
|
||||||
|
MonoMod.ILHelpers.dll
|
||||||
|
MonoMod.Utils.dll
|
||||||
|
MonoMod.Iced.dll
|
||||||
|
Mono.Cecil.dll
|
||||||
|
Mono.Cecil.Mdb.dll
|
||||||
|
Mono.Cecil.Pdb.dll
|
||||||
|
Mono.Cecil.Rocks.dll
|
||||||
|
LightInject.dll
|
||||||
|
OneOf.dll
|
||||||
|
FluentResults.dll
|
||||||
|
Basic.Reference.Assemblies.Net80.dll
|
||||||
|
Microsoft.Extensions.Logging.Abstractions.dll
|
||||||
|
Microsoft.Toolkit.Diagnostics.dll
|
||||||
|
Microsoft.CodeAnalysis.CSharp.dll
|
||||||
|
Microsoft.CodeAnalysis.dll
|
||||||
|
System.Collections.Immutable.dll
|
||||||
|
System.Reflection.Metadata.dll
|
||||||
|
System.Runtime.CompilerServices.Unsafe.dll
|
||||||
|
mscordaccore_amd64_amd64_*
|
||||||
|
LocalMods/LuaCsForBarotrauma
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
uses: ./.github/workflows/build.yml
|
||||||
|
with:
|
||||||
|
target: ${{ inputs.target }}
|
||||||
|
|
||||||
|
publish-release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [build]
|
||||||
|
steps:
|
||||||
|
- name: Download build artifacts
|
||||||
|
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
|
||||||
|
with:
|
||||||
|
name: build
|
||||||
|
path: ${{ env.CI_DIR }}
|
||||||
|
|
||||||
|
- name: Extract build artifacts
|
||||||
|
run: |
|
||||||
|
artifacts_dir="$(realpath -m "$CI_DIR/artifacts")"
|
||||||
|
mkdir -p "$artifacts_dir"
|
||||||
|
tar -xzf "$CI_DIR/build.tar.gz" -C "$artifacts_dir"
|
||||||
|
rm "$CI_DIR/build.tar.gz"
|
||||||
|
|
||||||
|
- name: Create archives
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
shopt -s globstar nullglob
|
||||||
|
shopt -u dotglob
|
||||||
|
|
||||||
|
# This converts a newline-separated (LF) list into a Bash array
|
||||||
|
# NOTE: this doesn't discard the trailing LF that GitHub actions
|
||||||
|
# append (which results in an extra entry in the array).
|
||||||
|
lines_to_array() {
|
||||||
|
IFS=$'\n' readarray -td $'\n' "$1" <<< "${!1}"
|
||||||
|
}
|
||||||
|
|
||||||
|
lines_to_array ARCHIVE_FILES_SHARED
|
||||||
|
lines_to_array ARCHIVE_FILES_CLIENT
|
||||||
|
lines_to_array ARCHIVE_FILES_SERVER
|
||||||
|
lines_to_array RELEASES
|
||||||
|
|
||||||
|
artifacts_dir="$(realpath -m "$CI_DIR/artifacts")"
|
||||||
|
mkdir -p "$artifacts_dir"
|
||||||
|
|
||||||
|
archives_dir="$(realpath -m "$CI_DIR/archives")"
|
||||||
|
mkdir -p "$archives_dir"
|
||||||
|
|
||||||
|
refs_dir="$(realpath -m "$CI_DIR/refs")"
|
||||||
|
mkdir -p "${refs_dir}"
|
||||||
|
mkdir -p "${refs_dir}/Windows"
|
||||||
|
mkdir -p "${refs_dir}/Linux"
|
||||||
|
mkdir -p "${refs_dir}/OSX"
|
||||||
|
|
||||||
|
# Archive Refs, used by mod developers
|
||||||
|
cp "${artifacts_dir}/Windows/Client/Publicized/Barotrauma.dll" "${refs_dir}/Windows/Barotrauma.dll"
|
||||||
|
cp "${artifacts_dir}/Windows/Client/Publicized/DedicatedServer.dll" "${refs_dir}/Windows/DedicatedServer.dll"
|
||||||
|
cp "${artifacts_dir}/Windows/Client/Publicized/BarotraumaCore.dll" "${refs_dir}/Windows/BarotraumaCore.dll"
|
||||||
|
cp "${artifacts_dir}/Linux/Client/Publicized/Barotrauma.dll" "${refs_dir}/Linux/Barotrauma.dll"
|
||||||
|
cp "${artifacts_dir}/Linux/Client/Publicized/DedicatedServer.dll" "${refs_dir}/Linux/DedicatedServer.dll"
|
||||||
|
cp "${artifacts_dir}/Linux/Client/Publicized/BarotraumaCore.dll" "${refs_dir}/Linux/BarotraumaCore.dll"
|
||||||
|
cp "${artifacts_dir}/Mac/Client/Barotrauma.app/Contents/MacOS/Publicized/Barotrauma.dll" "${refs_dir}/OSX/Barotrauma.dll"
|
||||||
|
cp "${artifacts_dir}/Mac/Client/Barotrauma.app/Contents/MacOS/Publicized/DedicatedServer.dll" "${refs_dir}/OSX/DedicatedServer.dll"
|
||||||
|
cp "${artifacts_dir}/Mac/Client/Barotrauma.app/Contents/MacOS/Publicized/BarotraumaCore.dll" "${refs_dir}/OSX/BarotraumaCore.dll"
|
||||||
|
cp "${artifacts_dir}/Windows/Client/Publicized/MonoGame.Framework.Windows.NetStandard.dll" "${refs_dir}/MonoGame.Framework.Windows.NetStandard.dll"
|
||||||
|
cp "${artifacts_dir}/Linux/Client/Publicized/MonoGame.Framework.Linux.NetStandard.dll" "${refs_dir}/MonoGame.Framework.Linux.NetStandard.dll"
|
||||||
|
cp "${artifacts_dir}/Mac/Client/Barotrauma.app/Contents/MacOS/Publicized/MonoGame.Framework.MacOS.NetStandard.dll" "${refs_dir}/MonoGame.Framework.MacOS.NetStandard.dll"
|
||||||
|
# Those are the same across all the platforms, so i guess it doesn't matter?
|
||||||
|
cp "${artifacts_dir}/Windows/Client/Publicized/0Harmony.dll" "${refs_dir}/0Harmony.dll"
|
||||||
|
cp "${artifacts_dir}/Windows/Client/Publicized/MonoMod.Utils.dll" "${refs_dir}/MonoMod.Utils.dll"
|
||||||
|
cp "${artifacts_dir}/Windows/Client/Publicized/MonoMod.RuntimeDetour.dll" "${refs_dir}/MonoMod.RuntimeDetour.dll"
|
||||||
|
cp "${artifacts_dir}/Windows/Client/Publicized/MonoMod.ILHelpers.dll" "${refs_dir}/MonoMod.ILHelpers.dll"
|
||||||
|
cp "${artifacts_dir}/Windows/Client/Publicized/MonoMod.Iced.dll" "${refs_dir}/MonoMod.Iced.dll"
|
||||||
|
cp "${artifacts_dir}/Windows/Client/Publicized/MonoMod.Backports.dll" "${refs_dir}/MonoMod.Backports.dll"
|
||||||
|
cp "${artifacts_dir}/Windows/Client/Publicized/Farseer.NetStandard.dll" "${refs_dir}/Farseer.NetStandard.dll"
|
||||||
|
cp "${artifacts_dir}/Windows/Client/Publicized/Lidgren.NetStandard.dll" "${refs_dir}/Lidgren.NetStandard.dll"
|
||||||
|
cp "${artifacts_dir}/Windows/Client/Publicized/Mono.Cecil.dll" "${refs_dir}/Mono.Cecil.dll"
|
||||||
|
cp "${artifacts_dir}/Windows/Client/Publicized/MoonSharp.Interpreter.dll" "${refs_dir}/MoonSharp.Interpreter.dll"
|
||||||
|
cp "${artifacts_dir}/Windows/Client/Publicized/XNATypes.dll" "${refs_dir}/XNATypes.dll"
|
||||||
|
cd "${refs_dir}"
|
||||||
|
zip -r "${archives_dir}/${ARCHIVE_BASE_NAME}_refs.zip" .
|
||||||
|
|
||||||
|
for i in "${!RELEASES[@]}"; do
|
||||||
|
[[ -z "${RELEASES[i]}" ]] && continue
|
||||||
|
(
|
||||||
|
IFS=':' read platform side publish_dir _rest <<< "${RELEASES[i]}"
|
||||||
|
cd "${artifacts_dir}/${publish_dir}"
|
||||||
|
|
||||||
|
echo "Creating build_${platform}_${side}.zip"
|
||||||
|
zip --must-match -qr "${archives_dir}/${ARCHIVE_BASE_NAME}_build_${platform}_${side}.zip" *
|
||||||
|
|
||||||
|
echo "Creating build_${platform}_${side}.tar.gz"
|
||||||
|
tar -czf "${archives_dir}/${ARCHIVE_BASE_NAME}_build_${platform}_${side}.tar.gz" \
|
||||||
|
--owner=0 --group=0 \
|
||||||
|
*
|
||||||
|
|
||||||
|
if [[ "$side" == "client" ]]; then
|
||||||
|
files=(
|
||||||
|
${ARCHIVE_FILES_SHARED[@]}
|
||||||
|
${ARCHIVE_FILES_CLIENT[@]}
|
||||||
|
)
|
||||||
|
elif [[ "$side" == "server" ]]; then
|
||||||
|
files=(
|
||||||
|
${ARCHIVE_FILES_SHARED[@]}
|
||||||
|
${ARCHIVE_FILES_SERVER[@]}
|
||||||
|
)
|
||||||
|
else
|
||||||
|
echo "Invalid side: $side"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Creating patch_${platform}_${side}.zip"
|
||||||
|
zip \
|
||||||
|
--must-match \
|
||||||
|
-qr \
|
||||||
|
"${archives_dir}/${ARCHIVE_BASE_NAME}_patch_${platform}_${side}.zip" \
|
||||||
|
"${files[@]}"
|
||||||
|
|
||||||
|
echo "Creating patch_${platform}_${side}.tar.gz"
|
||||||
|
tar \
|
||||||
|
-zcf "${archives_dir}/${ARCHIVE_BASE_NAME}_patch_${platform}_${side}.tar.gz" \
|
||||||
|
--owner=0 --group=0 \
|
||||||
|
"${files[@]}"
|
||||||
|
)
|
||||||
|
done
|
||||||
|
|
||||||
|
- name: Publish release
|
||||||
|
uses: notpeelz/action-gh-create-release@c1bebd17c8a128e8db4165a68be4dc4e3f106ff1 # v5.0.1
|
||||||
|
with:
|
||||||
|
target: ${{ inputs.target }}
|
||||||
|
tag: ${{ inputs.tag }}
|
||||||
|
prerelease: ${{ inputs.prerelease }}
|
||||||
|
strategy: replace
|
||||||
|
title: "Automatic build"
|
||||||
|
body: "Automatic build"
|
||||||
|
files: |
|
||||||
|
${{ env.CI_DIR }}/archives/${{ env.ARCHIVE_BASE_NAME }}_{build,patch}_{windows,linux,mac}_{client,server}.zip
|
||||||
|
${{ env.CI_DIR }}/archives/${{ env.ARCHIVE_BASE_NAME }}_{build,patch}_linux_{client,server}.tar.gz
|
||||||
|
${{ env.CI_DIR }}/archives/${{ env.ARCHIVE_BASE_NAME }}_refs.zip
|
||||||
27
.github/workflows/report-test-results.yml
vendored
Normal file
27
.github/workflows/report-test-results.yml
vendored
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
|
||||||
|
|
||||||
|
name: Report test results
|
||||||
|
|
||||||
|
# HACK: the "on-push-pr" workflow gets run with read-only perms.
|
||||||
|
# This workflow will run in our repo with write permissions after
|
||||||
|
# the PR checks are done running.
|
||||||
|
on:
|
||||||
|
workflow_run:
|
||||||
|
workflows:
|
||||||
|
- On push to master branch
|
||||||
|
- On push to a secondary branch
|
||||||
|
- On push to a PR
|
||||||
|
types: [completed]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
report-test-results:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Report test results
|
||||||
|
uses: dorny/test-reporter@31a54ee7ebcacc03a09ea97a7e5465a47b84aea5 # v1.9.1
|
||||||
|
with:
|
||||||
|
name: Test results
|
||||||
|
artifact: test-results
|
||||||
|
path: test-results.trx
|
||||||
|
fail-on-error: false
|
||||||
|
reporter: dotnet-trx
|
||||||
47
.github/workflows/run-tests.yml
vendored
Normal file
47
.github/workflows/run-tests.yml
vendored
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
|
||||||
|
|
||||||
|
name: Run tests
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
target:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
run-tests:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout branch
|
||||||
|
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||||
|
with:
|
||||||
|
repository: ${{ inputs.repository }}
|
||||||
|
ref: ${{ inputs.target }}
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
|
- name: Setup .NET
|
||||||
|
uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee # v4.0.1
|
||||||
|
with:
|
||||||
|
dotnet-version: |
|
||||||
|
8.0.x
|
||||||
|
|
||||||
|
- name: Initialize environment
|
||||||
|
run: |
|
||||||
|
mkdir -p ~/".local/share/Daedalic Entertainment GmbH/Barotrauma"
|
||||||
|
|
||||||
|
- name: Run tests
|
||||||
|
continue-on-error: true
|
||||||
|
run: |
|
||||||
|
set +e
|
||||||
|
dotnet test LinuxSolution.sln -clp:"ErrorsOnly;Summary" --logger "trx;LogFileName=$PWD/test-results.trx"
|
||||||
|
echo "EXITCODE=$?" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
|
- name: Upload test results
|
||||||
|
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
|
||||||
|
with:
|
||||||
|
name: test-results
|
||||||
|
path: test-results.trx
|
||||||
|
|
||||||
|
- name: Set exit code
|
||||||
|
run: exit "$EXITCODE"
|
||||||
118
.github/workflows/update-docs.yml
vendored
Normal file
118
.github/workflows/update-docs.yml
vendored
Normal file
@@ -0,0 +1,118 @@
|
|||||||
|
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
|
||||||
|
|
||||||
|
name: Update documentation
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
env:
|
||||||
|
CI_DEPLOY_DIR: luacs-docs/ci-deploy
|
||||||
|
CI_ARTIFACTS_DIR: luacs-docs/ci-artifacts
|
||||||
|
DOCS_LUA_ROOT: luacs-docs/lua
|
||||||
|
DOCS_CS_ROOT: luacs-docs/cs
|
||||||
|
DOCS_LANDINGPAGE_ROOT: luacs-docs/landing-page
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
update-docs-lua:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout branch
|
||||||
|
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
|
- name: Setup .NET
|
||||||
|
uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee # v4.0.1
|
||||||
|
with:
|
||||||
|
dotnet-version: |
|
||||||
|
6.0.x
|
||||||
|
|
||||||
|
- uses: leafo/gh-actions-lua@35bcb06abec04ec87df82e08caa84d545348536e # v10.0.0
|
||||||
|
with:
|
||||||
|
luaVersion: "5.2"
|
||||||
|
|
||||||
|
- uses: leafo/gh-actions-luarocks@e65774a6386cb4f24e293dca7fc4ff89165b64c5 # v4.3.0
|
||||||
|
|
||||||
|
- name: Run install script
|
||||||
|
working-directory: ${{ env.DOCS_LUA_ROOT }}
|
||||||
|
run: ./scripts/install.sh
|
||||||
|
|
||||||
|
- name: Run docs generator script
|
||||||
|
working-directory: ${{ env.DOCS_LUA_ROOT }}
|
||||||
|
run: ./scripts/generate_docs.sh
|
||||||
|
|
||||||
|
- name: Run build script
|
||||||
|
working-directory: ${{ env.DOCS_LUA_ROOT }}
|
||||||
|
run: ./scripts/build.sh
|
||||||
|
|
||||||
|
- name: Create tarball
|
||||||
|
run: |
|
||||||
|
mkdir -p "$CI_ARTIFACTS_DIR"
|
||||||
|
tar -czf "$CI_ARTIFACTS_DIR"/lua.tar.gz -C "$DOCS_LUA_ROOT"/build .
|
||||||
|
|
||||||
|
- name: Upload tarball
|
||||||
|
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
|
||||||
|
with:
|
||||||
|
name: docs-lua
|
||||||
|
path: ${{ env.CI_ARTIFACTS_DIR }}/lua.tar.gz
|
||||||
|
|
||||||
|
update-docs-cs:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout branch
|
||||||
|
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||||
|
|
||||||
|
- name: Install doxygen
|
||||||
|
run: sudo apt-get update && sudo apt-get install -y doxygen
|
||||||
|
|
||||||
|
- name: Run build script
|
||||||
|
working-directory: ${{ env.DOCS_CS_ROOT }}
|
||||||
|
run: ./scripts/build.sh
|
||||||
|
|
||||||
|
- name: Create tarball
|
||||||
|
run: |
|
||||||
|
mkdir -p "$CI_ARTIFACTS_DIR"
|
||||||
|
tar -czf "$CI_ARTIFACTS_DIR"/cs.tar.gz -C "$DOCS_CS_ROOT"/build .
|
||||||
|
|
||||||
|
- name: Upload tarball
|
||||||
|
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
|
||||||
|
with:
|
||||||
|
name: docs-cs
|
||||||
|
path: ${{ env.CI_ARTIFACTS_DIR }}/cs.tar.gz
|
||||||
|
|
||||||
|
deploy-docs:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [update-docs-lua, update-docs-cs]
|
||||||
|
steps:
|
||||||
|
- name: Checkout branch
|
||||||
|
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||||
|
|
||||||
|
- run: mkdir -p "$CI_ARTIFACTS_DIR" "$CI_DEPLOY_DIR"
|
||||||
|
|
||||||
|
- name: "Download build artifacts: lua docs"
|
||||||
|
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
|
||||||
|
with:
|
||||||
|
name: docs-lua
|
||||||
|
path: ${{ env.CI_ARTIFACTS_DIR }}
|
||||||
|
|
||||||
|
- name: "Download build artifacts: cs docs"
|
||||||
|
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
|
||||||
|
with:
|
||||||
|
name: docs-cs
|
||||||
|
path: ${{ env.CI_ARTIFACTS_DIR }}
|
||||||
|
|
||||||
|
- name: Extract lua and cs tarballs
|
||||||
|
run: |
|
||||||
|
mkdir -p "$CI_DEPLOY_DIR"/{lua,cs}-docs
|
||||||
|
tar -xzf "$CI_ARTIFACTS_DIR"/lua.tar.gz -C "$CI_DEPLOY_DIR"/lua-docs
|
||||||
|
tar -xzf "$CI_ARTIFACTS_DIR"/cs.tar.gz -C "$CI_DEPLOY_DIR"/cs-docs
|
||||||
|
|
||||||
|
- name: Copy landing page files
|
||||||
|
run: cp -r "$DOCS_LANDINGPAGE_ROOT"/. "$CI_DEPLOY_DIR"
|
||||||
|
|
||||||
|
- name: Deploy
|
||||||
|
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e #v4.0.0
|
||||||
|
with:
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
publish_dir: ${{ env.CI_DEPLOY_DIR }}
|
||||||
|
keep_files: true
|
||||||
33
.github/workflows/update-moonsharp.yml
vendored
Normal file
33
.github/workflows/update-moonsharp.yml
vendored
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
|
||||||
|
|
||||||
|
name: Update MoonSharp
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
env:
|
||||||
|
SUBMODULE_PATH: Libraries/moonsharp
|
||||||
|
GIT_USER_EMAIL: "41898282+github-actions[bot]@users.noreply.github.com"
|
||||||
|
GIT_USER_NAME: "github-actions[bot]"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
update-moonsharp:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
|
- name: Update submodule
|
||||||
|
run: git submodule update --recursive --remote "$SUBMODULE_PATH"
|
||||||
|
|
||||||
|
- name: Create commit
|
||||||
|
run: |
|
||||||
|
git config user.name "$GIT_USER_NAME"
|
||||||
|
git config user.email "$GIT_USER_EMAIL"
|
||||||
|
git commit -am "Update submodule: $SUBMODULE_PATH"
|
||||||
|
|
||||||
|
- name: Push
|
||||||
|
run: git push
|
||||||
5
.gitignore
vendored
5
.gitignore
vendored
@@ -15,9 +15,11 @@ bld/
|
|||||||
[Rr]eleaseMac/
|
[Rr]eleaseMac/
|
||||||
[Dd]ebugLinux/
|
[Dd]ebugLinux/
|
||||||
[Rr]eleaseLinux/
|
[Rr]eleaseLinux/
|
||||||
|
LocalMods/
|
||||||
*.o
|
*.o
|
||||||
|
*/Barotrauma*/doc/
|
||||||
|
|
||||||
# Misc vs crap
|
# Misc vs crap
|
||||||
*.v12.suo
|
*.v12.suo
|
||||||
*.suo
|
*.suo
|
||||||
*.csproj.user
|
*.csproj.user
|
||||||
@@ -58,3 +60,4 @@ Deploy/DeployAll/PrivateKey.*
|
|||||||
|
|
||||||
#Rider
|
#Rider
|
||||||
*.DotSettings.user
|
*.DotSettings.user
|
||||||
|
.vscode/settings.json
|
||||||
|
|||||||
6
.gitmodules
vendored
Normal file
6
.gitmodules
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
[submodule "Libraries/moonsharp"]
|
||||||
|
path = Libraries/moonsharp
|
||||||
|
url = https://github.com/evilfactory/moonsharp.git
|
||||||
|
[submodule "luacs-docs/lua/libs/ldoc"]
|
||||||
|
path = luacs-docs/lua/libs/ldoc
|
||||||
|
url = https://github.com/evilfactory/LDoc.git
|
||||||
@@ -29,7 +29,7 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (SelectedAiTarget?.Entity != null)
|
else if (SelectedAiTarget?.Entity != null && AttackLimb != null)
|
||||||
{
|
{
|
||||||
Vector2 targetPos = SelectedAiTarget.Entity.DrawPosition;
|
Vector2 targetPos = SelectedAiTarget.Entity.DrawPosition;
|
||||||
if (State == AIState.Attack)
|
if (State == AIState.Attack)
|
||||||
@@ -37,15 +37,16 @@ namespace Barotrauma
|
|||||||
targetPos = attackWorldPos;
|
targetPos = attackWorldPos;
|
||||||
}
|
}
|
||||||
targetPos.Y = -targetPos.Y;
|
targetPos.Y = -targetPos.Y;
|
||||||
|
Vector2 attackLimbPos = AttackLimb.DrawPosition;
|
||||||
GUI.DrawLine(spriteBatch, pos, targetPos, GUIStyle.Red * 0.5f, 0, 4);
|
attackLimbPos.Y = -attackLimbPos.Y;
|
||||||
|
GUI.DrawLine(spriteBatch, attackLimbPos, targetPos, GUIStyle.Red * 0.75f, 0, 4);
|
||||||
if (wallTarget != null && !IsCoolDownRunning)
|
if (wallTarget != null && !IsCoolDownRunning)
|
||||||
{
|
{
|
||||||
Vector2 wallTargetPos = wallTarget.Position;
|
Vector2 wallTargetPos = wallTarget.Position;
|
||||||
if (wallTarget.Structure.Submarine != null) { wallTargetPos += wallTarget.Structure.Submarine.DrawPosition; }
|
if (wallTarget.Structure.Submarine != null) { wallTargetPos += wallTarget.Structure.Submarine.DrawPosition; }
|
||||||
wallTargetPos.Y = -wallTargetPos.Y;
|
wallTargetPos.Y = -wallTargetPos.Y;
|
||||||
GUI.DrawRectangle(spriteBatch, wallTargetPos - new Vector2(10.0f, 10.0f), new Vector2(20.0f, 20.0f), Color.Orange, false);
|
GUI.DrawRectangle(spriteBatch, wallTargetPos - new Vector2(10.0f, 10.0f), new Vector2(20.0f, 20.0f), Color.Orange, false);
|
||||||
GUI.DrawLine(spriteBatch, pos, wallTargetPos, Color.Orange * 0.5f, 0, 5);
|
GUI.DrawLine(spriteBatch, attackLimbPos, wallTargetPos, Color.Orange * 0.75f, 0, 5);
|
||||||
}
|
}
|
||||||
GUI.DrawString(spriteBatch, pos - Vector2.UnitY * 60.0f, $"{SelectedAiTarget.Entity}", GUIStyle.Red, Color.Black);
|
GUI.DrawString(spriteBatch, pos - Vector2.UnitY * 60.0f, $"{SelectedAiTarget.Entity}", GUIStyle.Red, Color.Black);
|
||||||
GUI.DrawString(spriteBatch, pos - Vector2.UnitY * 40.0f, $"{targetValue.FormatZeroDecimal()} (M: {CurrentTargetMemory?.Priority.FormatZeroDecimal()}, P: {CurrentTargetingParams?.Priority.FormatZeroDecimal()})", GUIStyle.Red, Color.Black);
|
GUI.DrawString(spriteBatch, pos - Vector2.UnitY * 40.0f, $"{targetValue.FormatZeroDecimal()} (M: {CurrentTargetMemory?.Priority.FormatZeroDecimal()}, P: {CurrentTargetingParams?.Priority.FormatZeroDecimal()})", GUIStyle.Red, Color.Black);
|
||||||
|
|||||||
@@ -23,6 +23,8 @@ namespace Barotrauma
|
|||||||
//GUI.DrawString(spriteBatch, pos + textOffset, $"AI TARGET: {SelectedAiTarget.Entity.ToString()}", Color.White, Color.Black);
|
//GUI.DrawString(spriteBatch, pos + textOffset, $"AI TARGET: {SelectedAiTarget.Entity.ToString()}", Color.White, Color.Black);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Vector2 spacing = new Vector2(0, GUIStyle.Font.MeasureChar('T').Y);
|
||||||
|
|
||||||
Vector2 stringDrawPos = pos + textOffset;
|
Vector2 stringDrawPos = pos + textOffset;
|
||||||
GUI.DrawString(spriteBatch, stringDrawPos, Character.Name, Color.White, Color.Black);
|
GUI.DrawString(spriteBatch, stringDrawPos, Character.Name, Color.White, Color.Black);
|
||||||
|
|
||||||
@@ -33,14 +35,14 @@ namespace Barotrauma
|
|||||||
currentOrders.Sort((x, y) => y.ManualPriority.CompareTo(x.ManualPriority));
|
currentOrders.Sort((x, y) => y.ManualPriority.CompareTo(x.ManualPriority));
|
||||||
for (int i = 0; i < currentOrders.Count; i++)
|
for (int i = 0; i < currentOrders.Count; i++)
|
||||||
{
|
{
|
||||||
stringDrawPos += new Vector2(0, 20);
|
stringDrawPos += spacing;
|
||||||
var order = currentOrders[i];
|
var order = currentOrders[i];
|
||||||
GUI.DrawString(spriteBatch, stringDrawPos, $"ORDER {i + 1}: {order.Objective.DebugTag} ({order.Objective.Priority.FormatZeroDecimal()})", Color.White, Color.Black);
|
GUI.DrawString(spriteBatch, stringDrawPos, $"ORDER {i + 1}: {order.Objective.DebugTag} ({order.Objective.Priority.FormatZeroDecimal()})", Color.White, Color.Black);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (ObjectiveManager.WaitTimer > 0)
|
else if (ObjectiveManager.WaitTimer > 0)
|
||||||
{
|
{
|
||||||
stringDrawPos += new Vector2(0, 20);
|
stringDrawPos += spacing;
|
||||||
GUI.DrawString(spriteBatch, stringDrawPos - textOffset, $"Waiting... {ObjectiveManager.WaitTimer.FormatZeroDecimal()}", Color.White, Color.Black);
|
GUI.DrawString(spriteBatch, stringDrawPos - textOffset, $"Waiting... {ObjectiveManager.WaitTimer.FormatZeroDecimal()}", Color.White, Color.Black);
|
||||||
}
|
}
|
||||||
var currentObjective = ObjectiveManager.CurrentObjective;
|
var currentObjective = ObjectiveManager.CurrentObjective;
|
||||||
@@ -49,19 +51,19 @@ namespace Barotrauma
|
|||||||
int offset = currentOrder != null ? 20 + ((ObjectiveManager.CurrentOrders.Count - 1) * 20) : 0;
|
int offset = currentOrder != null ? 20 + ((ObjectiveManager.CurrentOrders.Count - 1) * 20) : 0;
|
||||||
if (currentOrder == null || currentOrder.Priority <= 0)
|
if (currentOrder == null || currentOrder.Priority <= 0)
|
||||||
{
|
{
|
||||||
stringDrawPos += new Vector2(0, 20);
|
stringDrawPos += spacing;
|
||||||
GUI.DrawString(spriteBatch, stringDrawPos, $"MAIN OBJECTIVE: {currentObjective.DebugTag} ({currentObjective.Priority.FormatZeroDecimal()})", Color.White, Color.Black);
|
GUI.DrawString(spriteBatch, stringDrawPos, $"MAIN OBJECTIVE: {currentObjective.DebugTag} ({currentObjective.Priority.FormatZeroDecimal()})", Color.White, Color.Black);
|
||||||
}
|
}
|
||||||
var subObjective = currentObjective.CurrentSubObjective;
|
var subObjective = currentObjective.CurrentSubObjective;
|
||||||
if (subObjective != null)
|
if (subObjective != null)
|
||||||
{
|
{
|
||||||
stringDrawPos += new Vector2(0, 20);
|
stringDrawPos += spacing;
|
||||||
GUI.DrawString(spriteBatch, stringDrawPos, $"SUBOBJECTIVE: {subObjective.DebugTag} ({subObjective.Priority.FormatZeroDecimal()})", Color.White, Color.Black);
|
GUI.DrawString(spriteBatch, stringDrawPos, $"SUBOBJECTIVE: {subObjective.DebugTag} ({subObjective.Priority.FormatZeroDecimal()})", Color.White, Color.Black);
|
||||||
}
|
}
|
||||||
var activeObjective = ObjectiveManager.GetActiveObjective();
|
var activeObjective = ObjectiveManager.GetActiveObjective();
|
||||||
if (activeObjective != null)
|
if (activeObjective != null)
|
||||||
{
|
{
|
||||||
stringDrawPos += new Vector2(0, 20);
|
stringDrawPos += spacing;
|
||||||
GUI.DrawString(spriteBatch, stringDrawPos, $"ACTIVE OBJECTIVE: {activeObjective.DebugTag} ({activeObjective.Priority.FormatZeroDecimal()})", Color.White, Color.Black);
|
GUI.DrawString(spriteBatch, stringDrawPos, $"ACTIVE OBJECTIVE: {activeObjective.DebugTag} ({activeObjective.Priority.FormatZeroDecimal()})", Color.White, Color.Black);
|
||||||
}
|
}
|
||||||
if (currentObjective is AIObjectiveCombat
|
if (currentObjective is AIObjectiveCombat
|
||||||
@@ -85,12 +87,12 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector2 objectiveStringDrawPos = stringDrawPos + new Vector2(120, 40);
|
Vector2 objectiveStringDrawPos = stringDrawPos + new Vector2(120, spacing.Y * 2);
|
||||||
for (int i = 0; i < ObjectiveManager.Objectives.Count; i++)
|
for (int i = 0; i < ObjectiveManager.Objectives.Count; i++)
|
||||||
{
|
{
|
||||||
var objective = ObjectiveManager.Objectives[i];
|
var objective = ObjectiveManager.Objectives[i];
|
||||||
GUI.DrawString(spriteBatch, objectiveStringDrawPos, $"{objective.DebugTag} ({objective.Priority.FormatZeroDecimal()})", Color.White, Color.Black * 0.5f);
|
GUI.DrawString(spriteBatch, objectiveStringDrawPos, $"{objective.DebugTag} ({objective.Priority.FormatZeroDecimal()})", Color.White, Color.Black * 0.5f);
|
||||||
objectiveStringDrawPos += new Vector2(0, 18);
|
objectiveStringDrawPos += spacing * 0.8f;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (steeringManager is IndoorsSteeringManager pathSteering)
|
if (steeringManager is IndoorsSteeringManager pathSteering)
|
||||||
|
|||||||
@@ -547,7 +547,7 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Draw(SpriteBatch spriteBatch, Camera cam)
|
public void Draw(SpriteBatch spriteBatch, Camera cam, bool onlyDrawSeveredLimbs)
|
||||||
{
|
{
|
||||||
if (simplePhysicsEnabled) { return; }
|
if (simplePhysicsEnabled) { return; }
|
||||||
|
|
||||||
@@ -573,8 +573,12 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
foreach (Limb limb in limbs) { limb.ActiveSprite.Depth += depthOffset; }
|
foreach (Limb limb in limbs) { limb.ActiveSprite.Depth += depthOffset; }
|
||||||
}
|
}
|
||||||
for (int i = 0; i < limbs.Length; i++)
|
for (int i = 0; i < inversedLimbDrawOrder.Length; i++)
|
||||||
{
|
{
|
||||||
|
if (onlyDrawSeveredLimbs && !inversedLimbDrawOrder[i].IsSevered)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
inversedLimbDrawOrder[i].Draw(spriteBatch, cam, color);
|
inversedLimbDrawOrder[i].Draw(spriteBatch, cam, color);
|
||||||
}
|
}
|
||||||
if (!MathUtils.NearlyEqual(depthOffset, 0.0f))
|
if (!MathUtils.NearlyEqual(depthOffset, 0.0f))
|
||||||
|
|||||||
@@ -938,8 +938,8 @@ namespace Barotrauma
|
|||||||
|
|
||||||
public void Draw(SpriteBatch spriteBatch, Camera cam)
|
public void Draw(SpriteBatch spriteBatch, Camera cam)
|
||||||
{
|
{
|
||||||
if (!Enabled || InvisibleTimer > 0.0f) { return; }
|
if (!Enabled) { return; }
|
||||||
AnimController.Draw(spriteBatch, cam);
|
AnimController.Draw(spriteBatch, cam, onlyDrawSeveredLimbs: InvisibleTimer > 0.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DrawHUD(SpriteBatch spriteBatch, Camera cam, bool drawHealth = true)
|
public void DrawHUD(SpriteBatch spriteBatch, Camera cam, bool drawHealth = true)
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using Microsoft.Xna.Framework;
|
|||||||
using Microsoft.Xna.Framework.Graphics;
|
using Microsoft.Xna.Framework.Graphics;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Barotrauma.Items.Components;
|
using Barotrauma.Items.Components;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
namespace Barotrauma;
|
namespace Barotrauma;
|
||||||
|
|
||||||
@@ -106,12 +107,17 @@ public static class InteractionLabelManager
|
|||||||
}
|
}
|
||||||
|
|
||||||
RectangleF textRect = GetLabelRect(interactableInRange, cam);
|
RectangleF textRect = GetLabelRect(interactableInRange, cam);
|
||||||
|
var existingLabel = labels.FirstOrDefault(l => l.Item == interactableInRange);
|
||||||
if (labels.None(l => l.Item == interactableInRange))
|
if (existingLabel == null)
|
||||||
{
|
{
|
||||||
var labelData = new LabelData(interactableInRange, textRect, RichString.Rich(interactableInRange.Prefab.Name), cam);
|
var labelData = new LabelData(interactableInRange, textRect, RichString.Rich(interactableInRange.Prefab.Name), cam);
|
||||||
labels.Add(labelData);
|
labels.Add(labelData);
|
||||||
}
|
}
|
||||||
|
//size of the label doesn't match - can happen when we're using a CJK font which we asynchronously render new symbols for
|
||||||
|
else if (existingLabel.TextRect.Size != textRect.Size)
|
||||||
|
{
|
||||||
|
existingLabel.TextRect = textRect;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PreventInteractionLabelOverlap(centerPos: character.Position);
|
PreventInteractionLabelOverlap(centerPos: character.Position);
|
||||||
@@ -127,7 +133,11 @@ public static class InteractionLabelManager
|
|||||||
private static RectangleF GetLabelRect(Item item, Camera cam)
|
private static RectangleF GetLabelRect(Item item, Camera cam)
|
||||||
{
|
{
|
||||||
// create rectangle for overlap prevention
|
// create rectangle for overlap prevention
|
||||||
Vector2 itemTextSizeScreen = GUIStyle.SubHeadingFont.MeasureString(RichString.Rich(item.Prefab.Name).SanitizedValue) * LabelScale;
|
|
||||||
|
string nameText = RichString.Rich(item.Prefab.Name).SanitizedValue;
|
||||||
|
|
||||||
|
var font = GUIStyle.SubHeadingFont.GetFontForStr(nameText)!;
|
||||||
|
Vector2 itemTextSizeScreen = font.MeasureString(nameText) * LabelScale;
|
||||||
Vector2 interactablePosScreen = cam.WorldToScreen(item.Position);
|
Vector2 interactablePosScreen = cam.WorldToScreen(item.Position);
|
||||||
RectangleF textRect = new RectangleF(interactablePosScreen.X, interactablePosScreen.Y, itemTextSizeScreen.X, itemTextSizeScreen.Y);
|
RectangleF textRect = new RectangleF(interactablePosScreen.X, interactablePosScreen.Y, itemTextSizeScreen.X, itemTextSizeScreen.Y);
|
||||||
// center the rectangle on the item
|
// center the rectangle on the item
|
||||||
|
|||||||
@@ -340,10 +340,6 @@ namespace Barotrauma
|
|||||||
break;
|
break;
|
||||||
case "randomcolor":
|
case "randomcolor":
|
||||||
randomColor = subElement.GetAttributeColorArray("colors", null)?.GetRandomUnsynced();
|
randomColor = subElement.GetAttributeColorArray("colors", null)?.GetRandomUnsynced();
|
||||||
if (randomColor.HasValue)
|
|
||||||
{
|
|
||||||
Params.GetSprite().Color = randomColor.Value;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case "lightsource":
|
case "lightsource":
|
||||||
LightSource = new LightSource(subElement, GetConditionalTarget())
|
LightSource = new LightSource(subElement, GetConditionalTarget())
|
||||||
@@ -631,6 +627,8 @@ namespace Barotrauma
|
|||||||
SoundPlayer.PlayDamageSound(damageSoundType, Math.Max(damage, bleedingDamage), WorldPosition);
|
SoundPlayer.PlayDamageSound(damageSoundType, Math.Max(damage, bleedingDamage), WorldPosition);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (character.InvisibleTimer > 0.0f) { return; }
|
||||||
|
|
||||||
// spawn damage particles
|
// spawn damage particles
|
||||||
float damageParticleAmount = damage < 1 ? 0 : Math.Min(damage / 5, 1.0f) * damageMultiplier;
|
float damageParticleAmount = damage < 1 ? 0 : Math.Min(damage / 5, 1.0f) * damageMultiplier;
|
||||||
if (damageParticleAmount > 0.001f)
|
if (damageParticleAmount > 0.001f)
|
||||||
@@ -734,7 +732,8 @@ namespace Barotrauma
|
|||||||
if (spriteParams == null || Alpha <= 0) { return; }
|
if (spriteParams == null || Alpha <= 0) { return; }
|
||||||
float burn = spriteParams.IgnoreTint ? 0 : burnOverLayStrength;
|
float burn = spriteParams.IgnoreTint ? 0 : burnOverLayStrength;
|
||||||
float brightness = Math.Max(1.0f - burn, 0.2f);
|
float brightness = Math.Max(1.0f - burn, 0.2f);
|
||||||
Color tintedColor = spriteParams.Color;
|
Color baseColor = randomColor ?? spriteParams.Color;
|
||||||
|
Color tintedColor = baseColor;
|
||||||
if (!spriteParams.IgnoreTint)
|
if (!spriteParams.IgnoreTint)
|
||||||
{
|
{
|
||||||
tintedColor = tintedColor.Multiply(ragdoll.RagdollParams.Color);
|
tintedColor = tintedColor.Multiply(ragdoll.RagdollParams.Color);
|
||||||
@@ -752,7 +751,7 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Color color = new Color(tintedColor.Multiply(brightness), tintedColor.A);
|
Color color = new Color(tintedColor.Multiply(brightness), tintedColor.A);
|
||||||
Color colorWithoutTint = new Color(spriteParams.Color.Multiply(brightness), spriteParams.Color.A);
|
Color colorWithoutTint = new Color(baseColor.Multiply(brightness), baseColor.A);
|
||||||
Color blankColor = new Color(brightness, brightness, brightness, 1);
|
Color blankColor = new Color(brightness, brightness, brightness, 1);
|
||||||
if (deadTimer > 0)
|
if (deadTimer > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ namespace Barotrauma
|
|||||||
|
|
||||||
GUILayoutGroup connLayout = new GUILayoutGroup(new RectTransform(new Vector2(1f, 0.12f), labelList.Content.RectTransform), isHorizontal: true, childAnchor: Anchor.CenterLeft);
|
GUILayoutGroup connLayout = new GUILayoutGroup(new RectTransform(new Vector2(1f, 0.12f), labelList.Content.RectTransform), isHorizontal: true, childAnchor: Anchor.CenterLeft);
|
||||||
new GUITextBlock(new RectTransform(new Vector2(0.4f, 1f), connLayout.RectTransform), text: conn.Connection.DisplayName, font: GUIStyle.SubHeadingFont);
|
new GUITextBlock(new RectTransform(new Vector2(0.4f, 1f), connLayout.RectTransform), text: conn.Connection.DisplayName, font: GUIStyle.SubHeadingFont);
|
||||||
GUITextBox box = GUI.CreateTextBoxWithPlaceholder(new RectTransform(new Vector2(0.6f, 1f), connLayout.RectTransform), text: found ? labelOverride : string.Empty, conn.Connection.DisplayName.Value);
|
GUITextBox box = GUI.CreateTextBoxWithPlaceholder(new RectTransform(new Vector2(0.6f, 1f), connLayout.RectTransform), text: found ? labelOverride : string.Empty, conn.Connection.DefaultDisplayName.Value);
|
||||||
box.MaxTextLength = MaxConnectionLabelLength;
|
box.MaxTextLength = MaxConnectionLabelLength;
|
||||||
|
|
||||||
textBoxes.Add(conn.Name, box);
|
textBoxes.Add(conn.Name, box);
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Xml.Linq;
|
using System.Xml.Linq;
|
||||||
|
using Barotrauma.LuaCs.Events;
|
||||||
using static Barotrauma.FabricationRecipe;
|
using static Barotrauma.FabricationRecipe;
|
||||||
|
|
||||||
namespace Barotrauma
|
namespace Barotrauma
|
||||||
@@ -3543,6 +3544,11 @@ namespace Barotrauma
|
|||||||
ContentPackageManager.RegularPackages.Select(p => p.Name).ToArray()
|
ContentPackageManager.RegularPackages.Select(p => p.Name).ToArray()
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
commands.Add(new Command("ShowServerPerf", "Immediately log server performance info", (string[] args) =>
|
||||||
|
{
|
||||||
|
// TODO: Not yet :)
|
||||||
|
}));
|
||||||
|
|
||||||
#if WINDOWS
|
#if WINDOWS
|
||||||
commands.Add(new Command("startdedicatedserver", "", (string[] args) =>
|
commands.Add(new Command("startdedicatedserver", "", (string[] args) =>
|
||||||
{
|
{
|
||||||
@@ -3576,6 +3582,14 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
}));*/
|
}));*/
|
||||||
|
|
||||||
|
AssignOnClientExecute(
|
||||||
|
"ShowServerPerf",
|
||||||
|
(string[] args) =>
|
||||||
|
{
|
||||||
|
GameMain.Client?.SendConsoleCommand("ShowServerPerf");
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
AssignOnClientExecute(
|
AssignOnClientExecute(
|
||||||
"giveperm",
|
"giveperm",
|
||||||
(string[] args) =>
|
(string[] args) =>
|
||||||
@@ -4213,12 +4227,8 @@ namespace Barotrauma
|
|||||||
NewMessage("Minimum main path width: " + (Level.Loaded.LevelData?.MinMainPathWidth?.ToString() ?? "unknown"));
|
NewMessage("Minimum main path width: " + (Level.Loaded.LevelData?.MinMainPathWidth?.ToString() ?? "unknown"));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private static void ReloadWearables(Character character, int variant = 0)
|
private static void ReloadWearables(Character character, int variant = 0)
|
||||||
{
|
{
|
||||||
foreach (var limb in character.AnimController.Limbs)
|
foreach (var limb in character.AnimController.Limbs)
|
||||||
|
|||||||
@@ -277,6 +277,14 @@ namespace Barotrauma
|
|||||||
int selectedOption = (userdata as int?) ?? 0;
|
int selectedOption = (userdata as int?) ?? 0;
|
||||||
if (actionInstance != null)
|
if (actionInstance != null)
|
||||||
{
|
{
|
||||||
|
var option = actionInstance.Options[selectedOption];
|
||||||
|
if (GameMain.Client == null && option.ForceSay)
|
||||||
|
{
|
||||||
|
Character.Controlled.ForceSay(
|
||||||
|
option.ForceSayText.IsNullOrEmpty() ? TextManager.Get(option.Text).Fallback(option.Text) : TextManager.Get(option.ForceSayText).Fallback(option.ForceSayText),
|
||||||
|
option.ForceSayInRadio,
|
||||||
|
option.ForceSayRemoveQuotes);
|
||||||
|
}
|
||||||
actionInstance.selectedOption = selectedOption;
|
actionInstance.selectedOption = selectedOption;
|
||||||
DisableButtons(optionButtons, btn);
|
DisableButtons(optionButtons, btn);
|
||||||
btn.ExternalHighlight = true;
|
btn.ExternalHighlight = true;
|
||||||
@@ -340,7 +348,8 @@ namespace Barotrauma
|
|||||||
if (speaker?.Info != null && drawChathead)
|
if (speaker?.Info != null && drawChathead)
|
||||||
{
|
{
|
||||||
// chathead
|
// chathead
|
||||||
new GUICustomComponent(new RectTransform(new Vector2(0.15f, 0.8f), content.RectTransform), onDraw: (sb, customComponent) =>
|
int chatHeadWidth = (int)(content.RectTransform.Rect.Width * 0.15f);
|
||||||
|
new GUICustomComponent(new RectTransform(new Point(chatHeadWidth, chatHeadWidth), content.RectTransform, isFixedSize: true), onDraw: (sb, customComponent) =>
|
||||||
{
|
{
|
||||||
speaker.Info.DrawIcon(sb, customComponent.Rect.Center.ToVector2(), customComponent.Rect.Size.ToVector2());
|
speaker.Info.DrawIcon(sb, customComponent.Rect.Center.ToVector2(), customComponent.Rect.Size.ToVector2());
|
||||||
});
|
});
|
||||||
@@ -382,7 +391,7 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
|
|
||||||
textContent.RectTransform.MinSize = new Point(0, textContent.Children.Sum(c => c.Rect.Height + textContent.AbsoluteSpacing) + GUI.IntScale(16));
|
textContent.RectTransform.MinSize = new Point(0, textContent.Children.Sum(c => c.Rect.Height + textContent.AbsoluteSpacing) + GUI.IntScale(16));
|
||||||
content.RectTransform.MinSize = new Point(0, content.Children.Sum(c => c.Rect.Height));
|
content.RectTransform.MinSize = textContent.RectTransform.MinSize;
|
||||||
|
|
||||||
// Recalculate the text size as it is scaled up and no longer matching the text height due to the textContent's minSize increasing
|
// Recalculate the text size as it is scaled up and no longer matching the text height due to the textContent's minSize increasing
|
||||||
textBlock.CalculateHeightFromText();
|
textBlock.CalculateHeightFromText();
|
||||||
|
|||||||
@@ -61,17 +61,9 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
Item.ReadSpawnData(msg);
|
Item.ReadSpawnData(msg);
|
||||||
}
|
}
|
||||||
if (character.Submarine != null && character.AIController is EnemyAIController enemyAi)
|
if (character.AIController is EnemyAIController enemyAi && character.Submarine is Submarine ownSub)
|
||||||
{
|
{
|
||||||
enemyAi.UnattackableSubmarines.Add(character.Submarine);
|
enemyAi.SetUnattackableSubmarines(ownSub);
|
||||||
if (Submarine.MainSub != null)
|
|
||||||
{
|
|
||||||
enemyAi.UnattackableSubmarines.Add(Submarine.MainSub);
|
|
||||||
foreach (Submarine sub in Submarine.MainSub.DockedTo)
|
|
||||||
{
|
|
||||||
enemyAi.UnattackableSubmarines.Add(sub);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (characters.Contains(null))
|
if (characters.Contains(null))
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
#nullable enable
|
||||||
|
namespace Barotrauma;
|
||||||
|
|
||||||
|
internal sealed partial class CustomMission : Mission
|
||||||
|
{
|
||||||
|
public override bool DisplayAsCompleted => State == SuccessState;
|
||||||
|
public override bool DisplayAsFailed => State == FailureState;
|
||||||
|
}
|
||||||
@@ -14,7 +14,7 @@ namespace Barotrauma
|
|||||||
|
|
||||||
private void TryShowRetrievedMessage()
|
private void TryShowRetrievedMessage()
|
||||||
{
|
{
|
||||||
if (DetermineCompleted())
|
if (DetermineCompleted(CampaignMode.TransitionType.None))
|
||||||
{
|
{
|
||||||
HandleMessage(ref allRetrievedMessage);
|
HandleMessage(ref allRetrievedMessage);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using Barotrauma.Extensions;
|
using Barotrauma.Extensions;
|
||||||
using Barotrauma.Items.Components;
|
using Barotrauma.Items.Components;
|
||||||
|
using Barotrauma.LuaCs.Events;
|
||||||
using Barotrauma.Networking;
|
using Barotrauma.Networking;
|
||||||
using Microsoft.Xna.Framework;
|
using Microsoft.Xna.Framework;
|
||||||
using System;
|
using System;
|
||||||
@@ -411,6 +412,13 @@ namespace Barotrauma
|
|||||||
|
|
||||||
public void AddMessage(ChatMessage message)
|
public void AddMessage(ChatMessage message)
|
||||||
{
|
{
|
||||||
|
if (GameMain.IsSingleplayer)
|
||||||
|
{
|
||||||
|
bool? should = null;
|
||||||
|
LuaCsSetup.Instance.EventService.PublishEvent<IEventChatMessage>(x => should = x.OnChatMessage(message.Text, message.SenderClient, message.Type, message) ?? should);
|
||||||
|
if (should != null && should.Value) { return; }
|
||||||
|
}
|
||||||
|
|
||||||
while (chatBox.Content.CountChildren > 60)
|
while (chatBox.Content.CountChildren > 60)
|
||||||
{
|
{
|
||||||
chatBox.RemoveChild(chatBox.Content.Children.First());
|
chatBox.RemoveChild(chatBox.Content.Children.First());
|
||||||
|
|||||||
@@ -1435,8 +1435,15 @@ namespace Barotrauma
|
|||||||
Uri baseAddress = new Uri(url);
|
Uri baseAddress = new Uri(url);
|
||||||
Uri remoteDirectory = new Uri(baseAddress, ".");
|
Uri remoteDirectory = new Uri(baseAddress, ".");
|
||||||
string remoteFileName = Path.GetFileName(baseAddress.LocalPath);
|
string remoteFileName = Path.GetFileName(baseAddress.LocalPath);
|
||||||
IRestClient client = new RestClient(remoteDirectory);
|
var client = RestFactory.CreateClient(remoteDirectory.ToString());
|
||||||
var response = client.Execute(new RestRequest(remoteFileName, Method.GET));
|
var request = RestFactory.CreateRequest(remoteFileName);
|
||||||
|
var response = client.Execute(request);
|
||||||
|
if (response.ErrorException != null)
|
||||||
|
{
|
||||||
|
DebugConsole.AddWarning($"Connection error: Failed to load remote sprite from {url} " +
|
||||||
|
$"({response.ErrorException.Message}).");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
if (response.ResponseStatus != ResponseStatus.Completed) { return null; }
|
if (response.ResponseStatus != ResponseStatus.Completed) { return null; }
|
||||||
if (response.StatusCode != HttpStatusCode.OK) { return null; }
|
if (response.StatusCode != HttpStatusCode.OK) { return null; }
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,9 @@ namespace Barotrauma
|
|||||||
|
|
||||||
public OnSelectedHandler OnDropped;
|
public OnSelectedHandler OnDropped;
|
||||||
|
|
||||||
private readonly GUIButton button;
|
private readonly GUIButton button;
|
||||||
|
public GUIButton Button => button;
|
||||||
|
|
||||||
private readonly GUIImage icon;
|
private readonly GUIImage icon;
|
||||||
private readonly GUIListBox listBox;
|
private readonly GUIListBox listBox;
|
||||||
|
|
||||||
|
|||||||
@@ -36,6 +36,16 @@ namespace Barotrauma
|
|||||||
/// If the event launches, the text should already be up to date!
|
/// If the event launches, the text should already be up to date!
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public event OnTextChangedHandler OnTextChanged;
|
public event OnTextChangedHandler OnTextChanged;
|
||||||
|
public OnTextChangedHandler OnTextChangedDelegate
|
||||||
|
{
|
||||||
|
set
|
||||||
|
{
|
||||||
|
OnTextChanged += (GUITextBox a, string b) =>
|
||||||
|
{
|
||||||
|
return value.Invoke(a, b);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public bool CaretEnabled { get; set; }
|
public bool CaretEnabled { get; set; }
|
||||||
public Color? CaretColor { get; set; }
|
public Color? CaretColor { get; set; }
|
||||||
|
|||||||
@@ -710,19 +710,24 @@ namespace Barotrauma
|
|||||||
|
|
||||||
if (listBox == pendingList || listBox == crewList)
|
if (listBox == pendingList || listBox == crewList)
|
||||||
{
|
{
|
||||||
nameBlock.RectTransform.Resize(new Point(nameBlock.Rect.Width - nameBlock.Rect.Height, nameBlock.Rect.Height));
|
//if the character is already in the crew, only check permissions - reputation doesn't matter for renaming an already-hired bot
|
||||||
nameBlock.Text = ToolBox.LimitString(characterName, nameBlock.Font, nameBlock.Rect.Width);
|
bool canRename = listBox == crewList ? HasPermissionToHire : CanHire(characterInfo);
|
||||||
nameBlock.RectTransform.Resize(new Point((int)(nameBlock.Padding.X + nameBlock.TextSize.X + nameBlock.Padding.Z), nameBlock.Rect.Height));
|
if (canRename)
|
||||||
Point size = new Point((int)(0.7f * nameBlock.Rect.Height));
|
|
||||||
new GUIImage(new RectTransform(size, nameGroup.RectTransform), "EditIcon") { CanBeFocused = false };
|
|
||||||
size = new Point(3 * mainGroup.AbsoluteSpacing + icon.Rect.Width + nameAndJobGroup.Rect.Width, mainGroup.Rect.Height);
|
|
||||||
new GUIButton(new RectTransform(size, frame.RectTransform) { RelativeOffset = new Vector2(0.025f) }, style: null)
|
|
||||||
{
|
{
|
||||||
Enabled = CanHire(characterInfo),
|
nameBlock.RectTransform.Resize(new Point(nameBlock.Rect.Width - nameBlock.Rect.Height, nameBlock.Rect.Height));
|
||||||
ToolTip = TextManager.GetWithVariable("campaigncrew.givenicknametooltip", "[mouseprimary]", PlayerInput.PrimaryMouseLabel),
|
nameBlock.Text = ToolBox.LimitString(characterName, nameBlock.Font, nameBlock.Rect.Width);
|
||||||
UserData = characterInfo,
|
nameBlock.RectTransform.Resize(new Point((int)(nameBlock.Padding.X + nameBlock.TextSize.X + nameBlock.Padding.Z), nameBlock.Rect.Height));
|
||||||
OnClicked = CreateRenamingComponent
|
Point iconSize = new Point((int)(0.7f * nameBlock.Rect.Height));
|
||||||
};
|
new GUIImage(new RectTransform(iconSize, nameGroup.RectTransform), "EditIcon") { CanBeFocused = false };
|
||||||
|
Point buttonSize = new Point(3 * mainGroup.AbsoluteSpacing + icon.Rect.Width + nameAndJobGroup.Rect.Width + (int)(iconSize.X * 1.5f), mainGroup.Rect.Height);
|
||||||
|
new GUIButton(new RectTransform(buttonSize, frame.RectTransform) { RelativeOffset = new Vector2(0.025f) }, style: null)
|
||||||
|
{
|
||||||
|
ClampMouseRectToParent = false,
|
||||||
|
ToolTip = TextManager.GetWithVariable("campaigncrew.givenicknametooltip", "[mouseprimary]", PlayerInput.PrimaryMouseLabel),
|
||||||
|
UserData = characterInfo,
|
||||||
|
OnClicked = CreateRenamingComponent
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//recalculate everything and truncate texts if needed
|
//recalculate everything and truncate texts if needed
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ using System.Reflection;
|
|||||||
using System.Threading;
|
using System.Threading;
|
||||||
using Barotrauma.Extensions;
|
using Barotrauma.Extensions;
|
||||||
using System.Collections.Immutable;
|
using System.Collections.Immutable;
|
||||||
|
using Barotrauma.LuaCs.Events;
|
||||||
|
|
||||||
namespace Barotrauma
|
namespace Barotrauma
|
||||||
{
|
{
|
||||||
@@ -294,6 +295,8 @@ namespace Barotrauma
|
|||||||
MainThread = Thread.CurrentThread;
|
MainThread = Thread.CurrentThread;
|
||||||
|
|
||||||
Window.FileDropped += OnFileDropped;
|
Window.FileDropped += OnFileDropped;
|
||||||
|
|
||||||
|
LuaCsSetup.Instance.GetType();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void ExecuteAfterContentFinishedLoading(Action action)
|
public static void ExecuteAfterContentFinishedLoading(Action action)
|
||||||
@@ -1289,6 +1292,18 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
IsExiting = true;
|
IsExiting = true;
|
||||||
CreatureMetrics.Save();
|
CreatureMetrics.Save();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (LuaCsSetup.Instance is not null)
|
||||||
|
{
|
||||||
|
LuaCsSetup.Instance.Dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
DebugConsole.ThrowError($"Error while disposing of LuaCsForBarotrauma: {e.Message} | {e.StackTrace}");
|
||||||
|
}
|
||||||
|
|
||||||
DebugConsole.NewMessage("Exiting...");
|
DebugConsole.NewMessage("Exiting...");
|
||||||
Client?.Quit();
|
Client?.Quit();
|
||||||
SteamManager.ShutDown();
|
SteamManager.ShutDown();
|
||||||
|
|||||||
@@ -487,7 +487,21 @@ namespace Barotrauma.Items.Components
|
|||||||
return 0.0f;
|
return 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual bool ShouldDrawHUD(Character character)
|
public bool ShouldDrawHUD(Character character)
|
||||||
|
{
|
||||||
|
if (Character.Controlled?.SelectedItem != null)
|
||||||
|
{
|
||||||
|
Controller controller = item.GetComponent<Controller>();
|
||||||
|
if (controller != null && controller.User == Character.Controlled && controller.HideAllItemComponentHUDs)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return ShouldDrawHUDComponentSpecific(character);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected virtual bool ShouldDrawHUDComponentSpecific(Character character)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -552,9 +552,9 @@ namespace Barotrauma.Items.Components
|
|||||||
if (flippedY) { origin.Y = contained.Item.Sprite.SourceRect.Height - origin.Y; }
|
if (flippedY) { origin.Y = contained.Item.Sprite.SourceRect.Height - origin.Y; }
|
||||||
|
|
||||||
float containedSpriteDepth = ContainedSpriteDepth < 0.0f ? contained.Item.Sprite.Depth : ContainedSpriteDepth;
|
float containedSpriteDepth = ContainedSpriteDepth < 0.0f ? contained.Item.Sprite.Depth : ContainedSpriteDepth;
|
||||||
if (i < containedSpriteDepths.Length)
|
if (targetSlotIndex < containedSpriteDepths.Length)
|
||||||
{
|
{
|
||||||
containedSpriteDepth = containedSpriteDepths[i];
|
containedSpriteDepth = containedSpriteDepths[targetSlotIndex];
|
||||||
}
|
}
|
||||||
containedSpriteDepth = itemDepth + (containedSpriteDepth - (item.Sprite?.Depth ?? item.SpriteDepth)) / 10000.0f;
|
containedSpriteDepth = itemDepth + (containedSpriteDepth - (item.Sprite?.Depth ?? item.SpriteDepth)) / 10000.0f;
|
||||||
|
|
||||||
|
|||||||
@@ -52,10 +52,12 @@ namespace Barotrauma.Items.Components
|
|||||||
|
|
||||||
partial void SetLightSourceTransformProjSpecific()
|
partial void SetLightSourceTransformProjSpecific()
|
||||||
{
|
{
|
||||||
Vector2 offset = Vector2.Zero;
|
Vector2 offset = LightOffset * item.Scale;
|
||||||
if (LightOffset != Vector2.Zero)
|
if (offset != Vector2.Zero)
|
||||||
{
|
{
|
||||||
offset = Vector2.Transform(LightOffset, Matrix.CreateRotationZ(item.FlippedY ? -item.RotationRad - MathHelper.Pi : -item.RotationRad)) * item.Scale;
|
if (item.FlippedX) { offset.X *= -1; }
|
||||||
|
if (item.FlippedY) { offset.Y *= -1; }
|
||||||
|
offset = Vector2.Transform(offset, Matrix.CreateRotationZ(-item.RotationRad));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ParentBody != null)
|
if (ParentBody != null)
|
||||||
@@ -101,7 +103,10 @@ namespace Barotrauma.Items.Components
|
|||||||
if (Light?.LightSprite == null) { return; }
|
if (Light?.LightSprite == null) { return; }
|
||||||
if ((item.body == null || item.body.Enabled) && lightBrightness > 0.0f && IsOn && Light.Enabled)
|
if ((item.body == null || item.body.Enabled) && lightBrightness > 0.0f && IsOn && Light.Enabled)
|
||||||
{
|
{
|
||||||
Vector2 offset = Vector2.Transform(LightOffset, Matrix.CreateRotationZ(item.FlippedY ? -item.RotationRad - MathHelper.Pi : -item.RotationRad)) * item.Scale;
|
Vector2 offset = LightOffset * item.Scale;
|
||||||
|
if (item.FlippedX) { offset.X *= -1; }
|
||||||
|
if (item.FlippedY) { offset.Y *= -1; }
|
||||||
|
offset = Vector2.Transform(offset, Matrix.CreateRotationZ(-item.RotationRad));
|
||||||
|
|
||||||
Vector2 origin = Light.LightSprite.Origin;
|
Vector2 origin = Light.LightSprite.Origin;
|
||||||
if ((Light.LightSpriteEffect & SpriteEffects.FlipHorizontally) == SpriteEffects.FlipHorizontally) { origin.X = Light.LightSprite.SourceRect.Width - origin.X; }
|
if ((Light.LightSpriteEffect & SpriteEffects.FlipHorizontally) == SpriteEffects.FlipHorizontally) { origin.X = Light.LightSprite.SourceRect.Width - origin.X; }
|
||||||
@@ -114,6 +119,7 @@ namespace Barotrauma.Items.Components
|
|||||||
{
|
{
|
||||||
color = new Color(lightColor, Light.OverrideLightSpriteAlpha.Value);
|
color = new Color(lightColor, Light.OverrideLightSpriteAlpha.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
Light.LightSprite.Draw(spriteBatch,
|
Light.LightSprite.Draw(spriteBatch,
|
||||||
new Vector2(drawPos.X, -drawPos.Y),
|
new Vector2(drawPos.X, -drawPos.Y),
|
||||||
color * lightBrightness,
|
color * lightBrightness,
|
||||||
@@ -128,8 +134,16 @@ namespace Barotrauma.Items.Components
|
|||||||
{
|
{
|
||||||
if (Light?.LightSprite != null && item.Prefab.CanSpriteFlipX)
|
if (Light?.LightSprite != null && item.Prefab.CanSpriteFlipX)
|
||||||
{
|
{
|
||||||
Light.LightSpriteEffect = Light.LightSpriteEffect == SpriteEffects.None ?
|
Light.LightSpriteEffect ^= SpriteEffects.FlipHorizontally;
|
||||||
SpriteEffects.FlipHorizontally : SpriteEffects.None;
|
}
|
||||||
|
SetLightSourceTransformProjSpecific();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void FlipY(bool relativeToSub)
|
||||||
|
{
|
||||||
|
if (Light?.LightSprite != null && item.Prefab.CanSpriteFlipY)
|
||||||
|
{
|
||||||
|
Light.LightSpriteEffect ^= SpriteEffects.FlipVertically;
|
||||||
}
|
}
|
||||||
SetLightSourceTransformProjSpecific();
|
SetLightSourceTransformProjSpecific();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,30 @@ namespace Barotrauma.Items.Components
|
|||||||
{
|
{
|
||||||
private bool isHUDsHidden;
|
private bool isHUDsHidden;
|
||||||
|
|
||||||
|
public void UpdateMsg()
|
||||||
|
{
|
||||||
|
if (Character.Controlled == null) { return; }
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(KickOutCharacterMsg) &&
|
||||||
|
SelectingKicksCharacterOut &&
|
||||||
|
User != null && !User.Removed)
|
||||||
|
{
|
||||||
|
DisplayMsg = TextManager.ParseInputTypes(TextManager.Get(KickOutCharacterMsg));
|
||||||
|
}
|
||||||
|
else if (!string.IsNullOrEmpty(PutOtherCharacterMsg) &&
|
||||||
|
AllowPuttingInOtherCharacters &&
|
||||||
|
CanPutSelectedCharacter(Character.Controlled.SelectedCharacter))
|
||||||
|
{
|
||||||
|
DisplayMsg = TextManager.ParseInputTypes(TextManager.Get(PutOtherCharacterMsg));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DisplayMsg = TextManager.ParseInputTypes(TextManager.Get(Msg));
|
||||||
|
}
|
||||||
|
|
||||||
|
CharacterHUD.RecreateHudTextsIfControlling(Character.Controlled);
|
||||||
|
}
|
||||||
|
|
||||||
public override void DrawHUD(SpriteBatch spriteBatch, Character character)
|
public override void DrawHUD(SpriteBatch spriteBatch, Character character)
|
||||||
{
|
{
|
||||||
base.DrawHUD(spriteBatch, character);
|
base.DrawHUD(spriteBatch, character);
|
||||||
@@ -69,21 +93,33 @@ namespace Barotrauma.Items.Components
|
|||||||
ushort userID = msg.ReadUInt16();
|
ushort userID = msg.ReadUInt16();
|
||||||
if (userID == 0)
|
if (userID == 0)
|
||||||
{
|
{
|
||||||
if (user != null)
|
if (User != null)
|
||||||
{
|
{
|
||||||
IsActive = false;
|
IsActive = false;
|
||||||
CancelUsing(user);
|
CancelUsing(User);
|
||||||
user = null;
|
User = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Character newUser = Entity.FindEntityByID(userID) as Character;
|
Character newUser = Entity.FindEntityByID(userID) as Character;
|
||||||
if (newUser != user)
|
if (newUser != User)
|
||||||
{
|
{
|
||||||
CancelUsing(user);
|
CancelUsing(User);
|
||||||
}
|
}
|
||||||
user = newUser;
|
User = newUser;
|
||||||
|
|
||||||
|
// If the server assigned a user to this controller but the character is not selecting the item
|
||||||
|
// on the client-side, force the selection to prevent desync. This is required for force attaching,
|
||||||
|
// since the character placed into the controller may be unconscious, and in that state
|
||||||
|
// the server no longer syncs the current SelectedItem to clients.
|
||||||
|
if (ForceUserToStayAttached &&
|
||||||
|
user != null &&
|
||||||
|
!user.IsAnySelectedItem(Item))
|
||||||
|
{
|
||||||
|
user.SelectedItem = Item;
|
||||||
|
}
|
||||||
|
|
||||||
IsActive = true;
|
IsActive = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -434,18 +434,13 @@ namespace Barotrauma.Items.Components
|
|||||||
|
|
||||||
foreach (FabricationRecipe fi in fabricationRecipes.Values)
|
foreach (FabricationRecipe fi in fabricationRecipes.Values)
|
||||||
{
|
{
|
||||||
RichString recipeTooltip =
|
|
||||||
fi.RequiresRecipe ?
|
|
||||||
RichString.Rich(fi.TargetItem.Description + "\n\n" + $"‖color:{XMLExtensions.ToStringHex(GUIStyle.Red)}‖{TextManager.Get("fabricatorrequiresrecipe")}‖color:end‖") :
|
|
||||||
RichString.Rich(fi.TargetItem.Description);
|
|
||||||
|
|
||||||
var frame = new GUIFrame(new RectTransform(new Point(itemList.Content.Rect.Width, (int)(40 * GUI.yScale)), itemList.Content.RectTransform), style: null)
|
var frame = new GUIFrame(new RectTransform(new Point(itemList.Content.Rect.Width, (int)(40 * GUI.yScale)), itemList.Content.RectTransform), style: null)
|
||||||
{
|
{
|
||||||
UserData = fi,
|
UserData = fi,
|
||||||
HoverColor = Color.Gold * 0.2f,
|
HoverColor = Color.Gold * 0.2f,
|
||||||
SelectedColor = Color.Gold * 0.5f,
|
SelectedColor = Color.Gold * 0.5f,
|
||||||
ToolTip = recipeTooltip
|
|
||||||
};
|
};
|
||||||
|
SetRecipeTooltip(frame, fi);
|
||||||
|
|
||||||
var container = new GUILayoutGroup(new RectTransform(Vector2.One, frame.RectTransform),
|
var container = new GUILayoutGroup(new RectTransform(Vector2.One, frame.RectTransform),
|
||||||
childAnchor: Anchor.CenterLeft, isHorizontal: true) { RelativeSpacing = 0.02f };
|
childAnchor: Anchor.CenterLeft, isHorizontal: true) { RelativeSpacing = 0.02f };
|
||||||
@@ -457,7 +452,7 @@ namespace Barotrauma.Items.Components
|
|||||||
itemIcon, scaleToFit: true)
|
itemIcon, scaleToFit: true)
|
||||||
{
|
{
|
||||||
Color = itemIcon == fi.TargetItem.Sprite ? fi.TargetItem.SpriteColor : fi.TargetItem.InventoryIconColor,
|
Color = itemIcon == fi.TargetItem.Sprite ? fi.TargetItem.SpriteColor : fi.TargetItem.InventoryIconColor,
|
||||||
ToolTip = recipeTooltip
|
CanBeFocused = false
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -466,7 +461,7 @@ namespace Barotrauma.Items.Components
|
|||||||
{
|
{
|
||||||
Padding = Vector4.Zero,
|
Padding = Vector4.Zero,
|
||||||
AutoScaleVertical = true,
|
AutoScaleVertical = true,
|
||||||
ToolTip = recipeTooltip
|
CanBeFocused = false
|
||||||
};
|
};
|
||||||
|
|
||||||
new GUITextBlock(new RectTransform(new Vector2(0.85f, 1f), frame.RectTransform, Anchor.BottomRight),
|
new GUITextBlock(new RectTransform(new Vector2(0.85f, 1f), frame.RectTransform, Anchor.BottomRight),
|
||||||
@@ -478,6 +473,20 @@ namespace Barotrauma.Items.Components
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void SetRecipeTooltip(GUIComponent component, FabricationRecipe recipe)
|
||||||
|
{
|
||||||
|
if (!recipe.RequiresRecipe)
|
||||||
|
{
|
||||||
|
component.ToolTip = RichString.Rich(recipe.TargetItem.Description);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
component.ToolTip = AnyOneHasRecipeForItem(Character.Controlled, recipe.TargetItem) ?
|
||||||
|
RichString.Rich(recipe.TargetItem.Description + "\n\n" + $"‖color:{XMLExtensions.ToStringHex(GUIStyle.Green)}‖{TextManager.Get("unlockedrecipe.true")}‖color:end‖") :
|
||||||
|
RichString.Rich(recipe.TargetItem.Description + "\n\n" + $"‖color:{XMLExtensions.ToStringHex(GUIStyle.Red)}‖{TextManager.Get("fabricatorrequiresrecipe")}‖color:end‖");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void InitInventoryUIs()
|
private void InitInventoryUIs()
|
||||||
{
|
{
|
||||||
if (inputInventoryHolder != null)
|
if (inputInventoryHolder != null)
|
||||||
@@ -927,16 +936,24 @@ namespace Barotrauma.Items.Components
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (recipe.RequiresRecipe && recipe.HideIfNoRecipe)
|
if (recipe.RequiresRecipe)
|
||||||
{
|
{
|
||||||
if (Character.Controlled != null)
|
if (recipe.HideIfNoRecipe)
|
||||||
{
|
{
|
||||||
if (!AnyOneHasRecipeForItem(Character.Controlled, recipe.TargetItem))
|
bool anyOneHasRecipe = AnyOneHasRecipeForItem(Character.Controlled, recipe.TargetItem);
|
||||||
|
if (Character.Controlled != null)
|
||||||
{
|
{
|
||||||
child.Visible = false;
|
if (!anyOneHasRecipe)
|
||||||
continue;
|
{
|
||||||
|
child.Visible = false;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SetRecipeTooltip(child, recipe);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
child.Visible =
|
child.Visible =
|
||||||
@@ -1147,7 +1164,16 @@ namespace Barotrauma.Items.Components
|
|||||||
var lines = description.WrappedText.Split('\n');
|
var lines = description.WrappedText.Split('\n');
|
||||||
if (lines.Count <= 1) { break; }
|
if (lines.Count <= 1) { break; }
|
||||||
string newString = string.Join('\n', lines.Take(lines.Count - 1));
|
string newString = string.Join('\n', lines.Take(lines.Count - 1));
|
||||||
description.Text = newString.Substring(0, newString.Length - 4) + "...";
|
|
||||||
|
if (newString.Length > 4)
|
||||||
|
{
|
||||||
|
description.Text = newString.Substring(0, newString.Length - 4) + "...";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
description.Text = newString + "...";
|
||||||
|
}
|
||||||
|
|
||||||
description.CalculateHeightFromText();
|
description.CalculateHeightFromText();
|
||||||
description.ToolTip = richDescription;
|
description.ToolTip = richDescription;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -443,6 +443,7 @@ namespace Barotrauma.Items.Components
|
|||||||
var wire = targetItem.GetComponent<Wire>();
|
var wire = targetItem.GetComponent<Wire>();
|
||||||
if (wire != null && wire.Connections.Any(c => c != null)) { return false; }
|
if (wire != null && wire.Connections.Any(c => c != null)) { return false; }
|
||||||
|
|
||||||
|
if (targetItem.Container is { NonInteractable: true }) { return false; }
|
||||||
if (targetItem.Container?.GetComponent<ItemContainer>() is { DrawInventory: false } or { AllowAccess: false }) { return false; }
|
if (targetItem.Container?.GetComponent<ItemContainer>() is { DrawInventory: false } or { AllowAccess: false }) { return false; }
|
||||||
|
|
||||||
if (targetItem.HasTag(Tags.TraitorMissionItem)) { return false; }
|
if (targetItem.HasTag(Tags.TraitorMissionItem)) { return false; }
|
||||||
|
|||||||
@@ -575,6 +575,22 @@ namespace Barotrauma.Items.Components
|
|||||||
pos /= c.Resources.Count;
|
pos /= c.Resources.Count;
|
||||||
MineralClusters.Add((center: pos, resources: c.Resources));
|
MineralClusters.Add((center: pos, resources: c.Resources));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (GameMain.GameSession != null)
|
||||||
|
{
|
||||||
|
foreach (var mission in GameMain.GameSession.Missions)
|
||||||
|
{
|
||||||
|
if (mission is MineralMission mineralMission)
|
||||||
|
{
|
||||||
|
foreach (var minerals in mineralMission.SpawnedResources)
|
||||||
|
{
|
||||||
|
MineralClusters.Add((
|
||||||
|
center: new Vector2(minerals.Average(m => m.WorldPosition.X), minerals.Average(m => m.WorldPosition.Y)),
|
||||||
|
resources: minerals));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -823,18 +839,20 @@ namespace Barotrauma.Items.Components
|
|||||||
if (t.Entity is Character c && !c.IsUnconscious && c.Params.HideInSonar) { continue; }
|
if (t.Entity is Character c && !c.IsUnconscious && c.Params.HideInSonar) { continue; }
|
||||||
if (t.SoundRange <= 0.0f || float.IsNaN(t.SoundRange) || float.IsInfinity(t.SoundRange)) { continue; }
|
if (t.SoundRange <= 0.0f || float.IsNaN(t.SoundRange) || float.IsInfinity(t.SoundRange)) { continue; }
|
||||||
|
|
||||||
|
float sonarSoundRange = t.SoundRange * t.SoundRangeOnSonarMultiplier;
|
||||||
|
|
||||||
float distSqr = Vector2.DistanceSquared(t.WorldPosition, transducerCenter);
|
float distSqr = Vector2.DistanceSquared(t.WorldPosition, transducerCenter);
|
||||||
if (distSqr > t.SoundRange * t.SoundRange * 2) { continue; }
|
if (distSqr > sonarSoundRange * sonarSoundRange * 2) { continue; }
|
||||||
|
|
||||||
float dist = (float)Math.Sqrt(distSqr);
|
float dist = (float)Math.Sqrt(distSqr);
|
||||||
if (dist > prevPassivePingRadius * Range && dist <= passivePingRadius * Range && Rand.Int(sonarBlips.Count) < 500)
|
if (dist > prevPassivePingRadius * Range && dist <= passivePingRadius * Range && Rand.Int(sonarBlips.Count) < 500)
|
||||||
{
|
{
|
||||||
Ping(t.WorldPosition, transducerCenter,
|
Ping(t.WorldPosition, transducerCenter,
|
||||||
t.SoundRange * DisplayScale, 0, DisplayScale, range,
|
sonarSoundRange * DisplayScale, 0, DisplayScale, range,
|
||||||
passive: true, pingStrength: 0.5f, needsToBeInSector: t);
|
passive: true, pingStrength: 0.5f, needsToBeInSector: t);
|
||||||
if (t.IsWithinSector(transducerCenter))
|
if (t.IsWithinSector(transducerCenter))
|
||||||
{
|
{
|
||||||
sonarBlips.Add(new SonarBlip(t.WorldPosition, fadeTimer: 1.0f, scale: MathHelper.Clamp(t.SoundRange / 2000, 1.0f, 5.0f)));
|
sonarBlips.Add(new SonarBlip(t.WorldPosition, fadeTimer: 1.0f, scale: MathHelper.Clamp(sonarSoundRange / 2000, 1.0f, 5.0f)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -977,7 +995,9 @@ namespace Barotrauma.Items.Components
|
|||||||
if (aiTarget.InDetectable) { continue; }
|
if (aiTarget.InDetectable) { continue; }
|
||||||
if (aiTarget.SonarLabel.IsNullOrEmpty() || aiTarget.SoundRange <= 0.0f) { continue; }
|
if (aiTarget.SonarLabel.IsNullOrEmpty() || aiTarget.SoundRange <= 0.0f) { continue; }
|
||||||
|
|
||||||
if (Vector2.DistanceSquared(aiTarget.WorldPosition, transducerCenter) < aiTarget.SoundRange * aiTarget.SoundRange)
|
float sonarSoundRange = aiTarget.SoundRange * aiTarget.SoundRangeOnSonarMultiplier;
|
||||||
|
|
||||||
|
if (Vector2.DistanceSquared(aiTarget.WorldPosition, transducerCenter) < sonarSoundRange * sonarSoundRange)
|
||||||
{
|
{
|
||||||
DrawMarker(spriteBatch,
|
DrawMarker(spriteBatch,
|
||||||
aiTarget.SonarLabel.Value,
|
aiTarget.SonarLabel.Value,
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ namespace Barotrauma.Items.Components
|
|||||||
get { return Vector2.Zero; }
|
get { return Vector2.Zero; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool ShouldDrawHUD(Character character)
|
protected override bool ShouldDrawHUDComponentSpecific(Character character)
|
||||||
{
|
{
|
||||||
if (item.IsHidden) { return false; }
|
if (item.IsHidden) { return false; }
|
||||||
if (!HasRequiredItems(character, false) || character.SelectedItem != item) { return false; }
|
if (!HasRequiredItems(character, false) || character.SelectedItem != item) { return false; }
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ namespace Barotrauma.Items.Components
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool ShouldDrawHUD(Character character)
|
protected override bool ShouldDrawHUDComponentSpecific(Character character)
|
||||||
=> character == Character.Controlled && (character.SelectedItem == item || character.SelectedSecondaryItem == item);
|
=> character == Character.Controlled && (character.SelectedItem == item || character.SelectedSecondaryItem == item);
|
||||||
|
|
||||||
public override void UpdateHUDComponentSpecific(Character character, float deltaTime, Camera cam)
|
public override void UpdateHUDComponentSpecific(Character character, float deltaTime, Camera cam)
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ namespace Barotrauma.Items.Components
|
|||||||
MoveConnectedWires(amount);
|
MoveConnectedWires(amount);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool ShouldDrawHUD(Character character)
|
protected override bool ShouldDrawHUDComponentSpecific(Character character)
|
||||||
{
|
{
|
||||||
return character == Character.Controlled && character == user && (character.SelectedItem == item || character.SelectedSecondaryItem == item);
|
return character == Character.Controlled && character == user && (character.SelectedItem == item || character.SelectedSecondaryItem == item);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -287,20 +287,24 @@ namespace Barotrauma.Items.Components
|
|||||||
texts.Add(target.CustomInteractHUDText);
|
texts.Add(target.CustomInteractHUDText);
|
||||||
textColors.Add(GUIStyle.Green);
|
textColors.Add(GUIStyle.Green);
|
||||||
}
|
}
|
||||||
if (!target.IsIncapacitated && target.IsPet)
|
if (equipper?.FocusedCharacter == target)
|
||||||
{
|
{
|
||||||
texts.Add(CharacterHUD.GetCachedHudText("PlayHint", InputType.Use));
|
if (!target.IsIncapacitated && target.IsPet &&
|
||||||
textColors.Add(GUIStyle.Green);
|
target.AIController is EnemyAIController enemyAI && enemyAI.PetBehavior.CanPlayWith(Character.Controlled))
|
||||||
}
|
{
|
||||||
if (equipper?.FocusedCharacter == target && target.CanBeHealedBy(equipper, checkFriendlyTeam: false))
|
texts.Add(CharacterHUD.GetCachedHudText("PlayHint", InputType.Use));
|
||||||
{
|
textColors.Add(GUIStyle.Green);
|
||||||
texts.Add(CharacterHUD.GetCachedHudText("HealHint", InputType.Health));
|
}
|
||||||
textColors.Add(GUIStyle.Green);
|
if (target.CanBeHealedBy(equipper, checkFriendlyTeam: false))
|
||||||
}
|
{
|
||||||
if (target.CanBeDraggedBy(Character.Controlled))
|
texts.Add(CharacterHUD.GetCachedHudText("HealHint", InputType.Health));
|
||||||
{
|
textColors.Add(GUIStyle.Green);
|
||||||
texts.Add(CharacterHUD.GetCachedHudText("GrabHint", InputType.Grab));
|
}
|
||||||
textColors.Add(GUIStyle.Green);
|
if (target.CanBeDraggedBy(Character.Controlled))
|
||||||
|
{
|
||||||
|
texts.Add(CharacterHUD.GetCachedHudText("GrabHint", InputType.Grab));
|
||||||
|
textColors.Add(GUIStyle.Green);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (target.IsUnconscious)
|
if (target.IsUnconscious)
|
||||||
|
|||||||
@@ -1597,7 +1597,8 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
if (DraggingSlot == null || (!DraggingSlot.MouseOn()))
|
if (DraggingSlot == null || (!DraggingSlot.MouseOn()))
|
||||||
{
|
{
|
||||||
Sprite sprite = DraggingItems.First().Prefab.InventoryIcon ?? DraggingItems.First().Sprite;
|
Item firstDraggingItem = DraggingItems.First();
|
||||||
|
Sprite sprite = firstDraggingItem.OverrideInventorySprite ?? firstDraggingItem.Prefab.InventoryIcon ?? firstDraggingItem.Sprite;
|
||||||
|
|
||||||
int iconSize = (int)(64 * GUI.Scale);
|
int iconSize = (int)(64 * GUI.Scale);
|
||||||
float scale = Math.Min(Math.Min(iconSize / sprite.size.X, iconSize / sprite.size.Y), 1.5f);
|
float scale = Math.Min(Math.Min(iconSize / sprite.size.X, iconSize / sprite.size.Y), 1.5f);
|
||||||
@@ -1854,7 +1855,7 @@ namespace Barotrauma
|
|||||||
|
|
||||||
if (item != null && drawItem)
|
if (item != null && drawItem)
|
||||||
{
|
{
|
||||||
Sprite sprite = item.Prefab.InventoryIcon ?? item.Sprite;
|
Sprite sprite = item.OverrideInventorySprite ?? item.Prefab.InventoryIcon ?? item.Sprite;
|
||||||
float scale = Math.Min(Math.Min((rect.Width - 10) / sprite.size.X, (rect.Height - 10) / sprite.size.Y), 2.0f);
|
float scale = Math.Min(Math.Min((rect.Width - 10) / sprite.size.X, (rect.Height - 10) / sprite.size.Y), 2.0f);
|
||||||
Vector2 itemPos = rect.Center.ToVector2();
|
Vector2 itemPos = rect.Center.ToVector2();
|
||||||
if (itemPos.Y > GameMain.GraphicsHeight)
|
if (itemPos.Y > GameMain.GraphicsHeight)
|
||||||
|
|||||||
@@ -419,7 +419,7 @@ namespace Barotrauma
|
|||||||
|
|
||||||
if (fadeInBrokenSprite != null)
|
if (fadeInBrokenSprite != null)
|
||||||
{
|
{
|
||||||
float d = Math.Min(depth + (fadeInBrokenSprite.Sprite.Depth - activeSprite.Depth - 0.000001f), 0.999f);
|
float d = MathHelper.Clamp(depth + (fadeInBrokenSprite.Sprite.Depth - activeSprite.Depth - 0.000001f), 0.0f, 0.999f);
|
||||||
fadeInBrokenSprite.Sprite.DrawTiled(spriteBatch, new Vector2(DrawPosition.X - rect.Width / 2, -(DrawPosition.Y + rect.Height / 2)) + fadeInBrokenSprite.Offset.ToVector2() * Scale, size, color: color * fadeInBrokenSpriteAlpha,
|
fadeInBrokenSprite.Sprite.DrawTiled(spriteBatch, new Vector2(DrawPosition.X - rect.Width / 2, -(DrawPosition.Y + rect.Height / 2)) + fadeInBrokenSprite.Offset.ToVector2() * Scale, size, color: color * fadeInBrokenSpriteAlpha,
|
||||||
textureScale: Vector2.One * Scale,
|
textureScale: Vector2.One * Scale,
|
||||||
depth: d);
|
depth: d);
|
||||||
@@ -435,7 +435,7 @@ namespace Barotrauma
|
|||||||
activeSprite.Draw(spriteBatch, new Vector2(DrawPosition.X, -DrawPosition.Y) + drawOffset, color, origin, RotationRad, Scale, activeSprite.effects, depth);
|
activeSprite.Draw(spriteBatch, new Vector2(DrawPosition.X, -DrawPosition.Y) + drawOffset, color, origin, RotationRad, Scale, activeSprite.effects, depth);
|
||||||
if (fadeInBrokenSprite != null)
|
if (fadeInBrokenSprite != null)
|
||||||
{
|
{
|
||||||
float d = Math.Min(depth + (fadeInBrokenSprite.Sprite.Depth - activeSprite.Depth - 0.000001f), 0.999f);
|
float d = MathHelper.Clamp(depth + (fadeInBrokenSprite.Sprite.Depth - activeSprite.Depth - 0.000001f), 0.0f, 0.999f);
|
||||||
fadeInBrokenSprite.Sprite.Draw(spriteBatch, new Vector2(DrawPosition.X, -DrawPosition.Y) + fadeInBrokenSprite.Offset.ToVector2() * Scale, color * fadeInBrokenSpriteAlpha, origin, RotationRad, Scale, activeSprite.effects, d);
|
fadeInBrokenSprite.Sprite.Draw(spriteBatch, new Vector2(DrawPosition.X, -DrawPosition.Y) + fadeInBrokenSprite.Offset.ToVector2() * Scale, color * fadeInBrokenSpriteAlpha, origin, RotationRad, Scale, activeSprite.effects, d);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -885,7 +885,12 @@ namespace Barotrauma
|
|||||||
Spacing = (int)(25 * GUI.Scale)
|
Spacing = (int)(25 * GUI.Scale)
|
||||||
};
|
};
|
||||||
|
|
||||||
var itemEditor = new SerializableEntityEditor(listBox.Content.RectTransform, this, inGame, showName: true, titleFont: GUIStyle.LargeFont) { UserData = this };
|
var itemEditor = new SerializableEntityEditor(listBox.Content.RectTransform, this, inGame, showName: true,
|
||||||
|
titleFont: GUIStyle.LargeFont,
|
||||||
|
dimOutDefaultValues: false)
|
||||||
|
{
|
||||||
|
UserData = this
|
||||||
|
};
|
||||||
activeEditors.Add(itemEditor);
|
activeEditors.Add(itemEditor);
|
||||||
itemEditor.Children.First().Color = Color.Black * 0.7f;
|
itemEditor.Children.First().Color = Color.Black * 0.7f;
|
||||||
if (!inGame)
|
if (!inGame)
|
||||||
@@ -1045,7 +1050,12 @@ namespace Barotrauma
|
|||||||
|
|
||||||
new GUIFrame(new RectTransform(new Vector2(1.0f, 0.02f), listBox.Content.RectTransform), style: "HorizontalLine");
|
new GUIFrame(new RectTransform(new Vector2(1.0f, 0.02f), listBox.Content.RectTransform), style: "HorizontalLine");
|
||||||
|
|
||||||
var componentEditor = new SerializableEntityEditor(listBox.Content.RectTransform, ic, inGame, showName: !inGame, titleFont: GUIStyle.SubHeadingFont) { UserData = ic };
|
var componentEditor = new SerializableEntityEditor(listBox.Content.RectTransform, ic, inGame, showName: !inGame,
|
||||||
|
titleFont: GUIStyle.SubHeadingFont,
|
||||||
|
dimOutDefaultValues: false)
|
||||||
|
{
|
||||||
|
UserData = ic
|
||||||
|
};
|
||||||
componentEditor.Children.First().Color = Color.Black * 0.7f;
|
componentEditor.Children.First().Color = Color.Black * 0.7f;
|
||||||
activeEditors.Add(componentEditor);
|
activeEditors.Add(componentEditor);
|
||||||
|
|
||||||
@@ -1064,7 +1074,12 @@ namespace Barotrauma
|
|||||||
requiredItems.Add(relatedItem);
|
requiredItems.Add(relatedItem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
requiredItems.AddRange(ic.DisabledRequiredItems);
|
//if we have some actual requirements, no need to keep the empty requirement
|
||||||
|
//as a "placeholder" for the user to add requirements in the sub editor
|
||||||
|
if (ic.RequiredItems.None())
|
||||||
|
{
|
||||||
|
requiredItems.AddRange(ic.DisabledRequiredItems);
|
||||||
|
}
|
||||||
|
|
||||||
foreach (RelatedItem relatedItem in requiredItems)
|
foreach (RelatedItem relatedItem in requiredItems)
|
||||||
{
|
{
|
||||||
@@ -1626,12 +1641,16 @@ namespace Barotrauma
|
|||||||
activeComponents.Clear();
|
activeComponents.Clear();
|
||||||
activeComponents.AddRange(components);
|
activeComponents.AddRange(components);
|
||||||
|
|
||||||
foreach (MapEntity entity in linkedTo)
|
Controller controller = GetComponent<Controller>();
|
||||||
|
if (controller == null || controller.User != Character.Controlled || !controller.HideAllItemComponentHUDs)
|
||||||
{
|
{
|
||||||
if (Prefab.IsLinkAllowed(entity.Prefab) && entity is Item i)
|
foreach (MapEntity entity in linkedTo)
|
||||||
{
|
{
|
||||||
if (!i.DisplaySideBySideWhenLinked) { continue; }
|
if (Prefab.IsLinkAllowed(entity.Prefab) && entity is Item i)
|
||||||
activeComponents.AddRange(i.components);
|
{
|
||||||
|
if (!i.DisplaySideBySideWhenLinked) { continue; }
|
||||||
|
activeComponents.AddRange(i.components);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1701,7 +1720,9 @@ namespace Barotrauma
|
|||||||
foreach (Character otherCharacter in Character.CharacterList)
|
foreach (Character otherCharacter in Character.CharacterList)
|
||||||
{
|
{
|
||||||
if (otherCharacter != character &&
|
if (otherCharacter != character &&
|
||||||
otherCharacter.SelectedItem == this)
|
otherCharacter.SelectedItem == this &&
|
||||||
|
// Prevent the in use message from being shown if a character is, for example, inside the deconstructor
|
||||||
|
!otherCharacter.IsAttachedToController())
|
||||||
{
|
{
|
||||||
ItemInUseWarning.Visible = true;
|
ItemInUseWarning.Visible = true;
|
||||||
if (mergedHUDRect.Width > GameMain.GraphicsWidth / 2) { mergedHUDRect.Inflate(-GameMain.GraphicsWidth / 4, 0); }
|
if (mergedHUDRect.Width > GameMain.GraphicsWidth / 2) { mergedHUDRect.Inflate(-GameMain.GraphicsWidth / 4, 0); }
|
||||||
@@ -1751,6 +1772,11 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ClearActiveHUDs()
|
||||||
|
{
|
||||||
|
activeHUDs.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
readonly List<ColoredText> texts = new();
|
readonly List<ColoredText> texts = new();
|
||||||
public List<ColoredText> GetHUDTexts(Character character, bool recreateHudTexts = true)
|
public List<ColoredText> GetHUDTexts(Character character, bool recreateHudTexts = true)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -166,6 +166,14 @@ namespace Barotrauma
|
|||||||
subElement.GetAttributeBool("fadein", false),
|
subElement.GetAttributeBool("fadein", false),
|
||||||
subElement.GetAttributePoint("offset", Point.Zero));
|
subElement.GetAttributePoint("offset", Point.Zero));
|
||||||
|
|
||||||
|
if (brokenSprite.FadeIn && brokenSprite.MaxConditionPercentage <= 0.0f)
|
||||||
|
{
|
||||||
|
DebugConsole.AddWarning(
|
||||||
|
$"Potential error in item {Identifier}: a broken sprite that's set to fade in despite the max condition being 0."+
|
||||||
|
" The sprite cannot fade in if it's set to only appear when the item is fully broken.",
|
||||||
|
ContentPackage);
|
||||||
|
}
|
||||||
|
|
||||||
int spriteIndex = 0;
|
int spriteIndex = 0;
|
||||||
for (int i = 0; i < brokenSprites.Count && brokenSprites[i].MaxConditionPercentage < brokenSprite.MaxConditionPercentage; i++)
|
for (int i = 0; i < brokenSprites.Count && brokenSprites[i].MaxConditionPercentage < brokenSprite.MaxConditionPercentage; i++)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
using Barotrauma.LuaCs.Data;
|
||||||
|
|
||||||
|
namespace Barotrauma.LuaCs.Data;
|
||||||
|
|
||||||
|
public partial interface IConfigInfo : IConfigDisplayInfo { }
|
||||||
|
|
||||||
|
public interface IConfigDisplayInfo
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Localization Token for display name.
|
||||||
|
/// </summary>
|
||||||
|
string DisplayName { get; }
|
||||||
|
/// <summary>
|
||||||
|
/// Localization Token for description.
|
||||||
|
/// </summary>
|
||||||
|
string Description { get; }
|
||||||
|
/// <summary>
|
||||||
|
/// The menu category to display under. Used for filtering.
|
||||||
|
/// </summary>
|
||||||
|
string DisplayCategory { get; }
|
||||||
|
/// <summary>
|
||||||
|
/// Should this config be displayed in end-user menus.
|
||||||
|
/// </summary>
|
||||||
|
bool ShowInMenus { get; }
|
||||||
|
/// <summary>
|
||||||
|
/// User-friendly on-hover tooltip text or Localization Token.
|
||||||
|
/// </summary>
|
||||||
|
string Tooltip { get; }
|
||||||
|
/// <summary>
|
||||||
|
/// Icon for display in menus, if available.
|
||||||
|
/// </summary>
|
||||||
|
ContentPath ImageIconPath { get; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
using System;
|
||||||
|
using Microsoft.Xna.Framework;
|
||||||
|
|
||||||
|
namespace Barotrauma.LuaCs.Data;
|
||||||
|
|
||||||
|
public interface IDisplayable
|
||||||
|
{
|
||||||
|
public void AddDisplayComponent(GUILayoutGroup layoutGroup, Vector2 relativeSize, Action<string> onSerializedValue);
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
namespace Barotrauma.LuaCs.Data;
|
||||||
|
|
||||||
|
public partial interface ISettingBase : IDisplayable
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Barotrauma.LuaCs.Data;
|
||||||
|
|
||||||
|
public interface ISettingControl : ISettingBase
|
||||||
|
{
|
||||||
|
KeyOrMouse Value { get; }
|
||||||
|
bool TrySetValue(KeyOrMouse value);
|
||||||
|
bool IsDown();
|
||||||
|
bool IsHit();
|
||||||
|
}
|
||||||
@@ -0,0 +1,252 @@
|
|||||||
|
using System;
|
||||||
|
using System.Globalization;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Xml.Linq;
|
||||||
|
using Barotrauma.LuaCs.Data;
|
||||||
|
using Microsoft.Toolkit.Diagnostics;
|
||||||
|
using Microsoft.Xna.Framework;
|
||||||
|
using Microsoft.Xna.Framework.Input;
|
||||||
|
using OneOf;
|
||||||
|
|
||||||
|
namespace Barotrauma.LuaCs.Data;
|
||||||
|
|
||||||
|
public sealed class SettingControl : SettingBase, ISettingControl
|
||||||
|
{
|
||||||
|
public class Factory : ISettingBase.IFactory<ISettingBase>
|
||||||
|
{
|
||||||
|
public ISettingBase CreateInstance(IConfigInfo configInfo, Func<OneOf<string, XElement, object>, bool> valueChangePredicate)
|
||||||
|
{
|
||||||
|
Guard.IsNotNull(configInfo, nameof(configInfo));
|
||||||
|
return new SettingControl(configInfo, valueChangePredicate);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public SettingControl(IConfigInfo configInfo, Func<OneOf<string, XElement, object>, bool> valueChangePredicate) : base(configInfo)
|
||||||
|
{
|
||||||
|
_valueChangePredicate = valueChangePredicate;
|
||||||
|
TrySetSerializedValue(configInfo.Element);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnDispose()
|
||||||
|
{
|
||||||
|
OnValueChanged = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Func<OneOf<string, XElement, object>, bool> _valueChangePredicate;
|
||||||
|
public override Type GetValueType() => typeof(KeyOrMouse);
|
||||||
|
public override string GetStringValue() => Value.ToString();
|
||||||
|
public override string GetDefaultStringValue() => new KeyOrMouse(Keys.NumLock).ToString();
|
||||||
|
|
||||||
|
public override bool TrySetSerializedValue(OneOf<string, XElement> value)
|
||||||
|
{
|
||||||
|
var newVal = value.Match<KeyOrMouse>(
|
||||||
|
(string v) => GetKeyOrMouse(v),
|
||||||
|
(XElement e) => e.GetAttributeKeyOrMouse("Value", null));
|
||||||
|
|
||||||
|
if (newVal is null)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_valueChangePredicate is not null && !_valueChangePredicate.Invoke(newVal))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
Value = newVal;
|
||||||
|
OnValueChanged?.Invoke(this);
|
||||||
|
return true;
|
||||||
|
|
||||||
|
KeyOrMouse GetKeyOrMouse(string strValue)
|
||||||
|
{
|
||||||
|
strValue ??= string.Empty;
|
||||||
|
if (Enum.TryParse(strValue, true, out Microsoft.Xna.Framework.Input.Keys key))
|
||||||
|
{
|
||||||
|
return key;
|
||||||
|
}
|
||||||
|
else if (Enum.TryParse(strValue, out MouseButton mouseButton))
|
||||||
|
{
|
||||||
|
return mouseButton;
|
||||||
|
}
|
||||||
|
else if (int.TryParse(strValue, NumberStyles.Any, CultureInfo.InvariantCulture, out int mouseButtonInt) &&
|
||||||
|
Enum.GetValues<MouseButton>().Contains((MouseButton)mouseButtonInt))
|
||||||
|
{
|
||||||
|
return (MouseButton)mouseButtonInt;
|
||||||
|
}
|
||||||
|
else if (string.Equals(strValue, "LeftMouse", StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
return !PlayerInput.MouseButtonsSwapped() ? MouseButton.PrimaryMouse : MouseButton.SecondaryMouse;
|
||||||
|
}
|
||||||
|
else if (string.Equals(strValue, "RightMouse", StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
return !PlayerInput.MouseButtonsSwapped() ? MouseButton.SecondaryMouse : MouseButton.PrimaryMouse;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public override event Action<ISettingBase> OnValueChanged;
|
||||||
|
public override OneOf<string, XElement> GetSerializableValue() => Value.ToString();
|
||||||
|
public KeyOrMouse Value { get; private set; } = new KeyOrMouse(Keys.NumLock);
|
||||||
|
|
||||||
|
public bool TrySetValue(KeyOrMouse value)
|
||||||
|
{
|
||||||
|
Value = value;
|
||||||
|
OnValueChanged?.Invoke(this);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool IsDown()
|
||||||
|
{
|
||||||
|
if (this.Value is null)
|
||||||
|
return false;
|
||||||
|
switch (this.Value.MouseButton)
|
||||||
|
{
|
||||||
|
case MouseButton.None:
|
||||||
|
return Barotrauma.PlayerInput.KeyDown(this.Value.Key);
|
||||||
|
case MouseButton.PrimaryMouse:
|
||||||
|
return Barotrauma.PlayerInput.PrimaryMouseButtonHeld();
|
||||||
|
case MouseButton.SecondaryMouse:
|
||||||
|
return Barotrauma.PlayerInput.SecondaryMouseButtonHeld();
|
||||||
|
case MouseButton.MiddleMouse:
|
||||||
|
return Barotrauma.PlayerInput.MidButtonHeld();
|
||||||
|
case MouseButton.MouseButton4:
|
||||||
|
return Barotrauma.PlayerInput.Mouse4ButtonHeld();
|
||||||
|
case MouseButton.MouseButton5:
|
||||||
|
return Barotrauma.PlayerInput.Mouse5ButtonHeld();
|
||||||
|
case MouseButton.MouseWheelUp:
|
||||||
|
return Barotrauma.PlayerInput.MouseWheelUpClicked();
|
||||||
|
case MouseButton.MouseWheelDown:
|
||||||
|
return Barotrauma.PlayerInput.MouseWheelDownClicked();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool IsHit()
|
||||||
|
{
|
||||||
|
if (this.Value is null)
|
||||||
|
return false;
|
||||||
|
switch (this.Value.MouseButton)
|
||||||
|
{
|
||||||
|
case MouseButton.None:
|
||||||
|
return Barotrauma.PlayerInput.KeyHit(this.Value.Key);
|
||||||
|
case MouseButton.PrimaryMouse:
|
||||||
|
return Barotrauma.PlayerInput.PrimaryMouseButtonClicked();
|
||||||
|
case MouseButton.SecondaryMouse:
|
||||||
|
return Barotrauma.PlayerInput.SecondaryMouseButtonClicked();
|
||||||
|
case MouseButton.MiddleMouse:
|
||||||
|
return Barotrauma.PlayerInput.MidButtonClicked();
|
||||||
|
case MouseButton.MouseButton4:
|
||||||
|
return Barotrauma.PlayerInput.Mouse4ButtonClicked();
|
||||||
|
case MouseButton.MouseButton5:
|
||||||
|
return Barotrauma.PlayerInput.Mouse5ButtonClicked();
|
||||||
|
case MouseButton.MouseWheelUp:
|
||||||
|
return Barotrauma.PlayerInput.MouseWheelUpClicked();
|
||||||
|
case MouseButton.MouseWheelDown:
|
||||||
|
return Barotrauma.PlayerInput.MouseWheelDownClicked();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if CLIENT
|
||||||
|
private static GUICustomComponent InputListener;
|
||||||
|
|
||||||
|
public override void AddDisplayComponent(GUILayoutGroup layoutGroup, Vector2 relativeSize, Action<string> onSerializedValue)
|
||||||
|
{
|
||||||
|
var inputButton = new GUIButton(new RectTransform(relativeSize, layoutGroup.RectTransform), Alignment.Center,
|
||||||
|
style: "GUITextBoxNoIcon")
|
||||||
|
{
|
||||||
|
Text = this.Value.ToString(),
|
||||||
|
OnClicked = (btn, obj) =>
|
||||||
|
{
|
||||||
|
if (InputListener is not null)
|
||||||
|
{
|
||||||
|
// Another button is active
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
CoroutineManager.Invoke(() =>
|
||||||
|
{
|
||||||
|
CreateListener(btn);
|
||||||
|
}, 0f); // delay one frame for button inputs
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
inputButton.OutlineColor = Color.PeachPuff;
|
||||||
|
inputButton.TextColor = Color.White;
|
||||||
|
|
||||||
|
|
||||||
|
void ClearListener()
|
||||||
|
{
|
||||||
|
InputListener?.Parent.RemoveChild(InputListener);
|
||||||
|
InputListener = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CreateListener(GUIButton button)
|
||||||
|
{
|
||||||
|
ClearListener();
|
||||||
|
InputListener = new GUICustomComponent(new RectTransform(Vector2.Zero, layoutGroup.RectTransform),
|
||||||
|
onUpdate: (deltaTime, component) =>
|
||||||
|
{
|
||||||
|
var pressedKeys = PlayerInput.GetKeyboardState.GetPressedKeys();
|
||||||
|
if (pressedKeys?.Any() ?? false)
|
||||||
|
{
|
||||||
|
if (pressedKeys.Contains(Keys.Escape))
|
||||||
|
{
|
||||||
|
ClearListener();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ApplyValue(pressedKeys.First(), button);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (PlayerInput.PrimaryMouseButtonClicked() &&
|
||||||
|
(GUI.MouseOn == null || !(GUI.MouseOn is GUIButton) || GUI.MouseOn.IsChildOf(layoutGroup)))
|
||||||
|
{
|
||||||
|
ApplyValue(MouseButton.PrimaryMouse, button);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if (PlayerInput.SecondaryMouseButtonClicked())
|
||||||
|
{
|
||||||
|
ApplyValue(MouseButton.SecondaryMouse, button);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if (PlayerInput.MidButtonClicked())
|
||||||
|
{
|
||||||
|
ApplyValue(MouseButton.MiddleMouse, button);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if (PlayerInput.Mouse4ButtonClicked())
|
||||||
|
{
|
||||||
|
ApplyValue(MouseButton.MouseButton4, button);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if (PlayerInput.Mouse5ButtonClicked())
|
||||||
|
{
|
||||||
|
ApplyValue(MouseButton.MouseButton5, button);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if (PlayerInput.MouseWheelUpClicked())
|
||||||
|
{
|
||||||
|
ApplyValue(MouseButton.MouseWheelUp, button);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if (PlayerInput.MouseWheelDownClicked())
|
||||||
|
{
|
||||||
|
ApplyValue(MouseButton.MouseWheelDown, button);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void ApplyValue(KeyOrMouse input, GUIButton button)
|
||||||
|
{
|
||||||
|
button.Text = input.ToString();
|
||||||
|
onSerializedValue?.Invoke(input.ToString());
|
||||||
|
ClearListener();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
using System.Collections.Immutable;
|
||||||
|
|
||||||
|
namespace Barotrauma.LuaCs.Data;
|
||||||
|
|
||||||
|
public interface IStylesResourceInfo : IBaseResourceInfo { }
|
||||||
|
|
||||||
|
public record StylesResourceInfo : BaseResourceInfo, IStylesResourceInfo { }
|
||||||
|
|
||||||
|
public partial interface IModConfigInfo
|
||||||
|
{
|
||||||
|
public ImmutableArray<IStylesResourceInfo> Styles { get; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public partial record ModConfigInfo
|
||||||
|
{
|
||||||
|
public ImmutableArray<IStylesResourceInfo> Styles { get; init; }
|
||||||
|
}
|
||||||
143
Barotrauma/BarotraumaClient/ClientSource/LuaCs/GUIUtil.cs
Normal file
143
Barotrauma/BarotraumaClient/ClientSource/LuaCs/GUIUtil.cs
Normal file
@@ -0,0 +1,143 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Barotrauma.Extensions;
|
||||||
|
using Microsoft.Xna.Framework;
|
||||||
|
#nullable enable
|
||||||
|
|
||||||
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// A collection of helper GUI functions. Mostly ripped from "Barotrauma/ClientSource/Settings/SettingsMenu.cs"
|
||||||
|
/// </summary>
|
||||||
|
public static class GUIUtil
|
||||||
|
{
|
||||||
|
public static (GUILayoutGroup Left, GUILayoutGroup Right) CreateSidebars(GUIFrame parent, bool split = false)
|
||||||
|
{
|
||||||
|
GUILayoutGroup layout = new GUILayoutGroup(new RectTransform(Vector2.One, parent.RectTransform), isHorizontal: true);
|
||||||
|
GUILayoutGroup left = new GUILayoutGroup(new RectTransform((0.4875f, 1.0f), layout.RectTransform), isHorizontal: false);
|
||||||
|
var centerFrame = new GUIFrame(new RectTransform((0.025f, 1.0f), layout.RectTransform), style: null);
|
||||||
|
if (split)
|
||||||
|
{
|
||||||
|
new GUICustomComponent(new RectTransform(Vector2.One, centerFrame.RectTransform),
|
||||||
|
onDraw: (sb, c) =>
|
||||||
|
{
|
||||||
|
sb.DrawLine((c.Rect.Center.X, c.Rect.Top),
|
||||||
|
(c.Rect.Center.X, c.Rect.Bottom),
|
||||||
|
GUIStyle.TextColorDim,
|
||||||
|
2f);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
GUILayoutGroup right = new GUILayoutGroup(new RectTransform((0.4875f, 1.0f), layout.RectTransform), isHorizontal: false);
|
||||||
|
return (left, right);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static (GUILayoutGroup Left, GUILayoutGroup Right) CreateSidebars(GUILayoutGroup parent, bool split = false)
|
||||||
|
{
|
||||||
|
GUILayoutGroup layout = new GUILayoutGroup(new RectTransform(Vector2.One, parent.RectTransform), isHorizontal: true);
|
||||||
|
GUILayoutGroup left = new GUILayoutGroup(new RectTransform((0.4875f, 1.0f), layout.RectTransform), isHorizontal: false);
|
||||||
|
var centerFrame = new GUIFrame(new RectTransform((0.025f, 1.0f), layout.RectTransform), style: null);
|
||||||
|
if (split)
|
||||||
|
{
|
||||||
|
new GUICustomComponent(new RectTransform(Vector2.One, centerFrame.RectTransform),
|
||||||
|
onDraw: (sb, c) =>
|
||||||
|
{
|
||||||
|
sb.DrawLine((c.Rect.Center.X, c.Rect.Top),
|
||||||
|
(c.Rect.Center.X, c.Rect.Bottom),
|
||||||
|
GUIStyle.TextColorDim,
|
||||||
|
2f);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
GUILayoutGroup right = new GUILayoutGroup(new RectTransform((0.4875f, 1.0f), layout.RectTransform), isHorizontal: false);
|
||||||
|
return (left, right);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static GUILayoutGroup CreateCenterLayout(GUIFrame parent)
|
||||||
|
=> new GUILayoutGroup(new RectTransform((0.5f, 1.0f), parent.RectTransform, Anchor.TopCenter, Pivot.TopCenter)) { ChildAnchor = Anchor.TopCenter };
|
||||||
|
|
||||||
|
public static RectTransform NewItemRectT(GUILayoutGroup parent, Vector2 adjustRatio)
|
||||||
|
=> new RectTransform((1.0f * adjustRatio.X, 0.06f * adjustRatio.Y), parent.RectTransform, Anchor.CenterLeft);
|
||||||
|
|
||||||
|
public static void Spacer(GUILayoutGroup parent, Vector2 adjustRatio)
|
||||||
|
=> new GUIFrame(new RectTransform((1.0f * adjustRatio.X, 0.03f * adjustRatio.Y), parent.RectTransform, Anchor.CenterLeft), style: null);
|
||||||
|
|
||||||
|
public static void ClearChildElements(GUIComponent component, bool clearSelfFromParent = false)
|
||||||
|
{
|
||||||
|
component.GetAllChildren().ForEachMod(c =>
|
||||||
|
{
|
||||||
|
c.Visible = false;
|
||||||
|
component.RemoveChild(c);
|
||||||
|
});
|
||||||
|
if (clearSelfFromParent && component.Parent is not null)
|
||||||
|
component.Parent.RemoveChild(component);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static GUITextBlock Label(GUILayoutGroup parent, LocalizedString str, GUIFont font, Vector2 adjustRatio)
|
||||||
|
=> new GUITextBlock(NewItemRectT(parent, adjustRatio), str, font: font);
|
||||||
|
|
||||||
|
public static GUIDropDown DropdownEnum<T>(GUILayoutGroup parent, Func<T, LocalizedString> textFunc, Func<T, LocalizedString>? tooltipFunc, T currentValue,
|
||||||
|
Action<T> setter, Vector2 adjustRatio) where T : Enum
|
||||||
|
=> Dropdown(parent, textFunc, tooltipFunc, (T[])Enum.GetValues(typeof(T)), currentValue, setter, adjustRatio);
|
||||||
|
|
||||||
|
public static GUIDropDown Dropdown<T>(GUILayoutGroup parent, Func<T, LocalizedString> textFunc, Func<T,
|
||||||
|
LocalizedString>? tooltipFunc, IReadOnlyList<T> values, T currentValue, Action<T> setter, Vector2 adjustRatio, float listBoxScale = 1)
|
||||||
|
{
|
||||||
|
var dropdown = new GUIDropDown(NewItemRectT(parent, adjustRatio), listBoxScale: listBoxScale);
|
||||||
|
values.ForEach(v => dropdown.AddItem(text: textFunc(v), userData: v, toolTip: tooltipFunc?.Invoke(v) ?? null));
|
||||||
|
int childIndex = values.IndexOf(currentValue);
|
||||||
|
dropdown.Select(childIndex);
|
||||||
|
dropdown.ListBox.ForceLayoutRecalculation();
|
||||||
|
dropdown.ListBox.ScrollToElement(dropdown.ListBox.Content.GetChild(childIndex));
|
||||||
|
dropdown.OnSelected = (dd, obj) =>
|
||||||
|
{
|
||||||
|
setter((T)obj);
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
return dropdown;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static (GUIScrollBar, GUITextBlock) Slider(GUILayoutGroup parent, Vector2 range, int steps, Func<float,
|
||||||
|
string> labelFunc, float currentValue, Action<float> setter, LocalizedString? tooltip, Vector2 adjustRatio)
|
||||||
|
{
|
||||||
|
var layout = new GUILayoutGroup(new RectTransform(adjustRatio, parent.RectTransform), isHorizontal: true);
|
||||||
|
var slider = new GUIScrollBar(new RectTransform((0.72f, 1.0f), layout.RectTransform), style: "GUISlider")
|
||||||
|
{
|
||||||
|
Range = range,
|
||||||
|
BarScrollValue = currentValue,
|
||||||
|
Step = 1.0f / (float)(steps - 1),
|
||||||
|
BarSize = 1.0f / steps
|
||||||
|
};
|
||||||
|
if (tooltip != null)
|
||||||
|
{
|
||||||
|
slider.ToolTip = tooltip;
|
||||||
|
}
|
||||||
|
var label = new GUITextBlock(new RectTransform((0.28f, 1.0f), layout.RectTransform),
|
||||||
|
labelFunc(currentValue), wrap: false, textAlignment: Alignment.Center);
|
||||||
|
slider.OnMoved = (sb, val) =>
|
||||||
|
{
|
||||||
|
label.Text = labelFunc(sb.BarScrollValue);
|
||||||
|
setter(sb.BarScrollValue);
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
return (slider, label);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static GUITickBox Tickbox(GUILayoutGroup parent, LocalizedString label, LocalizedString tooltip,
|
||||||
|
bool currentValue, Action<bool> setter, Vector2 adjustRatio)
|
||||||
|
{
|
||||||
|
var tickbox = new GUITickBox(NewItemRectT(parent, adjustRatio), label)
|
||||||
|
{
|
||||||
|
Selected = currentValue,
|
||||||
|
ToolTip = tooltip,
|
||||||
|
OnSelected = (tb) =>
|
||||||
|
{
|
||||||
|
setter(tb.Selected);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return tickbox;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string Percentage(float v) => ToolBox.GetFormattedPercentage(v);
|
||||||
|
|
||||||
|
public static int Round(float v) => (int)MathF.Round(v);
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
using System;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
|
namespace Barotrauma
|
||||||
|
{
|
||||||
|
static partial class LuaCsInstaller
|
||||||
|
{
|
||||||
|
public static void Uninstall()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
using Microsoft.Xna.Framework;
|
||||||
|
|
||||||
|
namespace Barotrauma
|
||||||
|
{
|
||||||
|
partial class LuaCsLogger
|
||||||
|
{
|
||||||
|
private static GUIFrame overlayFrame;
|
||||||
|
private static GUITextBlock textBlock;
|
||||||
|
private static double showTimer = 0;
|
||||||
|
|
||||||
|
private static void CreateOverlay(string message)
|
||||||
|
{
|
||||||
|
overlayFrame = new GUIFrame(new RectTransform(new Vector2(0.4f, 0.03f), null), null, new Color(50, 50, 50, 100))
|
||||||
|
{
|
||||||
|
CanBeFocused = false
|
||||||
|
};
|
||||||
|
|
||||||
|
GUILayoutGroup layout = new GUILayoutGroup(new RectTransform(new Vector2(0.8f, 0.8f), overlayFrame.RectTransform, Anchor.CenterLeft), false, Anchor.Center)
|
||||||
|
{
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
textBlock = new GUITextBlock(new RectTransform(new Vector2(1f, 0f), layout.RectTransform), message);
|
||||||
|
overlayFrame.RectTransform.MinSize = new Point((int)(textBlock.TextSize.X * 1.2), 0);
|
||||||
|
|
||||||
|
layout.Recalculate();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void AddToGUIUpdateList()
|
||||||
|
{
|
||||||
|
if (overlayFrame != null && Timing.TotalTime <= showTimer)
|
||||||
|
{
|
||||||
|
overlayFrame.AddToGUIUpdateList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void ShowErrorOverlay(string message, float time = 5f, float duration = 1.5f)
|
||||||
|
{
|
||||||
|
if (Timing.TotalTime <= showTimer)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
CreateOverlay(message);
|
||||||
|
|
||||||
|
overlayFrame.Flash(Color.Red, duration, true);
|
||||||
|
showTimer = Timing.TotalTime + time;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
184
Barotrauma/BarotraumaClient/ClientSource/LuaCs/LuaCsSetup.cs
Normal file
184
Barotrauma/BarotraumaClient/ClientSource/LuaCs/LuaCsSetup.cs
Normal file
@@ -0,0 +1,184 @@
|
|||||||
|
using Barotrauma.CharacterEditor;
|
||||||
|
using Barotrauma.Extensions;
|
||||||
|
using Barotrauma.LuaCs;
|
||||||
|
using Barotrauma.LuaCs.Data;
|
||||||
|
using Barotrauma.Networking;
|
||||||
|
using Microsoft.Xna.Framework;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.Immutable;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using static System.Collections.Specialized.BitVector32;
|
||||||
|
|
||||||
|
// ReSharper disable ObjectCreationAsStatement
|
||||||
|
|
||||||
|
namespace Barotrauma
|
||||||
|
{
|
||||||
|
partial class LuaCsSetup
|
||||||
|
{
|
||||||
|
public void PromptCSharpMods(Action<bool> onSelection, bool joiningServer)
|
||||||
|
{
|
||||||
|
ImmutableArray<ContentPackage> contentPackages = PackageManagementService.GetLoadedUnrestrictedPackages()
|
||||||
|
.Where(p => p.Name != PackageName)
|
||||||
|
.ToImmutableArray();
|
||||||
|
|
||||||
|
if (_csRunPolicy?.Value is "Enabled")
|
||||||
|
{
|
||||||
|
IsCsEnabledForSession = true;
|
||||||
|
onSelection(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if (_csRunPolicy?.Value is "Disabled")
|
||||||
|
{
|
||||||
|
IsCsEnabledForSession = false;
|
||||||
|
onSelection(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (contentPackages.None())
|
||||||
|
{
|
||||||
|
onSelection(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
GUIMessageBox messageBox = new GUIMessageBox(
|
||||||
|
TextManager.Get("warning"),
|
||||||
|
relativeSize: new Vector2(0.3f, 0.55f),
|
||||||
|
minSize: new Point(400, 500),
|
||||||
|
text: string.Empty,
|
||||||
|
buttons: []);
|
||||||
|
|
||||||
|
GUILayoutGroup msgBoxLayout = new GUILayoutGroup(new RectTransform(new Vector2(1f, 0.75f), messageBox.Content.RectTransform), isHorizontal: false, childAnchor: Anchor.TopCenter)
|
||||||
|
{
|
||||||
|
RelativeSpacing = 0.01f,
|
||||||
|
Stretch = true
|
||||||
|
};
|
||||||
|
|
||||||
|
new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.0f), msgBoxLayout.RectTransform), "The following mods contain CSharp code OR Unsandboxed Lua Code",
|
||||||
|
font: GUIStyle.SubHeadingFont, wrap: true, textAlignment: Alignment.Center);
|
||||||
|
|
||||||
|
GUIListBox packageListBox = new GUIListBox(new RectTransform(new Vector2(1.0f, 0.4f), msgBoxLayout.RectTransform))
|
||||||
|
{
|
||||||
|
CurrentSelectMode = GUIListBox.SelectMode.None
|
||||||
|
};
|
||||||
|
|
||||||
|
foreach (ContentPackage package in contentPackages)
|
||||||
|
{
|
||||||
|
GUIFrame packageFrame = new GUIFrame(new RectTransform(new Vector2(1.0f, 0.15f), packageListBox.Content.RectTransform), style: "ListBoxElement");
|
||||||
|
GUILayoutGroup packageLayout = new GUILayoutGroup(new RectTransform(Vector2.One, packageFrame.RectTransform), true, Anchor.CenterLeft);
|
||||||
|
new GUITextBlock(new RectTransform(new Vector2(0.7f, 1f), packageLayout.RectTransform), package.Name);
|
||||||
|
new GUIButton(new RectTransform(new Vector2(0.3f, 1f), packageLayout.RectTransform, Anchor.CenterRight), "Open Folder", style: "GUIButtonSmall")
|
||||||
|
{
|
||||||
|
OnClicked = (GUIButton button, object obj) =>
|
||||||
|
{
|
||||||
|
string directory = package.Dir;
|
||||||
|
if (string.IsNullOrEmpty(directory)) { return false; }
|
||||||
|
|
||||||
|
ToolBox.OpenFileWithShell(directory);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
string bodyText =
|
||||||
|
joiningServer ?
|
||||||
|
"You are joining a server that includes mods with C# code OR unrestricted Lua code. These mods are not sandboxed and may access your computer without restrictions. If you trust these mods, select 'Enable C# for this session'. Otherwise, select 'Cancel' to run only Lua mods."
|
||||||
|
: "You have enabled mods that include C# code. These mods are not sandboxed and may access your computer without restrictions. If you trust these mods, select 'Enable C# for this session'. Otherwise, select 'Cancel' to run only Sandboxed Lua mods.";
|
||||||
|
|
||||||
|
new GUITextBlock(new RectTransform(new Vector2(1.0f, 0f), msgBoxLayout.RectTransform), bodyText, wrap: true)
|
||||||
|
{
|
||||||
|
Wrap = true
|
||||||
|
};
|
||||||
|
|
||||||
|
GUILayoutGroup buttonLayout = new GUILayoutGroup(new RectTransform(new Vector2(1f, 0.25f), messageBox.Content.RectTransform, Anchor.BottomCenter), isHorizontal: false, childAnchor: Anchor.TopCenter);
|
||||||
|
|
||||||
|
new GUIButton(new RectTransform(new Vector2(0.8f, 0.0f), buttonLayout.RectTransform), "Enable C# for this session")
|
||||||
|
{
|
||||||
|
TextBlock = { AutoScaleHorizontal = true },
|
||||||
|
OnClicked = (btn, userdata) =>
|
||||||
|
{
|
||||||
|
IsCsEnabledForSession = true;
|
||||||
|
onSelection(true);
|
||||||
|
messageBox.Close();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new GUIButton(new RectTransform(new Vector2(0.8f, 0.0f), buttonLayout.RectTransform), "Cancel")
|
||||||
|
{
|
||||||
|
OnClicked = (btn, userdata) =>
|
||||||
|
{
|
||||||
|
IsCsEnabledForSession = false;
|
||||||
|
onSelection(false);
|
||||||
|
messageBox.Close();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SetupServicesProviderClient(IServicesProvider serviceProvider)
|
||||||
|
{
|
||||||
|
serviceProvider.RegisterServiceType<IUIStylesService, UIStylesService>(ServiceLifetime.Singleton);
|
||||||
|
// supplied via factory
|
||||||
|
//serviceProvider.RegisterServiceType<IUIStylesCollection, UIStylesCollection>(ServiceLifetime.Transient);
|
||||||
|
serviceProvider.RegisterServiceType<IParserServiceAsync<ResourceParserInfo, IStylesResourceInfo>, ModConfigFileParserService>(ServiceLifetime.Transient);
|
||||||
|
serviceProvider.RegisterServiceType<IUIStylesCollection.IFactory, UIStylesCollection.Factory>(ServiceLifetime.Transient);
|
||||||
|
serviceProvider.RegisterServiceType<ISettingsMenuSystem, SettingsMenuSystem>(ServiceLifetime.Singleton);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Handles changes in game states tracked by screen changes.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="screen">The new game screen.</param>
|
||||||
|
public partial void OnScreenSelected(Screen screen)
|
||||||
|
{
|
||||||
|
/*Note: This logic needs to be run after the triggering event so that recursion scenarios (ie. resetting the EventService)
|
||||||
|
do not occur, so we delay it by one game tick.*/
|
||||||
|
CoroutineManager.Invoke(() =>
|
||||||
|
{
|
||||||
|
switch (screen)
|
||||||
|
{
|
||||||
|
// menus and navigation states
|
||||||
|
case MainMenuScreen:
|
||||||
|
case ModDownloadScreen:
|
||||||
|
case ServerListScreen:
|
||||||
|
SetRunState(RunState.Unloaded);
|
||||||
|
SetRunState(RunState.LoadedNoExec);
|
||||||
|
break;
|
||||||
|
// running lobby or editor states
|
||||||
|
case CampaignEndScreen:
|
||||||
|
case CharacterEditorScreen:
|
||||||
|
case EventEditorScreen:
|
||||||
|
case GameScreen:
|
||||||
|
case LevelEditorScreen:
|
||||||
|
case NetLobbyScreen:
|
||||||
|
case ParticleEditorScreen:
|
||||||
|
case RoundSummaryScreen:
|
||||||
|
case SpriteEditorScreen:
|
||||||
|
case SubEditorScreen:
|
||||||
|
case TestScreen: // notes: TestScreen is a Linux edge case editor screen and is deprecated.
|
||||||
|
|
||||||
|
if (screen is NetLobbyScreen && CurrentRunState != RunState.Running && GameMain.Client?.ClientPeer is not P2POwnerPeer)
|
||||||
|
{
|
||||||
|
PromptCSharpMods(selection =>
|
||||||
|
{
|
||||||
|
SetRunState(RunState.Running);
|
||||||
|
}, joiningServer: true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SetRunState(RunState.Running);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
Logger.LogError(
|
||||||
|
$"{nameof(LuaCsSetup)}: Received an unknown screen {screen?.GetType().Name ?? "'null screen'"}. Retarding load state to 'unloaded'.");
|
||||||
|
SetRunState(RunState.Unloaded);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}, delay: 0f); // min is one tick delay.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Immutable;
|
||||||
|
using System.Linq;
|
||||||
|
using Barotrauma.LuaCs.Data;
|
||||||
|
|
||||||
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
|
public sealed partial class ConfigService
|
||||||
|
{
|
||||||
|
public ImmutableArray<ISettingBase> GetDisplayableConfigs()
|
||||||
|
{
|
||||||
|
using var _ = _operationLock.AcquireReaderLock().ConfigureAwait(false).GetAwaiter().GetResult();
|
||||||
|
IService.CheckDisposed(this);
|
||||||
|
|
||||||
|
return _settingsInstances.Values
|
||||||
|
.Where(s => !s.IsDisposed)
|
||||||
|
.Where(s => s.GetDisplayInfo().ShowInMenus)
|
||||||
|
.Where(s => !GameMain.IsMultiplayer || s.GetConfigInfo().NetSync != NetSync.ServerAuthority)
|
||||||
|
.Where(s => s.GetConfigInfo().EditableStates >= _infoProvider.CurrentRunState)
|
||||||
|
.ToImmutableArray();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
using Microsoft.Xna.Framework;
|
||||||
|
|
||||||
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
|
public partial class LoggerService : ILoggerService, IClientLoggerService
|
||||||
|
{
|
||||||
|
private GUIFrame _overlayFrame;
|
||||||
|
private GUITextBlock _textBlock;
|
||||||
|
private double _showTimer = 0;
|
||||||
|
|
||||||
|
|
||||||
|
private void CreateOverlay(string message)
|
||||||
|
{
|
||||||
|
_overlayFrame = new GUIFrame(new RectTransform(new Vector2(0.4f, 0.03f), null), null, new Color(50, 50, 50, 100))
|
||||||
|
{
|
||||||
|
CanBeFocused = false
|
||||||
|
};
|
||||||
|
|
||||||
|
GUILayoutGroup layout =
|
||||||
|
new GUILayoutGroup(
|
||||||
|
new RectTransform(new Vector2(0.8f, 0.8f), _overlayFrame.RectTransform, Anchor.CenterLeft), false,
|
||||||
|
Anchor.Center);
|
||||||
|
|
||||||
|
_textBlock = new GUITextBlock(new RectTransform(new Vector2(1f, 0f), layout.RectTransform), message);
|
||||||
|
_overlayFrame.RectTransform.MinSize = new Point((int)(_textBlock.TextSize.X * 1.2), 0);
|
||||||
|
|
||||||
|
layout.Recalculate();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AddToGUIUpdateList()
|
||||||
|
{
|
||||||
|
if (_overlayFrame != null && Timing.TotalTime <= _showTimer)
|
||||||
|
{
|
||||||
|
_overlayFrame.AddToGUIUpdateList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ShowErrorOverlay(string message, float time = 5f, float duration = 1.5f)
|
||||||
|
{
|
||||||
|
if (Timing.TotalTime <= _showTimer)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
CreateOverlay(message);
|
||||||
|
|
||||||
|
_overlayFrame.Flash(Color.Red, duration, true);
|
||||||
|
_showTimer = Timing.TotalTime + time;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.Immutable;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Barotrauma.LuaCs.Data;
|
||||||
|
using FluentResults;
|
||||||
|
|
||||||
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
|
public sealed partial class ModConfigFileParserService :
|
||||||
|
IParserServiceAsync<ResourceParserInfo, IStylesResourceInfo>
|
||||||
|
{
|
||||||
|
async Task<Result<IStylesResourceInfo>> IParserServiceAsync<ResourceParserInfo, IStylesResourceInfo>.TryParseResourceAsync(ResourceParserInfo src)
|
||||||
|
{
|
||||||
|
using var lck = await _operationsLock.AcquireReaderLock();
|
||||||
|
IService.CheckDisposed(this);
|
||||||
|
|
||||||
|
if (CheckThrowNullRefs(src, "Style") is { IsFailed: true } fail)
|
||||||
|
return fail;
|
||||||
|
|
||||||
|
var runtimeEnv = GetRuntimeEnvironment(src.Element);
|
||||||
|
var fileResults = await UnsafeGetCheckedFiles(src.Element, src.Owner, ".xml");
|
||||||
|
|
||||||
|
if (fileResults.IsFailed)
|
||||||
|
return FluentResults.Result.Fail(fileResults.Errors);
|
||||||
|
|
||||||
|
return new StylesResourceInfo()
|
||||||
|
{
|
||||||
|
SupportedPlatforms = runtimeEnv.Platform,
|
||||||
|
SupportedTargets = Target.Client, // clientside only
|
||||||
|
LoadPriority = src.Element.GetAttributeInt("LoadPriority", 0),
|
||||||
|
FilePaths = fileResults.Value,
|
||||||
|
Optional = src.Element.GetAttributeBool("Optional", false),
|
||||||
|
InternalName = src.Element.GetAttributeString("Name", string.Empty),
|
||||||
|
OwnerPackage = src.Owner,
|
||||||
|
RequiredPackages = src.Required,
|
||||||
|
IncompatiblePackages = src.Incompatible
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<ImmutableArray<Result<IStylesResourceInfo>>> TryParseResourcesAsync(IEnumerable<ResourceParserInfo> sources)
|
||||||
|
{
|
||||||
|
return await this.TryParseGenericResourcesAsync<IStylesResourceInfo>(sources);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,163 @@
|
|||||||
|
using Barotrauma.LuaCs;
|
||||||
|
using Barotrauma.LuaCs.Events;
|
||||||
|
using Barotrauma.Networking;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
|
partial class NetworkingService : INetworkingService, IEventServerConnected, IEventServerRawNetMessageReceived
|
||||||
|
{
|
||||||
|
private ConcurrentDictionary<ushort, ConcurrentQueue<IReadMessage>> receiveQueue = new();
|
||||||
|
|
||||||
|
public void OnServerConnected()
|
||||||
|
{
|
||||||
|
ActivateNetVars();
|
||||||
|
SendSyncMessage();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ActivateNetVars()
|
||||||
|
{
|
||||||
|
if (GameMain.Client == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// re-activate net vars
|
||||||
|
// todo: unregister net vars on client disconnect, currently handled by unloading the state machine.
|
||||||
|
foreach (var networkSyncVar in netVars.Keys)
|
||||||
|
{
|
||||||
|
networkSyncVar.SetNetworkOwner(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool? OnReceivedServerNetMessage(IReadMessage netMessage, ServerPacketHeader serverPacketHeader)
|
||||||
|
{
|
||||||
|
if (serverPacketHeader != ServerHeader)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
ServerToClient luaCsHeader = (ServerToClient)netMessage.ReadByte();
|
||||||
|
|
||||||
|
switch (luaCsHeader)
|
||||||
|
{
|
||||||
|
case ServerToClient.NetMessageNetId:
|
||||||
|
HandleNetMessageString(netMessage);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ServerToClient.NetMessageInternalId:
|
||||||
|
HandleNetMessageId(netMessage);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ServerToClient.ReceiveNetIds:
|
||||||
|
ReadIds(netMessage);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SendSyncMessage()
|
||||||
|
{
|
||||||
|
if (GameMain.Client == null) { return; }
|
||||||
|
|
||||||
|
WriteOnlyMessage message = new WriteOnlyMessage();
|
||||||
|
message.WriteByte((byte)ClientHeader);
|
||||||
|
message.WriteByte((byte)ClientToServer.RequestSync);
|
||||||
|
GameMain.Client.ClientPeer.Send(message, DeliveryMethod.Reliable);
|
||||||
|
}
|
||||||
|
|
||||||
|
public IWriteMessage Start(NetId netId)
|
||||||
|
{
|
||||||
|
var message = new WriteOnlyMessage();
|
||||||
|
|
||||||
|
message.WriteByte((byte)ClientHeader);
|
||||||
|
|
||||||
|
if (idToPacket.ContainsKey(netId))
|
||||||
|
{
|
||||||
|
message.WriteByte((byte)ClientToServer.NetMessageInternalId);
|
||||||
|
message.WriteUInt16(idToPacket[netId]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
message.WriteByte((byte)ClientToServer.NetMessageNetId);
|
||||||
|
NetId.Write(message, netId);
|
||||||
|
}
|
||||||
|
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SendToServer(IWriteMessage netMessage, DeliveryMethod deliveryMethod = DeliveryMethod.Reliable)
|
||||||
|
{
|
||||||
|
GameMain.Client.ClientPeer.Send(netMessage, deliveryMethod);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Send(IWriteMessage netMessage, DeliveryMethod deliveryMethod = DeliveryMethod.Reliable)
|
||||||
|
=> SendToServer(netMessage, deliveryMethod);
|
||||||
|
|
||||||
|
private void RequestId(NetId netId)
|
||||||
|
{
|
||||||
|
if (idToPacket.ContainsKey(netId)) { return; }
|
||||||
|
|
||||||
|
if (GameMain.Client == null) { return; }
|
||||||
|
|
||||||
|
WriteOnlyMessage message = new WriteOnlyMessage();
|
||||||
|
message.WriteByte((byte)ClientHeader);
|
||||||
|
message.WriteByte((byte)ClientToServer.RequestSingleNetId);
|
||||||
|
|
||||||
|
NetId.Write(message, netId);
|
||||||
|
|
||||||
|
SendToServer(message, DeliveryMethod.Reliable);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void HandleNetMessageId(IReadMessage netMessage, Client client = null)
|
||||||
|
{
|
||||||
|
ushort id = netMessage.ReadUInt16();
|
||||||
|
|
||||||
|
if (packetToId.ContainsKey(id))
|
||||||
|
{
|
||||||
|
HandleNetMessage(netMessage, packetToId[id], client);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!receiveQueue.ContainsKey(id)) { receiveQueue[id] = new ConcurrentQueue<IReadMessage>(); }
|
||||||
|
receiveQueue[id].Enqueue(netMessage);
|
||||||
|
|
||||||
|
if (GameSettings.CurrentConfig.VerboseLogging)
|
||||||
|
{
|
||||||
|
_loggerService.LogMessage($"Received NetMessage with unknown id {id} from server, storing in queue in case we receive the id later.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ReadIds(IReadMessage netMessage)
|
||||||
|
{
|
||||||
|
ushort size = netMessage.ReadUInt16();
|
||||||
|
|
||||||
|
for (int i = 0; i < size; i++)
|
||||||
|
{
|
||||||
|
ushort packetId = netMessage.ReadUInt16();
|
||||||
|
NetId netId = NetId.Read(netMessage);
|
||||||
|
|
||||||
|
packetToId[packetId] = netId;
|
||||||
|
idToPacket[netId] = packetId;
|
||||||
|
|
||||||
|
if (!receiveQueue.ContainsKey(packetId))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// We could have received messages before receiving the sync message, so we need to process them now
|
||||||
|
|
||||||
|
while (receiveQueue[packetId].TryDequeue(out var queueMessage))
|
||||||
|
{
|
||||||
|
if (netReceives.ContainsKey(netId))
|
||||||
|
{
|
||||||
|
netReceives[netId](queueMessage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,239 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.Immutable;
|
||||||
|
using Barotrauma.Extensions;
|
||||||
|
using Barotrauma.LuaCs.Data;
|
||||||
|
using FluentResults;
|
||||||
|
using Microsoft.Toolkit.Diagnostics;
|
||||||
|
|
||||||
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
|
public class UIStylesCollection : HashlessFile, IUIStylesCollection
|
||||||
|
{
|
||||||
|
public class Factory : IUIStylesCollection.IFactory
|
||||||
|
{
|
||||||
|
public IEnumerable<IUIStylesCollection> CreateInstance(IStylesResourceInfo info, IStorageService storageService)
|
||||||
|
{
|
||||||
|
Guard.IsNotNull(info, nameof(info));
|
||||||
|
Guard.IsNotNull(info.OwnerPackage, nameof(info.OwnerPackage));
|
||||||
|
if (info.FilePaths.IsDefaultOrEmpty)
|
||||||
|
{
|
||||||
|
return ImmutableArray<IUIStylesCollection>.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
var builder = ImmutableArray.CreateBuilder<IUIStylesCollection>();
|
||||||
|
foreach (var contentPath in info.FilePaths)
|
||||||
|
{
|
||||||
|
builder.Add(new UIStylesCollection(contentPath, storageService));
|
||||||
|
}
|
||||||
|
return builder.ToImmutable();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
//ignore, stateless service
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool IsDisposed => false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private readonly ConcurrentDictionary<string, GUIFont> _fonts = new();
|
||||||
|
private readonly ConcurrentDictionary<string, GUISprite> _sprites = new();
|
||||||
|
private readonly ConcurrentDictionary<string, GUISpriteSheet> _spriteSheets = new();
|
||||||
|
private readonly ConcurrentDictionary<string, GUICursor> _cursors = new();
|
||||||
|
private readonly ConcurrentDictionary<string, GUIColor> _colors = new();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Only for internal reference.
|
||||||
|
/// </summary>
|
||||||
|
private UIStyleFile _fakeFile;
|
||||||
|
|
||||||
|
private IStorageService _storageService;
|
||||||
|
|
||||||
|
public UIStylesCollection(ContentPath path, IStorageService storageService) : base(path.ContentPackage, path)
|
||||||
|
{
|
||||||
|
Guard.IsNotNull(path, nameof(path));
|
||||||
|
Guard.IsNotNull(path.ContentPackage, nameof(path.ContentPackage));
|
||||||
|
_storageService = storageService;
|
||||||
|
_fakeFile = new UIStyleFile(path.ContentPackage, path);
|
||||||
|
}
|
||||||
|
|
||||||
|
public new ContentPath Path => base.Path;
|
||||||
|
|
||||||
|
public Result<GUIFont> GetFont(string name)
|
||||||
|
{
|
||||||
|
using var lck = _lock.AcquireReaderLock().ConfigureAwait(false).GetAwaiter().GetResult();
|
||||||
|
IService.CheckDisposed(this);
|
||||||
|
if (_fonts.TryGetValue(name, out var asset))
|
||||||
|
{
|
||||||
|
return asset;
|
||||||
|
}
|
||||||
|
|
||||||
|
return FluentResults.Result.Fail($"{nameof(GetFont)}: Failed to find the font with the name '{name}'");
|
||||||
|
}
|
||||||
|
|
||||||
|
public Result<GUISprite> GetSprite(string name)
|
||||||
|
{
|
||||||
|
using var lck = _lock.AcquireReaderLock().ConfigureAwait(false).GetAwaiter().GetResult();
|
||||||
|
IService.CheckDisposed(this);
|
||||||
|
if (_sprites.TryGetValue(name, out var asset))
|
||||||
|
{
|
||||||
|
return asset;
|
||||||
|
}
|
||||||
|
|
||||||
|
return FluentResults.Result.Fail($"{nameof(GetSprite)}: Failed to find the sprite with the name '{name}'");
|
||||||
|
}
|
||||||
|
|
||||||
|
public Result<GUISpriteSheet> GetSpriteSheet(string name)
|
||||||
|
{
|
||||||
|
using var lck = _lock.AcquireReaderLock().ConfigureAwait(false).GetAwaiter().GetResult();
|
||||||
|
IService.CheckDisposed(this);
|
||||||
|
if (_spriteSheets.TryGetValue(name, out var asset))
|
||||||
|
{
|
||||||
|
return asset;
|
||||||
|
}
|
||||||
|
|
||||||
|
return FluentResults.Result.Fail($"{nameof(GetSpriteSheet)}: Failed to find the spritesheet with the name '{name}'");
|
||||||
|
}
|
||||||
|
|
||||||
|
public Result<GUICursor> GetCursor(string name)
|
||||||
|
{
|
||||||
|
using var lck = _lock.AcquireReaderLock().ConfigureAwait(false).GetAwaiter().GetResult();
|
||||||
|
IService.CheckDisposed(this);
|
||||||
|
if (_cursors.TryGetValue(name, out var asset))
|
||||||
|
{
|
||||||
|
return asset;
|
||||||
|
}
|
||||||
|
|
||||||
|
return FluentResults.Result.Fail($"{nameof(GetCursor)}: Failed to find the cursor with the name '{name}'");
|
||||||
|
}
|
||||||
|
|
||||||
|
public Result<GUIColor> GetColor(string name)
|
||||||
|
{
|
||||||
|
using var lck = _lock.AcquireReaderLock().ConfigureAwait(false).GetAwaiter().GetResult();
|
||||||
|
IService.CheckDisposed(this);
|
||||||
|
if (_colors.TryGetValue(name, out var asset))
|
||||||
|
{
|
||||||
|
return asset;
|
||||||
|
}
|
||||||
|
|
||||||
|
return FluentResults.Result.Fail($"{nameof(GetColor)}: Failed to find the color with the name '{name}'");
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void LoadFile()
|
||||||
|
{
|
||||||
|
using var lck = _lock.AcquireWriterLock().ConfigureAwait(false).GetAwaiter().GetResult();
|
||||||
|
IService.CheckDisposed(this);
|
||||||
|
|
||||||
|
if (_storageService.LoadPackageXml(Path) is not { IsSuccess: true } result)
|
||||||
|
{
|
||||||
|
DebugConsole.LogError($"Failed to load xml from {Path.FullPath}.");
|
||||||
|
ThrowHelper.ThrowArgumentException($"Failed to load xml from {Path.FullPath}.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var root = result.Value.Root?.FromPackage(Path.ContentPackage);
|
||||||
|
if (root is null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var styleElement = root.Name.LocalName.ToLowerInvariant() == "style" ? root : root.GetChildElement("style");
|
||||||
|
if (styleElement is null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var childElements = styleElement.GetChildElements("Font");
|
||||||
|
if (childElements is not null)
|
||||||
|
AddToList<GUIFont, GUIFontPrefab>(_fonts, childElements, _fakeFile);
|
||||||
|
|
||||||
|
childElements = styleElement.GetChildElements("Sprite");
|
||||||
|
if (childElements is not null)
|
||||||
|
AddToList<GUISprite, GUISpritePrefab>(_sprites, childElements, _fakeFile);
|
||||||
|
|
||||||
|
childElements = styleElement.GetChildElements("Spritesheet");
|
||||||
|
if (childElements is not null)
|
||||||
|
AddToList<GUISpriteSheet, GUISpriteSheetPrefab>(_spriteSheets, childElements, _fakeFile);
|
||||||
|
|
||||||
|
childElements = styleElement.GetChildElements("Cursor");
|
||||||
|
if (childElements is not null)
|
||||||
|
AddToList<GUICursor, GUICursorPrefab>(_cursors, childElements, _fakeFile);
|
||||||
|
|
||||||
|
childElements = styleElement.GetChildElements("Color");
|
||||||
|
if (childElements is not null)
|
||||||
|
AddToList<GUIColor, GUIColorPrefab>(_colors, childElements, _fakeFile);
|
||||||
|
|
||||||
|
void AddToList<T1, T2>(ConcurrentDictionary<string, T1> dict, IEnumerable<ContentXElement> elem, UIStyleFile file) where T1 : GUISelector<T2> where T2 : GUIPrefab
|
||||||
|
{
|
||||||
|
foreach (ContentXElement prefabElement in elem)
|
||||||
|
{
|
||||||
|
string name = prefabElement.GetAttributeString("name", string.Empty);
|
||||||
|
if (name != string.Empty)
|
||||||
|
{
|
||||||
|
var prefab = (T2)Activator.CreateInstance(typeof(T2), new object[]{ prefabElement, file })!;
|
||||||
|
if (!dict.ContainsKey(name))
|
||||||
|
dict[name] = (T1)Activator.CreateInstance(typeof(T1), new object[] { name })!;
|
||||||
|
dict[name].Prefabs.Add(prefab, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void UnloadFile()
|
||||||
|
{
|
||||||
|
using var lck = _lock.AcquireWriterLock().ConfigureAwait(false).GetAwaiter().GetResult();
|
||||||
|
IService.CheckDisposed(this);
|
||||||
|
|
||||||
|
_fonts.Values.ForEach(p => p.Prefabs.RemoveByFile(_fakeFile));
|
||||||
|
_sprites.Values.ForEach(p => p.Prefabs.RemoveByFile(_fakeFile));
|
||||||
|
_spriteSheets.Values.ForEach(p => p.Prefabs.RemoveByFile(_fakeFile));
|
||||||
|
_cursors.Values.ForEach(p => p.Prefabs.RemoveByFile(_fakeFile));
|
||||||
|
_colors.Values.ForEach(p => p.Prefabs.RemoveByFile(_fakeFile));
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Sort()
|
||||||
|
{
|
||||||
|
using var lck = _lock.AcquireWriterLock().ConfigureAwait(false).GetAwaiter().GetResult();
|
||||||
|
IService.CheckDisposed(this);
|
||||||
|
|
||||||
|
_fonts.Values.ForEach(p => p.Prefabs.Sort());
|
||||||
|
_sprites.Values.ForEach(p => p.Prefabs.Sort());
|
||||||
|
_spriteSheets.Values.ForEach(p => p.Prefabs.Sort());
|
||||||
|
_cursors.Values.ForEach(p => p.Prefabs.Sort());
|
||||||
|
_colors.Values.ForEach(p => p.Prefabs.Sort());
|
||||||
|
}
|
||||||
|
|
||||||
|
#region INTERNAL_DISPOSE
|
||||||
|
|
||||||
|
private readonly AsyncReaderWriterLock _lock = new();
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
using var lck = _lock.AcquireWriterLock().ConfigureAwait(false).GetAwaiter().GetResult();
|
||||||
|
if (!ModUtils.Threading.CheckIfClearAndSetBool(ref _isDisposed))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_fonts.Values.ForEach(p => p.Prefabs.RemoveByFile(_fakeFile));
|
||||||
|
_sprites.Values.ForEach(p => p.Prefabs.RemoveByFile(_fakeFile));
|
||||||
|
_spriteSheets.Values.ForEach(p => p.Prefabs.RemoveByFile(_fakeFile));
|
||||||
|
_cursors.Values.ForEach(p => p.Prefabs.RemoveByFile(_fakeFile));
|
||||||
|
_colors.Values.ForEach(p => p.Prefabs.RemoveByFile(_fakeFile));
|
||||||
|
|
||||||
|
_fonts.Clear();
|
||||||
|
_sprites.Clear();
|
||||||
|
_spriteSheets.Clear();
|
||||||
|
_cursors.Clear();
|
||||||
|
_colors.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
private int _isDisposed;
|
||||||
|
public bool IsDisposed
|
||||||
|
{
|
||||||
|
get => ModUtils.Threading.GetBool(ref _isDisposed);
|
||||||
|
private set => ModUtils.Threading.SetBool(ref _isDisposed, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
@@ -0,0 +1,350 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Immutable;
|
||||||
|
using System.Linq;
|
||||||
|
using Barotrauma.LuaCs.Data;
|
||||||
|
using FluentResults;
|
||||||
|
using Microsoft.Toolkit.Diagnostics;
|
||||||
|
|
||||||
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
|
public class UIStylesService : IUIStylesService
|
||||||
|
{
|
||||||
|
#region DISPOSAL
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
using var lck = _lock.AcquireWriterLock().ConfigureAwait(false).GetAwaiter().GetResult();
|
||||||
|
if (!ModUtils.Threading.CheckIfClearAndSetBool(ref _isDisposed))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var collection in _stylesCollections.Values.SelectMany(c => c))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
collection.Dispose();
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
//ignored
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_stylesCollections.Clear();
|
||||||
|
_storageService.Dispose();
|
||||||
|
_stylesCollectionFactory.Dispose();
|
||||||
|
|
||||||
|
_storageService = null;
|
||||||
|
_stylesCollectionFactory = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private int _isDisposed = 0;
|
||||||
|
public bool IsDisposed
|
||||||
|
{
|
||||||
|
get => ModUtils.Threading.GetBool(ref _isDisposed);
|
||||||
|
private set => ModUtils.Threading.SetBool(ref _isDisposed, value);
|
||||||
|
}
|
||||||
|
public FluentResults.Result Reset()
|
||||||
|
{
|
||||||
|
using var lck = _lock.AcquireWriterLock().ConfigureAwait(false).GetAwaiter().GetResult();
|
||||||
|
IService.CheckDisposed(this);
|
||||||
|
|
||||||
|
var result = FluentResults.Result.Ok();
|
||||||
|
|
||||||
|
foreach (var collection in _stylesCollections.Values.SelectMany(c => c))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
collection.Dispose();
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
result.WithError(new ExceptionalError(e));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_stylesCollections.Clear();
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
private readonly AsyncReaderWriterLock _lock = new();
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private IStorageService _storageService;
|
||||||
|
private IUIStylesCollection.IFactory _stylesCollectionFactory;
|
||||||
|
|
||||||
|
private ConcurrentDictionary<(ContentPackage Package, string InternalName), ImmutableArray<IUIStylesCollection>>
|
||||||
|
_stylesCollections = new();
|
||||||
|
|
||||||
|
public UIStylesService(IUIStylesCollection.IFactory stylesCollectionFactory, IStorageService storageService)
|
||||||
|
{
|
||||||
|
_stylesCollectionFactory = stylesCollectionFactory;
|
||||||
|
_storageService = storageService;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Result<GUIColor> GetColor(ContentPackage package, string internalName, string assetName)
|
||||||
|
{
|
||||||
|
using var lck = _lock.AcquireReaderLock().ConfigureAwait(false).GetAwaiter().GetResult();
|
||||||
|
IService.CheckDisposed(this);
|
||||||
|
Guard.IsNotNull(package, nameof(package));
|
||||||
|
Guard.IsNotNullOrWhiteSpace(internalName, nameof(internalName));
|
||||||
|
Guard.IsNotNullOrWhiteSpace(assetName, nameof(assetName));
|
||||||
|
|
||||||
|
if (!_stylesCollections.TryGetValue((package, internalName), out var collection)
|
||||||
|
|| collection.IsDefaultOrEmpty)
|
||||||
|
{
|
||||||
|
return FluentResults.Result.Fail(
|
||||||
|
$"{nameof(UIStylesService)}: No styles loaded for [ContentPackage].[InternalName] of: [{package.Name}].[{internalName}]");
|
||||||
|
}
|
||||||
|
|
||||||
|
var failedResult = new FluentResults.Result();
|
||||||
|
|
||||||
|
foreach (var stylesCollection in collection)
|
||||||
|
{
|
||||||
|
var res = stylesCollection.GetColor(assetName);
|
||||||
|
if (res.IsSuccess)
|
||||||
|
{
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
failedResult.WithErrors(res.Errors);
|
||||||
|
}
|
||||||
|
|
||||||
|
return failedResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Result<GUICursor> GetCursor(ContentPackage package, string internalName, string assetName)
|
||||||
|
{
|
||||||
|
using var lck = _lock.AcquireReaderLock().ConfigureAwait(false).GetAwaiter().GetResult();
|
||||||
|
IService.CheckDisposed(this);
|
||||||
|
Guard.IsNotNull(package, nameof(package));
|
||||||
|
Guard.IsNotNullOrWhiteSpace(internalName, nameof(internalName));
|
||||||
|
Guard.IsNotNullOrWhiteSpace(assetName, nameof(assetName));
|
||||||
|
|
||||||
|
if (!_stylesCollections.TryGetValue((package, internalName), out var collection)
|
||||||
|
|| collection.IsDefaultOrEmpty)
|
||||||
|
{
|
||||||
|
return FluentResults.Result.Fail(
|
||||||
|
$"{nameof(UIStylesService)}: No styles loaded for [ContentPackage].[InternalName] of: [{package.Name}].[{internalName}]");
|
||||||
|
}
|
||||||
|
|
||||||
|
var failedResult = new FluentResults.Result();
|
||||||
|
|
||||||
|
foreach (var stylesCollection in collection)
|
||||||
|
{
|
||||||
|
var res = stylesCollection.GetCursor(assetName);
|
||||||
|
if (res.IsSuccess)
|
||||||
|
{
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
failedResult.WithErrors(res.Errors);
|
||||||
|
}
|
||||||
|
|
||||||
|
return failedResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Result<GUIFont> GetFont(ContentPackage package, string internalName, string assetName)
|
||||||
|
{
|
||||||
|
using var lck = _lock.AcquireReaderLock().ConfigureAwait(false).GetAwaiter().GetResult();
|
||||||
|
IService.CheckDisposed(this);
|
||||||
|
Guard.IsNotNull(package, nameof(package));
|
||||||
|
Guard.IsNotNullOrWhiteSpace(internalName, nameof(internalName));
|
||||||
|
Guard.IsNotNullOrWhiteSpace(assetName, nameof(assetName));
|
||||||
|
|
||||||
|
if (!_stylesCollections.TryGetValue((package, internalName), out var collection)
|
||||||
|
|| collection.IsDefaultOrEmpty)
|
||||||
|
{
|
||||||
|
return FluentResults.Result.Fail(
|
||||||
|
$"{nameof(UIStylesService)}: No styles loaded for [ContentPackage].[InternalName] of: [{package.Name}].[{internalName}]");
|
||||||
|
}
|
||||||
|
|
||||||
|
var failedResult = new FluentResults.Result();
|
||||||
|
|
||||||
|
foreach (var stylesCollection in collection)
|
||||||
|
{
|
||||||
|
var res = stylesCollection.GetFont(assetName);
|
||||||
|
if (res.IsSuccess)
|
||||||
|
{
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
failedResult.WithErrors(res.Errors);
|
||||||
|
}
|
||||||
|
|
||||||
|
return failedResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Result<GUISprite> GetSprite(ContentPackage package, string internalName, string assetName)
|
||||||
|
{
|
||||||
|
using var lck = _lock.AcquireReaderLock().ConfigureAwait(false).GetAwaiter().GetResult();
|
||||||
|
IService.CheckDisposed(this);
|
||||||
|
Guard.IsNotNull(package, nameof(package));
|
||||||
|
Guard.IsNotNullOrWhiteSpace(internalName, nameof(internalName));
|
||||||
|
Guard.IsNotNullOrWhiteSpace(assetName, nameof(assetName));
|
||||||
|
|
||||||
|
if (!_stylesCollections.TryGetValue((package, internalName), out var collection)
|
||||||
|
|| collection.IsDefaultOrEmpty)
|
||||||
|
{
|
||||||
|
return FluentResults.Result.Fail(
|
||||||
|
$"{nameof(UIStylesService)}: No styles loaded for [ContentPackage].[InternalName] of: [{package.Name}].[{internalName}]");
|
||||||
|
}
|
||||||
|
|
||||||
|
var failedResult = new FluentResults.Result();
|
||||||
|
|
||||||
|
foreach (var stylesCollection in collection)
|
||||||
|
{
|
||||||
|
var res = stylesCollection.GetSprite(assetName);
|
||||||
|
if (res.IsSuccess)
|
||||||
|
{
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
failedResult.WithErrors(res.Errors);
|
||||||
|
}
|
||||||
|
|
||||||
|
return failedResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Result<GUISpriteSheet> GetSpriteSheet(ContentPackage package, string internalName, string assetName)
|
||||||
|
{
|
||||||
|
using var lck = _lock.AcquireReaderLock().ConfigureAwait(false).GetAwaiter().GetResult();
|
||||||
|
IService.CheckDisposed(this);
|
||||||
|
Guard.IsNotNull(package, nameof(package));
|
||||||
|
Guard.IsNotNullOrWhiteSpace(internalName, nameof(internalName));
|
||||||
|
Guard.IsNotNullOrWhiteSpace(assetName, nameof(assetName));
|
||||||
|
|
||||||
|
if (!_stylesCollections.TryGetValue((package, internalName), out var collection)
|
||||||
|
|| collection.IsDefaultOrEmpty)
|
||||||
|
{
|
||||||
|
return FluentResults.Result.Fail(
|
||||||
|
$"{nameof(UIStylesService)}: No styles loaded for [ContentPackage].[InternalName] of: [{package.Name}].[{internalName}]");
|
||||||
|
}
|
||||||
|
|
||||||
|
var failedResult = new FluentResults.Result();
|
||||||
|
|
||||||
|
foreach (var stylesCollection in collection)
|
||||||
|
{
|
||||||
|
var res = stylesCollection.GetSpriteSheet(assetName);
|
||||||
|
if (res.IsSuccess)
|
||||||
|
{
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
failedResult.WithErrors(res.Errors);
|
||||||
|
}
|
||||||
|
|
||||||
|
return failedResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FluentResults.Result LoadAssets(ImmutableArray<IStylesResourceInfo> resources)
|
||||||
|
{
|
||||||
|
using var lck = _lock.AcquireReaderLock().ConfigureAwait(false).GetAwaiter().GetResult();
|
||||||
|
IService.CheckDisposed(this);
|
||||||
|
if (resources.IsDefaultOrEmpty)
|
||||||
|
{
|
||||||
|
ThrowHelper.ThrowArgumentNullException(nameof(resources));
|
||||||
|
}
|
||||||
|
|
||||||
|
var operationSuccess = FluentResults.Result.Ok();
|
||||||
|
|
||||||
|
foreach (var resource in resources)
|
||||||
|
{
|
||||||
|
var builder = ImmutableArray.CreateBuilder<IUIStylesCollection>();
|
||||||
|
if (_stylesCollections.TryGetValue((resource.OwnerPackage, resource.InternalName), out var collection))
|
||||||
|
{
|
||||||
|
builder.AddRange(collection);
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var newCollections = _stylesCollectionFactory.CreateInstance(resource, _storageService).ToImmutableArray();
|
||||||
|
foreach (var stylesCollection in newCollections)
|
||||||
|
{
|
||||||
|
stylesCollection.LoadFile();
|
||||||
|
}
|
||||||
|
builder.AddRange(newCollections);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
operationSuccess.WithError(new ExceptionalError(e));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
_stylesCollections[(resource.OwnerPackage, resource.InternalName)] = builder.ToImmutable();
|
||||||
|
}
|
||||||
|
|
||||||
|
return operationSuccess;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FluentResults.Result UnloadPackages(ImmutableArray<ContentPackage> packages)
|
||||||
|
{
|
||||||
|
using var lck = _lock.AcquireWriterLock().ConfigureAwait(false).GetAwaiter().GetResult();
|
||||||
|
IService.CheckDisposed(this);
|
||||||
|
|
||||||
|
var toRemove = _stylesCollections
|
||||||
|
.Select(c => c.Key)
|
||||||
|
.Where(c => packages.Contains(c.Package))
|
||||||
|
.ToImmutableArray();
|
||||||
|
|
||||||
|
var result = FluentResults.Result.Ok();
|
||||||
|
|
||||||
|
foreach (var key in toRemove)
|
||||||
|
{
|
||||||
|
if (_stylesCollections.TryRemove(key, out var collection) && !collection.IsDefaultOrEmpty)
|
||||||
|
{
|
||||||
|
foreach (var stylesCollection in collection)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
stylesCollection.UnloadFile();
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
result.WithError(new ExceptionalError(e));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FluentResults.Result UnloadPackage(ContentPackage package)
|
||||||
|
{
|
||||||
|
// Yes, this is very cursed/inefficient. We don't care.
|
||||||
|
return UnloadPackages(new [] { package }.ToImmutableArray());
|
||||||
|
}
|
||||||
|
|
||||||
|
public FluentResults.Result UnloadAllPackages()
|
||||||
|
{
|
||||||
|
using var lck = _lock.AcquireWriterLock().ConfigureAwait(false).GetAwaiter().GetResult();
|
||||||
|
IService.CheckDisposed(this);
|
||||||
|
|
||||||
|
var result = FluentResults.Result.Ok();
|
||||||
|
|
||||||
|
foreach (var key in _stylesCollections.Keys.ToImmutableArray())
|
||||||
|
{
|
||||||
|
if (_stylesCollections.TryRemove(key, out var collection) && !collection.IsDefaultOrEmpty)
|
||||||
|
{
|
||||||
|
foreach (var stylesCollection in collection)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
stylesCollection.UnloadFile();
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
result.WithError(new ExceptionalError(e));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
|
public interface IClientLoggerService : IReusableService
|
||||||
|
{
|
||||||
|
void AddToGUIUpdateList();
|
||||||
|
void ShowErrorOverlay(string message, float time = 5f, float duration = 1.5f);
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.Immutable;
|
||||||
|
using Barotrauma.LuaCs.Data;
|
||||||
|
using Barotrauma.LuaCs;
|
||||||
|
using Barotrauma.Networking;
|
||||||
|
|
||||||
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
|
public partial interface IConfigService
|
||||||
|
{
|
||||||
|
ImmutableArray<ISettingBase> GetDisplayableConfigs();
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
|
public interface ISettingsMenuSystem : ISystem
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,75 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.Immutable;
|
||||||
|
using Barotrauma.LuaCs.Data;
|
||||||
|
using FluentResults;
|
||||||
|
|
||||||
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
|
public interface IUIStylesCollection : IService
|
||||||
|
{
|
||||||
|
public interface IFactory : IService
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a new <see cref="IUIStylesCollection"/> for-each <see cref="ContentPath"/> in the given
|
||||||
|
/// <see cref="IStylesResourceInfo.FilePaths"/> or empty is none.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="info"></param>
|
||||||
|
/// <param name="storageService"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
IEnumerable<IUIStylesCollection> CreateInstance(IStylesResourceInfo info, IStorageService storageService);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The assigned/target <see cref="ContentPath"/> for this collection.
|
||||||
|
/// </summary>
|
||||||
|
public ContentPath Path { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the <see cref="GUIFont"/> with the given name.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="name"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public Result<GUIFont> GetFont(string name);
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the <see cref="GUISprite"/> with the given name.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="name"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public Result<GUISprite> GetSprite(string name);
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the <see cref="GUISpriteSheet"/> with the given name.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="name"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public Result<GUISpriteSheet> GetSpriteSheet(string name);
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the <see cref="GUICursor"/> with the given name.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="name"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public Result<GUICursor> GetCursor(string name);
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the <see cref="GUIColor"/> with the given name.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="name"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public Result<GUIColor> GetColor(string name);
|
||||||
|
|
||||||
|
#region BAROTRAUMA.UISTYLEFILE
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Definition of <see cref="HashlessFile.LoadFile"/>
|
||||||
|
/// </summary>
|
||||||
|
internal void LoadFile();
|
||||||
|
/// <summary>
|
||||||
|
/// Definition of <see cref="HashlessFile.UnloadFile"/>
|
||||||
|
/// </summary>
|
||||||
|
internal void UnloadFile();
|
||||||
|
/// <summary>
|
||||||
|
/// Definition of <see cref="HashlessFile.Sort"/>
|
||||||
|
/// </summary>
|
||||||
|
internal void Sort();
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
using System.Collections.Immutable;
|
||||||
|
using Barotrauma.LuaCs.Data;
|
||||||
|
using FluentResults;
|
||||||
|
|
||||||
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
|
public interface IUIStylesService : IReusableService
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the first loaded <see cref="GUIColor"/>.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="package">The target <see cref="ContentPackage"/></param>
|
||||||
|
/// <param name="internalName">The targets <see cref="IDataInfo.InternalName"/> as specified in the ModConfig.xml.</param>
|
||||||
|
/// <param name="assetName">The asset's name as specified in the styles XML file.</param>
|
||||||
|
/// <returns>A <see cref="FluentResults.Result"/> indicating success, and the target if succeeded.</returns>
|
||||||
|
public Result<GUIColor> GetColor(ContentPackage package, string internalName, string assetName);
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the loaded <see cref="GUICursor"/>.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="package">The target <see cref="ContentPackage"/></param>
|
||||||
|
/// <param name="internalName">The targets <see cref="IDataInfo.InternalName"/> as specified in the ModConfig.xml.</param>
|
||||||
|
/// <param name="assetName">The asset's name as specified in the styles XML file.</param>
|
||||||
|
/// <returns>A <see cref="FluentResults.Result"/> indicating success, and the target if succeeded.</returns>
|
||||||
|
public Result<GUICursor> GetCursor(ContentPackage package, string internalName, string assetName);
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the loaded <see cref="GUIFont"/>.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="package">The target <see cref="ContentPackage"/></param>
|
||||||
|
/// <param name="internalName">The targets <see cref="IDataInfo.InternalName"/> as specified in the ModConfig.xml.</param>
|
||||||
|
/// <param name="assetName">The asset's name as specified in the styles XML file.</param>
|
||||||
|
/// <returns>A <see cref="FluentResults.Result"/> indicating success, and the target if succeeded.</returns>
|
||||||
|
public Result<GUIFont> GetFont(ContentPackage package, string internalName, string assetName);
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the loaded <see cref="GUISprite"/>.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="package">The target <see cref="ContentPackage"/></param>
|
||||||
|
/// <param name="internalName">The targets <see cref="IDataInfo.InternalName"/> as specified in the ModConfig.xml.</param>
|
||||||
|
/// <param name="assetName">The asset's name as specified in the styles XML file.</param>
|
||||||
|
/// <returns>A <see cref="FluentResults.Result"/> indicating success, and the target if succeeded.</returns>
|
||||||
|
public Result<GUISprite> GetSprite(ContentPackage package, string internalName, string assetName);
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the loaded <see cref="GUISpriteSheet"/>.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="package">The target <see cref="ContentPackage"/></param>
|
||||||
|
/// <param name="internalName">The targets <see cref="IDataInfo.InternalName"/> as specified in the ModConfig.xml.</param>
|
||||||
|
/// <param name="assetName">The asset's name as specified in the styles XML file.</param>
|
||||||
|
/// <returns>A <see cref="FluentResults.Result"/> indicating success, and the target if succeeded.</returns>
|
||||||
|
public Result<GUISpriteSheet> GetSpriteSheet(ContentPackage package, string internalName, string assetName);
|
||||||
|
|
||||||
|
public FluentResults.Result LoadAssets(ImmutableArray<IStylesResourceInfo> resources);
|
||||||
|
|
||||||
|
public FluentResults.Result UnloadPackages(ImmutableArray<ContentPackage> packages);
|
||||||
|
|
||||||
|
public FluentResults.Result UnloadPackage(ContentPackage package);
|
||||||
|
|
||||||
|
public FluentResults.Result UnloadAllPackages();
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
|
internal sealed class ModsControlsSettingsMenu : ModsSettingsMenuBase
|
||||||
|
{
|
||||||
|
public ModsControlsSettingsMenu(GUIFrame contentFrame,
|
||||||
|
IPackageManagementService packageManagementService,
|
||||||
|
IConfigService configService,
|
||||||
|
SettingsMenu settingsMenuInstance) : base(contentFrame, packageManagementService, configService, settingsMenuInstance)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void DisposeInternal()
|
||||||
|
{
|
||||||
|
// TODO: Finish this later.
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void ApplyInstalledModChanges()
|
||||||
|
{
|
||||||
|
// TODO: Finish this later.
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,458 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.Immutable;
|
||||||
|
using Microsoft.Xna.Framework;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Numerics;
|
||||||
|
using Barotrauma.LuaCs.Data;
|
||||||
|
using Vector2 = Microsoft.Xna.Framework.Vector2;
|
||||||
|
using Vector4 = Microsoft.Xna.Framework.Vector4;
|
||||||
|
|
||||||
|
// ReSharper disable ObjectCreationAsStatement
|
||||||
|
|
||||||
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
|
internal sealed class ModsGameplaySettingsMenu : ModsSettingsMenuBase
|
||||||
|
{
|
||||||
|
private ImmutableArray<ISettingBase> _settingsInstancesGameplay;
|
||||||
|
// menu vars
|
||||||
|
private GUILayoutGroup _modCategoryDisplayGroup, _settingsDisplayGroup;
|
||||||
|
private string _selectedSearchQuery = string.Empty;
|
||||||
|
private ContentPackage _selectedContentPackage;
|
||||||
|
private string _selectedCategory = string.Empty;
|
||||||
|
private ImmutableArray<ISettingBase> _currentlyDisplayedSettings;
|
||||||
|
private ILoggerService _loggerService;
|
||||||
|
|
||||||
|
private bool _promptOpen = false;
|
||||||
|
|
||||||
|
|
||||||
|
// Note: "static" instead of "const" for Hot Reload and to allow changing at runtime.
|
||||||
|
// ReSharper disable FieldCanBeMadeReadOnly.Local
|
||||||
|
|
||||||
|
// --- UI controls ---
|
||||||
|
private static float MenuTitleHeight = 0.06f; // (ContentDisplayAreaHeightContainer + MenuTitleHeight) < 1f
|
||||||
|
private static float ContentDisplayAreaHeightContainer = 0.93f;
|
||||||
|
private static float ContentDisplayAreaHeightInnerCategories = 0.99f;
|
||||||
|
private static float ContentDisplayAreaHeightInnerSettings = 0.97f;
|
||||||
|
private static float ContentLeftRightSplitPosition = 0.3f;
|
||||||
|
|
||||||
|
// Search Bar
|
||||||
|
private static float SearchBarLayoutHeight = 0.06f;
|
||||||
|
private static float SearchBarLabelWidth = 0.1f;
|
||||||
|
private static float SearchBarLabelBoxSpacing = 0.05f;
|
||||||
|
|
||||||
|
private static float SearchBarTextBoxWidth = 1f - SearchBarLabelWidth - SearchBarLabelBoxSpacing;
|
||||||
|
|
||||||
|
// Categories, Packages Display Area
|
||||||
|
private static float CategoriesDisplayListHeight = 0.945f;
|
||||||
|
private static float CategoryButtonHeightRelative = 0.122f;
|
||||||
|
private static float PackageSelectionButtonHeight = 0.07f;
|
||||||
|
|
||||||
|
private static Color CategoryButtonHoverSelectColor = new Color(50, 50, 50, 255);
|
||||||
|
private static Color CategoryButtonTextColor = Color.PeachPuff;
|
||||||
|
private static Color CategoryButtonTextColorSelected = Color.White;
|
||||||
|
private static Color CategoryButtonColorPressed = Color.TransparentBlack;
|
||||||
|
|
||||||
|
// Settings Display Area
|
||||||
|
private static float SettingLabelWidth = 0.6f;
|
||||||
|
private static float SettingControlWidth = 0.4f;
|
||||||
|
private static float SettingHeight = 0.05625f/ContentDisplayAreaHeightContainer/ContentDisplayAreaHeightInnerSettings;
|
||||||
|
private static Color SettingEntryLabelTextColor = Color.PeachPuff;
|
||||||
|
private static string SettingGUIFrameStyle = "";
|
||||||
|
private static Color? SettingGUIFrameColor = null;
|
||||||
|
|
||||||
|
// settings reset
|
||||||
|
private static Vector2 SettingsResetButtonTopSpacer = new Vector2(0f, 0.02f);
|
||||||
|
private static Vector2 SettingsResetButtonDimensions = new Vector2(0.3f, 0.05f);
|
||||||
|
private static string SettingsResetButtonStyle = "GUIButtonSmall";
|
||||||
|
private static Color SettingsResetButtonColor = Color.DarkOliveGreen;
|
||||||
|
private static Color SettingsResetButtonHoverColor = Color.Olive;
|
||||||
|
private static Color SettingsResetButtonTextColor = Color.PeachPuff;
|
||||||
|
private static Color SettingsResetButtonTextColorSelected = Color.White;
|
||||||
|
|
||||||
|
private static Vector2 ResetConfirmationPromptDimensions = new Vector2(0.15f, 0.2f);
|
||||||
|
|
||||||
|
|
||||||
|
// ReSharper restore FieldCanBeMadeReadOnly.Local
|
||||||
|
private const string SettingsResetButtonText = "LuaCsForBarotrauma.SettingsMenu.ResetVisibleSettings";
|
||||||
|
private const string SettingsResetPromptTitle = "LuaCsForBarotrauma.SettingsMenu.ResetPrompt.Title";
|
||||||
|
private const string SettingsResetPromptContents = "LuaCsForBarotrauma.SettingsMenu.ResetPrompt.Message";
|
||||||
|
private const string SettingsResetPromptYesText = "LuaCsForBarotrauma.SettingsMenu.ResetPrompt.Yes";
|
||||||
|
private const string SettingsResetPromptNoText = "LuaCsForBarotrauma.SettingsMenu.ResetPrompt.No";
|
||||||
|
|
||||||
|
|
||||||
|
private event Action OnApplyInstalledModsChanges;
|
||||||
|
|
||||||
|
public ModsGameplaySettingsMenu(GUIFrame contentFrame,
|
||||||
|
IPackageManagementService packageManagementService,
|
||||||
|
IConfigService configService,
|
||||||
|
ILoggerService loggerService,
|
||||||
|
SettingsMenu settingsMenuInstance) : base(contentFrame, packageManagementService, configService, settingsMenuInstance)
|
||||||
|
{
|
||||||
|
_settingsInstancesGameplay = configService.GetDisplayableConfigs()
|
||||||
|
.ToImmutableArray();
|
||||||
|
|
||||||
|
_loggerService = loggerService;
|
||||||
|
|
||||||
|
var mainLayoutGroup = new GUILayoutGroup(new RectTransform(new Vector2(1f, 1f), contentFrame.RectTransform, Anchor.Center), false, Anchor.TopLeft);
|
||||||
|
// page title
|
||||||
|
var menuTitleLayoutGroup = new GUILayoutGroup(
|
||||||
|
new RectTransform(new Vector2(1f, MenuTitleHeight), mainLayoutGroup.RectTransform, Anchor.TopLeft), true, Anchor.TopLeft);
|
||||||
|
GUIUtil.Label(menuTitleLayoutGroup,
|
||||||
|
GetLocalizedString("LuaCsForBarotrauma.SettingsMenu.ModGameplayButton", "Mod Gameplay Settings"),
|
||||||
|
GUIStyle.LargeFont, new Vector2(1f, 1f));
|
||||||
|
|
||||||
|
// page contents
|
||||||
|
var contentAreaLayoutGroup = new GUILayoutGroup(
|
||||||
|
new RectTransform(new Vector2(1f, 0.94f), mainLayoutGroup.RectTransform, Anchor.BottomLeft), false,
|
||||||
|
Anchor.TopLeft);
|
||||||
|
|
||||||
|
var searchBarLayoutGroup = new GUILayoutGroup(
|
||||||
|
new RectTransform(new Vector2(1f, SearchBarLayoutHeight), contentAreaLayoutGroup.RectTransform, Anchor.TopCenter), true, Anchor.CenterLeft);
|
||||||
|
GUIUtil.Label(searchBarLayoutGroup, "Search: ", GUIStyle.SubHeadingFont, new Vector2(SearchBarLabelWidth, 1f));
|
||||||
|
var searchBar = new GUITextBox(
|
||||||
|
new RectTransform(new Vector2(SearchBarTextBoxWidth, 0.1f), searchBarLayoutGroup.RectTransform, Anchor.TopLeft),
|
||||||
|
createClearButton: true)
|
||||||
|
{
|
||||||
|
OnTextChangedDelegate = (btn, txt) =>
|
||||||
|
{
|
||||||
|
GenerateDisplayFromFilter(txt);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// main display area
|
||||||
|
var settingsContentAreaGroup = new GUILayoutGroup(new RectTransform(new Vector2(1f, ContentDisplayAreaHeightContainer), contentAreaLayoutGroup.RectTransform, Anchor.BottomCenter));
|
||||||
|
GUIUtil.Spacer(settingsContentAreaGroup, Vector2.One);
|
||||||
|
(_modCategoryDisplayGroup, _settingsDisplayGroup) = GUIUtil.CreateSidebars(settingsContentAreaGroup, true);
|
||||||
|
_modCategoryDisplayGroup.RectTransform.RelativeSize = new Vector2(ContentLeftRightSplitPosition, ContentDisplayAreaHeightInnerCategories);
|
||||||
|
_settingsDisplayGroup.RectTransform.RelativeSize = new Vector2(1f-ContentLeftRightSplitPosition, ContentDisplayAreaHeightInnerSettings);
|
||||||
|
|
||||||
|
// default category
|
||||||
|
_selectedCategory = "All";
|
||||||
|
|
||||||
|
OnApplyInstalledModsChanges = () =>
|
||||||
|
{
|
||||||
|
_settingsInstancesGameplay = configService.GetDisplayableConfigs()
|
||||||
|
.ToImmutableArray();
|
||||||
|
if (_selectedContentPackage is not null && !GetTargetPackagesList().Contains(_selectedContentPackage))
|
||||||
|
{
|
||||||
|
_selectedContentPackage = null;
|
||||||
|
_selectedCategory = string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
GenerateCategoryListDisplay(_modCategoryDisplayGroup, GetTargetPackagesList(), GetDisplayCategoriesList());
|
||||||
|
GenerateSettingsListDisplay(_settingsDisplayGroup, GetDisplaySettingsList());
|
||||||
|
};
|
||||||
|
|
||||||
|
GenerateCategoryListDisplay(_modCategoryDisplayGroup, GetTargetPackagesList(), GetDisplayCategoriesList());
|
||||||
|
GenerateSettingsListDisplay(_settingsDisplayGroup, GetDisplaySettingsList());
|
||||||
|
|
||||||
|
void GenerateDisplayFromFilter(string text)
|
||||||
|
{
|
||||||
|
_selectedSearchQuery = text;
|
||||||
|
GenerateCategoryListDisplay(_modCategoryDisplayGroup, GetTargetPackagesList(), GetDisplayCategoriesList());
|
||||||
|
GenerateSettingsListDisplay(_settingsDisplayGroup, GetDisplaySettingsList());
|
||||||
|
}
|
||||||
|
|
||||||
|
string GetLocalizedString(string identifier, string defaultValue)
|
||||||
|
{
|
||||||
|
var lstr = TextManager.Get(identifier);
|
||||||
|
return lstr.IsNullOrWhiteSpace() ? defaultValue : lstr.Value;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Filters by selected package and query text
|
||||||
|
ImmutableArray<string> GetDisplayCategoriesList()
|
||||||
|
{
|
||||||
|
return GetFilteredSettingsList()
|
||||||
|
.Select(s => GetLocalizedString(s.GetDisplayInfo().DisplayCategory, "General"))
|
||||||
|
.Concat(new []{ "All" })
|
||||||
|
.Distinct()
|
||||||
|
.OrderBy(s => s)
|
||||||
|
.ToImmutableArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Filters by query text
|
||||||
|
ImmutableArray<ContentPackage> GetTargetPackagesList()
|
||||||
|
{
|
||||||
|
return _settingsInstancesGameplay
|
||||||
|
.Where(s => SettingMatchesQuery(s, _selectedSearchQuery))
|
||||||
|
.Select(s => s.OwnerPackage)
|
||||||
|
.Concat(new[] { ContentPackageManager.VanillaCorePackage })
|
||||||
|
.Distinct()
|
||||||
|
.OrderByDescending(p => p == ContentPackageManager.VanillaCorePackage ? 0 : 1)
|
||||||
|
.ThenBy(p => p.Name)
|
||||||
|
.ToImmutableArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Filters by selected package, query text, and selected category.
|
||||||
|
ImmutableArray<ISettingBase> GetDisplaySettingsList()
|
||||||
|
{
|
||||||
|
return GetFilteredSettingsList()
|
||||||
|
.Where(s => _selectedCategory.IsNullOrWhiteSpace()
|
||||||
|
|| _selectedCategory == "All"
|
||||||
|
|| GetLocalizedString(s.GetDisplayInfo().DisplayCategory, "General") == _selectedCategory)
|
||||||
|
.OrderBy(s => GetLocalizedString(s.GetDisplayInfo().DisplayName, s.InternalName))
|
||||||
|
.ToImmutableArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Filters by selected package and by query text.
|
||||||
|
ImmutableArray<ISettingBase> GetFilteredSettingsList()
|
||||||
|
{
|
||||||
|
return _settingsInstancesGameplay
|
||||||
|
.Where(s => SettingMatchesQuery(s, _selectedSearchQuery))
|
||||||
|
.Where(s => _selectedContentPackage is null
|
||||||
|
|| _selectedContentPackage == ContentPackageManager.VanillaCorePackage // vanilla is treated as all packages
|
||||||
|
|| s.OwnerPackage == _selectedContentPackage)
|
||||||
|
.OrderBy(s => GetLocalizedString(s.GetDisplayInfo().DisplayName, s.InternalName))
|
||||||
|
.ToImmutableArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool SettingMatchesQuery(ISettingBase setting, string queryText)
|
||||||
|
{
|
||||||
|
if (queryText.IsNullOrWhiteSpace())
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
queryText = queryText.ToLowerInvariant().Trim();
|
||||||
|
|
||||||
|
if (setting.InternalName.ToLowerInvariant().Trim().Contains(queryText) || setting.OwnerPackage.Name.ToLowerInvariant().Trim().Contains(queryText))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
var displayInfo = setting.GetDisplayInfo();
|
||||||
|
return TextManager.Get(displayInfo.DisplayName).Value.ToLowerInvariant().Trim().Contains(queryText)
|
||||||
|
|| TextManager.Get(displayInfo.DisplayCategory).Value.ToLowerInvariant().Trim().Contains(queryText)
|
||||||
|
|| TextManager.Get(displayInfo.Description).Value.ToLowerInvariant().Trim().Contains(queryText)
|
||||||
|
|| TextManager.Get(displayInfo.Tooltip).Value.ToLowerInvariant().Trim().Contains(queryText);
|
||||||
|
}
|
||||||
|
|
||||||
|
string GetPackageName(ContentPackage package)
|
||||||
|
{
|
||||||
|
return package is null || package == ContentPackageManager.VanillaCorePackage ? "All" : package.Name;
|
||||||
|
}
|
||||||
|
|
||||||
|
ContentPackage GetCurrentSelectedPackage(ImmutableArray<ContentPackage> packages)
|
||||||
|
{
|
||||||
|
if (_selectedContentPackage is null)
|
||||||
|
{
|
||||||
|
return ContentPackageManager.VanillaCorePackage;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (packages.Contains(_selectedContentPackage))
|
||||||
|
{
|
||||||
|
return _selectedContentPackage;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (packages.Length > 0)
|
||||||
|
{
|
||||||
|
_selectedContentPackage = packages[0];
|
||||||
|
return packages[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GenerateCategoryListDisplay(GUILayoutGroup layoutGroup, ImmutableArray<ContentPackage> packagesList,
|
||||||
|
ImmutableArray<string> categories)
|
||||||
|
{
|
||||||
|
layoutGroup.ClearChildren();
|
||||||
|
var packageSelectionList = GUIUtil.Dropdown<ContentPackage>(layoutGroup, cp => GetPackageName(cp), null,
|
||||||
|
packagesList, GetCurrentSelectedPackage(packagesList), cp =>
|
||||||
|
{
|
||||||
|
_selectedContentPackage = cp;
|
||||||
|
_selectedCategory = string.Empty;
|
||||||
|
GenerateCategoryListDisplay(_modCategoryDisplayGroup, GetTargetPackagesList(), GetDisplayCategoriesList());
|
||||||
|
GenerateSettingsListDisplay(_settingsDisplayGroup, GetDisplaySettingsList());
|
||||||
|
}, new Vector2(1f, PackageSelectionButtonHeight));
|
||||||
|
var containerBox = new GUIListBox(new RectTransform(new Vector2(1f, CategoriesDisplayListHeight), layoutGroup.RectTransform));
|
||||||
|
|
||||||
|
|
||||||
|
float sizeY = MathF.Max(categories.Length * CategoryButtonHeightRelative, 1f);
|
||||||
|
var displayedCategoriesFrame = new GUIFrame(new RectTransform(new Vector2(1f, sizeY), containerBox.Content.RectTransform), style: null, color: Color.Black)
|
||||||
|
{
|
||||||
|
CanBeFocused = false
|
||||||
|
};
|
||||||
|
var displayCategoriesLayout = new GUILayoutGroup(new RectTransform(Vector2.One, displayedCategoriesFrame.RectTransform));
|
||||||
|
|
||||||
|
foreach (var category in categories)
|
||||||
|
{
|
||||||
|
var btn = new GUIButton(new RectTransform(new Vector2(1f, CategoryButtonHeightRelative), displayCategoriesLayout.RectTransform),
|
||||||
|
text: category, color: Color.TransparentBlack)
|
||||||
|
{
|
||||||
|
CanBeFocused = true,
|
||||||
|
CanBeSelected = true,
|
||||||
|
TextColor = CategoryButtonTextColor,
|
||||||
|
HoverColor = CategoryButtonHoverSelectColor,
|
||||||
|
HoverTextColor = CategoryButtonTextColorSelected,
|
||||||
|
PressedColor = CategoryButtonColorPressed,
|
||||||
|
SelectedColor = CategoryButtonHoverSelectColor,
|
||||||
|
SelectedTextColor = CategoryButtonHoverSelectColor,
|
||||||
|
OnClicked = (btn, obj) =>
|
||||||
|
{
|
||||||
|
_selectedCategory = category;
|
||||||
|
GenerateSettingsListDisplay(_settingsDisplayGroup, GetDisplaySettingsList());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void GenerateSettingsListDisplay(GUILayoutGroup layoutGroup, ImmutableArray<ISettingBase> settings)
|
||||||
|
{
|
||||||
|
layoutGroup.ClearChildren();
|
||||||
|
_currentlyDisplayedSettings = settings;
|
||||||
|
|
||||||
|
var containerBox = new GUIListBox(new RectTransform(new Vector2(1f, 1f-SettingsResetButtonDimensions.Y), layoutGroup.RectTransform));
|
||||||
|
foreach (var setting in settings)
|
||||||
|
{
|
||||||
|
var entry = AddSettingToDisplay(
|
||||||
|
setting,
|
||||||
|
containerBox.Content.RectTransform,
|
||||||
|
settingHeight: SettingHeight,
|
||||||
|
labelSize: new Vector2(SettingLabelWidth, 1f),
|
||||||
|
controlSize: new Vector2(SettingControlWidth, 1f));
|
||||||
|
}
|
||||||
|
|
||||||
|
var spacer = new GUIFrame(new RectTransform(SettingsResetButtonTopSpacer, layoutGroup.RectTransform),
|
||||||
|
style: null, color: Color.TransparentBlack);
|
||||||
|
|
||||||
|
var resetSettingsButton = new GUIButton(
|
||||||
|
new RectTransform(SettingsResetButtonDimensions, layoutGroup.RectTransform),
|
||||||
|
GetLocalizedString(SettingsResetButtonText, "Reset Visible Settings"),
|
||||||
|
style: SettingsResetButtonStyle)
|
||||||
|
{
|
||||||
|
CanBeSelected = true,
|
||||||
|
CanBeFocused = true,
|
||||||
|
Color = SettingsResetButtonColor,
|
||||||
|
HoverColor = SettingsResetButtonHoverColor,
|
||||||
|
SelectedColor = SettingsResetButtonHoverColor,
|
||||||
|
SelectedTextColor = SettingsResetButtonTextColorSelected,
|
||||||
|
TextColor = SettingsResetButtonTextColor,
|
||||||
|
OnClicked = (btn, obj) =>
|
||||||
|
{
|
||||||
|
DisplayResetConfirmationPrompt(settings);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
(GUIFrame entryFrame, GUILayoutGroup entryLayoutGroup)
|
||||||
|
AddSettingToDisplay(ISettingBase setting, RectTransform parent, float settingHeight, Vector2 labelSize, Vector2 controlSize)
|
||||||
|
{
|
||||||
|
GUIFrame entryFrame = new GUIFrame(new RectTransform(new Vector2(1f, settingHeight), parent),
|
||||||
|
style: SettingGUIFrameStyle, color: SettingGUIFrameColor)
|
||||||
|
{
|
||||||
|
Color = Color.DarkGray
|
||||||
|
};
|
||||||
|
GUILayoutGroup entryLayoutGroup = new GUILayoutGroup(new RectTransform(Vector2.One, entryFrame.RectTransform), isHorizontal: true);
|
||||||
|
|
||||||
|
// padding
|
||||||
|
new GUIFrame(new RectTransform(new Vector2(0.02f, 1f), entryLayoutGroup.RectTransform),
|
||||||
|
color: Color.TransparentBlack);
|
||||||
|
|
||||||
|
// setting label
|
||||||
|
new GUITextBlock(new RectTransform(labelSize - new Vector2(0.05f, 0f), entryLayoutGroup.RectTransform),
|
||||||
|
GetLocalizedString(setting.GetDisplayInfo().DisplayName, setting.GetDisplayInfo().DisplayName),
|
||||||
|
textColor: SettingEntryLabelTextColor,
|
||||||
|
font: GUIStyle.SmallFont,
|
||||||
|
textAlignment: Alignment.Left)
|
||||||
|
{
|
||||||
|
ToolTip = GetLocalizedString(setting.GetDisplayInfo().Tooltip, string.Empty)
|
||||||
|
};
|
||||||
|
|
||||||
|
setting.AddDisplayComponent(entryLayoutGroup, controlSize, newValue =>
|
||||||
|
{
|
||||||
|
NewValuesCache[setting] = newValue;
|
||||||
|
});
|
||||||
|
return (entryFrame, entryLayoutGroup);
|
||||||
|
}
|
||||||
|
|
||||||
|
void DisplayResetConfirmationPrompt(ImmutableArray<ISettingBase> settings)
|
||||||
|
{
|
||||||
|
if (_promptOpen)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_promptOpen = true;
|
||||||
|
|
||||||
|
var msgBox = new GUIMessageBox(GetLocalizedString(SettingsResetPromptTitle, "Reset Visible Settings"),
|
||||||
|
GetLocalizedString(SettingsResetPromptContents,
|
||||||
|
"Are you sure you want to reset the values for currently displayed settings?"),
|
||||||
|
new LocalizedString[]
|
||||||
|
{
|
||||||
|
GetLocalizedString(SettingsResetPromptYesText, "Yes"),
|
||||||
|
GetLocalizedString(SettingsResetPromptNoText, "No")
|
||||||
|
}, ResetConfirmationPromptDimensions);
|
||||||
|
msgBox.Buttons[0].OnClicked = (btn, obj) =>
|
||||||
|
{
|
||||||
|
ResetValuesForDisplayedSettings(settings);
|
||||||
|
btn.Visible = false;
|
||||||
|
_promptOpen = false;
|
||||||
|
msgBox.Close();
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
msgBox.Buttons[1].OnClicked = (btn, obj) =>
|
||||||
|
{
|
||||||
|
btn.Visible = false;
|
||||||
|
_promptOpen = false;
|
||||||
|
msgBox.Close();
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
void ResetValuesForDisplayedSettings(ImmutableArray<ISettingBase> settings)
|
||||||
|
{
|
||||||
|
if (settings.IsDefaultOrEmpty)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
NewValuesCache.Clear();
|
||||||
|
foreach (var setting in settings)
|
||||||
|
{
|
||||||
|
var str = setting.GetDefaultStringValue();
|
||||||
|
NewValuesCache[setting] = str;
|
||||||
|
loggerService.LogDebug($"Resetting value for {setting.InternalName} to '{str}'");
|
||||||
|
}
|
||||||
|
|
||||||
|
ApplyInstalledModChanges();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
protected override void DisposeInternal()
|
||||||
|
{
|
||||||
|
NewValuesCache.Clear();
|
||||||
|
_modCategoryDisplayGroup?.Parent.RemoveChild(_modCategoryDisplayGroup);
|
||||||
|
_settingsDisplayGroup?.Parent.RemoveChild(_settingsDisplayGroup);
|
||||||
|
_modCategoryDisplayGroup = null;
|
||||||
|
_settingsDisplayGroup = null;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void ApplyInstalledModChanges()
|
||||||
|
{
|
||||||
|
foreach (var kvp in NewValuesCache)
|
||||||
|
{
|
||||||
|
if (kvp.Key.IsDisposed)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
var success = kvp.Key.TrySetSerializedValue(kvp.Value);
|
||||||
|
if (success)
|
||||||
|
{
|
||||||
|
ConfigService.SaveConfigValue(kvp.Key);
|
||||||
|
_loggerService.LogDebug($"Applied save value for {kvp.Key.InternalName} of {kvp.Value.ToString()}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
NewValuesCache.Clear();
|
||||||
|
OnApplyInstalledModsChanges?.Invoke();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Xml.Linq;
|
||||||
|
using Barotrauma.Extensions;
|
||||||
|
using Barotrauma.LuaCs.Data;
|
||||||
|
using Microsoft.Xna.Framework;
|
||||||
|
using OneOf;
|
||||||
|
|
||||||
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
|
internal abstract class ModsSettingsMenuBase : IDisposable
|
||||||
|
{
|
||||||
|
public GUIFrame ContentFrame { get; private set; }
|
||||||
|
protected IPackageManagementService PackageManagementService { get; private set; }
|
||||||
|
protected IConfigService ConfigService { get; private set; }
|
||||||
|
protected SettingsMenu SettingsMenuInstance { get; private set; }
|
||||||
|
protected readonly ConcurrentDictionary<ISettingBase, OneOf<string, XElement>> NewValuesCache = new();
|
||||||
|
|
||||||
|
protected ModsSettingsMenuBase(GUIFrame contentFrame,
|
||||||
|
IPackageManagementService packageManagementService,
|
||||||
|
IConfigService configService, SettingsMenu settingsMenuInstance)
|
||||||
|
{
|
||||||
|
ContentFrame = contentFrame;
|
||||||
|
PackageManagementService = packageManagementService;
|
||||||
|
ConfigService = configService;
|
||||||
|
SettingsMenuInstance = settingsMenuInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected abstract void DisposeInternal();
|
||||||
|
public abstract void ApplyInstalledModChanges();
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
DisposeInternal();
|
||||||
|
ContentFrame?.Parent.RemoveChild(ContentFrame);
|
||||||
|
SettingsMenuInstance = null;
|
||||||
|
ContentFrame = null;
|
||||||
|
PackageManagementService = null;
|
||||||
|
ConfigService = null;
|
||||||
|
NewValuesCache.Clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,125 @@
|
|||||||
|
using System;
|
||||||
|
using System.Linq;
|
||||||
|
using Barotrauma.Extensions;
|
||||||
|
using HarmonyLib;
|
||||||
|
using Microsoft.Xna.Framework;
|
||||||
|
|
||||||
|
namespace Barotrauma.LuaCs;
|
||||||
|
|
||||||
|
public class SettingsMenuSystem : ISettingsMenuSystem
|
||||||
|
{
|
||||||
|
|
||||||
|
private ModsControlsSettingsMenu _controlsMenuInstance;
|
||||||
|
private ModsGameplaySettingsMenu _gameplayMenuInstance;
|
||||||
|
private GUIFrame _gameplayContentFrame;
|
||||||
|
private GUIFrame _controlsContentFrame;
|
||||||
|
private SettingsMenu _settingsMenuInstance;
|
||||||
|
|
||||||
|
private readonly Harmony _harmony;
|
||||||
|
private readonly IPackageManagementService _packageManagementService;
|
||||||
|
private readonly IConfigService _configService;
|
||||||
|
private readonly ILoggerService _loggerService;
|
||||||
|
private static SettingsMenuSystem SystemInstance;
|
||||||
|
|
||||||
|
public SettingsMenuSystem(IPackageManagementService packageManagementService, IConfigService configService, ILoggerService loggerService)
|
||||||
|
{
|
||||||
|
_packageManagementService = packageManagementService;
|
||||||
|
_configService = configService;
|
||||||
|
_loggerService = loggerService;
|
||||||
|
SystemInstance = this;
|
||||||
|
_harmony = Harmony.CreateAndPatchAll(typeof(SettingsMenuSystem));
|
||||||
|
}
|
||||||
|
|
||||||
|
[HarmonyPatch(typeof(SettingsMenu), "CreateModsTab"), HarmonyPostfix]
|
||||||
|
private static void SettingsMenu_CreateModsTab_Post(SettingsMenu __instance)
|
||||||
|
{
|
||||||
|
SystemInstance._settingsMenuInstance = __instance;
|
||||||
|
SystemInstance.CreateSettingsMenu(__instance);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CreateSettingsMenu(SettingsMenu __instance)
|
||||||
|
{
|
||||||
|
DisposeMenuFrames();
|
||||||
|
|
||||||
|
var tabCount = Enum.GetValues<SettingsMenu.Tab>().Length;
|
||||||
|
var tabGameplayIndex = (SettingsMenu.Tab)tabCount;
|
||||||
|
var tabControlsIndex = (SettingsMenu.Tab)tabCount+1;
|
||||||
|
|
||||||
|
_gameplayContentFrame = CreateNewContentTab(tabGameplayIndex, __instance,
|
||||||
|
GUIStyle.ComponentStyles.ContainsKey("SettingsMenuTab.LuaCsSettings") ? "SettingsMenuTab.LuaCsSettings" : "SettingsMenuTab.Mods",
|
||||||
|
"LuaCsForBarotrauma.SettingsMenu.ModGameplayButton");
|
||||||
|
/*_controlsContentFrame = CreateNewContentTab(tabControlsIndex, __instance,
|
||||||
|
"SettingsMenuTab.Controls", "LuaCsForBarotrauma.SettingsMenu.ModControlsButton");
|
||||||
|
*/
|
||||||
|
|
||||||
|
_gameplayMenuInstance = new ModsGameplaySettingsMenu(_gameplayContentFrame, _packageManagementService, _configService, _loggerService, __instance);
|
||||||
|
//_controlsMenuInstance = new ModsControlsSettingsMenu(_controlsContentFrame, _packageManagementService, _configService, __instance);
|
||||||
|
}
|
||||||
|
|
||||||
|
private GUIFrame CreateNewContentTab(SettingsMenu.Tab tab, SettingsMenu settingsMenuInstance, string settingsMenuTabName, string settingMenuHoverTextIdent)
|
||||||
|
{
|
||||||
|
if (settingsMenuInstance.tabContents.TryGetValue(tab, out (GUIButton Button, GUIFrame Content) tabContent))
|
||||||
|
{
|
||||||
|
return tabContent.Content;
|
||||||
|
}
|
||||||
|
|
||||||
|
var contentFr = new GUIFrame(new RectTransform(Vector2.One * 0.95f, settingsMenuInstance.contentFrame.RectTransform, Anchor.Center, Pivot.Center), style: null);
|
||||||
|
|
||||||
|
var button = new GUIButton(new RectTransform(Vector2.One, settingsMenuInstance.tabber.RectTransform,
|
||||||
|
Anchor.TopLeft, Pivot.TopLeft, scaleBasis: ScaleBasis.Smallest), "", style: settingsMenuTabName)
|
||||||
|
{
|
||||||
|
ToolTip = TextManager.Get(settingMenuHoverTextIdent),
|
||||||
|
OnClicked = (b, _) =>
|
||||||
|
{
|
||||||
|
settingsMenuInstance.SelectTab(tab);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
button.RectTransform.MaxSize = RectTransform.MaxPoint;
|
||||||
|
button.Children.ForEach(c => c.RectTransform.MaxSize = RectTransform.MaxPoint);
|
||||||
|
|
||||||
|
settingsMenuInstance.tabContents.Add(tab, (button, contentFr));
|
||||||
|
|
||||||
|
return contentFr;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
[HarmonyPatch(typeof(SettingsMenu), nameof(SettingsMenu.ApplyInstalledModChanges)), HarmonyPostfix]
|
||||||
|
private static void SettingsMenu_ApplyInstalledModChanges_Post()
|
||||||
|
{
|
||||||
|
SystemInstance._gameplayMenuInstance?.ApplyInstalledModChanges();
|
||||||
|
SystemInstance._controlsMenuInstance?.ApplyInstalledModChanges();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DisposeMenuFrames()
|
||||||
|
{
|
||||||
|
_controlsMenuInstance?.Dispose();
|
||||||
|
_gameplayMenuInstance?.Dispose();
|
||||||
|
_controlsMenuInstance = null;
|
||||||
|
_gameplayMenuInstance = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
#region DISPOSAL
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
if (!ModUtils.Threading.CheckIfClearAndSetBool(ref _isDisposed))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
DisposeMenuFrames();
|
||||||
|
GC.SuppressFinalize(this);
|
||||||
|
}
|
||||||
|
private int _isDisposed = 0;
|
||||||
|
public bool IsDisposed
|
||||||
|
{
|
||||||
|
get => ModUtils.Threading.GetBool(ref _isDisposed);
|
||||||
|
private set => ModUtils.Threading.SetBool(ref _isDisposed, value);
|
||||||
|
}
|
||||||
|
public FluentResults.Result Reset()
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
@@ -16,15 +16,17 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
public readonly UInt32 DecalId;
|
public readonly UInt32 DecalId;
|
||||||
public readonly int SpriteIndex;
|
public readonly int SpriteIndex;
|
||||||
public Vector2 NormalizedPos;
|
public readonly Vector2 NormalizedPos;
|
||||||
public readonly float Scale;
|
public readonly float Scale;
|
||||||
|
public readonly float DecalAlpha;
|
||||||
|
|
||||||
public RemoteDecal(UInt32 decalId, int spriteIndex, Vector2 normalizedPos, float scale)
|
public RemoteDecal(UInt32 decalId, int spriteIndex, Vector2 normalizedPos, float scale, float decalAlpha)
|
||||||
{
|
{
|
||||||
DecalId = decalId;
|
DecalId = decalId;
|
||||||
SpriteIndex = spriteIndex;
|
SpriteIndex = spriteIndex;
|
||||||
NormalizedPos = normalizedPos;
|
NormalizedPos = normalizedPos;
|
||||||
Scale = scale;
|
Scale = scale;
|
||||||
|
DecalAlpha = decalAlpha;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -696,7 +698,7 @@ namespace Barotrauma
|
|||||||
var decal = decalEventData.Decal;
|
var decal = decalEventData.Decal;
|
||||||
int decalIndex = decals.IndexOf(decal);
|
int decalIndex = decals.IndexOf(decal);
|
||||||
msg.WriteByte((byte)(decalIndex < 0 ? 255 : decalIndex));
|
msg.WriteByte((byte)(decalIndex < 0 ? 255 : decalIndex));
|
||||||
msg.WriteRangedSingle(decal.BaseAlpha, 0.0f, 1.0f, 8);
|
msg.WriteRangedSingle(decal.BaseAlpha, 0f, 1f, 8);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new Exception($"Malformed hull event: did not expect {eventData.GetType().Name}");
|
throw new Exception($"Malformed hull event: did not expect {eventData.GetType().Name}");
|
||||||
@@ -752,7 +754,9 @@ namespace Barotrauma
|
|||||||
float normalizedXPos = msg.ReadRangedSingle(0.0f, 1.0f, 8);
|
float normalizedXPos = msg.ReadRangedSingle(0.0f, 1.0f, 8);
|
||||||
float normalizedYPos = msg.ReadRangedSingle(0.0f, 1.0f, 8);
|
float normalizedYPos = msg.ReadRangedSingle(0.0f, 1.0f, 8);
|
||||||
float decalScale = msg.ReadRangedSingle(0.0f, 2.0f, 12);
|
float decalScale = msg.ReadRangedSingle(0.0f, 2.0f, 12);
|
||||||
remoteDecals.Add(new RemoteDecal(decalId, spriteIndex, new Vector2(normalizedXPos, normalizedYPos), decalScale));
|
float decalAlpha = msg.ReadRangedSingle(0f, 1f, 8);
|
||||||
|
|
||||||
|
remoteDecals.Add(new RemoteDecal(decalId, spriteIndex, new Vector2(normalizedXPos, normalizedYPos), decalScale, decalAlpha));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case EventType.BallastFlora:
|
case EventType.BallastFlora:
|
||||||
@@ -804,7 +808,8 @@ namespace Barotrauma
|
|||||||
decalPosX += Submarine.Position.X;
|
decalPosX += Submarine.Position.X;
|
||||||
decalPosY += Submarine.Position.Y;
|
decalPosY += Submarine.Position.Y;
|
||||||
}
|
}
|
||||||
AddDecal(remoteDecal.DecalId, new Vector2(decalPosX, decalPosY), remoteDecal.Scale, isNetworkEvent: true, spriteIndex: remoteDecal.SpriteIndex);
|
Decal decal = AddDecal(remoteDecal.DecalId, new Vector2(decalPosX, decalPosY), remoteDecal.Scale, isNetworkEvent: true, spriteIndex: remoteDecal.SpriteIndex);
|
||||||
|
decal.BaseAlpha = remoteDecal.DecalAlpha;
|
||||||
}
|
}
|
||||||
remoteDecals.Clear();
|
remoteDecals.Clear();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -296,13 +296,9 @@ namespace Barotrauma.Lights
|
|||||||
|
|
||||||
light.Priority = lightPriority(range, light);
|
light.Priority = lightPriority(range, light);
|
||||||
|
|
||||||
int i = 0;
|
activeLights.Add(light);
|
||||||
while (i < activeLights.Count && light.Priority < activeLights[i].Priority)
|
|
||||||
{
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
activeLights.Insert(i, light);
|
|
||||||
}
|
}
|
||||||
|
activeLights.Sort(static (a, b) => b.Priority.CompareTo(a.Priority));
|
||||||
ActiveLightCount = activeLights.Count;
|
ActiveLightCount = activeLights.Count;
|
||||||
|
|
||||||
float lightPriority(float range, LightSource light)
|
float lightPriority(float range, LightSource light)
|
||||||
@@ -332,7 +328,7 @@ namespace Barotrauma.Lights
|
|||||||
activeLights.Remove(activeShadowCastingLights[i]);
|
activeLights.Remove(activeShadowCastingLights[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
activeLights.Sort((l1, l2) => l1.LastRecalculationTime.CompareTo(l2.LastRecalculationTime));
|
activeLights.Sort(static (l1, l2) => l1.LastRecalculationTime.CompareTo(l2.LastRecalculationTime));
|
||||||
|
|
||||||
//draw light sprites attached to characters
|
//draw light sprites attached to characters
|
||||||
//render into a separate rendertarget using alpha blending (instead of on top of everything else with alpha blending)
|
//render into a separate rendertarget using alpha blending (instead of on top of everything else with alpha blending)
|
||||||
|
|||||||
@@ -50,8 +50,14 @@ namespace Barotrauma.Lights
|
|||||||
[Serialize("0, 0", IsPropertySaveable.Yes), Editable(ValueStep = 1, DecimalCount = 1, MinValueFloat = -1000f, MaxValueFloat = 1000f)]
|
[Serialize("0, 0", IsPropertySaveable.Yes), Editable(ValueStep = 1, DecimalCount = 1, MinValueFloat = -1000f, MaxValueFloat = 1000f)]
|
||||||
public Vector2 Offset { get; set; }
|
public Vector2 Offset { get; set; }
|
||||||
|
|
||||||
|
public float RotationRad { get; private set; }
|
||||||
|
|
||||||
[Serialize(0f, IsPropertySaveable.Yes), Editable(MinValueFloat = -360, MaxValueFloat = 360, ValueStep = 1, DecimalCount = 0)]
|
[Serialize(0f, IsPropertySaveable.Yes), Editable(MinValueFloat = -360, MaxValueFloat = 360, ValueStep = 1, DecimalCount = 0)]
|
||||||
public float Rotation { get; set; }
|
public float Rotation
|
||||||
|
{
|
||||||
|
get => MathHelper.ToDegrees(RotationRad);
|
||||||
|
set => RotationRad = MathHelper.ToRadians(value);
|
||||||
|
}
|
||||||
|
|
||||||
[Serialize(false, IsPropertySaveable.Yes, "Directional lights only shine in \"one direction\", meaning no shadows are cast behind them."+
|
[Serialize(false, IsPropertySaveable.Yes, "Directional lights only shine in \"one direction\", meaning no shadows are cast behind them."+
|
||||||
" Note that this does not affect how the light texture is drawn: if you want something like a conical spotlight, you should use an appropriate texture for that.")]
|
" Note that this does not affect how the light texture is drawn: if you want something like a conical spotlight, you should use an appropriate texture for that.")]
|
||||||
@@ -314,6 +320,10 @@ namespace Barotrauma.Lights
|
|||||||
|
|
||||||
private float prevCalculatedRotation;
|
private float prevCalculatedRotation;
|
||||||
private float rotation;
|
private float rotation;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Current rotation in radians. Note that LightSourceParams.RotationRad also affects the final rotation of the light.
|
||||||
|
/// </summary>
|
||||||
public float Rotation
|
public float Rotation
|
||||||
{
|
{
|
||||||
get { return rotation; }
|
get { return rotation; }
|
||||||
@@ -322,7 +332,7 @@ namespace Barotrauma.Lights
|
|||||||
if (Math.Abs(value - rotation) < 0.001f) { return; }
|
if (Math.Abs(value - rotation) < 0.001f) { return; }
|
||||||
rotation = value;
|
rotation = value;
|
||||||
|
|
||||||
dir = new Vector2(MathF.Cos(rotation), -MathF.Sin(rotation));
|
RefreshDirection();
|
||||||
|
|
||||||
if (Math.Abs(rotation - prevCalculatedRotation) < RotationRecalculationThreshold && vertices != null)
|
if (Math.Abs(rotation - prevCalculatedRotation) < RotationRecalculationThreshold && vertices != null)
|
||||||
{
|
{
|
||||||
@@ -486,6 +496,9 @@ namespace Barotrauma.Lights
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//make sure the rotation defined in the parameters is taken into account
|
||||||
|
RefreshDirection();
|
||||||
|
NeedsRecalculation = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public LightSource(LightSourceParams lightSourceParams)
|
public LightSource(LightSourceParams lightSourceParams)
|
||||||
@@ -497,6 +510,9 @@ namespace Barotrauma.Lights
|
|||||||
{
|
{
|
||||||
DeformableLightSprite = new DeformableSprite(lightSourceParams.DeformableLightSpriteElement, invert: true);
|
DeformableLightSprite = new DeformableSprite(lightSourceParams.DeformableLightSpriteElement, invert: true);
|
||||||
}
|
}
|
||||||
|
//make sure the rotation defined in the parameters is taken into account
|
||||||
|
RefreshDirection();
|
||||||
|
NeedsRecalculation = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public LightSource(Vector2 position, float range, Color color, Submarine submarine, bool addLight=true)
|
public LightSource(Vector2 position, float range, Color color, Submarine submarine, bool addLight=true)
|
||||||
@@ -511,6 +527,14 @@ namespace Barotrauma.Lights
|
|||||||
if (addLight) { GameMain.LightManager.AddLight(this); }
|
if (addLight) { GameMain.LightManager.AddLight(this); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Refresh the direction vector of the light (which is used for calculating shadows) based on the rotation and <see cref="LightSourceParams.RotationRad"/>
|
||||||
|
/// </summary>
|
||||||
|
private void RefreshDirection()
|
||||||
|
{
|
||||||
|
dir = new Vector2(MathF.Cos(rotation - LightSourceParams.RotationRad), -MathF.Sin(rotation - LightSourceParams.RotationRad));
|
||||||
|
}
|
||||||
|
|
||||||
public void Update(float time)
|
public void Update(float time)
|
||||||
{
|
{
|
||||||
float brightness = 1.0f;
|
float brightness = 1.0f;
|
||||||
@@ -773,9 +797,6 @@ namespace Barotrauma.Lights
|
|||||||
float boundsExtended = TextureRange;
|
float boundsExtended = TextureRange;
|
||||||
if (OverrideLightTexture != null)
|
if (OverrideLightTexture != null)
|
||||||
{
|
{
|
||||||
float cosAngle = (float)Math.Cos(rotation);
|
|
||||||
float sinAngle = -(float)Math.Sin(rotation);
|
|
||||||
|
|
||||||
var overrideTextureDims = new Vector2(OverrideLightTexture.SourceRect.Width, OverrideLightTexture.SourceRect.Height);
|
var overrideTextureDims = new Vector2(OverrideLightTexture.SourceRect.Width, OverrideLightTexture.SourceRect.Height);
|
||||||
|
|
||||||
Vector2 origin = OverrideLightTextureOrigin;
|
Vector2 origin = OverrideLightTextureOrigin;
|
||||||
@@ -790,8 +811,11 @@ namespace Barotrauma.Lights
|
|||||||
|
|
||||||
origin *= TextureRange;
|
origin *= TextureRange;
|
||||||
|
|
||||||
drawOffset.X = -origin.X * cosAngle - origin.Y * sinAngle;
|
//rotate the origin based on the direction
|
||||||
drawOffset.Y = origin.X * sinAngle + origin.Y * cosAngle;
|
float cos = dir.X;
|
||||||
|
float sin = dir.Y;
|
||||||
|
drawOffset.X = -origin.X * cos - origin.Y * sin;
|
||||||
|
drawOffset.Y = origin.X * sin + origin.Y * cos;
|
||||||
}
|
}
|
||||||
|
|
||||||
//add a square-shaped boundary to make sure we've got something to construct the triangles from
|
//add a square-shaped boundary to make sure we've got something to construct the triangles from
|
||||||
@@ -1536,7 +1560,6 @@ namespace Barotrauma.Lights
|
|||||||
Vector2 offset = ParentSub == null ? Vector2.Zero : ParentSub.DrawPosition;
|
Vector2 offset = ParentSub == null ? Vector2.Zero : ParentSub.DrawPosition;
|
||||||
lightEffect.World =
|
lightEffect.World =
|
||||||
Matrix.CreateTranslation(-new Vector3(position, 0.0f)) *
|
Matrix.CreateTranslation(-new Vector3(position, 0.0f)) *
|
||||||
Matrix.CreateRotationZ(MathHelper.ToRadians(LightSourceParams.Rotation)) *
|
|
||||||
Matrix.CreateTranslation(new Vector3(position + offset + translateVertices, 0.0f)) *
|
Matrix.CreateTranslation(new Vector3(position + offset + translateVertices, 0.0f)) *
|
||||||
transform;
|
transform;
|
||||||
|
|
||||||
|
|||||||
@@ -193,7 +193,12 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
CanTakeKeyBoardFocus = false
|
CanTakeKeyBoardFocus = false
|
||||||
};
|
};
|
||||||
var editor = new SerializableEntityEditor(listBox.Content.RectTransform, this, inGame, showName: true, titleFont: GUIStyle.LargeFont) { UserData = this };
|
var editor = new SerializableEntityEditor(listBox.Content.RectTransform, this, inGame, showName: true,
|
||||||
|
titleFont: GUIStyle.LargeFont,
|
||||||
|
dimOutDefaultValues: false)
|
||||||
|
{
|
||||||
|
UserData = this
|
||||||
|
};
|
||||||
|
|
||||||
if (editor.Fields.TryGetValue(nameof(Scale).ToIdentifier(), out GUIComponent[] scaleFields) &&
|
if (editor.Fields.TryGetValue(nameof(Scale).ToIdentifier(), out GUIComponent[] scaleFields) &&
|
||||||
scaleFields.FirstOrDefault() is GUINumberInput scaleInput)
|
scaleFields.FirstOrDefault() is GUINumberInput scaleInput)
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using Barotrauma.Extensions;
|
using Barotrauma.Extensions;
|
||||||
using Barotrauma.IO;
|
using Barotrauma.IO;
|
||||||
using Barotrauma.Items.Components;
|
using Barotrauma.Items.Components;
|
||||||
|
using Barotrauma.LuaCs.Events;
|
||||||
using Barotrauma.Steam;
|
using Barotrauma.Steam;
|
||||||
using Microsoft.Xna.Framework;
|
using Microsoft.Xna.Framework;
|
||||||
using Microsoft.Xna.Framework.Input;
|
using Microsoft.Xna.Framework.Input;
|
||||||
@@ -284,7 +285,7 @@ namespace Barotrauma.Networking
|
|||||||
|
|
||||||
otherClients = new List<Client>();
|
otherClients = new List<Client>();
|
||||||
|
|
||||||
ServerSettings = new ServerSettings(this, serverName, 0, 0, 0, false, false);
|
ServerSettings = new ServerSettings(this, serverName, 0, 0, 0, false, false, System.Net.IPAddress.Any);
|
||||||
Voting = new Voting();
|
Voting = new Voting();
|
||||||
|
|
||||||
serverEndpoints = endpoints;
|
serverEndpoints = endpoints;
|
||||||
@@ -3002,6 +3003,10 @@ namespace Barotrauma.Networking
|
|||||||
|
|
||||||
public override void AddChatMessage(ChatMessage message)
|
public override void AddChatMessage(ChatMessage message)
|
||||||
{
|
{
|
||||||
|
bool? should = null;
|
||||||
|
LuaCsSetup.Instance.EventService.PublishEvent<IEventChatMessage>(x => should = x.OnChatMessage(message.Text, message.SenderClient, message.Type, message) ?? should);
|
||||||
|
if (should != null && should.Value) { return; }
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(message.Text)) { return; }
|
if (string.IsNullOrEmpty(message.Text)) { return; }
|
||||||
if (message.SenderCharacter is { IsDead: false } sender)
|
if (message.SenderCharacter is { IsDead: false } sender)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -30,6 +30,13 @@ namespace Barotrauma.Networking
|
|||||||
{
|
{
|
||||||
DualStack = GameSettings.CurrentConfig.UseDualModeSockets
|
DualStack = GameSettings.CurrentConfig.UseDualModeSockets
|
||||||
};
|
};
|
||||||
|
if (NetConfig.UseLenientHandshake)
|
||||||
|
{
|
||||||
|
// More lenient timeouts for local testing, so the server would start even without perfect conditions
|
||||||
|
netPeerConfiguration.ConnectionTimeout = 60.0f;
|
||||||
|
netPeerConfiguration.ResendHandshakeInterval = 5.0f;
|
||||||
|
netPeerConfiguration.MaximumHandshakeAttempts = 20;
|
||||||
|
}
|
||||||
if (endpoint.NetEndpoint.Address.AddressFamily == AddressFamily.InterNetworkV6)
|
if (endpoint.NetEndpoint.Address.AddressFamily == AddressFamily.InterNetworkV6)
|
||||||
{
|
{
|
||||||
netPeerConfiguration.LocalAddress = System.Net.IPAddress.IPv6Any;
|
netPeerConfiguration.LocalAddress = System.Net.IPAddress.IPv6Any;
|
||||||
|
|||||||
@@ -222,7 +222,7 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class PlayerInput
|
public class PlayerInput
|
||||||
{
|
{
|
||||||
static MouseState mouseState, oldMouseState;
|
static MouseState mouseState, oldMouseState;
|
||||||
static MouseState latestMouseState; //the absolute latest state, do NOT use for player interaction
|
static MouseState latestMouseState; //the absolute latest state, do NOT use for player interaction
|
||||||
|
|||||||
@@ -95,6 +95,7 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
GameMain.GameSession?.AddToGUIUpdateList();
|
GameMain.GameSession?.AddToGUIUpdateList();
|
||||||
Character.AddAllToGUIUpdateList();
|
Character.AddAllToGUIUpdateList();
|
||||||
|
base.AddToGUIUpdateList();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Draw(double deltaTime, GraphicsDevice graphics, SpriteBatch spriteBatch)
|
public override void Draw(double deltaTime, GraphicsDevice graphics, SpriteBatch spriteBatch)
|
||||||
@@ -351,7 +352,7 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
Level.Loaded.DrawBack(graphics, spriteBatch, cam);
|
Level.Loaded.DrawBack(graphics, spriteBatch, cam);
|
||||||
}
|
}
|
||||||
else if (GameMain.GameSession.GameMode is TestGameMode testMode)
|
else if (GameMain.GameSession?.GameMode is TestGameMode testMode)
|
||||||
{
|
{
|
||||||
graphics.Clear(testMode.BackgroundParams.BackgroundColor);
|
graphics.Clear(testMode.BackgroundParams.BackgroundColor);
|
||||||
|
|
||||||
|
|||||||
@@ -49,6 +49,9 @@ namespace Barotrauma
|
|||||||
private GUITextBox serverNameBox, passwordBox, maxPlayersBox;
|
private GUITextBox serverNameBox, passwordBox, maxPlayersBox;
|
||||||
private GUITickBox isPublicBox, wrongPasswordBanBox, karmaBox;
|
private GUITickBox isPublicBox, wrongPasswordBanBox, karmaBox;
|
||||||
private GUIDropDown languageDropdown, serverExecutableDropdown;
|
private GUIDropDown languageDropdown, serverExecutableDropdown;
|
||||||
|
#if DEBUG
|
||||||
|
private GUITickBox lenientHandshakeBox;
|
||||||
|
#endif
|
||||||
private readonly GUIButton joinServerButton, hostServerButton;
|
private readonly GUIButton joinServerButton, hostServerButton;
|
||||||
|
|
||||||
private readonly GUIFrame modsButtonContainer;
|
private readonly GUIFrame modsButtonContainer;
|
||||||
@@ -531,6 +534,7 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
var minButtonSize = new Point(120, 20);
|
var minButtonSize = new Point(120, 20);
|
||||||
var maxButtonSize = new Point(480, 80);
|
var maxButtonSize = new Point(480, 80);
|
||||||
|
|
||||||
@@ -1024,7 +1028,7 @@ namespace Barotrauma
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
StartServer();
|
StartServer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private IEnumerable<CoroutineStatus> WaitForSubmarineHashCalculations(GUIMessageBox messageBox)
|
private IEnumerable<CoroutineStatus> WaitForSubmarineHashCalculations(GUIMessageBox messageBox)
|
||||||
@@ -1075,7 +1079,7 @@ namespace Barotrauma
|
|||||||
"-public", isPublicBox.Selected.ToString(),
|
"-public", isPublicBox.Selected.ToString(),
|
||||||
"-playstyle", ((PlayStyle)playstyleBanner.UserData).ToString(),
|
"-playstyle", ((PlayStyle)playstyleBanner.UserData).ToString(),
|
||||||
"-banafterwrongpassword", wrongPasswordBanBox.Selected.ToString(),
|
"-banafterwrongpassword", wrongPasswordBanBox.Selected.ToString(),
|
||||||
"-karmaenabled", (!karmaBox.Selected).ToString(),
|
"-karmaenabled", (karmaBox.Selected).ToString(),
|
||||||
"-maxplayers", maxPlayersBox.Text,
|
"-maxplayers", maxPlayersBox.Text,
|
||||||
"-language", languageDropdown.SelectedData.ToString()
|
"-language", languageDropdown.SelectedData.ToString()
|
||||||
};
|
};
|
||||||
@@ -1114,6 +1118,13 @@ namespace Barotrauma
|
|||||||
int ownerKey = Math.Max(CryptoRandom.Instance.Next(), 1);
|
int ownerKey = Math.Max(CryptoRandom.Instance.Next(), 1);
|
||||||
arguments.Add("-ownerkey");
|
arguments.Add("-ownerkey");
|
||||||
arguments.Add(ownerKey.ToString());
|
arguments.Add(ownerKey.ToString());
|
||||||
|
#if DEBUG
|
||||||
|
if (lenientHandshakeBox.Selected)
|
||||||
|
{
|
||||||
|
arguments.Add("-lenienthandshake");
|
||||||
|
NetConfig.UseLenientHandshake = true;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
var processInfo = new ProcessStartInfo
|
var processInfo = new ProcessStartInfo
|
||||||
{
|
{
|
||||||
@@ -1368,7 +1379,7 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
int maxPlayers = Math.Clamp(maxPlayersElement, min: 1, max: NetConfig.MaxPlayers);
|
int maxPlayers = Math.Clamp(maxPlayersElement, min: 1, max: NetConfig.MaxPlayers);
|
||||||
|
|
||||||
var karmaEnabled = serverSettings.GetAttributeBool("karmaenabled", true);
|
var karmaEnabled = serverSettings.GetAttributeBool("karmaenabled", false);
|
||||||
var selectedPlayStyle = serverSettings.GetAttributeEnum("playstyle", PlayStyle.Casual);
|
var selectedPlayStyle = serverSettings.GetAttributeEnum("playstyle", PlayStyle.Casual);
|
||||||
|
|
||||||
Vector2 textLabelSize = new Vector2(1.0f, 0.05f);
|
Vector2 textLabelSize = new Vector2(1.0f, 0.05f);
|
||||||
@@ -1579,10 +1590,18 @@ namespace Barotrauma
|
|||||||
|
|
||||||
karmaBox = new GUITickBox(new RectTransform(new Vector2(0.5f, 1.0f), tickboxAreaLower.RectTransform), TextManager.Get("HostServerKarmaSetting"))
|
karmaBox = new GUITickBox(new RectTransform(new Vector2(0.5f, 1.0f), tickboxAreaLower.RectTransform), TextManager.Get("HostServerKarmaSetting"))
|
||||||
{
|
{
|
||||||
Selected = !karmaEnabled,
|
Selected = karmaEnabled,
|
||||||
ToolTip = TextManager.Get("hostserverkarmasettingtooltip")
|
ToolTip = TextManager.Get("hostserverkarmasettingtooltip")
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if DEBUG
|
||||||
|
lenientHandshakeBox = new GUITickBox(new RectTransform(new Vector2(0.5f, 1.0f), tickboxAreaLower.RectTransform), "DEBUG: Lenient server startup timeouts")
|
||||||
|
{
|
||||||
|
Selected = true,
|
||||||
|
ToolTip = "Start with more lenient Lidgren handshake timeouts. The server is more likely to start even when running multiple instances on the same machine under heavy load."
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
tickboxAreaLower.RectTransform.IsFixedSize = true;
|
tickboxAreaLower.RectTransform.IsFixedSize = true;
|
||||||
|
|
||||||
//spacing
|
//spacing
|
||||||
@@ -1671,8 +1690,8 @@ namespace Barotrauma
|
|||||||
if (string.IsNullOrEmpty(remoteContentUrl)) { return; }
|
if (string.IsNullOrEmpty(remoteContentUrl)) { return; }
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var client = new RestClient(remoteContentUrl);
|
var client = RestFactory.CreateClient(remoteContentUrl);
|
||||||
var request = new RestRequest("MenuContent.xml", Method.GET);
|
var request = RestFactory.CreateRequest("MenuContent.xml");
|
||||||
TaskPool.Add("RequestMainMenuRemoteContent", client.ExecuteAsync(request),
|
TaskPool.Add("RequestMainMenuRemoteContent", client.ExecuteAsync(request),
|
||||||
RemoteContentReceived);
|
RemoteContentReceived);
|
||||||
}
|
}
|
||||||
@@ -1693,12 +1712,17 @@ namespace Barotrauma
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (!t.TryGetResult(out IRestResponse remoteContentResponse)) { throw new Exception("Task did not return a valid result"); }
|
if (!t.TryGetResult(out IRestResponse remoteContentResponse)) { throw new Exception("Task did not return a valid result"); }
|
||||||
|
if (remoteContentResponse.ErrorException != null)
|
||||||
|
{
|
||||||
|
DebugConsole.AddWarning($"Connection error: Failed to fetch remote main menu content " +
|
||||||
|
$"({remoteContentResponse.ErrorException.Message}).");
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (remoteContentResponse.StatusCode != HttpStatusCode.OK)
|
if (remoteContentResponse.StatusCode != HttpStatusCode.OK)
|
||||||
{
|
{
|
||||||
DebugConsole.AddWarning(
|
DebugConsole.AddWarning(
|
||||||
"Failed to receive remote main menu content. " +
|
"Failed to receive remote main menu content. " +
|
||||||
"There may be an issue with your internet connection, or the master server might be temporarily unavailable " +
|
$"The master server might be temporarily unavailable (HTTP error: {remoteContentResponse.StatusCode})");
|
||||||
$"(error code: {remoteContentResponse.StatusCode})");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
string xml = remoteContentResponse.Content;
|
string xml = remoteContentResponse.Content;
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ using System.Diagnostics.CodeAnalysis;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Barotrauma.Extensions;
|
using Barotrauma.Extensions;
|
||||||
using Barotrauma.IO;
|
using Barotrauma.IO;
|
||||||
|
using Barotrauma.LuaCs.Events;
|
||||||
using Barotrauma.Networking;
|
using Barotrauma.Networking;
|
||||||
using Barotrauma.Steam;
|
using Barotrauma.Steam;
|
||||||
using Microsoft.Xna.Framework;
|
using Microsoft.Xna.Framework;
|
||||||
@@ -365,7 +366,7 @@ namespace Barotrauma
|
|||||||
ContentPackageManager.EnabledPackages.BackUp();
|
ContentPackageManager.EnabledPackages.BackUp();
|
||||||
ContentPackageManager.EnabledPackages.SetCore(corePackage);
|
ContentPackageManager.EnabledPackages.SetCore(corePackage);
|
||||||
ContentPackageManager.EnabledPackages.SetRegular(regularPackages);
|
ContentPackageManager.EnabledPackages.SetRegular(regularPackages);
|
||||||
|
|
||||||
//see if any of the packages we enabled contain subs that we were missing previously, and update their paths
|
//see if any of the packages we enabled contain subs that we were missing previously, and update their paths
|
||||||
foreach (var serverSub in GameMain.Client.ServerSubmarines)
|
foreach (var serverSub in GameMain.Client.ServerSubmarines)
|
||||||
{
|
{
|
||||||
@@ -398,7 +399,7 @@ namespace Barotrauma
|
|||||||
string dir = path.RemoveFromEnd(ModReceiver.Extension, StringComparison.OrdinalIgnoreCase);
|
string dir = path.RemoveFromEnd(ModReceiver.Extension, StringComparison.OrdinalIgnoreCase);
|
||||||
|
|
||||||
SaveUtil.DecompressToDirectory(path, dir);
|
SaveUtil.DecompressToDirectory(path, dir);
|
||||||
var result = ContentPackage.TryLoad(Path.Combine(dir, ContentPackage.FileListFileName));
|
var result = ContentPackage.TryLoad(Path.Combine(dir, ContentPackage.FileListFileName).CleanUpPathCrossPlatform());
|
||||||
|
|
||||||
if (!result.TryUnwrapSuccess(out var newPackage))
|
if (!result.TryUnwrapSuccess(out var newPackage))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ using System.Globalization;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Xml.Linq;
|
using System.Xml.Linq;
|
||||||
|
using Barotrauma.LuaCs.Events;
|
||||||
using Barotrauma.Sounds;
|
using Barotrauma.Sounds;
|
||||||
|
|
||||||
namespace Barotrauma
|
namespace Barotrauma
|
||||||
@@ -733,6 +734,8 @@ namespace Barotrauma
|
|||||||
AutoHideScrollBar = false,
|
AutoHideScrollBar = false,
|
||||||
OnSelected = (component, userdata) =>
|
OnSelected = (component, userdata) =>
|
||||||
{
|
{
|
||||||
|
//if we're clicking on a checkbox (toggle visibility) on the list, don't select the entry on the list
|
||||||
|
if (GUI.MouseOn is GUITickBox) { return false; }
|
||||||
//toggling selection is not how listboxes normally work, need to do that manually here
|
//toggling selection is not how listboxes normally work, need to do that manually here
|
||||||
SoundPlayer.PlayUISound(GUISoundType.Select);
|
SoundPlayer.PlayUISound(GUISoundType.Select);
|
||||||
if (layerList.SelectedData == userdata)
|
if (layerList.SelectedData == userdata)
|
||||||
@@ -3253,6 +3256,20 @@ namespace Barotrauma
|
|||||||
= new GUITextBox(new RectTransform((1.0f, 0.15f), saveInPackageLayout.RectTransform),
|
= new GUITextBox(new RectTransform((1.0f, 0.15f), saveInPackageLayout.RectTransform),
|
||||||
createClearButton: true);
|
createClearButton: true);
|
||||||
|
|
||||||
|
packToSaveInFilter.OnTextChanged += (GUITextBox textBox, string text) =>
|
||||||
|
{
|
||||||
|
|
||||||
|
foreach (GUIComponent child in packageToSaveInList.Content.Children)
|
||||||
|
{
|
||||||
|
child.Visible =
|
||||||
|
// Get the pkgText from below
|
||||||
|
!(child.GetChild<GUILayoutGroup>()?.GetChild<GUITextBlock>() is GUITextBlock textBlock &&
|
||||||
|
!textBlock.Text.Contains(packToSaveInFilter.Text, StringComparison.OrdinalIgnoreCase));
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
GUILayoutGroup addItemToPackageToSaveList(LocalizedString itemText, ContentPackage p)
|
GUILayoutGroup addItemToPackageToSaveList(LocalizedString itemText, ContentPackage p)
|
||||||
{
|
{
|
||||||
var listItem = new GUIFrame(new RectTransform((1.0f, 0.15f), packageToSaveInList.Content.RectTransform),
|
var listItem = new GUIFrame(new RectTransform((1.0f, 0.15f), packageToSaveInList.Content.RectTransform),
|
||||||
@@ -3273,28 +3290,26 @@ namespace Barotrauma
|
|||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ContentPackage ownerPkg = null;
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
//this is a debug-only option so I won't bother submitting it for localization
|
//this is a debug-only option so I won't bother submitting it for localization
|
||||||
var modifyVanillaListItem = addItemToPackageToSaveList("Modify Vanilla content package", ContentPackageManager.VanillaCorePackage);
|
var modifyVanillaListItem = addItemToPackageToSaveList("Modify Vanilla content package", ContentPackageManager.VanillaCorePackage);
|
||||||
var modifyVanillaListIcon = modifyVanillaListItem.GetChild<GUIFrame>();
|
var modifyVanillaListIcon = modifyVanillaListItem.GetChild<GUIFrame>();
|
||||||
GUIStyle.Apply(modifyVanillaListIcon, "WorkshopMenu.EditButton");
|
GUIStyle.Apply(modifyVanillaListIcon, "WorkshopMenu.EditButton");
|
||||||
|
|
||||||
|
if (MainSub?.Info != null && IsVanillaSub(MainSub.Info))
|
||||||
|
{
|
||||||
|
ownerPkg = ContentPackageManager.VanillaCorePackage;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
var newPackageListItem = addItemToPackageToSaveList(TextManager.Get("CreateNewLocalPackage"), null);
|
var newPackageListItem = addItemToPackageToSaveList(TextManager.Get("CreateNewLocalPackage"), null);
|
||||||
var newPackageListIcon = newPackageListItem.GetChild<GUIFrame>();
|
var newPackageListIcon = newPackageListItem.GetChild<GUIFrame>();
|
||||||
var newPackageListText = newPackageListItem.GetChild<GUITextBlock>();
|
var newPackageListText = newPackageListItem.GetChild<GUITextBlock>();
|
||||||
GUIStyle.Apply(newPackageListIcon, "NewContentPackageIcon");
|
GUIStyle.Apply(newPackageListIcon, "NewContentPackageIcon");
|
||||||
new GUICustomComponent(new RectTransform(Vector2.Zero, saveInPackageLayout.RectTransform),
|
|
||||||
onUpdate: (f, component) =>
|
if (ownerPkg == null && MainSub?.Info != null) { ownerPkg = GetLocalPackageThatOwnsSub(MainSub.Info); }
|
||||||
{
|
|
||||||
foreach (GUIComponent contentChild in packageToSaveInList.Content.Children)
|
|
||||||
{
|
|
||||||
contentChild.Visible &= !(contentChild.GetChild<GUILayoutGroup>()?.GetChild<GUITextBlock>() is GUITextBlock tb &&
|
|
||||||
!tb.Text.Contains(packToSaveInFilter.Text, StringComparison.OrdinalIgnoreCase));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
ContentPackage ownerPkg = null;
|
|
||||||
if (MainSub?.Info != null) { ownerPkg = GetLocalPackageThatOwnsSub(MainSub.Info); }
|
|
||||||
foreach (var p in ContentPackageManager.LocalPackages)
|
foreach (var p in ContentPackageManager.LocalPackages)
|
||||||
{
|
{
|
||||||
var packageListItem = addItemToPackageToSaveList(p.Name, p);
|
var packageListItem = addItemToPackageToSaveList(p.Name, p);
|
||||||
@@ -3849,6 +3864,10 @@ namespace Barotrauma
|
|||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.1f), deleteButtonHolder.RectTransform), TextManager.Get("DragAndDropSubmarineTip").Fallback(LocalizedString.EmptyString), textAlignment: Alignment.Center, font: GUIStyle.Font)
|
||||||
|
{
|
||||||
|
Wrap = true
|
||||||
|
};
|
||||||
|
|
||||||
if (AutoSaveInfo?.Root != null)
|
if (AutoSaveInfo?.Root != null)
|
||||||
{
|
{
|
||||||
@@ -4486,6 +4505,7 @@ namespace Barotrauma
|
|||||||
|
|
||||||
public void ReconstructLayers()
|
public void ReconstructLayers()
|
||||||
{
|
{
|
||||||
|
Dictionary<string, LayerData> previousLayers = Layers.ToDictionary();
|
||||||
ClearLayers();
|
ClearLayers();
|
||||||
foreach (MapEntity entity in MapEntity.MapEntityList)
|
foreach (MapEntity entity in MapEntity.MapEntityList)
|
||||||
{
|
{
|
||||||
@@ -4494,6 +4514,13 @@ namespace Barotrauma
|
|||||||
Layers.TryAdd(entity.Layer, new LayerData(!entity.IsLayerHidden));
|
Layers.TryAdd(entity.Layer, new LayerData(!entity.IsLayerHidden));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
foreach ((string layerName, LayerData data) in previousLayers)
|
||||||
|
{
|
||||||
|
if (Layers.ContainsKey(layerName))
|
||||||
|
{
|
||||||
|
Layers[layerName] = data;
|
||||||
|
}
|
||||||
|
}
|
||||||
UpdateLayerPanel();
|
UpdateLayerPanel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ namespace Barotrauma
|
|||||||
public static DateTime NextCommandPush;
|
public static DateTime NextCommandPush;
|
||||||
public static Tuple<SerializableProperty, PropertyCommand> CommandBuffer;
|
public static Tuple<SerializableProperty, PropertyCommand> CommandBuffer;
|
||||||
|
|
||||||
|
private bool dimOutDefaultValues;
|
||||||
|
|
||||||
private bool isReadonly;
|
private bool isReadonly;
|
||||||
public bool Readonly
|
public bool Readonly
|
||||||
{
|
{
|
||||||
@@ -316,16 +318,17 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public SerializableEntityEditor(RectTransform parent, ISerializableEntity entity, bool inGame, bool showName, string style = "", int elementHeight = 24, GUIFont titleFont = null)
|
public SerializableEntityEditor(RectTransform parent, ISerializableEntity entity, bool inGame, bool showName, string style = "", int elementHeight = 24, GUIFont titleFont = null, bool dimOutDefaultValues = true)
|
||||||
: this(parent, entity, inGame ?
|
: this(parent, entity, inGame ?
|
||||||
SerializableProperty.GetProperties<InGameEditable>(entity).Union(SerializableProperty.GetProperties<ConditionallyEditable>(entity).Where(p => p.GetAttribute<ConditionallyEditable>()?.IsEditable(entity) ?? false))
|
SerializableProperty.GetProperties<InGameEditable>(entity).Union(SerializableProperty.GetProperties<ConditionallyEditable>(entity).Where(p => p.GetAttribute<ConditionallyEditable>()?.IsEditable(entity) ?? false))
|
||||||
: SerializableProperty.GetProperties<Editable>(entity).Where(p => p.GetAttribute<ConditionallyEditable>()?.IsEditable(entity) ?? true), showName, style, elementHeight, titleFont)
|
: SerializableProperty.GetProperties<Editable>(entity).Where(p => p.GetAttribute<ConditionallyEditable>()?.IsEditable(entity) ?? true), showName, style, elementHeight, titleFont, dimOutDefaultValues)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public SerializableEntityEditor(RectTransform parent, ISerializableEntity entity, IEnumerable<SerializableProperty> properties, bool showName, string style = "", int elementHeight = 24, GUIFont titleFont = null)
|
public SerializableEntityEditor(RectTransform parent, ISerializableEntity entity, IEnumerable<SerializableProperty> properties, bool showName, string style = "", int elementHeight = 24, GUIFont titleFont = null, bool dimOutDefaultValues = true)
|
||||||
: base(style, new RectTransform(Vector2.One, parent))
|
: base(style, new RectTransform(Vector2.One, parent))
|
||||||
{
|
{
|
||||||
|
this.dimOutDefaultValues = dimOutDefaultValues;
|
||||||
elementHeight = (int)(elementHeight * GUI.Scale);
|
elementHeight = (int)(elementHeight * GUI.Scale);
|
||||||
var tickBoxStyle = GUIStyle.GetComponentStyle("GUITickBox");
|
var tickBoxStyle = GUIStyle.GetComponentStyle("GUITickBox");
|
||||||
var textBoxStyle = GUIStyle.GetComponentStyle("GUITextBox");
|
var textBoxStyle = GUIStyle.GetComponentStyle("GUITextBox");
|
||||||
@@ -523,9 +526,67 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
propertyField = CreateStringField(entity, property, value.ToString(), displayName, toolTip);
|
propertyField = CreateStringField(entity, property, value.ToString(), displayName, toolTip);
|
||||||
}
|
}
|
||||||
|
if (propertyField != null && dimOutDefaultValues)
|
||||||
|
{
|
||||||
|
UpdateTextColors(property, entity, propertyField);
|
||||||
|
}
|
||||||
return propertyField;
|
return propertyField;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void UpdateTextColors(SerializableProperty property, object parentObject, GUIComponent parentElement)
|
||||||
|
{
|
||||||
|
if (!dimOutDefaultValues) { return; }
|
||||||
|
|
||||||
|
bool isSetToDefaultValue = false;
|
||||||
|
object currentValue = property.GetValue(parentObject);
|
||||||
|
foreach (var attribute in property.Attributes.OfType<Serialize>())
|
||||||
|
{
|
||||||
|
if (XMLExtensions.DefaultValueEquals(attribute.DefaultValue, currentValue) ||
|
||||||
|
//treat null and empty strings as identical, because there's no way to differentiate between those in the editor
|
||||||
|
(currentValue == null && attribute.DefaultValue is string defaultValueStr && defaultValueStr.IsNullOrEmpty()))
|
||||||
|
{
|
||||||
|
isSetToDefaultValue = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
foreach (var component in parentElement.GetAllChildren())
|
||||||
|
{
|
||||||
|
UpdateTextColors(component, isSetToDefaultValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UpdateTextColors(GUIComponent component, bool isSetToDefaultValue)
|
||||||
|
{
|
||||||
|
if (!dimOutDefaultValues) { return; }
|
||||||
|
|
||||||
|
if (component is GUINumberInput numberInput)
|
||||||
|
{
|
||||||
|
SetTextColor(numberInput.TextBox.TextBlock);
|
||||||
|
}
|
||||||
|
else if (component is GUIDropDown dropDown)
|
||||||
|
{
|
||||||
|
SetTextColor(dropDown.Button.TextBlock);
|
||||||
|
}
|
||||||
|
else if (component is GUITextBox textBox)
|
||||||
|
{
|
||||||
|
SetTextColor(textBox.TextBlock);
|
||||||
|
}
|
||||||
|
else if (component is GUITextBlock textBlock)
|
||||||
|
{
|
||||||
|
SetTextColor(textBlock);
|
||||||
|
}
|
||||||
|
else if (component is GUITickBox tickBox)
|
||||||
|
{
|
||||||
|
SetTextColor(tickBox.TextBlock);
|
||||||
|
}
|
||||||
|
|
||||||
|
void SetTextColor(GUITextBlock textBlock)
|
||||||
|
{
|
||||||
|
textBlock.TextColor = new Color(textBlock.TextColor, alpha: isSetToDefaultValue ? 0.5f : 1.0f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public GUIComponent CreateBoolField(ISerializableEntity entity, SerializableProperty property, bool value, LocalizedString displayName, LocalizedString toolTip)
|
public GUIComponent CreateBoolField(ISerializableEntity entity, SerializableProperty property, bool value, LocalizedString displayName, LocalizedString toolTip)
|
||||||
{
|
{
|
||||||
var editableAttribute = property.GetAttribute<Editable>();
|
var editableAttribute = property.GetAttribute<Editable>();
|
||||||
@@ -564,6 +625,7 @@ namespace Barotrauma
|
|||||||
tickBox.Selected = propertyValue;
|
tickBox.Selected = propertyValue;
|
||||||
tickBox.Flash(Color.Red);
|
tickBox.Flash(Color.Red);
|
||||||
}
|
}
|
||||||
|
UpdateTextColors(property, entity, tickBox);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -611,6 +673,7 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
TrySendNetworkUpdate(entity, property);
|
TrySendNetworkUpdate(entity, property);
|
||||||
}
|
}
|
||||||
|
UpdateTextColors(property, entity, frame);
|
||||||
};
|
};
|
||||||
refresh += () =>
|
refresh += () =>
|
||||||
{
|
{
|
||||||
@@ -654,6 +717,7 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
TrySendNetworkUpdate(entity, property);
|
TrySendNetworkUpdate(entity, property);
|
||||||
}
|
}
|
||||||
|
UpdateTextColors(property, entity, frame);
|
||||||
};
|
};
|
||||||
|
|
||||||
HandleSetterValueTampering(numberInput, () => property.GetFloatValue(entity));
|
HandleSetterValueTampering(numberInput, () => property.GetFloatValue(entity));
|
||||||
@@ -711,6 +775,7 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
TrySendNetworkUpdate(entity, property);
|
TrySendNetworkUpdate(entity, property);
|
||||||
}
|
}
|
||||||
|
UpdateTextColors(property, entity, frame);
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
refresh += () =>
|
refresh += () =>
|
||||||
@@ -829,6 +894,7 @@ namespace Barotrauma
|
|||||||
TrySendNetworkUpdate(entity, property);
|
TrySendNetworkUpdate(entity, property);
|
||||||
textBox.Text = StripPrefabTags(property.GetValue(entity).ToString());
|
textBox.Text = StripPrefabTags(property.GetValue(entity).ToString());
|
||||||
textBox.Flash(GUIStyle.Green, flashDuration: 1f);
|
textBox.Flash(GUIStyle.Green, flashDuration: 1f);
|
||||||
|
UpdateTextColors(property, entity, frame);
|
||||||
}
|
}
|
||||||
//restore the entities that were selected before applying
|
//restore the entities that were selected before applying
|
||||||
MapEntity.SelectedList.Clear();
|
MapEntity.SelectedList.Clear();
|
||||||
@@ -973,6 +1039,7 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
TrySendNetworkUpdate(entity, property);
|
TrySendNetworkUpdate(entity, property);
|
||||||
}
|
}
|
||||||
|
UpdateTextColors(property, entity, frame);
|
||||||
};
|
};
|
||||||
fields[i] = numberInput;
|
fields[i] = numberInput;
|
||||||
}
|
}
|
||||||
@@ -1046,6 +1113,7 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
TrySendNetworkUpdate(entity, property);
|
TrySendNetworkUpdate(entity, property);
|
||||||
}
|
}
|
||||||
|
UpdateTextColors(property, entity, frame);
|
||||||
};
|
};
|
||||||
HandleSetterValueTampering(numberInput, () =>
|
HandleSetterValueTampering(numberInput, () =>
|
||||||
{
|
{
|
||||||
@@ -1126,6 +1194,7 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
TrySendNetworkUpdate(entity, property);
|
TrySendNetworkUpdate(entity, property);
|
||||||
}
|
}
|
||||||
|
UpdateTextColors(property, entity, frame);
|
||||||
};
|
};
|
||||||
fields[i] = numberInput;
|
fields[i] = numberInput;
|
||||||
}
|
}
|
||||||
@@ -1206,6 +1275,7 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
TrySendNetworkUpdate(entity, property);
|
TrySendNetworkUpdate(entity, property);
|
||||||
}
|
}
|
||||||
|
UpdateTextColors(property, entity, frame);
|
||||||
};
|
};
|
||||||
fields[i] = numberInput;
|
fields[i] = numberInput;
|
||||||
}
|
}
|
||||||
@@ -1299,6 +1369,7 @@ namespace Barotrauma
|
|||||||
TrySendNetworkUpdate(entity, property);
|
TrySendNetworkUpdate(entity, property);
|
||||||
colorBox.Color = colorBox.HoverColor = colorBox.PressedColor = colorBox.SelectedTextColor = newVal;
|
colorBox.Color = colorBox.HoverColor = colorBox.PressedColor = colorBox.SelectedTextColor = newVal;
|
||||||
}
|
}
|
||||||
|
UpdateTextColors(property, entity, frame);
|
||||||
};
|
};
|
||||||
colorBox.Color = colorBox.HoverColor = colorBox.PressedColor = colorBox.SelectedTextColor = (Color)property.GetValue(entity);
|
colorBox.Color = colorBox.HoverColor = colorBox.PressedColor = colorBox.SelectedTextColor = (Color)property.GetValue(entity);
|
||||||
fields[i] = numberInput;
|
fields[i] = numberInput;
|
||||||
@@ -1373,6 +1444,7 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
TrySendNetworkUpdate(entity, property);
|
TrySendNetworkUpdate(entity, property);
|
||||||
}
|
}
|
||||||
|
UpdateTextColors(property, entity, frame);
|
||||||
};
|
};
|
||||||
fields[i] = numberInput;
|
fields[i] = numberInput;
|
||||||
}
|
}
|
||||||
@@ -1437,6 +1509,7 @@ namespace Barotrauma
|
|||||||
TrySendNetworkUpdate(entity, property);
|
TrySendNetworkUpdate(entity, property);
|
||||||
textBox.Flash(color: GUIStyle.Green, flashDuration: 1f);
|
textBox.Flash(color: GUIStyle.Green, flashDuration: 1f);
|
||||||
}
|
}
|
||||||
|
UpdateTextColors(property, entity, frame);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -33,10 +33,10 @@ namespace Barotrauma
|
|||||||
|
|
||||||
private GameSettings.Config unsavedConfig;
|
private GameSettings.Config unsavedConfig;
|
||||||
|
|
||||||
private readonly GUIFrame mainFrame;
|
public readonly GUIFrame mainFrame;
|
||||||
|
|
||||||
private readonly GUILayoutGroup tabber;
|
public readonly GUILayoutGroup tabber;
|
||||||
private readonly GUIFrame contentFrame;
|
public readonly GUIFrame contentFrame;
|
||||||
private readonly GUILayoutGroup bottom;
|
private readonly GUILayoutGroup bottom;
|
||||||
|
|
||||||
public readonly WorkshopMenu WorkshopMenu;
|
public readonly WorkshopMenu WorkshopMenu;
|
||||||
@@ -103,7 +103,7 @@ namespace Barotrauma
|
|||||||
newContent.Visible = true;
|
newContent.Visible = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private readonly Dictionary<Tab, (GUIButton Button, GUIFrame Content)> tabContents;
|
public readonly Dictionary<Tab, (GUIButton Button, GUIFrame Content)> tabContents;
|
||||||
|
|
||||||
public void SelectTab(Tab tab)
|
public void SelectTab(Tab tab)
|
||||||
{
|
{
|
||||||
@@ -149,7 +149,7 @@ namespace Barotrauma
|
|||||||
return content;
|
return content;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static (GUILayoutGroup Left, GUILayoutGroup Right) CreateSidebars(GUIFrame parent, bool split = false)
|
public static (GUILayoutGroup Left, GUILayoutGroup Right) CreateSidebars(GUIFrame parent, bool split = false)
|
||||||
{
|
{
|
||||||
GUILayoutGroup layout = new GUILayoutGroup(new RectTransform(Vector2.One, parent.RectTransform), isHorizontal: true);
|
GUILayoutGroup layout = new GUILayoutGroup(new RectTransform(Vector2.One, parent.RectTransform), isHorizontal: true);
|
||||||
GUILayoutGroup left = new GUILayoutGroup(new RectTransform((0.4875f, 1.0f), layout.RectTransform), isHorizontal: false);
|
GUILayoutGroup left = new GUILayoutGroup(new RectTransform((0.4875f, 1.0f), layout.RectTransform), isHorizontal: false);
|
||||||
@@ -166,29 +166,29 @@ namespace Barotrauma
|
|||||||
return (left, right);
|
return (left, right);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static GUILayoutGroup CreateCenterLayout(GUIFrame parent)
|
public static GUILayoutGroup CreateCenterLayout(GUIFrame parent)
|
||||||
{
|
{
|
||||||
return new GUILayoutGroup(new RectTransform((0.5f, 1.0f), parent.RectTransform, Anchor.TopCenter, Pivot.TopCenter)) { ChildAnchor = Anchor.TopCenter };
|
return new GUILayoutGroup(new RectTransform((0.5f, 1.0f), parent.RectTransform, Anchor.TopCenter, Pivot.TopCenter)) { ChildAnchor = Anchor.TopCenter };
|
||||||
}
|
}
|
||||||
|
|
||||||
private static RectTransform NewItemRectT(GUILayoutGroup parent)
|
public static RectTransform NewItemRectT(GUILayoutGroup parent)
|
||||||
=> new RectTransform((1.0f, 0.06f), parent.RectTransform, Anchor.CenterLeft);
|
=> new RectTransform((1.0f, 0.06f), parent.RectTransform, Anchor.CenterLeft);
|
||||||
|
|
||||||
private static void Spacer(GUILayoutGroup parent)
|
public static void Spacer(GUILayoutGroup parent, float height = 0.03f)
|
||||||
{
|
{
|
||||||
new GUIFrame(new RectTransform((1.0f, 0.03f), parent.RectTransform, Anchor.CenterLeft), style: null);
|
new GUIFrame(new RectTransform((1.0f, height), parent.RectTransform, Anchor.CenterLeft), style: null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static GUITextBlock Label(GUILayoutGroup parent, LocalizedString str, GUIFont font)
|
public static GUITextBlock Label(GUILayoutGroup parent, LocalizedString str, GUIFont font)
|
||||||
{
|
{
|
||||||
return new GUITextBlock(NewItemRectT(parent), str, font: font);
|
return new GUITextBlock(NewItemRectT(parent), str, font: font);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void DropdownEnum<T>(GUILayoutGroup parent, Func<T, LocalizedString> textFunc, Func<T, LocalizedString>? tooltipFunc, T currentValue,
|
public static void DropdownEnum<T>(GUILayoutGroup parent, Func<T, LocalizedString> textFunc, Func<T, LocalizedString>? tooltipFunc, T currentValue,
|
||||||
Action<T> setter) where T : Enum
|
Action<T> setter) where T : Enum
|
||||||
=> Dropdown(parent, textFunc, tooltipFunc, (T[])Enum.GetValues(typeof(T)), currentValue, setter);
|
=> Dropdown(parent, textFunc, tooltipFunc, (T[])Enum.GetValues(typeof(T)), currentValue, setter);
|
||||||
|
|
||||||
private static GUIDropDown Dropdown<T>(GUILayoutGroup parent, Func<T, LocalizedString> textFunc, Func<T, LocalizedString>? tooltipFunc, IReadOnlyList<T> values, T currentValue, Action<T> setter)
|
public static GUIDropDown Dropdown<T>(GUILayoutGroup parent, Func<T, LocalizedString> textFunc, Func<T, LocalizedString>? tooltipFunc, IReadOnlyList<T> values, T currentValue, Action<T> setter)
|
||||||
{
|
{
|
||||||
var dropdown = new GUIDropDown(NewItemRectT(parent), elementCount: values.Count);
|
var dropdown = new GUIDropDown(NewItemRectT(parent), elementCount: values.Count);
|
||||||
values.ForEach(v => dropdown.AddItem(text: textFunc(v), userData: v, toolTip: tooltipFunc?.Invoke(v) ?? null));
|
values.ForEach(v => dropdown.AddItem(text: textFunc(v), userData: v, toolTip: tooltipFunc?.Invoke(v) ?? null));
|
||||||
@@ -204,7 +204,7 @@ namespace Barotrauma
|
|||||||
return dropdown;
|
return dropdown;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static (GUIScrollBar slider, GUITextBlock label) Slider(GUILayoutGroup parent, Vector2 range, int steps, Func<float, string> labelFunc, float currentValue, Action<float> setter, LocalizedString? tooltip = null)
|
public static (GUIScrollBar slider, GUITextBlock label) Slider(GUILayoutGroup parent, Vector2 range, int steps, Func<float, string> labelFunc, float currentValue, Action<float> setter, LocalizedString? tooltip = null)
|
||||||
{
|
{
|
||||||
var layout = new GUILayoutGroup(NewItemRectT(parent), isHorizontal: true);
|
var layout = new GUILayoutGroup(NewItemRectT(parent), isHorizontal: true);
|
||||||
var slider = new GUIScrollBar(new RectTransform((0.72f, 1.0f), layout.RectTransform), style: "GUISlider")
|
var slider = new GUIScrollBar(new RectTransform((0.72f, 1.0f), layout.RectTransform), style: "GUISlider")
|
||||||
@@ -229,7 +229,7 @@ namespace Barotrauma
|
|||||||
return (slider, label);
|
return (slider, label);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static GUITickBox Tickbox(GUILayoutGroup parent, LocalizedString label, LocalizedString tooltip, bool currentValue, Action<bool> setter)
|
public static GUITickBox Tickbox(GUILayoutGroup parent, LocalizedString label, LocalizedString tooltip, bool currentValue, Action<bool> setter)
|
||||||
{
|
{
|
||||||
return new GUITickBox(NewItemRectT(parent), label)
|
return new GUITickBox(NewItemRectT(parent), label)
|
||||||
{
|
{
|
||||||
@@ -243,9 +243,9 @@ namespace Barotrauma
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private string Percentage(float v) => ToolBox.GetFormattedPercentage(v);
|
public string Percentage(float v) => ToolBox.GetFormattedPercentage(v);
|
||||||
|
|
||||||
private static int Round(float v) => MathUtils.RoundToInt(v);
|
public static int Round(float v) => MathUtils.RoundToInt(v);
|
||||||
|
|
||||||
private void CreateGraphicsTab()
|
private void CreateGraphicsTab()
|
||||||
{
|
{
|
||||||
@@ -507,6 +507,47 @@ namespace Barotrauma
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
#if OSX
|
||||||
|
Spacer(voiceChat, 0.003f);
|
||||||
|
|
||||||
|
// On macOS, microphone permission can apparently sometimes end up in a broken state when the app binary changes (eg. after a Steam update).
|
||||||
|
// The device seems to be there, but won't receive anything, even if the mic permission is fine.
|
||||||
|
// This button lets the user reset it and reboot the game, so the mic permission check will be retriggered on next run.
|
||||||
|
new GUIButton(new RectTransform(new Vector2(1.0f, 1.0f), voiceChat.RectTransform),
|
||||||
|
text: TextManager.Get("MacResetMicPermissions"),
|
||||||
|
style: "GUIButtonSmall")
|
||||||
|
{
|
||||||
|
ToolTip = TextManager.Get("MacResetMicPermissionsToolTip"),
|
||||||
|
OnClicked = (btn, obj) =>
|
||||||
|
{
|
||||||
|
var confirmBox = new GUIMessageBox(
|
||||||
|
TextManager.Get("MacResetMicPermissions"),
|
||||||
|
TextManager.Get("MacResetMicPermissionsConfirm"),
|
||||||
|
[TextManager.Get("OK"), TextManager.Get("Cancel")]);
|
||||||
|
confirmBox.Buttons[0].OnClicked = (_, _) =>
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo
|
||||||
|
{
|
||||||
|
FileName = "tccutil",
|
||||||
|
Arguments = "reset Microphone com.FakeFish.Barotrauma",
|
||||||
|
UseShellExecute = false
|
||||||
|
});
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
DebugConsole.NewMessage($"Failed to reset microphone permission: {e.Message}", Color.Orange);
|
||||||
|
}
|
||||||
|
GameMain.Instance.Exit();
|
||||||
|
confirmBox.Close();
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
confirmBox.Buttons[1].OnClicked = confirmBox.Close;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
#endif
|
||||||
Spacer(voiceChat);
|
Spacer(voiceChat);
|
||||||
|
|
||||||
Label(voiceChat, TextManager.Get("VCInputMode"), GUIStyle.SubHeadingFont);
|
Label(voiceChat, TextManager.Get("VCInputMode"), GUIStyle.SubHeadingFont);
|
||||||
@@ -965,4 +1006,4 @@ namespace Barotrauma
|
|||||||
GUI.SettingsMenuOpen = false;
|
GUI.SettingsMenuOpen = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -387,13 +387,11 @@ These will hide all servers that have a discord.gg link in their name or descrip
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var client = new RestClient($"{remoteContentUrl}spamfilter")
|
var client = RestFactory.CreateClient($"{remoteContentUrl}spamfilter");
|
||||||
{
|
client.CachePolicy = new HttpRequestCachePolicy(HttpRequestCacheLevel.NoCacheNoStore);
|
||||||
CachePolicy = new HttpRequestCachePolicy(HttpRequestCacheLevel.NoCacheNoStore)
|
|
||||||
};
|
|
||||||
client.AddDefaultHeader("Cache-Control", "no-cache");
|
client.AddDefaultHeader("Cache-Control", "no-cache");
|
||||||
client.AddDefaultHeader("Pragma", "no-cache");
|
client.AddDefaultHeader("Pragma", "no-cache");
|
||||||
var request = new RestRequest("serve_spamlist.php", Method.GET);
|
var request = RestFactory.CreateRequest("serve_spamlist.php");
|
||||||
TaskPool.Add("RequestGlobalSpamFilter", client.ExecuteAsync(request), RemoteContentReceived);
|
TaskPool.Add("RequestGlobalSpamFilter", client.ExecuteAsync(request), RemoteContentReceived);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
@@ -410,12 +408,18 @@ These will hide all servers that have a discord.gg link in their name or descrip
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (!t.TryGetResult(out IRestResponse? remoteContentResponse)) { throw new Exception("Task did not return a valid result"); }
|
if (!t.TryGetResult(out IRestResponse? remoteContentResponse)) { throw new Exception("Task did not return a valid result"); }
|
||||||
|
if (remoteContentResponse.ErrorException != null)
|
||||||
|
{
|
||||||
|
DebugConsole.AddWarning(
|
||||||
|
"Connection error: Failed to receive global spam filter " +
|
||||||
|
$"({remoteContentResponse.ErrorException.Message}).");
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (remoteContentResponse.StatusCode != HttpStatusCode.OK)
|
if (remoteContentResponse.StatusCode != HttpStatusCode.OK)
|
||||||
{
|
{
|
||||||
DebugConsole.AddWarning(
|
DebugConsole.AddWarning(
|
||||||
"Failed to receive global spam filter." +
|
"Failed to receive global spam filter. " +
|
||||||
"There may be an issue with your internet connection, or the master server might be temporarily unavailable " +
|
$"The master server might be temporarily unavailable, HTTP status: {remoteContentResponse.StatusCode}");
|
||||||
$"(error code: {remoteContentResponse.StatusCode})");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
string data = remoteContentResponse.Content;
|
string data = remoteContentResponse.Content;
|
||||||
|
|||||||
@@ -18,18 +18,36 @@ namespace Barotrauma.Steam
|
|||||||
{
|
{
|
||||||
public const int MaxThumbnailSize = 1024 * 1024;
|
public const int MaxThumbnailSize = 1024 * 1024;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Tags the players can choose for their workshop items. These must match the ones defined in the Steamworks backend. They're case insensitive, but must otherwise match exactly for the tag filtering to work correctly.
|
||||||
|
/// The localized names for these are fetched from the loca files with the identifier "workshop.contenttag.{tag.RemoveWhitespace()}".
|
||||||
|
/// </summary>
|
||||||
public static readonly ImmutableArray<Identifier> Tags = new []
|
public static readonly ImmutableArray<Identifier> Tags = new []
|
||||||
{
|
{
|
||||||
"submarine",
|
"submarine",
|
||||||
"item",
|
"item",
|
||||||
"monster",
|
"monster",
|
||||||
"art",
|
|
||||||
"mission",
|
"mission",
|
||||||
|
"outpost",
|
||||||
|
"beacon station",
|
||||||
|
"wreck",
|
||||||
|
"ruin",
|
||||||
|
"weapons",
|
||||||
|
"medical",
|
||||||
|
"equipment",
|
||||||
|
"art",
|
||||||
"event set",
|
"event set",
|
||||||
"total conversion",
|
"total conversion",
|
||||||
|
"game mode",
|
||||||
|
"gameplay mechanics",
|
||||||
"environment",
|
"environment",
|
||||||
"item assembly",
|
"item assembly",
|
||||||
"language",
|
"language",
|
||||||
|
"qol",
|
||||||
|
"client-side",
|
||||||
|
"server-side",
|
||||||
|
"outdated",
|
||||||
|
"library"
|
||||||
}.ToIdentifiers().ToImmutableArray();
|
}.ToIdentifiers().ToImmutableArray();
|
||||||
|
|
||||||
public class ItemThumbnail : IDisposable
|
public class ItemThumbnail : IDisposable
|
||||||
@@ -113,10 +131,14 @@ namespace Barotrauma.Steam
|
|||||||
|
|
||||||
string? thumbnailUrl = item.PreviewImageUrl;
|
string? thumbnailUrl = item.PreviewImageUrl;
|
||||||
if (thumbnailUrl.IsNullOrWhiteSpace()) { return null; }
|
if (thumbnailUrl.IsNullOrWhiteSpace()) { return null; }
|
||||||
var client = new RestClient(thumbnailUrl);
|
var client = RestFactory.CreateClient(thumbnailUrl);
|
||||||
var request = new RestRequest(".", Method.GET);
|
var request = RestFactory.CreateRequest(".");
|
||||||
IRestResponse response = await client.ExecuteAsync(request, cancellationToken);
|
IRestResponse response = await client.ExecuteAsync(request, cancellationToken);
|
||||||
if (response is { StatusCode: System.Net.HttpStatusCode.OK, ResponseStatus: ResponseStatus.Completed })
|
if (response.ErrorException != null)
|
||||||
|
{
|
||||||
|
DebugConsole.NewMessage($"Connection error: Failed to load workshop item thumbnail for {item.Id} ({response.ErrorException.Message}).");
|
||||||
|
}
|
||||||
|
else if (response is { StatusCode: System.Net.HttpStatusCode.OK, ResponseStatus: ResponseStatus.Completed })
|
||||||
{
|
{
|
||||||
using var dataStream = new System.IO.MemoryStream();
|
using var dataStream = new System.IO.MemoryStream();
|
||||||
await dataStream.WriteAsync(response.RawBytes, cancellationToken);
|
await dataStream.WriteAsync(response.RawBytes, cancellationToken);
|
||||||
|
|||||||
@@ -535,9 +535,9 @@ namespace Barotrauma.Steam
|
|||||||
= new GUIListBox(rectT, style: null, isHorizontal: false)
|
= new GUIListBox(rectT, style: null, isHorizontal: false)
|
||||||
{
|
{
|
||||||
UseGridLayout = true,
|
UseGridLayout = true,
|
||||||
ScrollBarEnabled = false,
|
ScrollBarEnabled = true,
|
||||||
ScrollBarVisible = false,
|
ScrollBarVisible = false,
|
||||||
HideChildrenOutsideFrame = false,
|
HideChildrenOutsideFrame = true,
|
||||||
Spacing = GUI.IntScale(4)
|
Spacing = GUI.IntScale(4)
|
||||||
};
|
};
|
||||||
tagsList.Content.ClampMouseRectToParent = false;
|
tagsList.Content.ClampMouseRectToParent = false;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<RootNamespace>Barotrauma</RootNamespace>
|
<RootNamespace>Barotrauma</RootNamespace>
|
||||||
<Authors>FakeFish, Undertow Games</Authors>
|
<Authors>FakeFish, Undertow Games</Authors>
|
||||||
<Product>Barotrauma</Product>
|
<Product>Barotrauma</Product>
|
||||||
<Version>1.11.5.0</Version>
|
<Version>1.12.7.0</Version>
|
||||||
<Copyright>Copyright © FakeFish 2018-2024</Copyright>
|
<Copyright>Copyright © FakeFish 2018-2024</Copyright>
|
||||||
<Platforms>AnyCPU;x64</Platforms>
|
<Platforms>AnyCPU;x64</Platforms>
|
||||||
<AssemblyName>Barotrauma</AssemblyName>
|
<AssemblyName>Barotrauma</AssemblyName>
|
||||||
@@ -14,6 +14,7 @@
|
|||||||
<Configurations>Debug;Release;Unstable</Configurations>
|
<Configurations>Debug;Release;Unstable</Configurations>
|
||||||
<InvariantGlobalization>true</InvariantGlobalization>
|
<InvariantGlobalization>true</InvariantGlobalization>
|
||||||
<WarningsAsErrors>;NU1605;CS0114;CS0108;CS8597;CS8600;CS8601;CS8602;CS8603;CS8604;CS8605;CS8606;CS8607;CS8608;CS8609;CS8610;CS8611;CS8612;CS8613;CS8614;CS8615;CS8616;CS8617;CS8618;CS8619;CS8620;CS8621;CS8622;CS8624;CS8625;CS8626;CS8629;CS8631;CS8632;CS8633;CS8634;CS8638;CS8643;CS8644;CS8645;CS8653;CS8654;CS8655;CS8667;CS8669;CS8670;CS8714;CS8717;CS8765</WarningsAsErrors>
|
<WarningsAsErrors>;NU1605;CS0114;CS0108;CS8597;CS8600;CS8601;CS8602;CS8603;CS8604;CS8605;CS8606;CS8607;CS8608;CS8609;CS8610;CS8611;CS8612;CS8613;CS8614;CS8615;CS8616;CS8617;CS8618;CS8619;CS8620;CS8621;CS8622;CS8624;CS8625;CS8626;CS8629;CS8631;CS8632;CS8633;CS8634;CS8638;CS8643;CS8644;CS8645;CS8653;CS8654;CS8655;CS8667;CS8669;CS8670;CS8714;CS8717;CS8765</WarningsAsErrors>
|
||||||
|
<LangVersion>latest</LangVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||||
@@ -211,4 +212,9 @@
|
|||||||
<Import Project="../BarotraumaShared/DeployEosPrivate.props" />
|
<Import Project="../BarotraumaShared/DeployEosPrivate.props" />
|
||||||
<Import Project="../BarotraumaShared/DeployGameAnalytics.props" />
|
<Import Project="../BarotraumaShared/DeployGameAnalytics.props" />
|
||||||
|
|
||||||
</Project>
|
<Import Project="../BarotraumaShared/Luatrauma.props" />
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="../BarotraumaShared/Luatrauma.props" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="../BarotraumaShared/LuatraumaBuild.props" />
|
||||||
|
</Project>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<RootNamespace>Barotrauma</RootNamespace>
|
<RootNamespace>Barotrauma</RootNamespace>
|
||||||
<Authors>FakeFish, Undertow Games</Authors>
|
<Authors>FakeFish, Undertow Games</Authors>
|
||||||
<Product>Barotrauma</Product>
|
<Product>Barotrauma</Product>
|
||||||
<Version>1.11.5.0</Version>
|
<Version>1.12.7.0</Version>
|
||||||
<Copyright>Copyright © FakeFish 2018-2024</Copyright>
|
<Copyright>Copyright © FakeFish 2018-2024</Copyright>
|
||||||
<Platforms>AnyCPU;x64</Platforms>
|
<Platforms>AnyCPU;x64</Platforms>
|
||||||
<AssemblyName>Barotrauma</AssemblyName>
|
<AssemblyName>Barotrauma</AssemblyName>
|
||||||
@@ -14,6 +14,8 @@
|
|||||||
<Configurations>Debug;Release;Unstable</Configurations>
|
<Configurations>Debug;Release;Unstable</Configurations>
|
||||||
<InvariantGlobalization>true</InvariantGlobalization>
|
<InvariantGlobalization>true</InvariantGlobalization>
|
||||||
<WarningsAsErrors>;NU1605;CS0114;CS0108;CS8597;CS8600;CS8601;CS8602;CS8603;CS8604;CS8605;CS8606;CS8607;CS8608;CS8609;CS8610;CS8611;CS8612;CS8613;CS8614;CS8615;CS8616;CS8617;CS8618;CS8619;CS8620;CS8621;CS8622;CS8624;CS8625;CS8626;CS8629;CS8631;CS8632;CS8633;CS8634;CS8638;CS8643;CS8644;CS8645;CS8653;CS8654;CS8655;CS8667;CS8669;CS8670;CS8714;CS8717;CS8765</WarningsAsErrors>
|
<WarningsAsErrors>;NU1605;CS0114;CS0108;CS8597;CS8600;CS8601;CS8602;CS8603;CS8604;CS8605;CS8606;CS8607;CS8608;CS8609;CS8610;CS8611;CS8612;CS8613;CS8614;CS8615;CS8616;CS8617;CS8618;CS8619;CS8620;CS8621;CS8622;CS8624;CS8625;CS8626;CS8629;CS8631;CS8632;CS8633;CS8634;CS8638;CS8643;CS8644;CS8645;CS8653;CS8654;CS8655;CS8667;CS8669;CS8670;CS8714;CS8717;CS8765</WarningsAsErrors>
|
||||||
|
<ErrorOnDuplicatePublishOutputFiles>false</ErrorOnDuplicatePublishOutputFiles>
|
||||||
|
<LangVersion>latest</LangVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||||
@@ -215,4 +217,10 @@
|
|||||||
<Import Project="../BarotraumaShared/DeployEosPrivate.props" />
|
<Import Project="../BarotraumaShared/DeployEosPrivate.props" />
|
||||||
<Import Project="../BarotraumaShared/DeployGameAnalytics.props" />
|
<Import Project="../BarotraumaShared/DeployGameAnalytics.props" />
|
||||||
|
|
||||||
</Project>
|
<Import Project="../BarotraumaShared/Luatrauma.props" />
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="../BarotraumaShared/Luatrauma.props" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="../BarotraumaShared/LuatraumaBuild.props" />
|
||||||
|
|
||||||
|
</Project>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>WinExe</OutputType>
|
<OutputType>WinExe</OutputType>
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
<RootNamespace>Barotrauma</RootNamespace>
|
<RootNamespace>Barotrauma</RootNamespace>
|
||||||
<Authors>FakeFish, Undertow Games</Authors>
|
<Authors>FakeFish, Undertow Games</Authors>
|
||||||
<Product>Barotrauma</Product>
|
<Product>Barotrauma</Product>
|
||||||
<Version>1.11.5.0</Version>
|
<Version>1.12.7.0</Version>
|
||||||
<Copyright>Copyright © FakeFish 2018-2024</Copyright>
|
<Copyright>Copyright © FakeFish 2018-2024</Copyright>
|
||||||
<Platforms>AnyCPU;x64</Platforms>
|
<Platforms>AnyCPU;x64</Platforms>
|
||||||
<AssemblyName>Barotrauma</AssemblyName>
|
<AssemblyName>Barotrauma</AssemblyName>
|
||||||
@@ -15,6 +15,7 @@
|
|||||||
<InvariantGlobalization>true</InvariantGlobalization>
|
<InvariantGlobalization>true</InvariantGlobalization>
|
||||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||||
<WarningsAsErrors>;NU1605;CS0114;CS0108;CS8597;CS8600;CS8601;CS8602;CS8603;CS8604;CS8605;CS8606;CS8607;CS8608;CS8609;CS8610;CS8611;CS8612;CS8613;CS8614;CS8615;CS8616;CS8617;CS8618;CS8619;CS8620;CS8621;CS8622;CS8624;CS8625;CS8626;CS8629;CS8631;CS8632;CS8633;CS8634;CS8638;CS8643;CS8644;CS8645;CS8653;CS8654;CS8655;CS8667;CS8669;CS8670;CS8714;CS8717;CS8765</WarningsAsErrors>
|
<WarningsAsErrors>;NU1605;CS0114;CS0108;CS8597;CS8600;CS8601;CS8602;CS8603;CS8604;CS8605;CS8606;CS8607;CS8608;CS8609;CS8610;CS8611;CS8612;CS8613;CS8614;CS8615;CS8616;CS8617;CS8618;CS8619;CS8620;CS8621;CS8622;CS8624;CS8625;CS8626;CS8629;CS8631;CS8632;CS8633;CS8634;CS8638;CS8643;CS8644;CS8645;CS8653;CS8654;CS8655;CS8667;CS8669;CS8670;CS8714;CS8717;CS8765</WarningsAsErrors>
|
||||||
|
<LangVersion>latest</LangVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||||
@@ -243,4 +244,9 @@
|
|||||||
<Import Project="../BarotraumaShared/DeployEosPrivate.props" />
|
<Import Project="../BarotraumaShared/DeployEosPrivate.props" />
|
||||||
<Import Project="../BarotraumaShared/DeployGameAnalytics.props" />
|
<Import Project="../BarotraumaShared/DeployGameAnalytics.props" />
|
||||||
|
|
||||||
</Project>
|
<Import Project="../BarotraumaShared/Luatrauma.props" />
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="../BarotraumaShared/Luatrauma.props" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="../BarotraumaShared/LuatraumaBuild.props" />
|
||||||
|
</Project>
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||||
|
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=clientsource/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
|
||||||
@@ -1,160 +1,169 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<TargetFramework>net8.0</TargetFramework>
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
<RootNamespace>Barotrauma</RootNamespace>
|
<RootNamespace>Barotrauma</RootNamespace>
|
||||||
<Authors>FakeFish, Undertow Games</Authors>
|
<Authors>FakeFish, Undertow Games</Authors>
|
||||||
<Product>Barotrauma Dedicated Server</Product>
|
<Product>Barotrauma Dedicated Server</Product>
|
||||||
<Version>1.11.5.0</Version>
|
<Version>1.12.7.0</Version>
|
||||||
<Copyright>Copyright © FakeFish 2018-2023</Copyright>
|
<Copyright>Copyright © FakeFish 2018-2023</Copyright>
|
||||||
<Platforms>AnyCPU;x64</Platforms>
|
<Platforms>AnyCPU;x64</Platforms>
|
||||||
<AssemblyName>DedicatedServer</AssemblyName>
|
<AssemblyName>DedicatedServer</AssemblyName>
|
||||||
<ApplicationIcon>..\BarotraumaShared\Icon.ico</ApplicationIcon>
|
<ApplicationIcon>..\BarotraumaShared\Icon.ico</ApplicationIcon>
|
||||||
<Configurations>Debug;Release;Unstable</Configurations>
|
<Configurations>Debug;Release;Unstable</Configurations>
|
||||||
<InvariantGlobalization>true</InvariantGlobalization>
|
<InvariantGlobalization>true</InvariantGlobalization>
|
||||||
<WarningsAsErrors>;NU1605;CS0114;CS0108;CS8597;CS8600;CS8601;CS8602;CS8603;CS8604;CS8605;CS8606;CS8607;CS8608;CS8609;CS8610;CS8611;CS8612;CS8613;CS8614;CS8615;CS8616;CS8617;CS8618;CS8619;CS8620;CS8621;CS8622;CS8624;CS8625;CS8626;CS8629;CS8631;CS8632;CS8633;CS8634;CS8638;CS8643;CS8644;CS8645;CS8653;CS8654;CS8655;CS8667;CS8669;CS8670;CS8714;CS8717;CS8765</WarningsAsErrors>
|
<LangVersion>latest</LangVersion>
|
||||||
</PropertyGroup>
|
<WarningsAsErrors>;NU1605;CS0114;CS0108;CS8597;CS8600;CS8601;CS8602;CS8603;CS8604;CS8605;CS8606;CS8607;CS8608;CS8609;CS8610;CS8611;CS8612;CS8613;CS8614;CS8615;CS8616;CS8617;CS8618;CS8619;CS8620;CS8621;CS8622;CS8624;CS8625;CS8626;CS8629;CS8631;CS8632;CS8633;CS8634;CS8638;CS8643;CS8644;CS8645;CS8653;CS8654;CS8655;CS8667;CS8669;CS8670;CS8714;CS8717;CS8765</WarningsAsErrors>
|
||||||
|
<LangVersion>latest</LangVersion>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
</PropertyGroup>
|
||||||
<DefineConstants>DEBUG;TRACE;SERVER;LINUX</DefineConstants>
|
|
||||||
<PlatformTarget>x64</PlatformTarget>
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||||
<OutputPath>..\bin\$(Configuration)Linux\</OutputPath>
|
<DefineConstants>DEBUG;TRACE;SERVER;LINUX</DefineConstants>
|
||||||
</PropertyGroup>
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
|
<OutputPath>..\bin\$(Configuration)Linux\</OutputPath>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
</PropertyGroup>
|
||||||
<DefineConstants>TRACE;DEBUG;SERVER;LINUX;X64</DefineConstants>
|
|
||||||
<PlatformTarget>x64</PlatformTarget>
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
<OutputPath>..\bin\$(Configuration)Linux\</OutputPath>
|
<DefineConstants>TRACE;DEBUG;SERVER;LINUX;X64</DefineConstants>
|
||||||
</PropertyGroup>
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
|
<OutputPath>..\bin\$(Configuration)Linux\</OutputPath>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
</PropertyGroup>
|
||||||
<DefineConstants>TRACE;SERVER;LINUX</DefineConstants>
|
|
||||||
<PlatformTarget>x64</PlatformTarget>
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
||||||
<OutputPath>..\bin\$(Configuration)Linux\</OutputPath>
|
<DefineConstants>TRACE;SERVER;LINUX</DefineConstants>
|
||||||
</PropertyGroup>
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
|
<OutputPath>..\bin\$(Configuration)Linux\</OutputPath>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unstable|AnyCPU'">
|
</PropertyGroup>
|
||||||
<DefineConstants>TRACE;SERVER;LINUX</DefineConstants>
|
|
||||||
<PlatformTarget>x64</PlatformTarget>
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unstable|AnyCPU'">
|
||||||
<OutputPath>..\bin\$(Configuration)Linux\</OutputPath>
|
<DefineConstants>TRACE;SERVER;LINUX</DefineConstants>
|
||||||
<Optimize>true</Optimize>
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
</PropertyGroup>
|
<OutputPath>..\bin\$(Configuration)Linux\</OutputPath>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
</PropertyGroup>
|
||||||
<DefineConstants>TRACE;SERVER;LINUX;X64</DefineConstants>
|
|
||||||
<PlatformTarget>x64</PlatformTarget>
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
<OutputPath>..\bin\$(Configuration)Linux\</OutputPath>
|
<DefineConstants>TRACE;SERVER;LINUX;X64</DefineConstants>
|
||||||
</PropertyGroup>
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
|
<OutputPath>..\bin\$(Configuration)Linux\</OutputPath>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unstable|x64'">
|
</PropertyGroup>
|
||||||
<DefineConstants>TRACE;SERVER;LINUX;X64</DefineConstants>
|
|
||||||
<PlatformTarget>x64</PlatformTarget>
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unstable|x64'">
|
||||||
<OutputPath>..\bin\$(Configuration)Linux\</OutputPath>
|
<DefineConstants>TRACE;SERVER;LINUX;X64</DefineConstants>
|
||||||
<Optimize>true</Optimize>
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
</PropertyGroup>
|
<OutputPath>..\bin\$(Configuration)Linux\</OutputPath>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
<ItemGroup>
|
</PropertyGroup>
|
||||||
<Content Include="..\BarotraumaShared\**\*" CopyToOutputDirectory="PreserveNewest" Exclude="..\BarotraumaShared\Data\Saves\*.save;..\BarotraumaShared\ModLists\*.xml;..\BarotraumaShared\LocalMods\[DebugOnlyTest]*\**" />
|
|
||||||
<Content Remove="..\BarotraumaShared\**\*.cs" />
|
<ItemGroup>
|
||||||
<Content Remove="..\BarotraumaShared\**\*.props" />
|
<Content Include="..\BarotraumaShared\**\*" CopyToOutputDirectory="PreserveNewest" Exclude="..\BarotraumaShared\Data\Saves\*.save;..\BarotraumaShared\ModLists\*.xml;..\BarotraumaShared\LocalMods\[DebugOnlyTest]*\**" />
|
||||||
<Compile Include="..\BarotraumaShared\**\*.cs" />
|
<Content Include="..\BarotraumaShared\**\*" CopyToOutputDirectory="PreserveNewest" Exclude="..\BarotraumaShared\Data\Saves\*.save;..\BarotraumaShared\ModLists\*.xml" />
|
||||||
<Compile Remove="..\BarotraumaShared\Content\**\*.cs" />
|
<Content Remove="..\BarotraumaShared\**\*.cs" />
|
||||||
<Content Include="DedicatedServer.exe" CopyToOutputDirectory="PreserveNewest" />
|
<Content Remove="..\BarotraumaShared\**\*.props" />
|
||||||
</ItemGroup>
|
<Compile Include="..\BarotraumaShared\**\*.cs" />
|
||||||
|
<Compile Remove="..\BarotraumaShared\Content\**\*.cs" />
|
||||||
<ItemGroup Condition="'$(Configuration)'!='Debug'">
|
<Content Include="DedicatedServer.exe" CopyToOutputDirectory="PreserveNewest" />
|
||||||
<ProjectReference Include="..\..\Libraries\Concentus\CSharp\Concentus\Concentus.NetStandard.csproj" AdditionalProperties="Configuration=Release" />
|
</ItemGroup>
|
||||||
<ProjectReference Include="..\..\Libraries\Facepunch.Steamworks\Facepunch.Steamworks.Posix.csproj" AdditionalProperties="Configuration=Release" />
|
|
||||||
<ProjectReference Include="..\..\Libraries\Farseer Physics Engine 3.5\Farseer.NetStandard.csproj" AdditionalProperties="Configuration=Release" />
|
<ItemGroup Condition="'$(Configuration)'!='Debug'">
|
||||||
<ProjectReference Include="..\..\Libraries\Hyper.ComponentModel\Hyper.ComponentModel.NetStandard.csproj" AdditionalProperties="Configuration=Release" />
|
<ProjectReference Include="..\..\Libraries\Concentus\CSharp\Concentus\Concentus.NetStandard.csproj" AdditionalProperties="Configuration=Release" />
|
||||||
<ProjectReference Include="..\..\Libraries\Lidgren.Network\Lidgren.NetStandard.csproj" AdditionalProperties="Configuration=Release" />
|
<ProjectReference Include="..\..\Libraries\Facepunch.Steamworks\Facepunch.Steamworks.Posix.csproj" AdditionalProperties="Configuration=Release" />
|
||||||
</ItemGroup>
|
<ProjectReference Include="..\..\Libraries\Farseer Physics Engine 3.5\Farseer.NetStandard.csproj" AdditionalProperties="Configuration=Release" />
|
||||||
<ItemGroup Condition="'$(Configuration)'=='Debug'">
|
<ProjectReference Include="..\..\Libraries\Hyper.ComponentModel\Hyper.ComponentModel.NetStandard.csproj" AdditionalProperties="Configuration=Release" />
|
||||||
<ProjectReference Include="..\..\Libraries\Concentus\CSharp\Concentus\Concentus.NetStandard.csproj" AdditionalProperties="Configuration=Debug" />
|
<ProjectReference Include="..\..\Libraries\Lidgren.Network\Lidgren.NetStandard.csproj" AdditionalProperties="Configuration=Release" />
|
||||||
<ProjectReference Include="..\..\Libraries\Facepunch.Steamworks\Facepunch.Steamworks.Posix.csproj" AdditionalProperties="Configuration=Debug" />
|
</ItemGroup>
|
||||||
<ProjectReference Include="..\..\Libraries\Farseer Physics Engine 3.5\Farseer.NetStandard.csproj" AdditionalProperties="Configuration=Debug" />
|
<ItemGroup Condition="'$(Configuration)'=='Debug'">
|
||||||
<ProjectReference Include="..\..\Libraries\Hyper.ComponentModel\Hyper.ComponentModel.NetStandard.csproj" AdditionalProperties="Configuration=Debug" />
|
<ProjectReference Include="..\..\Libraries\Concentus\CSharp\Concentus\Concentus.NetStandard.csproj" AdditionalProperties="Configuration=Debug" />
|
||||||
<ProjectReference Include="..\..\Libraries\Lidgren.Network\Lidgren.NetStandard.csproj" AdditionalProperties="Configuration=Debug" />
|
<ProjectReference Include="..\..\Libraries\Facepunch.Steamworks\Facepunch.Steamworks.Posix.csproj" AdditionalProperties="Configuration=Debug" />
|
||||||
</ItemGroup>
|
<ProjectReference Include="..\..\Libraries\Farseer Physics Engine 3.5\Farseer.NetStandard.csproj" AdditionalProperties="Configuration=Debug" />
|
||||||
|
<ProjectReference Include="..\..\Libraries\Hyper.ComponentModel\Hyper.ComponentModel.NetStandard.csproj" AdditionalProperties="Configuration=Debug" />
|
||||||
<ItemGroup>
|
<ProjectReference Include="..\..\Libraries\Lidgren.Network\Lidgren.NetStandard.csproj" AdditionalProperties="Configuration=Debug" />
|
||||||
<PackageReference Include="RestSharp" Version="106.13.0" />
|
</ItemGroup>
|
||||||
</ItemGroup>
|
|
||||||
|
<ItemGroup>
|
||||||
<ItemGroup>
|
<PackageReference Include="RestSharp" Version="106.13.0" />
|
||||||
<ProjectReference Include="..\..\Libraries\BarotraumaLibs\BarotraumaCore\BarotraumaCore.csproj" />
|
</ItemGroup>
|
||||||
<ProjectReference Include="..\..\Libraries\BarotraumaLibs\EosInterface\EosInterface.csproj" />
|
|
||||||
</ItemGroup>
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\..\Libraries\BarotraumaLibs\BarotraumaCore\BarotraumaCore.csproj" />
|
||||||
<!-- Sourced from https://stackoverflow.com/a/45248069 -->
|
<ProjectReference Include="..\..\Libraries\BarotraumaLibs\EosInterface\EosInterface.csproj" />
|
||||||
<Target Name="GetGitRevision" BeforeTargets="WriteGitRevision" Condition="'$(BuildHash)' == ''">
|
</ItemGroup>
|
||||||
<PropertyGroup>
|
|
||||||
<!-- temp file for the git version (lives in "obj" folder)-->
|
<!-- Sourced from https://stackoverflow.com/a/45248069 -->
|
||||||
<VerFile>$(IntermediateOutputPath)gitver</VerFile>
|
<Target Name="GetGitRevision" BeforeTargets="WriteGitRevision" Condition="'$(BuildHash)' == ''">
|
||||||
<BranchFile>$(IntermediateOutputPath)gitbranch</BranchFile>
|
<PropertyGroup>
|
||||||
</PropertyGroup>
|
<!-- temp file for the git version (lives in "obj" folder)-->
|
||||||
|
<VerFile>$(IntermediateOutputPath)gitver</VerFile>
|
||||||
<!-- write the hash to the temp file.-->
|
<BranchFile>$(IntermediateOutputPath)gitbranch</BranchFile>
|
||||||
<Exec Command="git -C $(ProjectDir) rev-parse --short HEAD > $(VerFile)" ContinueOnError="true">
|
</PropertyGroup>
|
||||||
<Output TaskParameter="exitcode" ItemName="exitcodes" />
|
|
||||||
</Exec>
|
<!-- write the hash to the temp file.-->
|
||||||
<Exec Command="git -C $(ProjectDir) rev-parse --short HEAD --symbolic-full-name --abbrev-ref=strict > $(BranchFile)" ContinueOnError="true" />
|
<Exec Command="git -C $(ProjectDir) rev-parse --short HEAD > $(VerFile)" ContinueOnError="true">
|
||||||
|
<Output TaskParameter="exitcode" ItemName="exitcodes" />
|
||||||
<Exec Command="echo GIT_UNAVAILABLE > $(VerFile)" Condition="'%(exitcodes.identity)'>0" />
|
</Exec>
|
||||||
<Exec Command="echo GIT_UNAVAILABLE > $(BranchFile)" Condition="'%(exitcodes.identity)'>0" />
|
<Exec Command="git -C $(ProjectDir) rev-parse --short HEAD --symbolic-full-name --abbrev-ref=strict > $(BranchFile)" ContinueOnError="true" />
|
||||||
|
|
||||||
<!-- read the version into the GitVersion itemGroup-->
|
<Exec Command="echo GIT_UNAVAILABLE > $(VerFile)" Condition="'%(exitcodes.identity)'>0" />
|
||||||
<ReadLinesFromFile File="$(VerFile)">
|
<Exec Command="echo GIT_UNAVAILABLE > $(BranchFile)" Condition="'%(exitcodes.identity)'>0" />
|
||||||
<Output TaskParameter="Lines" ItemName="GitVersion" />
|
|
||||||
</ReadLinesFromFile>
|
<!-- read the version into the GitVersion itemGroup-->
|
||||||
<!-- Set the BuildHash property to contain the GitVersion, if it wasn't already set.-->
|
<ReadLinesFromFile File="$(VerFile)">
|
||||||
<PropertyGroup>
|
<Output TaskParameter="Lines" ItemName="GitVersion" />
|
||||||
<BuildHash>@(GitVersion)</BuildHash>
|
</ReadLinesFromFile>
|
||||||
</PropertyGroup>
|
<!-- Set the BuildHash property to contain the GitVersion, if it wasn't already set.-->
|
||||||
|
<PropertyGroup>
|
||||||
<!-- read the branch into the GitBranch itemGroup-->
|
<BuildHash>@(GitVersion)</BuildHash>
|
||||||
<ReadLinesFromFile File="$(BranchFile)">
|
</PropertyGroup>
|
||||||
<Output TaskParameter="Lines" ItemName="GitBranch" />
|
|
||||||
</ReadLinesFromFile>
|
<!-- read the branch into the GitBranch itemGroup-->
|
||||||
<!-- Set the BuildHash property to contain the GitVersion, if it wasn't already set.-->
|
<ReadLinesFromFile File="$(BranchFile)">
|
||||||
<PropertyGroup>
|
<Output TaskParameter="Lines" ItemName="GitBranch" />
|
||||||
<BuildBranch>@(GitBranch)</BuildBranch>
|
</ReadLinesFromFile>
|
||||||
</PropertyGroup>
|
<!-- Set the BuildHash property to contain the GitVersion, if it wasn't already set.-->
|
||||||
</Target>
|
<PropertyGroup>
|
||||||
|
<BuildBranch>@(GitBranch)</BuildBranch>
|
||||||
<Target Name="WriteGitRevision" BeforeTargets="CoreCompile">
|
</PropertyGroup>
|
||||||
<!-- names the obj/.../CustomAssemblyInfo.cs file -->
|
</Target>
|
||||||
<PropertyGroup>
|
|
||||||
<CustomAssemblyInfoFile>$(IntermediateOutputPath)CustomAssemblyInfo.cs</CustomAssemblyInfoFile>
|
<Target Name="WriteGitRevision" BeforeTargets="CoreCompile">
|
||||||
</PropertyGroup>
|
<!-- names the obj/.../CustomAssemblyInfo.cs file -->
|
||||||
<!-- includes the CustomAssemblyInfo for compilation into your project -->
|
<PropertyGroup>
|
||||||
<ItemGroup>
|
<CustomAssemblyInfoFile>$(IntermediateOutputPath)CustomAssemblyInfo.cs</CustomAssemblyInfoFile>
|
||||||
<Compile Include="$(CustomAssemblyInfoFile)" />
|
</PropertyGroup>
|
||||||
</ItemGroup>
|
<!-- includes the CustomAssemblyInfo for compilation into your project -->
|
||||||
<!-- defines the AssemblyMetadata attribute that will be written -->
|
<ItemGroup>
|
||||||
<ItemGroup>
|
<Compile Include="$(CustomAssemblyInfoFile)" />
|
||||||
<AssemblyAttributes Include="AssemblyMetadata">
|
</ItemGroup>
|
||||||
<_Parameter1>GitRevision</_Parameter1>
|
<!-- defines the AssemblyMetadata attribute that will be written -->
|
||||||
<_Parameter2>$(BuildHash)</_Parameter2>
|
<ItemGroup>
|
||||||
</AssemblyAttributes>
|
<AssemblyAttributes Include="AssemblyMetadata">
|
||||||
<AssemblyAttributes Include="AssemblyMetadata">
|
<_Parameter1>GitRevision</_Parameter1>
|
||||||
<_Parameter1>GitBranch</_Parameter1>
|
<_Parameter2>$(BuildHash)</_Parameter2>
|
||||||
<_Parameter2>$(BuildBranch)</_Parameter2>
|
</AssemblyAttributes>
|
||||||
</AssemblyAttributes>
|
<AssemblyAttributes Include="AssemblyMetadata">
|
||||||
<AssemblyAttributes Include="AssemblyMetadata">
|
<_Parameter1>GitBranch</_Parameter1>
|
||||||
<_Parameter1>ProjectDir</_Parameter1>
|
<_Parameter2>$(BuildBranch)</_Parameter2>
|
||||||
<_Parameter2>$(ProjectDir)</_Parameter2>
|
</AssemblyAttributes>
|
||||||
</AssemblyAttributes>
|
<AssemblyAttributes Include="AssemblyMetadata">
|
||||||
</ItemGroup>
|
<_Parameter1>ProjectDir</_Parameter1>
|
||||||
<!-- writes the attribute to the customAssemblyInfo file -->
|
<_Parameter2>$(ProjectDir)</_Parameter2>
|
||||||
<WriteCodeFragment Language="C#" OutputFile="$(CustomAssemblyInfoFile)" AssemblyAttributes="@(AssemblyAttributes)" />
|
</AssemblyAttributes>
|
||||||
</Target>
|
</ItemGroup>
|
||||||
|
<!-- writes the attribute to the customAssemblyInfo file -->
|
||||||
<PropertyGroup>
|
<WriteCodeFragment Language="C#" OutputFile="$(CustomAssemblyInfoFile)" AssemblyAttributes="@(AssemblyAttributes)" />
|
||||||
<ManualDeployRuntime>linux-x64</ManualDeployRuntime>
|
</Target>
|
||||||
<ProjectFileNamePlatformSuffix>Linux</ProjectFileNamePlatformSuffix>
|
|
||||||
</PropertyGroup>
|
<PropertyGroup>
|
||||||
<Import Project="../BarotraumaShared/DeployEosPrivate.props" />
|
<ManualDeployRuntime>linux-x64</ManualDeployRuntime>
|
||||||
|
<ProjectFileNamePlatformSuffix>Linux</ProjectFileNamePlatformSuffix>
|
||||||
</Project>
|
</PropertyGroup>
|
||||||
|
<Import Project="../BarotraumaShared/DeployEosPrivate.props" />
|
||||||
|
|
||||||
|
<Import Project="../BarotraumaShared/Luatrauma.props" />
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="../BarotraumaShared/Luatrauma.props" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="../BarotraumaShared/LuatraumaBuild.props" />
|
||||||
|
|
||||||
|
</Project>
|
||||||
|
|||||||
@@ -1,165 +1,172 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<TargetFramework>net8.0</TargetFramework>
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
<RootNamespace>Barotrauma</RootNamespace>
|
<RootNamespace>Barotrauma</RootNamespace>
|
||||||
<Authors>FakeFish, Undertow Games</Authors>
|
<Authors>FakeFish, Undertow Games</Authors>
|
||||||
<Product>Barotrauma Dedicated Server</Product>
|
<Product>Barotrauma Dedicated Server</Product>
|
||||||
<Version>1.11.5.0</Version>
|
<Version>1.12.7.0</Version>
|
||||||
<Copyright>Copyright © FakeFish 2018-2023</Copyright>
|
<Copyright>Copyright © FakeFish 2018-2023</Copyright>
|
||||||
<Platforms>AnyCPU;x64</Platforms>
|
<Platforms>AnyCPU;x64</Platforms>
|
||||||
<AssemblyName>DedicatedServer</AssemblyName>
|
<AssemblyName>DedicatedServer</AssemblyName>
|
||||||
<ApplicationIcon>..\BarotraumaShared\Icon.ico</ApplicationIcon>
|
<ApplicationIcon>..\BarotraumaShared\Icon.ico</ApplicationIcon>
|
||||||
<Configurations>Debug;Release;Unstable</Configurations>
|
<Configurations>Debug;Release;Unstable</Configurations>
|
||||||
<InvariantGlobalization>true</InvariantGlobalization>
|
<InvariantGlobalization>true</InvariantGlobalization>
|
||||||
<WarningsAsErrors>;NU1605;CS0114;CS0108;CS8597;CS8600;CS8601;CS8602;CS8603;CS8604;CS8605;CS8606;CS8607;CS8608;CS8609;CS8610;CS8611;CS8612;CS8613;CS8614;CS8615;CS8616;CS8617;CS8618;CS8619;CS8620;CS8621;CS8622;CS8624;CS8625;CS8626;CS8629;CS8631;CS8632;CS8633;CS8634;CS8638;CS8643;CS8644;CS8645;CS8653;CS8654;CS8655;CS8667;CS8669;CS8670;CS8714;CS8717;CS8765</WarningsAsErrors>
|
<WarningsAsErrors>;NU1605;CS0114;CS0108;CS8597;CS8600;CS8601;CS8602;CS8603;CS8604;CS8605;CS8606;CS8607;CS8608;CS8609;CS8610;CS8611;CS8612;CS8613;CS8614;CS8615;CS8616;CS8617;CS8618;CS8619;CS8620;CS8621;CS8622;CS8624;CS8625;CS8626;CS8629;CS8631;CS8632;CS8633;CS8634;CS8638;CS8643;CS8644;CS8645;CS8653;CS8654;CS8655;CS8667;CS8669;CS8670;CS8714;CS8717;CS8765</WarningsAsErrors>
|
||||||
</PropertyGroup>
|
<LangVersion>latest</LangVersion>
|
||||||
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
|
||||||
<DefineConstants>TRACE;SERVER;OSX;DEBUG;NETCOREAPP;NETCOREAPP3_0</DefineConstants>
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||||
<PlatformTarget>x64</PlatformTarget>
|
<DefineConstants>TRACE;SERVER;OSX;DEBUG;NETCOREAPP;NETCOREAPP3_0</DefineConstants>
|
||||||
<OutputPath>..\bin\DebugMac</OutputPath>
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
<ConsolePause>true</ConsolePause>
|
<OutputPath>..\bin\DebugMac</OutputPath>
|
||||||
<CheckForOverflowUnderflow></CheckForOverflowUnderflow>
|
<ConsolePause>true</ConsolePause>
|
||||||
</PropertyGroup>
|
<CheckForOverflowUnderflow></CheckForOverflowUnderflow>
|
||||||
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
|
||||||
<DefineConstants>TRACE;DEBUG;SERVER;OSX;X64</DefineConstants>
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
<PlatformTarget>x64</PlatformTarget>
|
<DefineConstants>TRACE;DEBUG;SERVER;OSX;X64</DefineConstants>
|
||||||
<OutputPath>..\bin\$(Configuration)Mac\</OutputPath>
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
</PropertyGroup>
|
<OutputPath>..\bin\$(Configuration)Mac\</OutputPath>
|
||||||
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
|
||||||
<DefineConstants>TRACE;SERVER;OSX;RELEASE;NETCOREAPP;NETCOREAPP3_0</DefineConstants>
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
||||||
<PlatformTarget>x64</PlatformTarget>
|
<DefineConstants>TRACE;SERVER;OSX;RELEASE;NETCOREAPP;NETCOREAPP3_0</DefineConstants>
|
||||||
<DebugType></DebugType>
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
<OutputPath>..\bin\ReleaseMac</OutputPath>
|
<DebugType></DebugType>
|
||||||
</PropertyGroup>
|
<OutputPath>..\bin\ReleaseMac</OutputPath>
|
||||||
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unstable|AnyCPU'">
|
|
||||||
<DefineConstants>TRACE;SERVER;OSX;RELEASE;NETCOREAPP;NETCOREAPP3_0;UNSTABLE</DefineConstants>
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unstable|AnyCPU'">
|
||||||
<PlatformTarget>x64</PlatformTarget>
|
<DefineConstants>TRACE;SERVER;OSX;RELEASE;NETCOREAPP;NETCOREAPP3_0;UNSTABLE</DefineConstants>
|
||||||
<DebugType />
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
<OutputPath>..\bin\ReleaseMac</OutputPath>
|
<DebugType />
|
||||||
<Optimize>true</Optimize>
|
<OutputPath>..\bin\ReleaseMac</OutputPath>
|
||||||
</PropertyGroup>
|
<Optimize>true</Optimize>
|
||||||
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
|
||||||
<DefineConstants>TRACE;SERVER;OSX;X64</DefineConstants>
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
<PlatformTarget>x64</PlatformTarget>
|
<DefineConstants>TRACE;SERVER;OSX;X64</DefineConstants>
|
||||||
<OutputPath>..\bin\$(Configuration)Mac\</OutputPath>
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
</PropertyGroup>
|
<OutputPath>..\bin\$(Configuration)Mac\</OutputPath>
|
||||||
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unstable|x64'">
|
|
||||||
<DefineConstants>TRACE;SERVER;OSX;X64;UNSTABLE</DefineConstants>
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Unstable|x64'">
|
||||||
<PlatformTarget>x64</PlatformTarget>
|
<DefineConstants>TRACE;SERVER;OSX;X64;UNSTABLE</DefineConstants>
|
||||||
<OutputPath>..\bin\$(Configuration)Mac\</OutputPath>
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
<Optimize>true</Optimize>
|
<OutputPath>..\bin\$(Configuration)Mac\</OutputPath>
|
||||||
</PropertyGroup>
|
<Optimize>true</Optimize>
|
||||||
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
|
||||||
<Content Include="..\BarotraumaShared\**\*" CopyToOutputDirectory="PreserveNewest" Exclude="..\BarotraumaShared\Data\Saves\*.save;..\BarotraumaShared\ModLists\*.xml;..\BarotraumaShared\LocalMods\[DebugOnlyTest]*\**" />
|
<ItemGroup>
|
||||||
<Content Remove="..\BarotraumaShared\**\*.cs" />
|
<Content Include="..\BarotraumaShared\**\*" CopyToOutputDirectory="PreserveNewest" Exclude="..\BarotraumaShared\Data\Saves\*.save;..\BarotraumaShared\ModLists\*.xml" />
|
||||||
<Content Remove="..\BarotraumaShared\**\*.props" />
|
<Content Remove="..\BarotraumaShared\**\*.cs" />
|
||||||
<Compile Include="..\BarotraumaShared\**\*.cs" />
|
<Content Remove="..\BarotraumaShared\**\*.props" />
|
||||||
<Compile Remove="..\BarotraumaShared\Content\**\*.cs" />
|
<Compile Include="..\BarotraumaShared\**\*.cs" />
|
||||||
<Content Remove="..\BarotraumaShared\libsteam_api64.dylib" />
|
<Compile Remove="..\BarotraumaShared\Content\**\*.cs" />
|
||||||
<Content Remove="..\BarotraumaShared\libsteam_api64.so" />
|
<Content Remove="..\BarotraumaShared\libsteam_api64.dylib" />
|
||||||
<Content Remove="DedicatedServer.exe" />
|
<Content Remove="..\BarotraumaShared\libsteam_api64.so" />
|
||||||
</ItemGroup>
|
<Content Remove="DedicatedServer.exe" />
|
||||||
|
</ItemGroup>
|
||||||
<ItemGroup Condition="'$(Configuration)'!='Debug'">
|
|
||||||
<ProjectReference Include="..\..\Libraries\Concentus\CSharp\Concentus\Concentus.NetStandard.csproj" AdditionalProperties="Configuration=Release" />
|
<ItemGroup Condition="'$(Configuration)'!='Debug'">
|
||||||
<ProjectReference Include="..\..\Libraries\Facepunch.Steamworks\Facepunch.Steamworks.Posix.csproj" AdditionalProperties="Configuration=Release" />
|
<ProjectReference Include="..\..\Libraries\Concentus\CSharp\Concentus\Concentus.NetStandard.csproj" AdditionalProperties="Configuration=Release" />
|
||||||
<ProjectReference Include="..\..\Libraries\Farseer Physics Engine 3.5\Farseer.NetStandard.csproj" AdditionalProperties="Configuration=Release" />
|
<ProjectReference Include="..\..\Libraries\Facepunch.Steamworks\Facepunch.Steamworks.Posix.csproj" AdditionalProperties="Configuration=Release" />
|
||||||
<ProjectReference Include="..\..\Libraries\Hyper.ComponentModel\Hyper.ComponentModel.NetStandard.csproj" AdditionalProperties="Configuration=Release" />
|
<ProjectReference Include="..\..\Libraries\Farseer Physics Engine 3.5\Farseer.NetStandard.csproj" AdditionalProperties="Configuration=Release" />
|
||||||
<ProjectReference Include="..\..\Libraries\Lidgren.Network\Lidgren.NetStandard.csproj" AdditionalProperties="Configuration=Release" />
|
<ProjectReference Include="..\..\Libraries\Hyper.ComponentModel\Hyper.ComponentModel.NetStandard.csproj" AdditionalProperties="Configuration=Release" />
|
||||||
</ItemGroup>
|
<ProjectReference Include="..\..\Libraries\Lidgren.Network\Lidgren.NetStandard.csproj" AdditionalProperties="Configuration=Release" />
|
||||||
<ItemGroup Condition="'$(Configuration)'=='Debug'">
|
</ItemGroup>
|
||||||
<ProjectReference Include="..\..\Libraries\Concentus\CSharp\Concentus\Concentus.NetStandard.csproj" AdditionalProperties="Configuration=Debug" />
|
<ItemGroup Condition="'$(Configuration)'=='Debug'">
|
||||||
<ProjectReference Include="..\..\Libraries\Facepunch.Steamworks\Facepunch.Steamworks.Posix.csproj" AdditionalProperties="Configuration=Debug" />
|
<ProjectReference Include="..\..\Libraries\Concentus\CSharp\Concentus\Concentus.NetStandard.csproj" AdditionalProperties="Configuration=Debug" />
|
||||||
<ProjectReference Include="..\..\Libraries\Farseer Physics Engine 3.5\Farseer.NetStandard.csproj" AdditionalProperties="Configuration=Debug" />
|
<ProjectReference Include="..\..\Libraries\Facepunch.Steamworks\Facepunch.Steamworks.Posix.csproj" AdditionalProperties="Configuration=Debug" />
|
||||||
<ProjectReference Include="..\..\Libraries\Hyper.ComponentModel\Hyper.ComponentModel.NetStandard.csproj" AdditionalProperties="Configuration=Debug" />
|
<ProjectReference Include="..\..\Libraries\Farseer Physics Engine 3.5\Farseer.NetStandard.csproj" AdditionalProperties="Configuration=Debug" />
|
||||||
<ProjectReference Include="..\..\Libraries\Lidgren.Network\Lidgren.NetStandard.csproj" AdditionalProperties="Configuration=Debug" />
|
<ProjectReference Include="..\..\Libraries\Hyper.ComponentModel\Hyper.ComponentModel.NetStandard.csproj" AdditionalProperties="Configuration=Debug" />
|
||||||
</ItemGroup>
|
<ProjectReference Include="..\..\Libraries\Lidgren.Network\Lidgren.NetStandard.csproj" AdditionalProperties="Configuration=Debug" />
|
||||||
|
</ItemGroup>
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="RestSharp" Version="106.13.0" />
|
<ItemGroup>
|
||||||
</ItemGroup>
|
<PackageReference Include="RestSharp" Version="106.13.0" />
|
||||||
|
</ItemGroup>
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\..\Libraries\BarotraumaLibs\BarotraumaCore\BarotraumaCore.csproj" />
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\..\Libraries\BarotraumaLibs\EosInterface\EosInterface.csproj" />
|
<ProjectReference Include="..\..\Libraries\BarotraumaLibs\BarotraumaCore\BarotraumaCore.csproj" />
|
||||||
</ItemGroup>
|
<ProjectReference Include="..\..\Libraries\BarotraumaLibs\EosInterface\EosInterface.csproj" />
|
||||||
<!-- Sourced from https://stackoverflow.com/a/45248069 -->
|
</ItemGroup>
|
||||||
<Target Name="GetGitRevision" BeforeTargets="WriteGitRevision" Condition="'$(BuildHash)' == ''">
|
<!-- Sourced from https://stackoverflow.com/a/45248069 -->
|
||||||
<PropertyGroup>
|
<Target Name="GetGitRevision" BeforeTargets="WriteGitRevision" Condition="'$(BuildHash)' == ''">
|
||||||
<!-- temp file for the git version (lives in "obj" folder)-->
|
<PropertyGroup>
|
||||||
<VerFile>$(IntermediateOutputPath)gitver</VerFile>
|
<!-- temp file for the git version (lives in "obj" folder)-->
|
||||||
<BranchFile>$(IntermediateOutputPath)gitbranch</BranchFile>
|
<VerFile>$(IntermediateOutputPath)gitver</VerFile>
|
||||||
</PropertyGroup>
|
<BranchFile>$(IntermediateOutputPath)gitbranch</BranchFile>
|
||||||
|
</PropertyGroup>
|
||||||
<!-- write the hash to the temp file.-->
|
|
||||||
<Exec Command="git -C $(ProjectDir) rev-parse --short HEAD > $(VerFile)" ContinueOnError="true">
|
<!-- write the hash to the temp file.-->
|
||||||
<Output TaskParameter="exitcode" ItemName="exitcodes" />
|
<Exec Command="git -C $(ProjectDir) rev-parse --short HEAD > $(VerFile)" ContinueOnError="true">
|
||||||
</Exec>
|
<Output TaskParameter="exitcode" ItemName="exitcodes" />
|
||||||
<Exec Command="git -C $(ProjectDir) rev-parse --short HEAD --symbolic-full-name --abbrev-ref=strict > $(BranchFile)" ContinueOnError="true" />
|
</Exec>
|
||||||
|
<Exec Command="git -C $(ProjectDir) rev-parse --short HEAD --symbolic-full-name --abbrev-ref=strict > $(BranchFile)" ContinueOnError="true" />
|
||||||
<Exec Command="echo GIT_UNAVAILABLE > $(VerFile)" Condition="'%(exitcodes.identity)'>0" />
|
|
||||||
<Exec Command="echo GIT_UNAVAILABLE > $(BranchFile)" Condition="'%(exitcodes.identity)'>0" />
|
<Exec Command="echo GIT_UNAVAILABLE > $(VerFile)" Condition="'%(exitcodes.identity)'>0" />
|
||||||
|
<Exec Command="echo GIT_UNAVAILABLE > $(BranchFile)" Condition="'%(exitcodes.identity)'>0" />
|
||||||
<!-- read the version into the GitVersion itemGroup-->
|
|
||||||
<ReadLinesFromFile File="$(VerFile)">
|
<!-- read the version into the GitVersion itemGroup-->
|
||||||
<Output TaskParameter="Lines" ItemName="GitVersion" />
|
<ReadLinesFromFile File="$(VerFile)">
|
||||||
</ReadLinesFromFile>
|
<Output TaskParameter="Lines" ItemName="GitVersion" />
|
||||||
<!-- Set the BuildHash property to contain the GitVersion, if it wasn't already set.-->
|
</ReadLinesFromFile>
|
||||||
<PropertyGroup>
|
<!-- Set the BuildHash property to contain the GitVersion, if it wasn't already set.-->
|
||||||
<BuildHash>@(GitVersion)</BuildHash>
|
<PropertyGroup>
|
||||||
</PropertyGroup>
|
<BuildHash>@(GitVersion)</BuildHash>
|
||||||
|
</PropertyGroup>
|
||||||
<!-- read the branch into the GitBranch itemGroup-->
|
|
||||||
<ReadLinesFromFile File="$(BranchFile)">
|
<!-- read the branch into the GitBranch itemGroup-->
|
||||||
<Output TaskParameter="Lines" ItemName="GitBranch" />
|
<ReadLinesFromFile File="$(BranchFile)">
|
||||||
</ReadLinesFromFile>
|
<Output TaskParameter="Lines" ItemName="GitBranch" />
|
||||||
<!-- Set the BuildHash property to contain the GitVersion, if it wasn't already set.-->
|
</ReadLinesFromFile>
|
||||||
<PropertyGroup>
|
<!-- Set the BuildHash property to contain the GitVersion, if it wasn't already set.-->
|
||||||
<BuildBranch>@(GitBranch)</BuildBranch>
|
<PropertyGroup>
|
||||||
</PropertyGroup>
|
<BuildBranch>@(GitBranch)</BuildBranch>
|
||||||
</Target>
|
</PropertyGroup>
|
||||||
|
</Target>
|
||||||
<Target Name="WriteGitRevision" BeforeTargets="CoreCompile">
|
|
||||||
<!-- names the obj/.../CustomAssemblyInfo.cs file -->
|
<Target Name="WriteGitRevision" BeforeTargets="CoreCompile">
|
||||||
<PropertyGroup>
|
<!-- names the obj/.../CustomAssemblyInfo.cs file -->
|
||||||
<CustomAssemblyInfoFile>$(IntermediateOutputPath)CustomAssemblyInfo.cs</CustomAssemblyInfoFile>
|
<PropertyGroup>
|
||||||
</PropertyGroup>
|
<CustomAssemblyInfoFile>$(IntermediateOutputPath)CustomAssemblyInfo.cs</CustomAssemblyInfoFile>
|
||||||
<!-- includes the CustomAssemblyInfo for compilation into your project -->
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<!-- includes the CustomAssemblyInfo for compilation into your project -->
|
||||||
<Compile Include="$(CustomAssemblyInfoFile)" />
|
<ItemGroup>
|
||||||
</ItemGroup>
|
<Compile Include="$(CustomAssemblyInfoFile)" />
|
||||||
<!-- defines the AssemblyMetadata attribute that will be written -->
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<!-- defines the AssemblyMetadata attribute that will be written -->
|
||||||
<AssemblyAttributes Include="AssemblyMetadata">
|
<ItemGroup>
|
||||||
<_Parameter1>GitRevision</_Parameter1>
|
<AssemblyAttributes Include="AssemblyMetadata">
|
||||||
<_Parameter2>$(BuildHash)</_Parameter2>
|
<_Parameter1>GitRevision</_Parameter1>
|
||||||
</AssemblyAttributes>
|
<_Parameter2>$(BuildHash)</_Parameter2>
|
||||||
<AssemblyAttributes Include="AssemblyMetadata">
|
</AssemblyAttributes>
|
||||||
<_Parameter1>GitBranch</_Parameter1>
|
<AssemblyAttributes Include="AssemblyMetadata">
|
||||||
<_Parameter2>$(BuildBranch)</_Parameter2>
|
<_Parameter1>GitBranch</_Parameter1>
|
||||||
</AssemblyAttributes>
|
<_Parameter2>$(BuildBranch)</_Parameter2>
|
||||||
<AssemblyAttributes Include="AssemblyMetadata">
|
</AssemblyAttributes>
|
||||||
<_Parameter1>ProjectDir</_Parameter1>
|
<AssemblyAttributes Include="AssemblyMetadata">
|
||||||
<_Parameter2>$(ProjectDir)</_Parameter2>
|
<_Parameter1>ProjectDir</_Parameter1>
|
||||||
</AssemblyAttributes>
|
<_Parameter2>$(ProjectDir)</_Parameter2>
|
||||||
</ItemGroup>
|
</AssemblyAttributes>
|
||||||
<!-- writes the attribute to the customAssemblyInfo file -->
|
</ItemGroup>
|
||||||
<WriteCodeFragment Language="C#" OutputFile="$(CustomAssemblyInfoFile)" AssemblyAttributes="@(AssemblyAttributes)" />
|
<!-- writes the attribute to the customAssemblyInfo file -->
|
||||||
</Target>
|
<WriteCodeFragment Language="C#" OutputFile="$(CustomAssemblyInfoFile)" AssemblyAttributes="@(AssemblyAttributes)" />
|
||||||
|
</Target>
|
||||||
<PropertyGroup>
|
|
||||||
<ManualDeployRuntime>osx-x64</ManualDeployRuntime>
|
<PropertyGroup>
|
||||||
<ProjectFileNamePlatformSuffix>MacOS</ProjectFileNamePlatformSuffix>
|
<ManualDeployRuntime>osx-x64</ManualDeployRuntime>
|
||||||
</PropertyGroup>
|
<ProjectFileNamePlatformSuffix>MacOS</ProjectFileNamePlatformSuffix>
|
||||||
<Import Project="../BarotraumaShared/DeployEosPrivate.props" />
|
</PropertyGroup>
|
||||||
|
<Import Project="../BarotraumaShared/DeployEosPrivate.props" />
|
||||||
</Project>
|
|
||||||
|
<Import Project="../BarotraumaShared/Luatrauma.props" />
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="../BarotraumaShared/Luatrauma.props" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="../BarotraumaShared/LuatraumaBuild.props" />
|
||||||
|
|
||||||
|
</Project>
|
||||||
|
|||||||
@@ -65,7 +65,10 @@ namespace Barotrauma
|
|||||||
var owner = GameMain.Server.ConnectedClients.Find(c => c.Character == this);
|
var owner = GameMain.Server.ConnectedClients.Find(c => c.Character == this);
|
||||||
if (owner != null)
|
if (owner != null)
|
||||||
{
|
{
|
||||||
GameMain.Server.SendDirectChatMessage(TextManager.FormatServerMessage("KilledByTraitorNotification"), owner, ChatMessageType.ServerMessageBoxInGame);
|
if (!LuaCsSetup.Instance.Game.overrideTraitors)
|
||||||
|
{
|
||||||
|
GameMain.Server.SendDirectChatMessage(TextManager.FormatServerMessage("KilledByTraitorNotification"), owner, ChatMessageType.ServerMessageBoxInGame);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach (Client client in GameMain.Server.ConnectedClients)
|
foreach (Client client in GameMain.Server.ConnectedClients)
|
||||||
|
|||||||
@@ -5,10 +5,12 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Barotrauma.Steam;
|
using Barotrauma.Steam;
|
||||||
using Barotrauma.Extensions;
|
using Barotrauma.Extensions;
|
||||||
|
using Barotrauma.LuaCs.Events;
|
||||||
|
|
||||||
namespace Barotrauma
|
namespace Barotrauma
|
||||||
{
|
{
|
||||||
@@ -313,7 +315,7 @@ namespace Barotrauma
|
|||||||
return client;
|
return client;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void AssignOnClientRequestExecute(string names, Action<Client, Vector2, string[]> onClientRequestExecute)
|
public static void AssignOnClientRequestExecute(string names, Action<Client, Vector2, string[]> onClientRequestExecute)
|
||||||
{
|
{
|
||||||
var matchingCommand = commands.Find(c => c.Names.Intersect(names.Split('|').ToIdentifiers()).Any());
|
var matchingCommand = commands.Find(c => c.Names.Intersect(names.Split('|').ToIdentifiers()).Any());
|
||||||
if (matchingCommand == null)
|
if (matchingCommand == null)
|
||||||
@@ -733,7 +735,7 @@ namespace Barotrauma
|
|||||||
revokedCommands.Add(matchingCommand);
|
revokedCommands.Add(matchingCommand);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
client.SetPermissions(client.Permissions, client.PermittedConsoleCommands.Except(revokedCommands).ToList());
|
client.SetPermissions(client.Permissions, client.PermittedConsoleCommands.Except(revokedCommands).ToList());
|
||||||
GameMain.Server.UpdateClientPermissions(client);
|
GameMain.Server.UpdateClientPermissions(client);
|
||||||
@@ -898,9 +900,9 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
if (GameMain.Server?.KarmaManager == null) { return; }
|
if (GameMain.Server?.KarmaManager == null) { return; }
|
||||||
GameMain.Server.KarmaManager.TestMode = !GameMain.Server.KarmaManager.TestMode;
|
GameMain.Server.KarmaManager.TestMode = !GameMain.Server.KarmaManager.TestMode;
|
||||||
NewMessage(GameMain.Server.KarmaManager.TestMode ?
|
NewMessage(GameMain.Server.KarmaManager.TestMode ?
|
||||||
$"Karma test mode enabled by {client.Name}." :
|
$"Karma test mode enabled by {client.Name}." :
|
||||||
$"Karma test mode disabled by {client.Name}.",
|
$"Karma test mode disabled by {client.Name}.",
|
||||||
Color.LightGreen);
|
Color.LightGreen);
|
||||||
GameMain.Server.SendDirectChatMessage(
|
GameMain.Server.SendDirectChatMessage(
|
||||||
GameMain.Server.KarmaManager.TestMode ? "Karma test mode enabled." : "Karma test mode disabled.",
|
GameMain.Server.KarmaManager.TestMode ? "Karma test mode enabled." : "Karma test mode disabled.",
|
||||||
@@ -1250,7 +1252,7 @@ namespace Barotrauma
|
|||||||
(Client client, Vector2 cursorPos, string[] args) =>
|
(Client client, Vector2 cursorPos, string[] args) =>
|
||||||
{
|
{
|
||||||
string text = string.Join(" ", args);
|
string text = string.Join(" ", args);
|
||||||
text = client.Name+": " + text;
|
text = client.Name + ": " + text;
|
||||||
if (GameMain.Server.OwnerConnection != null &&
|
if (GameMain.Server.OwnerConnection != null &&
|
||||||
client.Connection == GameMain.Server.OwnerConnection)
|
client.Connection == GameMain.Server.OwnerConnection)
|
||||||
{
|
{
|
||||||
@@ -2733,6 +2735,19 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
commands.Add(new Command("ShowServerPerf", "Immediately log server performance info in ServerMessage", (string[] args) =>
|
||||||
|
{
|
||||||
|
GameServer.Log(PerformanceMonitor.PM.ToString(), ServerLog.MessageType.ServerMessage);
|
||||||
|
}));
|
||||||
|
|
||||||
|
AssignOnClientRequestExecute(
|
||||||
|
"ShowServerPerf",
|
||||||
|
(senderClient, cursorWorldPos, args) =>
|
||||||
|
{
|
||||||
|
GameMain.Server.SendConsoleMessage(PerformanceMonitor.PM.ToString(), senderClient);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
commands.Add(new Command("spamevents", "A debug command that creates a ton of entity events.", (string[] args) =>
|
commands.Add(new Command("spamevents", "A debug command that creates a ton of entity events.", (string[] args) =>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -79,6 +79,15 @@ namespace Barotrauma
|
|||||||
convAction.SelectedOption = selectedOption;
|
convAction.SelectedOption = selectedOption;
|
||||||
if (convAction.Options.Any() && !convAction.GetEndingOptions().Contains(selectedOption))
|
if (convAction.Options.Any() && !convAction.GetEndingOptions().Contains(selectedOption))
|
||||||
{
|
{
|
||||||
|
var option = convAction.Options[selectedOption];
|
||||||
|
if (option.ForceSay && sender.Character != null)
|
||||||
|
{
|
||||||
|
sender.Character.ForceSay(
|
||||||
|
option.ForceSayText.IsNullOrEmpty() ? TextManager.Get(option.Text).Fallback(option.Text) : TextManager.Get(option.ForceSayText).Fallback(option.ForceSayText),
|
||||||
|
option.ForceSayInRadio,
|
||||||
|
option.ForceSayRemoveQuotes);
|
||||||
|
}
|
||||||
|
|
||||||
foreach (Client c in convAction.TargetClients)
|
foreach (Client c in convAction.TargetClients)
|
||||||
{
|
{
|
||||||
if (c == sender) { continue; }
|
if (c == sender) { continue; }
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user