Compare commits
726 Commits
mac_change
...
3d71b3c430
| Author | SHA1 | Date | |
|---|---|---|---|
| 3d71b3c430 | |||
| 72dcb7d5dd | |||
| 13bbaab1f3 | |||
| 4e7889bb24 | |||
| 96cc570e67 | |||
| e77f12904c | |||
| b53b1340ad | |||
| 3ea807468e | |||
| 0f135597fa | |||
|
|
8da0d2c4ce | ||
|
|
20f576783b | ||
|
|
ef2c551cee | ||
|
|
65cf59642c | ||
|
|
e2fc8a6283 | ||
|
|
73976f3ed9 | ||
|
|
7ab6bafe39 | ||
|
|
deb2ad7c8f | ||
|
|
cd7fc3242e | ||
|
|
31a0a77e7c | ||
|
|
f0ec4a901a | ||
|
|
3682159da6 | ||
|
|
e9f83f77bb | ||
|
|
8f3b80492e | ||
|
|
c61c013517 | ||
|
|
a2170ffd8a | ||
|
|
4f1f77fb32 | ||
|
|
6ae370f8fc | ||
|
|
da5c8555e5 | ||
|
|
c4c7ee941f | ||
|
|
4f45b3c1d0 | ||
|
|
4c640b915f | ||
|
|
1f3f1ea67e | ||
|
|
60c19303f6 | ||
|
|
adcfc50218 | ||
|
|
9b812ec34a | ||
|
|
7e1ac5e167 | ||
|
|
028b5fedec | ||
|
|
9cc2c1da40 | ||
|
|
5ed8564293 | ||
|
|
7c87ade12b | ||
|
|
7f87678282 | ||
|
|
e429d29d17 | ||
|
|
537d8b57ca | ||
|
|
4a3fb41035 | ||
|
|
797cb3c3f2 | ||
|
|
47670251ef | ||
|
|
cf1ef91246 | ||
|
|
7060cb5696 | ||
|
|
c449833d35 | ||
|
|
284aeca51a | ||
|
|
d8f7199c11 | ||
|
|
dc05bbbbcd | ||
|
|
3fcc9ed01f | ||
|
|
70ba750a5e | ||
|
|
50271199ac | ||
|
|
d1a99c9396 | ||
|
|
4ae3d57adc | ||
|
|
99b9967806 | ||
|
|
2f7e84253a | ||
|
|
2f55cb938f | ||
|
|
a86661a855 | ||
|
|
a68ce6633a | ||
|
|
5d57afe3aa | ||
|
|
6705138247 | ||
|
|
276caf771c | ||
|
|
5eea5a72c9 | ||
|
|
e9a7b1c8eb | ||
|
|
a151c78412 | ||
|
|
5f1e905e8f | ||
|
|
a0f764a774 | ||
|
|
7da5ce3ed4 | ||
|
|
1186833b2d | ||
|
|
bb180b0f59 | ||
|
|
5d1c79929a | ||
|
|
3f5a4cc4c9 | ||
|
|
62fd8ac967 | ||
|
|
d904b92f2e | ||
|
|
87e2b76ffa | ||
|
|
c5e11aed15 | ||
|
|
85d61b334b | ||
|
|
26e94f6f8e | ||
|
|
902744a0ce | ||
|
|
1c581bceaf | ||
|
|
9cc44825c6 | ||
|
|
92f4327fc2 | ||
|
|
47711ec5be | ||
|
|
d1fbc66cb9 | ||
|
|
7183a3306e | ||
|
|
fd191f7ffb | ||
|
|
2604d58687 | ||
|
|
01d1d634c2 | ||
|
|
c7e403661d | ||
|
|
1196db6d17 | ||
|
|
553a007508 | ||
|
|
de2ee36529 | ||
|
|
eea44ac897 | ||
|
|
c124713e99 | ||
|
|
364a523375 | ||
|
|
afdd264e63 | ||
|
|
8ec54f7b1c | ||
|
|
521518bde4 | ||
|
|
56077a268a | ||
|
|
a0ca000793 | ||
|
|
ae4ae7a638 | ||
|
|
e2a4c8ab03 | ||
|
|
7a40722964 | ||
|
|
1de8909d05 | ||
|
|
9749487e24 | ||
|
|
55968a8ddc | ||
|
|
e325b190ea | ||
|
|
ada6b9140f | ||
|
|
5582579173 | ||
|
|
88773e71e5 | ||
|
|
9e1f488f22 | ||
|
|
a471861e92 | ||
|
|
3d182c89f3 | ||
|
|
e3810a9938 | ||
| f0dea9d528 | |||
| d70a003617 | |||
| b443b74d18 | |||
|
|
eff5f84185 | ||
|
|
ad1163bccc | ||
|
|
1042ad4e7d | ||
|
|
8fdda1a71a | ||
|
|
3f7fe635d8 | ||
|
|
fcebc57ed0 | ||
|
|
c40e447bb7 | ||
|
|
e6f94bb154 | ||
|
|
adbc546978 | ||
|
|
2d171967e9 | ||
|
|
33a0e6ac7d | ||
|
|
848cc38bf1 | ||
|
|
91cd1e8065 | ||
|
|
9fafb47abb | ||
|
|
5222f1d35c | ||
|
|
785649f9d5 | ||
|
|
d47ac95681 | ||
|
|
703e0cb7ca | ||
|
|
ef7c7f2d30 | ||
|
|
f3d375e356 | ||
|
|
a3073321cf | ||
|
|
824b49dd88 | ||
|
|
d0e7bff03a | ||
|
|
d314d5b324 | ||
|
|
a027ed3b63 | ||
|
|
bcedb05a2c | ||
|
|
b36be95947 | ||
|
|
4ca399af71 | ||
|
|
c1f022520d | ||
|
|
2efd20f223 | ||
|
|
00dd432fbc | ||
|
|
f707508d70 | ||
|
|
b965ca6c8c | ||
|
|
6fea9eefaa | ||
|
|
47caa6af28 | ||
|
|
9aedb37ac2 | ||
|
|
e4bc2c69c7 | ||
|
|
6db9265112 | ||
|
|
21a84c5b84 | ||
|
|
633b5857c9 | ||
|
|
9f9dac1543 | ||
|
|
df6f8fd8ae | ||
|
|
4bd8ce37ac | ||
|
|
40e204839f | ||
|
|
d6c75b3f86 | ||
|
|
687c283533 | ||
|
|
70ee8501a5 | ||
|
|
2c34bd2308 | ||
| fc341a86e7 | |||
|
|
5023e3277b | ||
|
|
9003d855b3 | ||
|
|
75906719d4 | ||
|
|
9a59925a36 | ||
|
|
d5ca80c2c1 | ||
|
|
cb07ee77aa | ||
|
|
680783f2b0 | ||
|
|
4a28b4bd6c | ||
|
|
4bf36f3467 | ||
|
|
2c1713d300 | ||
|
|
8136691914 | ||
|
|
da23e287c0 | ||
|
|
e0825d870d | ||
|
|
86dbe6b93d | ||
|
|
e71b74c625 | ||
|
|
45f6ef29e9 | ||
|
|
0fabca19cd | ||
|
|
0bc242c738 | ||
|
|
8c548ceff2 | ||
|
|
46fda05000 | ||
|
|
1fee95be1c | ||
|
|
8c66ae99a3 | ||
|
|
1cf98e2188 | ||
|
|
6a8553a277 | ||
|
|
a02b7d4a1a | ||
|
|
606dfa4e2e | ||
|
|
b6f853a01c | ||
|
|
fc2112ec93 | ||
|
|
6ccfbfeff1 | ||
|
|
f21accd466 | ||
|
|
38b4ace1a8 | ||
|
|
774b6bd72c | ||
|
|
9c4606fefc | ||
|
|
0e50e47cce | ||
|
|
285fa870d0 | ||
|
|
69ed0bf56f | ||
|
|
237b9bccd5 | ||
|
|
f5fd7319e1 | ||
|
|
e04c0c4ace | ||
|
|
f6d0b073da | ||
|
|
68a7cf4f18 | ||
|
|
a91360529f | ||
|
|
bf9ca14deb | ||
|
|
cb92a2b8cb | ||
|
|
8a73d79936 | ||
|
|
2f7d7a0f2a | ||
|
|
d43c0c593f | ||
|
|
1087bd2445 | ||
|
|
5e19a9729b | ||
|
|
69e12d77be | ||
|
|
169d3e964d | ||
|
|
cf503cf921 | ||
|
|
6fd4ef735e | ||
|
|
303087c4c4 | ||
| 68da28ffe8 | |||
|
|
427e76e76e | ||
| b183b5bcfc | |||
|
|
e27880c1e6 | ||
|
|
6f15ef7690 | ||
|
|
0e3a22faa0 | ||
|
|
0dc1e04c89 | ||
|
|
5c7712daad | ||
|
|
f37b75df7b | ||
|
|
6132e45e25 | ||
|
|
753035c452 | ||
|
|
2dc44ac1a6 | ||
|
|
d6a33d5a1c | ||
|
|
6cbd40e6d8 | ||
|
|
b8e00f2ed1 | ||
|
|
b6e18ccae5 | ||
|
|
1fb6586dff | ||
|
|
e6265105b5 | ||
|
|
f8dadac453 | ||
|
|
fc46219a82 | ||
|
|
2546e19d65 | ||
|
|
bb37f980ed | ||
|
|
10e9aee8ce | ||
|
|
4af26a5516 | ||
|
|
3e82e550f3 | ||
|
|
33b540ed9e | ||
|
|
50871d8885 | ||
|
|
83374164db | ||
|
|
c5bfc6bc3d | ||
|
|
d698bf96cc | ||
|
|
b3f88e156c | ||
|
|
7418d60f24 | ||
|
|
3981d5090c | ||
|
|
0bc595f16f | ||
|
|
7abed93972 | ||
| 51feaa0730 | |||
| 8e69aa8bd6 | |||
| 90b2fded48 | |||
| 9125ffeb9e | |||
| 28980e5fbf | |||
| aab0d772a4 | |||
|
|
4b10d7057a | ||
|
|
85aed8c4d7 | ||
|
|
da08be42b4 | ||
| a93a940630 | |||
| 3e353db1fa | |||
|
|
056fea9a8c | ||
|
|
7f783bb7da | ||
|
|
b08f218f30 | ||
|
|
c6640be04a | ||
|
|
eff3c50d9c | ||
|
|
3fa099ad06 | ||
|
|
5e47a861f3 | ||
|
|
37b4b25ead | ||
|
|
edfd145226 | ||
|
|
763ede4bd9 | ||
|
|
284da341e1 | ||
|
|
53ed2431b5 | ||
|
|
b4ab39b3bf | ||
|
|
de61e3efb5 | ||
|
|
29fb36fcd6 | ||
|
|
78f0ff75f2 | ||
|
|
6efd456eaf | ||
|
|
e0c96c0cde | ||
|
|
ada269568a | ||
|
|
dd256ad518 | ||
|
|
12c8bb4f31 | ||
|
|
4e4d380267 | ||
|
|
75647d149a | ||
|
|
52b64540ab | ||
|
|
d7ab497b0e | ||
|
|
683a48a6e3 | ||
|
|
a41fc51f92 | ||
|
|
b9cfd054c1 | ||
|
|
53d4ea51af | ||
| 6296e1a9eb | |||
| 1586bb0702 | |||
|
|
bf10d0949e | ||
| edeaf6af09 | |||
|
|
dbd8297612 | ||
|
|
8d62a13cbc | ||
| 951edd95db | |||
| 9951211596 | |||
| 6d337464f7 | |||
|
|
5a05038a9b | ||
|
|
109d4423bb | ||
| d0b552d74a | |||
|
|
6c1e380a3e | ||
| 83512822b1 | |||
| ccb78103ec | |||
| 6e79ffea34 | |||
| 4f03d37a17 | |||
|
|
c57a1a7205 | ||
|
|
867ae2ceaa | ||
|
|
169db79b2a | ||
|
|
9e4c1da032 | ||
|
|
c8622d1801 | ||
|
|
fdd22c3380 | ||
|
|
53761df85e | ||
|
|
ecaae2b458 | ||
|
|
3cb74d48ca | ||
|
|
8633ed2124 | ||
|
|
6479a3d3c6 | ||
|
|
e41c48f9e5 | ||
|
|
9cfcbfa9d2 | ||
|
|
bcd2b1f0f2 | ||
| 6fb8419b3c | |||
| a4272d6ca9 | |||
|
|
eb6010cba7 | ||
|
|
5a23060e05 | ||
|
|
b92c18cf25 | ||
|
|
6a82eb114d | ||
|
|
97b37b3ce4 | ||
|
|
bbe54969b0 | ||
| 4654117d5e | |||
|
|
8164ce924f | ||
|
|
22911bbc45 | ||
|
|
cae2720585 | ||
|
|
90b6293bc2 | ||
|
|
d110237423 | ||
|
|
117f890612 | ||
|
|
a6a2fd2c66 | ||
|
|
a05ca12770 | ||
|
|
abe7785e94 | ||
|
|
2cedac8d96 | ||
|
|
ea854a0f7b | ||
|
|
d0817809ff | ||
|
|
95f2216f97 | ||
|
|
7e5edf1b33 | ||
|
|
c649a4f4b2 | ||
|
|
cd7233d559 | ||
| 6ff260d052 | |||
| 88d2b72822 | |||
|
|
3c74b315a8 | ||
|
|
f841575378 | ||
|
|
d90377ed62 | ||
|
|
c8d622bda9 | ||
|
|
fbf2d8f567 | ||
|
|
42687a792c | ||
|
|
5c43d35146 | ||
|
|
c1e1dee975 | ||
|
|
742d74a2d0 | ||
|
|
614ffa70a0 | ||
|
|
4b4331fd70 | ||
|
|
e221f7204b | ||
|
|
18fa8e1c47 | ||
|
|
2f02ec52ed | ||
|
|
9464f97e16 | ||
|
|
54467a4a5e | ||
|
|
3a9e175043 | ||
|
|
9dff048cb5 | ||
|
|
f376fd50a9 | ||
|
|
e27cf04f91 | ||
|
|
648504ceb1 | ||
|
|
a4d3ede368 | ||
|
|
92edb996f2 | ||
|
|
2e0c35e6e4 | ||
|
|
baba151d8a | ||
|
|
b44d4107c0 | ||
|
|
f40c67ddf0 | ||
|
|
ec154b4998 | ||
|
|
e2f741cab9 | ||
|
|
47e1547d29 | ||
|
|
28eaac37dc | ||
|
|
214ec9f2b1 | ||
|
|
27ac755bbe | ||
|
|
bed1f6e9cc | ||
|
|
00055ef663 | ||
|
|
aa59a6faf7 | ||
|
|
6997cbeb47 | ||
|
|
fc561b5ec5 | ||
|
|
dacc0068e0 | ||
|
|
e7d2025010 | ||
|
|
b418ab5275 | ||
|
|
c1e782bb32 | ||
|
|
e1a2a36978 | ||
|
|
793bc33b2f | ||
|
|
2109a2d261 | ||
|
|
9e50a39ebf | ||
|
|
7fc564a0ac | ||
|
|
8dfb564fb3 | ||
|
|
f8daff273a | ||
|
|
112e728465 | ||
| 29868531ad | |||
| 95dfb6fdc6 | |||
|
|
9c9d560ce5 | ||
|
|
f1945552ab | ||
|
|
ecd5559aad | ||
|
|
1fa83639c2 | ||
|
|
568719b615 | ||
|
|
74000fa766 | ||
|
|
1d63067614 | ||
|
|
85fd1389db | ||
|
|
cce042045e | ||
|
|
53e3cee196 | ||
|
|
6ee3b23261 | ||
|
|
1a77ba4552 | ||
|
|
eee4e55cf0 | ||
|
|
c2cbaeed30 | ||
|
|
e982a23ed3 | ||
|
|
f6feae5cf2 | ||
|
|
ba75fd5882 | ||
|
|
1eaf40f2f7 | ||
|
|
fe98a23cb4 | ||
|
|
77bf03128e | ||
|
|
8f49a492d8 | ||
| 8df3999f85 | |||
|
|
dd4bb2f7f1 | ||
|
|
6b78b498f7 | ||
|
|
c4130aa20f | ||
|
|
496856d12e | ||
|
|
e97d683545 | ||
|
|
71991ff8c7 | ||
|
|
ae44d47043 | ||
|
|
8b88def9d0 | ||
|
|
fa97229830 | ||
|
|
1946caac6e | ||
|
|
6f5308126b | ||
|
|
6a0c734cec | ||
|
|
13b8863f0c | ||
|
|
f2aaad0048 | ||
|
|
55b441e9fa | ||
|
|
6fece4ca38 | ||
|
|
2fd9b4a62a | ||
|
|
077f7a3cd1 | ||
|
|
c9fe9213b3 | ||
|
|
608839b6a5 | ||
|
|
7da69f18d4 | ||
| 6c63c2f650 | |||
| 149b189629 | |||
|
|
fd8a8b5a4d | ||
| b1fd86e6b5 | |||
| 5e8fdf879d | |||
|
|
fa89e710d8 | ||
|
|
b51ba58063 | ||
|
|
057489e5b9 | ||
|
|
5bae695ae9 | ||
|
|
5b3ed1fbc3 | ||
|
|
f5092e5262 | ||
|
|
3bd6160c3b | ||
|
|
1d0a0a409d | ||
|
|
eb90ab84f2 | ||
|
|
6f37525674 | ||
|
|
eeb8a7ea41 | ||
|
|
df0b571c50 | ||
|
|
ec22427acd | ||
|
|
6c499e877f | ||
|
|
4d9407e4e9 | ||
|
|
28c70f5078 | ||
|
|
14806a1ac7 | ||
|
|
1ebb3e67d6 | ||
|
|
991cdbb9a0 | ||
|
|
278b177c46 | ||
|
|
0630b6257a | ||
|
|
f86d9c47b7 | ||
|
|
ae2088bb9d | ||
|
|
9340c42f2b | ||
|
|
8d7dfd5946 | ||
|
|
894cb273aa | ||
|
|
2996e0c53c | ||
|
|
79ce82d8a0 | ||
|
|
3c8e59c114 | ||
|
|
1493571810 | ||
|
|
a613d89f47 | ||
|
|
5471c59d5f | ||
|
|
ac42223f9e | ||
|
|
c21c9c13ad | ||
|
|
8251509607 | ||
|
|
3083e3f611 | ||
|
|
66add1f3bd | ||
|
|
b8a680df57 | ||
|
|
e969b7fffb | ||
|
|
5d9657781a | ||
|
|
2cd03787cd | ||
|
|
619c5ac3b0 | ||
|
|
89baa91552 | ||
|
|
83b3b1af76 | ||
|
|
19148f21ac | ||
|
|
2da8e392db | ||
|
|
a812b8b108 | ||
|
|
3dc96352e6 | ||
|
|
c2b590d2cf | ||
|
|
842d6969fe | ||
|
|
0f3044ae72 | ||
|
|
11dec8e868 | ||
|
|
d6b1f06721 | ||
|
|
14fcc593c7 | ||
|
|
08ed5ae483 | ||
|
|
b065e6c989 | ||
|
|
372a23cf3a | ||
|
|
4721e8109f | ||
|
|
b58aaccc53 | ||
|
|
294dd3d363 | ||
|
|
e00f552baf | ||
|
|
ae9ded504d | ||
|
|
9753e579c1 | ||
|
|
954cf3eb5b | ||
|
|
2e996c8e91 | ||
|
|
545a43de32 | ||
|
|
e606c35093 | ||
|
|
21ae2d5d40 | ||
|
|
4649298605 | ||
|
|
ae9622d271 | ||
|
|
4366976015 | ||
|
|
5b2a966ac6 | ||
|
|
59308df250 | ||
|
|
9ba1c4c338 | ||
|
|
ec2957bf38 | ||
|
|
8bb5655b2f | ||
|
|
c24ecaaab1 | ||
|
|
483a33996f | ||
|
|
245d7de818 | ||
|
|
49e0cc937e | ||
|
|
6be8158209 | ||
|
|
8e7fcd3cad | ||
|
|
a792a8a533 | ||
|
|
25d8c4645e | ||
|
|
64c552d69d | ||
|
|
fafa400db0 | ||
|
|
0b20a5342e | ||
|
|
f71bdd0962 | ||
|
|
fa4e56a32a | ||
|
|
212bd7a011 | ||
|
|
943864004f | ||
|
|
8ce4d94a96 | ||
|
|
6be193bfbf | ||
|
|
5d3947f117 | ||
|
|
c7bb7be20f | ||
|
|
f74b96bcb6 | ||
|
|
cecfea1ecf | ||
|
|
09ce2b5a6d | ||
|
|
2f9cdadb11 | ||
|
|
e218ce2d85 | ||
|
|
5ec6993342 | ||
|
|
87787cb5bf | ||
|
|
5b618b4f31 | ||
|
|
08a86066d0 | ||
|
|
388eb654a5 | ||
|
|
d8059c3db3 | ||
| 559d17e6c3 | |||
|
|
dfe177447c | ||
|
|
2a5aed6c15 | ||
|
|
f5ad8566eb | ||
| 7c5628d47e | |||
| 9645008460 | |||
| 12dbf09164 | |||
| f09fd7ad34 | |||
| 8986290b12 | |||
| 9a4d3a56a3 | |||
|
|
b0048d6540 | ||
|
|
b1b36ea1a3 | ||
|
|
e568e6e17b | ||
|
|
af955ba418 | ||
|
|
a56e2e7b1e | ||
|
|
a0cdb08893 | ||
|
|
fbb829a915 | ||
|
|
5790da6167 | ||
|
|
c6e4fbd966 | ||
|
|
101ea44051 | ||
|
|
d6c6936f6d | ||
|
|
4929e8172c | ||
|
|
8c83156133 | ||
|
|
d587921a83 | ||
|
|
47a6da9e40 | ||
|
|
6fe6ba20fb | ||
|
|
2ea3cde203 | ||
|
|
059fe98c67 | ||
|
|
1ab05b620a | ||
|
|
4b387d040d | ||
|
|
9d527ab4a6 | ||
|
|
bbc221086a | ||
|
|
e5b7e58a07 | ||
|
|
1704cfba4d | ||
|
|
40dae18b76 | ||
|
|
cfef93134e | ||
| 84ada18299 | |||
| 635fe8017e | |||
| 834380ff05 | |||
| dd65fc2289 | |||
| 86125bb625 | |||
| 09a9d8b380 | |||
| 86b223ec93 | |||
| 78f6080321 | |||
| c7be6f6e0e | |||
| c40c31fbb7 | |||
| f5fbc1e32d | |||
| 0a20378acd | |||
| d4e87877b6 | |||
| 7eb7236b8a | |||
| dc0e4ffce2 | |||
| 86fe93943d | |||
| 3258113ef8 | |||
| ebf3999cfe | |||
| a1ccbbb5b9 | |||
| 35072c40d8 | |||
| 5c51021388 | |||
| 95fd527515 | |||
| 113d851cea | |||
| 72f0c460f9 | |||
| 13ddd15b44 | |||
| c9e24aaf5f | |||
| 68c0ac0ffc | |||
| bebda275a9 | |||
| 287eaae850 | |||
| 7e59c3b9a7 | |||
| 38658a5b8c | |||
| 88c75b8672 | |||
| 17ab1e6830 | |||
| 1f45110e5f | |||
| 5401166a07 | |||
| bfa8188782 | |||
| e777a71784 | |||
| c13e91a0d0 | |||
| aac5d57352 | |||
| ceca13c7b6 | |||
| 2905470330 | |||
| 2c17033822 | |||
| 0a4cb9e9b1 | |||
| 096651f4c1 | |||
| 275a08506b | |||
| 4cd61cb381 | |||
| 9ad1147581 | |||
| 35e09def1b | |||
| 0469607a71 | |||
| d115d22ee6 | |||
| 8120ae621d | |||
| f873c2fa9f | |||
| c3ffbe2f42 | |||
| 55a0a39881 | |||
| 592215dd30 | |||
| ef0c2a2785 | |||
| 37979e452a | |||
| e9671bb727 | |||
| aa328bd591 | |||
| 188e4313f9 | |||
| df02c70e31 | |||
| 257f54b323 | |||
| fb4b5b2575 | |||
| 4e1251276d | |||
| a7b200dc57 | |||
| 8cadbae80e | |||
| c3bae49aae | |||
|
|
6fa4fc6149 | ||
| f1ffe1acaa | |||
| 5c9ddf7f00 | |||
| 431767a150 | |||
| 8ba4e442a6 | |||
| 2f8d19c267 | |||
| f2fd98f742 | |||
| 3ce35d6e81 | |||
| 796dbaa836 | |||
| 84b209ec7f | |||
| fa976b34dc | |||
| e7cda362b7 | |||
| a41a09c162 | |||
| e82f84f0ab | |||
| f1d387ceea | |||
| 3893d4d1f8 | |||
| cf7ac50faf | |||
| 3f6bf15554 | |||
| dac74829b4 | |||
| 94d6f213a0 | |||
| 8f2550ef61 | |||
| b622a1cc5e | |||
| c83a3c32c7 | |||
| e7dcf7f7e7 | |||
| 398785a2be | |||
| 05dba0f1f5 | |||
| 39dbd32b2e | |||
| 23a34a455a | |||
| 4308328b48 | |||
|
|
4e44831bbe | ||
|
|
0c1e0e48d4 | ||
|
|
6884df02fd | ||
|
|
63655d18c5 | ||
|
|
4170699348 | ||
|
|
d58a9beb3d | ||
|
|
5049f3b2d8 | ||
|
|
6e44eebb9e | ||
|
|
aecbab5613 | ||
|
|
6bf90f29c5 | ||
|
|
19edce1770 | ||
|
|
e17b96b2d6 | ||
|
|
9b6feb9367 | ||
|
|
1dfd717093 | ||
|
|
68ef6f08c6 | ||
|
|
a0b80c6096 | ||
|
|
59ac8a3f60 | ||
|
|
dd281bbca8 | ||
|
|
2e48be97b6 | ||
|
|
0b7550e5ca | ||
|
|
391c67b1a9 | ||
|
|
975cc79085 | ||
|
|
468babae87 | ||
|
|
516d4263c9 | ||
|
|
ba35123420 | ||
|
|
409703d675 | ||
|
|
570c3f7462 | ||
|
|
42d02a9e63 | ||
|
|
819c93f6fb | ||
|
|
0c645cbc78 | ||
|
|
e665cc7500 | ||
|
|
0a516ac98d |
42
.github/ISSUE_TEMPLATE/1-bug.yaml
vendored
Normal file
42
.github/ISSUE_TEMPLATE/1-bug.yaml
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
name: Bug Report
|
||||
description: File a bug report.
|
||||
title: "[Bug]: "
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Thanks for taking the time to fill out this bug report! Please attach any minimal reproduction projects!
|
||||
- type: textarea
|
||||
id: description-area
|
||||
attributes:
|
||||
label: Description
|
||||
description: Please provide a description of the bug and what you expected to happen.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: steps-area
|
||||
attributes:
|
||||
label: Steps to reproduce
|
||||
description: Please provide reproduction steps if possible.
|
||||
validations:
|
||||
required: true
|
||||
- type: dropdown
|
||||
id: version
|
||||
attributes:
|
||||
label: Version
|
||||
description: What version of Flax are you running?
|
||||
options:
|
||||
- '1.8'
|
||||
- '1.9'
|
||||
- '1.10'
|
||||
- '1.11'
|
||||
- master branch
|
||||
default: 2
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: logs
|
||||
attributes:
|
||||
label: Relevant logs
|
||||
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
|
||||
render: shell
|
||||
22
.github/ISSUE_TEMPLATE/2-feature-request.yaml
vendored
Normal file
22
.github/ISSUE_TEMPLATE/2-feature-request.yaml
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
name: Feature Request
|
||||
description: File a feature request.
|
||||
title: "[Request]: "
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Thanks for taking the time to fill out a feature request!
|
||||
- type: textarea
|
||||
id: description-area
|
||||
attributes:
|
||||
label: Description
|
||||
description: Please provide a description of the feature!
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: benefits-area
|
||||
attributes:
|
||||
label: Benefits
|
||||
description: Please provide what benefits this feature would provide to the engine!
|
||||
validations:
|
||||
required: true
|
||||
4
.github/workflows/build_linux.yml
vendored
4
.github/workflows/build_linux.yml
vendored
@@ -16,7 +16,7 @@ jobs:
|
||||
uses: actions/checkout@v3
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get install libx11-dev libxcursor-dev libxinerama-dev build-essential gettext libtool libtool-bin libpulse-dev libasound2-dev libjack-dev portaudio19-dev
|
||||
sudo apt-get install libx11-dev libxcursor-dev libxinerama-dev build-essential gettext libtool libtool-bin libpulse-dev libasound2-dev libjack-dev portaudio19-dev libwayland-dev
|
||||
- name: Setup Vulkan
|
||||
uses: ./.github/actions/vulkan
|
||||
- name: Setup .NET
|
||||
@@ -44,7 +44,7 @@ jobs:
|
||||
uses: actions/checkout@v3
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get install libx11-dev libxcursor-dev libxinerama-dev
|
||||
sudo apt-get install libx11-dev libxcursor-dev libxinerama-dev libwayland-dev
|
||||
- name: Setup Vulkan
|
||||
uses: ./.github/actions/vulkan
|
||||
- name: Setup .NET
|
||||
|
||||
2
.github/workflows/tests.yml
vendored
2
.github/workflows/tests.yml
vendored
@@ -28,7 +28,7 @@ jobs:
|
||||
git lfs pull
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get install libx11-dev libxcursor-dev libxinerama-dev build-essential gettext libtool libtool-bin libpulse-dev libasound2-dev libjack-dev portaudio19-dev
|
||||
sudo apt-get install libx11-dev libxcursor-dev libxinerama-dev build-essential gettext libtool libtool-bin libpulse-dev libasound2-dev libjack-dev portaudio19-dev libwayland-dev
|
||||
- name: Build
|
||||
run: |
|
||||
./GenerateProjectFiles.sh -vs2022 -log -verbose -printSDKs -dotnet=8
|
||||
|
||||
BIN
Content/Editor/Camera/M_Camera.flax
(Stored with Git LFS)
BIN
Content/Editor/Camera/M_Camera.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Editor/CubeTexturePreviewMaterial.flax
(Stored with Git LFS)
BIN
Content/Editor/CubeTexturePreviewMaterial.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Editor/DebugMaterials/DDGIDebugProbes.flax
(Stored with Git LFS)
BIN
Content/Editor/DebugMaterials/DDGIDebugProbes.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Editor/DebugMaterials/SingleColor/Decal.flax
(Stored with Git LFS)
BIN
Content/Editor/DebugMaterials/SingleColor/Decal.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Editor/DebugMaterials/SingleColor/Particle.flax
(Stored with Git LFS)
BIN
Content/Editor/DebugMaterials/SingleColor/Particle.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Editor/DebugMaterials/SingleColor/Surface.flax
(Stored with Git LFS)
BIN
Content/Editor/DebugMaterials/SingleColor/Surface.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Editor/DebugMaterials/SingleColor/SurfaceAdditive.flax
(Stored with Git LFS)
BIN
Content/Editor/DebugMaterials/SingleColor/SurfaceAdditive.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Editor/DebugMaterials/SingleColor/Terrain.flax
(Stored with Git LFS)
BIN
Content/Editor/DebugMaterials/SingleColor/Terrain.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Editor/DefaultFontMaterial.flax
(Stored with Git LFS)
BIN
Content/Editor/DefaultFontMaterial.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Editor/Gizmo/FoliageBrushMaterial.flax
(Stored with Git LFS)
BIN
Content/Editor/Gizmo/FoliageBrushMaterial.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Editor/Gizmo/Material.flax
(Stored with Git LFS)
BIN
Content/Editor/Gizmo/Material.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Editor/Gizmo/MaterialAxisLocked.flax
(Stored with Git LFS)
BIN
Content/Editor/Gizmo/MaterialAxisLocked.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Editor/Gizmo/MaterialWire.flax
(Stored with Git LFS)
BIN
Content/Editor/Gizmo/MaterialWire.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Editor/Gizmo/SelectionOutlineMaterial.flax
(Stored with Git LFS)
BIN
Content/Editor/Gizmo/SelectionOutlineMaterial.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Editor/Gizmo/VertexColorsPreviewMaterial.flax
(Stored with Git LFS)
BIN
Content/Editor/Gizmo/VertexColorsPreviewMaterial.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Editor/Highlight Material.flax
(Stored with Git LFS)
BIN
Content/Editor/Highlight Material.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Editor/Icons/IconsMaterial.flax
(Stored with Git LFS)
BIN
Content/Editor/Icons/IconsMaterial.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Editor/IconsAtlas.flax
(Stored with Git LFS)
BIN
Content/Editor/IconsAtlas.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Editor/IesProfilePreviewMaterial.flax
(Stored with Git LFS)
BIN
Content/Editor/IesProfilePreviewMaterial.flax
(Stored with Git LFS)
Binary file not shown.
@@ -13,7 +13,7 @@
|
||||
META_CB_BEGIN(0, Data)
|
||||
float4x4 WorldMatrix;
|
||||
float4x4 InvWorld;
|
||||
float4x4 SVPositionToWorld;
|
||||
float4x4 SvPositionToWorld;
|
||||
@1META_CB_END
|
||||
|
||||
// Use depth buffer for per-pixel decal layering
|
||||
@@ -27,12 +27,63 @@ struct MaterialInput
|
||||
float3 WorldPosition;
|
||||
float TwoSidedSign;
|
||||
float2 TexCoord;
|
||||
float4 TexCoord_DDX_DDY;
|
||||
float3x3 TBN;
|
||||
float4 SvPosition;
|
||||
float3 PreSkinnedPosition;
|
||||
float3 PreSkinnedNormal;
|
||||
};
|
||||
|
||||
// Calculates decal texcoords for a given pixel position (sampels depth buffer and projects value to decal space).
|
||||
float2 SvPositionToDecalUV(float4 svPosition)
|
||||
{
|
||||
float2 screenUV = svPosition.xy * ScreenSize.zw;
|
||||
svPosition.z = SAMPLE_RT(DepthBuffer, screenUV).r;
|
||||
float4 positionHS = mul(float4(svPosition.xyz, 1), SvPositionToWorld);
|
||||
float3 positionWS = positionHS.xyz / positionHS.w;
|
||||
float3 positionOS = mul(float4(positionWS, 1), InvWorld).xyz;
|
||||
return positionOS.xz + 0.5f;
|
||||
}
|
||||
|
||||
// Manually compute ddx/ddy for decal texture cooordinates to avoid the 2x2 pixels artifacts on the edges of geometry under decal
|
||||
// [Reference: https://www.humus.name/index.php?page=3D&ID=84]
|
||||
float4 CalculateTextureDerivatives(float4 svPosition, float2 texCoord)
|
||||
{
|
||||
float4 svDiffX = float4(1, 0, 0, 0);
|
||||
float2 uvDiffX0 = texCoord - SvPositionToDecalUV(svPosition - svDiffX);
|
||||
float2 uvDiffX1 = SvPositionToDecalUV(svPosition + svDiffX) - texCoord;
|
||||
float2 dx = dot(uvDiffX0, uvDiffX0) < dot(uvDiffX1, uvDiffX1) ? uvDiffX0 : uvDiffX1;
|
||||
|
||||
float4 svDiffY = float4(0, 1, 0, 0);
|
||||
float2 uvDiffY0 = texCoord - SvPositionToDecalUV(svPosition - svDiffY);
|
||||
float2 uvDiffY1 = SvPositionToDecalUV(svPosition + svDiffY) - texCoord;
|
||||
float2 dy = dot(uvDiffY0, uvDiffY0) < dot(uvDiffY1, uvDiffY1) ? uvDiffY0 : uvDiffY1;
|
||||
|
||||
return float4(dx, dy);
|
||||
}
|
||||
|
||||
// Computes the mipmap level for a specific texture dimensions to be sampled at decal texture cooordinates.
|
||||
// [Reference: https://hugi.scene.org/online/coding/hugi%2014%20-%20comipmap.htm]
|
||||
float CalculateTextureMipmap(MaterialInput input, float2 textureSize)
|
||||
{
|
||||
float2 dx = input.TexCoord_DDX_DDY.xy * textureSize;
|
||||
float2 dy = input.TexCoord_DDX_DDY.zw * textureSize;
|
||||
float d = max(dot(dx, dx), dot(dy, dy));
|
||||
return (0.5 * 0.5) * log2(d); // Hardcoded half-mip rate reduction to avoid artifacts when decal is moved over dither texture
|
||||
}
|
||||
float CalculateTextureMipmap(MaterialInput input, Texture2D t)
|
||||
{
|
||||
float2 textureSize;
|
||||
t.GetDimensions(textureSize.x, textureSize.y);
|
||||
return CalculateTextureMipmap(input, textureSize);
|
||||
}
|
||||
float CalculateTextureMipmap(MaterialInput input, TextureCube t)
|
||||
{
|
||||
float2 textureSize;
|
||||
t.GetDimensions(textureSize.x, textureSize.y);
|
||||
return CalculateTextureMipmap(input, textureSize);
|
||||
}
|
||||
|
||||
// Transforms a vector from tangent space to world space
|
||||
float3 TransformTangentVectorToWorld(MaterialInput input, float3 tangentVector)
|
||||
{
|
||||
@@ -116,7 +167,6 @@ Material GetMaterialPS(MaterialInput input)
|
||||
}
|
||||
|
||||
// Input macro specified by the material: DECAL_BLEND_MODE
|
||||
|
||||
#define DECAL_BLEND_MODE_TRANSLUCENT 0
|
||||
#define DECAL_BLEND_MODE_STAIN 1
|
||||
#define DECAL_BLEND_MODE_NORMAL 2
|
||||
@@ -153,7 +203,7 @@ void PS_Decal(
|
||||
float2 screenUV = SvPosition.xy * ScreenSize.zw;
|
||||
SvPosition.z = SAMPLE_RT(DepthBuffer, screenUV).r;
|
||||
|
||||
float4 positionHS = mul(float4(SvPosition.xyz, 1), SVPositionToWorld);
|
||||
float4 positionHS = mul(float4(SvPosition.xyz, 1), SvPositionToWorld);
|
||||
float3 positionWS = positionHS.xyz / positionHS.w;
|
||||
float3 positionOS = mul(float4(positionWS, 1), InvWorld).xyz;
|
||||
|
||||
@@ -166,8 +216,9 @@ void PS_Decal(
|
||||
materialInput.TexCoord = decalUVs;
|
||||
materialInput.TwoSidedSign = 1;
|
||||
materialInput.SvPosition = SvPosition;
|
||||
|
||||
// Build tangent to world transformation matrix
|
||||
materialInput.TexCoord_DDX_DDY = CalculateTextureDerivatives(materialInput.SvPosition, materialInput.TexCoord);
|
||||
|
||||
// Calculate tangent-space
|
||||
float3 ddxWp = ddx(positionWS);
|
||||
float3 ddyWp = ddy(positionWS);
|
||||
materialInput.TBN[0] = normalize(ddyWp);
|
||||
|
||||
@@ -27,6 +27,7 @@ TextureCube EnvProbe : register(t__SRV__);
|
||||
TextureCube SkyLightTexture : register(t__SRV__);
|
||||
Buffer<float4> ShadowsBuffer : register(t__SRV__);
|
||||
Texture2D<float> ShadowMap : register(t__SRV__);
|
||||
Texture3D VolumetricFogTexture : register(t__SRV__);
|
||||
@4// Forward Shading: Utilities
|
||||
@5// Forward Shading: Shaders
|
||||
|
||||
@@ -143,9 +144,21 @@ void PS_Forward(
|
||||
|
||||
#endif
|
||||
|
||||
#if USE_FOG
|
||||
#if USE_FOG && MATERIAL_SHADING_MODEL != SHADING_MODEL_UNLIT
|
||||
// Calculate exponential height fog
|
||||
float4 fog = GetExponentialHeightFog(ExponentialHeightFog, materialInput.WorldPosition, ViewPos, 0);
|
||||
float4 fog = GetExponentialHeightFog(ExponentialHeightFog, materialInput.WorldPosition, ViewPos, 0, gBuffer.ViewPos.z);
|
||||
|
||||
if (ExponentialHeightFog.VolumetricFogMaxDistance > 0)
|
||||
{
|
||||
// Sample volumetric fog and mix it in
|
||||
float2 screenUV = materialInput.SvPosition.xy * ScreenSize.zw;
|
||||
float3 viewVector = materialInput.WorldPosition - ViewPos;
|
||||
float sceneDepth = length(viewVector);
|
||||
float depthSlice = sceneDepth / ExponentialHeightFog.VolumetricFogMaxDistance;
|
||||
float3 volumeUV = float3(screenUV, depthSlice);
|
||||
float4 volumetricFog = VolumetricFogTexture.SampleLevel(SamplerLinearClamp, volumeUV, 0);
|
||||
fog = CombineVolumetricFog(fog, volumetricFog);
|
||||
}
|
||||
|
||||
// Apply fog to the output color
|
||||
#if MATERIAL_BLEND == MATERIAL_BLEND_OPAQUE
|
||||
|
||||
@@ -20,6 +20,8 @@ float TimeParam;
|
||||
float4 ViewInfo;
|
||||
float4 ScreenSize;
|
||||
float4 ViewSize;
|
||||
float3 ViewPadding0;
|
||||
float UnscaledTimeParam;
|
||||
@1META_CB_END
|
||||
|
||||
// Shader resources
|
||||
|
||||
@@ -645,7 +645,7 @@ VertexOutput VS_Ribbon(RibbonInput input, uint vertexIndex : SV_VertexID)
|
||||
materialInput.TBN = output.TBN;
|
||||
materialInput.TwoSidedSign = 1;
|
||||
materialInput.SvPosition = output.Position;
|
||||
materialInput.PreSkinnedPosition = Position;
|
||||
materialInput.PreSkinnedPosition = position;
|
||||
materialInput.PreSkinnedNormal = tangentToLocal[2].xyz;
|
||||
materialInput.InstanceOrigin = output.InstanceOrigin;
|
||||
materialInput.InstanceParams = output.InstanceParams;
|
||||
|
||||
@@ -19,6 +19,8 @@ float4 ViewInfo;
|
||||
float4 ScreenSize;
|
||||
float4 TemporalAAJitter;
|
||||
float4x4 InverseViewProjectionMatrix;
|
||||
float3 ViewPadding0;
|
||||
float UnscaledTimeParam;
|
||||
@1META_CB_END
|
||||
|
||||
// Shader resources
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "./Flax/Common.hlsl"
|
||||
#include "./Flax/MaterialCommon.hlsl"
|
||||
#include "./Flax/GBufferCommon.hlsl"
|
||||
#include "./Flax/TerrainCommon.hlsl"
|
||||
@7
|
||||
// Primary constant buffer (with additional material parameters)
|
||||
META_CB_BEGIN(0, Data)
|
||||
@@ -334,7 +335,7 @@ VertexOutput VS(TerrainVertexInput input)
|
||||
float lodValue = CurrentLOD;
|
||||
float morphAlpha = lodCalculated - CurrentLOD;
|
||||
|
||||
// Sample heightmap
|
||||
// Sample heightmap and splatmaps
|
||||
float2 heightmapUVs = input.TexCoord * HeightmapUVScaleBias.xy + HeightmapUVScaleBias.zw;
|
||||
#if USE_SMOOTH_LOD_TRANSITION
|
||||
float4 heightmapValueThisLOD = Heightmap.SampleLevel(SamplerPointClamp, heightmapUVs, lodValue);
|
||||
@@ -342,7 +343,6 @@ VertexOutput VS(TerrainVertexInput input)
|
||||
float2 heightmapUVsNextLOD = nextLODPos * HeightmapUVScaleBias.xy + HeightmapUVScaleBias.zw;
|
||||
float4 heightmapValueNextLOD = Heightmap.SampleLevel(SamplerPointClamp, heightmapUVsNextLOD, lodValue + 1);
|
||||
float4 heightmapValue = lerp(heightmapValueThisLOD, heightmapValueNextLOD, morphAlpha);
|
||||
bool isHole = max(heightmapValueThisLOD.b + heightmapValueThisLOD.a, heightmapValueNextLOD.b + heightmapValueNextLOD.a) >= 1.9f;
|
||||
#if USE_TERRAIN_LAYERS
|
||||
float4 splatmapValueThisLOD = Splatmap0.SampleLevel(SamplerPointClamp, heightmapUVs, lodValue);
|
||||
float4 splatmapValueNextLOD = Splatmap0.SampleLevel(SamplerPointClamp, heightmapUVsNextLOD, lodValue + 1);
|
||||
@@ -355,7 +355,6 @@ VertexOutput VS(TerrainVertexInput input)
|
||||
#endif
|
||||
#else
|
||||
float4 heightmapValue = Heightmap.SampleLevel(SamplerPointClamp, heightmapUVs, lodValue);
|
||||
bool isHole = (heightmapValue.b + heightmapValue.a) >= 1.9f;
|
||||
#if USE_TERRAIN_LAYERS
|
||||
float4 splatmap0Value = Splatmap0.SampleLevel(SamplerPointClamp, heightmapUVs, lodValue);
|
||||
#if TERRAIN_LAYERS_DATA_SIZE > 1
|
||||
@@ -363,12 +362,11 @@ VertexOutput VS(TerrainVertexInput input)
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
float height = (float)((int)(heightmapValue.x * 255.0) + ((int)(heightmapValue.y * 255) << 8)) / 65535.0;
|
||||
float height = DecodeHeightmapHeight(heightmapValue);
|
||||
|
||||
// Extract normal and the holes mask
|
||||
float2 normalTemp = float2(heightmapValue.b, heightmapValue.a) * 2.0f - 1.0f;
|
||||
float3 normal = float3(normalTemp.x, sqrt(1.0 - saturate(dot(normalTemp, normalTemp))), normalTemp.y);
|
||||
normal = normalize(normal);
|
||||
bool isHole;
|
||||
float3 normal = DecodeHeightmapNormal(heightmapValue, isHole);
|
||||
output.Geometry.HolesMask = isHole ? 0 : 1;
|
||||
if (isHole)
|
||||
{
|
||||
@@ -438,7 +436,6 @@ VertexOutput VS(TerrainVertexInput input)
|
||||
// Apply world position offset per-vertex
|
||||
#if USE_POSITION_OFFSET
|
||||
output.Geometry.WorldPosition += material.PositionOffset;
|
||||
output.Geometry.PrevWorldPosition += material.PositionOffset;
|
||||
output.Position = mul(float4(output.Geometry.WorldPosition, 1), ViewProjectionMatrix);
|
||||
#endif
|
||||
|
||||
|
||||
BIN
Content/Editor/Particles/Particle Material Color.flax
(Stored with Git LFS)
BIN
Content/Editor/Particles/Particle Material Color.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Editor/Particles/Smoke Material.flax
(Stored with Git LFS)
BIN
Content/Editor/Particles/Smoke Material.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Editor/SpriteMaterial.flax
(Stored with Git LFS)
BIN
Content/Editor/SpriteMaterial.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Editor/Terrain/Circle Brush Material.flax
(Stored with Git LFS)
BIN
Content/Editor/Terrain/Circle Brush Material.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Editor/Terrain/Highlight Terrain Material.flax
(Stored with Git LFS)
BIN
Content/Editor/Terrain/Highlight Terrain Material.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Editor/TexturePreviewMaterial.flax
(Stored with Git LFS)
BIN
Content/Editor/TexturePreviewMaterial.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Editor/Wires Debug Material.flax
(Stored with Git LFS)
BIN
Content/Editor/Wires Debug Material.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Engine/DefaultDeformableMaterial.flax
(Stored with Git LFS)
BIN
Content/Engine/DefaultDeformableMaterial.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Engine/DefaultMaterial.flax
(Stored with Git LFS)
BIN
Content/Engine/DefaultMaterial.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Engine/DefaultRadialMenu.flax
(Stored with Git LFS)
BIN
Content/Engine/DefaultRadialMenu.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Engine/DefaultTerrainMaterial.flax
(Stored with Git LFS)
BIN
Content/Engine/DefaultTerrainMaterial.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Engine/SingleColorMaterial.flax
(Stored with Git LFS)
BIN
Content/Engine/SingleColorMaterial.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Engine/SkyboxMaterial.flax
(Stored with Git LFS)
BIN
Content/Engine/SkyboxMaterial.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Shaders/Editor/Grid.flax
(Stored with Git LFS)
BIN
Content/Shaders/Editor/Grid.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Shaders/Fog.flax
(Stored with Git LFS)
BIN
Content/Shaders/Fog.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Shaders/SSAO.flax
(Stored with Git LFS)
BIN
Content/Shaders/SSAO.flax
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Shaders/Sky.flax
(Stored with Git LFS)
BIN
Content/Shaders/Sky.flax
(Stored with Git LFS)
Binary file not shown.
@@ -13,6 +13,7 @@
|
||||
"Configuration": {
|
||||
"UseCSharp": true,
|
||||
"UseLargeWorlds": false,
|
||||
"UseDotNet": true
|
||||
"UseDotNet": true,
|
||||
"UseSDL": true
|
||||
}
|
||||
}
|
||||
@@ -73,6 +73,24 @@
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CppNaming/UserRules/=TYPEDEF/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aa_bb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CppNaming/UserRules/=UNION/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aa_bb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CppNaming/UserRules/=UNION_005FMEMBER/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aa_bb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CppNamingOptions/Abbreviations/=CCD/@EntryIndexedValue">CCD</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CppNamingOptions/Abbreviations/=GPU/@EntryIndexedValue">GPU</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CppNamingOptions/Abbreviations/=ID/@EntryIndexedValue">ID</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=175CE9C669E52F4D92FD2C07848740BD/@EntryIndexedValue"><NamingElement Priority="11" Title="Class and struct public fields"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="PUBLIC"><type Name="class field" /><type Name="struct field" /></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="AaBb" /></NamingElement></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=32EB6D69783B3E4481A733193E338089/@EntryIndexedValue"><NamingElement Priority="9" Title="Class and struct methods"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="member function" /></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="AaBb" /></NamingElement></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=3C4E0D59F298854F9608A9B454E8FF5E/@EntryIndexedValue"><NamingElement Priority="17" Title="Typedefs"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="type alias" /><type Name="typedef" /></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="AaBb" /></NamingElement></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=499C9026DADA2B448BCD0B2C54746A59/@EntryIndexedValue"><NamingElement Priority="14" Title="Other constants"><Descriptor Static="True" Constexpr="Indeterminate" Const="True" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="class field" /><type Name="local variable" /><type Name="struct field" /></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="AaBb" /></NamingElement></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=50D2535711CE1A43A3B06EF841C36CFD/@EntryIndexedValue"><NamingElement Priority="13" Title="Enum members"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="scoped enumerator" /><type Name="unscoped enumerator" /></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="AaBb" /></NamingElement></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=6AD3BADA1260CC4D840AB26323C51827/@EntryIndexedValue"><NamingElement Priority="15" Title="Global constants"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="True" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="global variable" /></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="AaBb" /></NamingElement></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=904CDCA174AACE4AA52660A247CDF9A0/@EntryIndexedValue"><NamingElement Priority="7" Title="Global variables"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="global variable" /></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="AaBb" /></NamingElement></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=95BCDE767C97B64DB3DAE800DBBBC758/@EntryIndexedValue"><NamingElement Priority="5" Title="Parameters"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="function parameter" /><type Name="lambda parameter" /></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="aaBb" /></NamingElement></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=C03AE454FC2CBA43819AC75E4D6C9C8C/@EntryIndexedValue"><NamingElement Priority="1" Title="Classes and structs"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="__interface" /><type Name="class" /><type Name="struct" /></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="AaBb" /></NamingElement></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=D49E31C610641E4CAD0407DB79ACC851/@EntryIndexedValue"><NamingElement Priority="8" Title="Global functions"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="global function" /></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="AaBb" /></NamingElement></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=D73FBB3529BC5449B6C85BB37B26A8D4/@EntryIndexedValue"><NamingElement Priority="16" Title="Namespaces"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="namespace" /><type Name="namespace alias" /></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="AaBb" /></NamingElement></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=DA41807CE47AEB4CBE1724C44D0B786E/@EntryIndexedValue"><NamingElement Priority="6" Title="Local variables"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="local variable" /></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="aaBb" /></NamingElement></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=DDF30C9A1DA74B4DBBC56D25FDF886AA/@EntryIndexedValue"><NamingElement Priority="10" Title="Class and struct fields"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="class field" /><type Name="struct field" /></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="_" Suffix="" Style="aaBb" /></NamingElement></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=EF70A6BF54ACE446971DDB32344C25A3/@EntryIndexedValue"><NamingElement Priority="12" Title="Union members"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="union member" /></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="AaBb" /></NamingElement></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CppNamingOptions/Rules/=F37818C54C323A4A80B1A478629985AE/@EntryIndexedValue"><NamingElement Priority="2" Title="Enums"><Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"><type Name="enum" /></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="AaBb" /></NamingElement></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=AI/@EntryIndexedValue">AI</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=ARGB/@EntryIndexedValue">ARGB</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=LO/@EntryIndexedValue">LO</s:String>
|
||||
@@ -213,6 +231,7 @@
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=YZ/@EntryIndexedValue">YZ</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PublicFields/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb"><ExtraRule Prefix="_" Suffix="" Style="aaBb" /></Policy></s:String>
|
||||
<s:String x:Key="/Default/Environment/Hierarchy/PsiConfigurationSettingsKey/CustomLocation/@EntryValue">C:\Users\Wojtek\AppData\Local\JetBrains\Transient\ReSharperPlatformVs15\v08_f9eacea9\SolutionCaches</s:String>
|
||||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EFeature_002EServices_002ECpp_002ECodeStyle_002ENaming_002ECppNamingOptionsMigration/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EFeature_002EServices_002ECpp_002ECodeStyle_002ESettingsUpgrade_002EFunctionReturnStyleSettingsUpgrader/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EFeature_002EServices_002ECpp_002ECodeStyle_002ESettingsUpgrade_002ENamespaceIndentationSettingsUpgrader/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpAttributeForSingleLineMethodUpgrade/@EntryIndexedValue">True</s:Boolean>
|
||||
@@ -267,6 +286,7 @@
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=comperand/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=coord/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=cubemap/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=DDGI/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Deformer/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=deformers/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=defragmentation/@EntryIndexedValue">True</s:Boolean>
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
<!-- Please search existing issues for potential duplicates before filing yours:
|
||||
https://github.com/flaxengine/FlaxEngine/issues?q=is%3Aissue
|
||||
-->
|
||||
|
||||
**Issue description:**
|
||||
<!-- What happened, and what was expected. -->
|
||||
<!-- Log file, can be found in the project directory's `Logs` folder (optional) -->
|
||||
|
||||
**Steps to reproduce:**
|
||||
<!-- Enter minimal reproduction steps if available. -->
|
||||
|
||||
|
||||
**Minimal reproduction project:**
|
||||
<!-- Recommended as it greatly speeds up debugging. Drag and drop a zip archive to upload it. -->
|
||||
|
||||
|
||||
**Flax version:**
|
||||
<!-- Specify version number. -->
|
||||
|
||||
13
README.md
13
README.md
@@ -6,7 +6,7 @@
|
||||
Flax Engine is a high quality modern 3D game engine written in C++ and C#.
|
||||
From stunning graphics to powerful scripts, it's designed for fast workflow with many ready-to-use features waiting for you right now. To learn more see the website ([www.flaxengine.com](https://flaxengine.com)).
|
||||
|
||||
This repository contains full source code of the Flax Engine (excluding NDA-protected platforms support). Anyone is welcome to contribute or use the modified source in Flax-based games.
|
||||
This repository contains full source code of the Flax Engine (excluding NDA-protected platforms support). Documentation source is also available in a separate repository. Anyone is welcome to contribute or use the modified source in Flax-based games.
|
||||
|
||||
# Development
|
||||
|
||||
@@ -46,21 +46,26 @@ Follow the instructions below to compile and run the engine from source.
|
||||
* Install Visual Studio Code
|
||||
* Install .NET 8 or 9 SDK ([https://dotnet.microsoft.com/en-us/download/dotnet/8.0](https://dotnet.microsoft.com/en-us/download/dotnet/8.0))
|
||||
* Ubuntu: `sudo apt install dotnet-sdk-8.0`
|
||||
* Fedora: `sudo dnf install dotnet-sdk-8.0`
|
||||
* Arch: `sudo pacman -S dotnet-sdk-8.0 dotnet-runtime-8.0 dotnet-targeting-pack-8.0 dotnet-host`
|
||||
* Install Vulkan SDK ([https://vulkan.lunarg.com/](https://vulkan.lunarg.com/))
|
||||
* Ubuntu: `sudo apt install vulkan-sdk`
|
||||
* Arch: `sudo pacman -S spirv-tools vulkan-headers vulkan-tools vulkan-validation-layers`
|
||||
* Fedora: `sudo dnf install vulkan-headers vulkan-tools vulkan-validation-layers`
|
||||
* Arch: `sudo pacman -S vulkan-headers vulkan-tools vulkan-validation-layers`
|
||||
* Install Git with LFS
|
||||
* Ubuntu: `sudo apt-get install git git-lfs`
|
||||
* Arch: `sudo pacman -S git git-lfs`
|
||||
* `git-lfs install`
|
||||
* Install the required packages:
|
||||
* Ubuntu: `sudo apt-get install libx11-dev libxcursor-dev libxinerama-dev zlib1g-dev`
|
||||
* Arch: `sudo pacman -S base-devel libx11 libxcursor libxinerama zlib`
|
||||
* Ubuntu: `sudo apt-get install libx11-dev libxcursor-dev libxinerama-dev zlib1g-dev zenity wayland-protocols libportal-dev`
|
||||
* Fedora: `sudo dnf install libX11-devel libXcursor-devel libXinerama-devel ghc-zlib-devel zenity wayland-protocols-devel libportal`
|
||||
* Arch: `sudo pacman -S base-devel libx11 libxcursor libxinerama zlib zenity wayland-protocols libportal`
|
||||
* Install Clang compiler (version 6 or later):
|
||||
* Ubuntu: `sudo apt-get install clang lldb lld`
|
||||
* Fedora: `sudo dnf install clang llvm lldb lld`
|
||||
* Arch: `sudo pacman -S clang lldb lld`
|
||||
* Clone the repository (with LFS)
|
||||
* git-lfs clone https://github.com/FlaxEngine/FlaxEngine.git
|
||||
* Run `./GenerateProjectFiles.sh`
|
||||
* Open workspace with Visual Code
|
||||
* Build and run (configuration and task named `Flax|Editor.Linux.Development|x64`)
|
||||
|
||||
@@ -13,6 +13,11 @@ namespace FlaxEditor.Content.Create
|
||||
/// <inheritdoc />
|
||||
public string ResultUrl { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating wether a file can be created based on the current settings.
|
||||
/// </summary>
|
||||
public abstract bool CanBeCreated { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether this entry has settings to modify.
|
||||
/// </summary>
|
||||
|
||||
@@ -60,7 +60,8 @@ namespace FlaxEditor.Content.Create
|
||||
Text = "Create",
|
||||
AnchorPreset = AnchorPresets.BottomRight,
|
||||
Offsets = new Margin(-ButtonsWidth - ButtonsMargin, ButtonsWidth, -ButtonsHeight - ButtonsMargin, ButtonsHeight),
|
||||
Parent = this
|
||||
Parent = this,
|
||||
Enabled = entry.CanBeCreated,
|
||||
};
|
||||
createButton.Clicked += OnSubmit;
|
||||
var cancelButton = new Button
|
||||
@@ -68,7 +69,7 @@ namespace FlaxEditor.Content.Create
|
||||
Text = "Cancel",
|
||||
AnchorPreset = AnchorPresets.BottomRight,
|
||||
Offsets = new Margin(-ButtonsWidth - ButtonsMargin - ButtonsWidth - ButtonsMargin, ButtonsWidth, -ButtonsHeight - ButtonsMargin, ButtonsHeight),
|
||||
Parent = this
|
||||
Parent = this,
|
||||
};
|
||||
cancelButton.Clicked += OnCancel;
|
||||
|
||||
@@ -77,7 +78,7 @@ namespace FlaxEditor.Content.Create
|
||||
{
|
||||
AnchorPreset = AnchorPresets.HorizontalStretchTop,
|
||||
Offsets = new Margin(2, 2, infoLabel.Bottom + 2, EditorHeight),
|
||||
Parent = this
|
||||
Parent = this,
|
||||
};
|
||||
|
||||
// Settings editor
|
||||
@@ -87,6 +88,7 @@ namespace FlaxEditor.Content.Create
|
||||
_dialogSize = new Float2(TotalWidth, panel.Bottom);
|
||||
|
||||
_settingsEditor.Select(_entry.Settings);
|
||||
_settingsEditor.Modified += () => createButton.Enabled = _entry.CanBeCreated;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -12,6 +12,9 @@ namespace FlaxEditor.Content.Create
|
||||
/// <seealso cref="FlaxEditor.Content.Create.CreateFileEntry" />
|
||||
public class ParticleEmitterCreateEntry : CreateFileEntry
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public override bool CanBeCreated => true;
|
||||
|
||||
/// <summary>
|
||||
/// Types of the emitter templates that can be created.
|
||||
/// </summary>
|
||||
|
||||
@@ -14,6 +14,9 @@ namespace FlaxEditor.Content.Create
|
||||
/// <seealso cref="FlaxEditor.Content.Create.CreateFileEntry" />
|
||||
public class PrefabCreateEntry : CreateFileEntry
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override bool CanBeCreated => _options.RootActorType != null;
|
||||
|
||||
/// <summary>
|
||||
/// The create options.
|
||||
/// </summary>
|
||||
@@ -73,6 +76,9 @@ namespace FlaxEditor.Content.Create
|
||||
/// <seealso cref="FlaxEditor.Content.Create.CreateFileEntry" />
|
||||
public class WidgetCreateEntry : CreateFileEntry
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public override bool CanBeCreated => _options.RootControlType != null;
|
||||
|
||||
/// <summary>
|
||||
/// The create options.
|
||||
/// </summary>
|
||||
@@ -111,7 +117,8 @@ namespace FlaxEditor.Content.Create
|
||||
|
||||
private static bool IsValid(Type type)
|
||||
{
|
||||
return (type.IsPublic || type.IsNestedPublic) && !type.IsAbstract && !type.IsGenericType;
|
||||
var controlTypes = Editor.Instance.CodeEditing.Controls.Get();
|
||||
return (type.IsPublic || type.IsNestedPublic) && !type.IsAbstract && !type.IsGenericType && controlTypes.Contains(new ScriptType(type));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -17,6 +17,8 @@ namespace FlaxEditor.Content.Create
|
||||
/// <seealso cref="FlaxEditor.Content.Create.CreateFileEntry" />
|
||||
internal class SettingsCreateEntry : CreateFileEntry
|
||||
{
|
||||
public override bool CanBeCreated => _options.Type != null;
|
||||
|
||||
internal class Options
|
||||
{
|
||||
[Tooltip("The settings type.")]
|
||||
|
||||
@@ -11,6 +11,9 @@ namespace FlaxEditor.Content.Create
|
||||
/// <seealso cref="FlaxEditor.Content.Create.CreateFileEntry" />
|
||||
public class VisualScriptCreateEntry : CreateFileEntry
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public override bool CanBeCreated => _options.BaseClass != null;
|
||||
|
||||
/// <summary>
|
||||
/// The create options.
|
||||
/// </summary>
|
||||
|
||||
@@ -145,7 +145,7 @@ namespace FlaxEditor.Content.GUI
|
||||
set
|
||||
{
|
||||
value = Mathf.Clamp(value, 0.3f, 3.0f);
|
||||
if (!Mathf.NearEqual(value, _viewScale))
|
||||
if (value != _viewScale)
|
||||
{
|
||||
_viewScale = value;
|
||||
ViewScaleChanged?.Invoke();
|
||||
|
||||
@@ -282,7 +282,7 @@ namespace FlaxEditor.Content
|
||||
|
||||
if (data is DragDataFiles)
|
||||
return DragDropEffect.Copy;
|
||||
return _dragOverItems.Effect;
|
||||
return _dragOverItems?.Effect ?? DragDropEffect.None;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace FlaxEditor.Content
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override string TypeDescription => Path.EndsWith(".h") ? "C++ Header File" : "C++ Source Code";
|
||||
public override string TypeDescription => Path.EndsWith(".h") || Path.EndsWith(".hpp") ? "C++ Header File" : "C++ Source Code";
|
||||
|
||||
/// <inheritdoc />
|
||||
public override SpriteHandle DefaultThumbnail => Editor.Instance.Icons.CPPScript128;
|
||||
|
||||
@@ -65,6 +65,9 @@ namespace FlaxEditor.Content
|
||||
/// <seealso cref="FlaxEditor.Content.Create.CreateFileEntry" />
|
||||
public class GenericJsonCreateEntry : CreateFileEntry
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public override bool CanBeCreated => _options.Type != null;
|
||||
|
||||
/// <summary>
|
||||
/// The create options.
|
||||
/// </summary>
|
||||
|
||||
@@ -10,11 +10,9 @@ using FlaxEngine;
|
||||
namespace FlaxEditor.Content
|
||||
{
|
||||
/// <summary>
|
||||
/// Context proxy object for shader source files (represented by <see cref="ShaderSourceItem"/>).
|
||||
/// Base class for shader source files.
|
||||
/// </summary>
|
||||
/// <seealso cref="FlaxEditor.Content.ContentProxy" />
|
||||
[ContentContextMenu("New/Shader Source")]
|
||||
public class ShaderSourceProxy : ContentProxy
|
||||
public abstract class ShaderBaseProxy : ContentProxy
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override bool CanCreate(ContentFolder targetLocation)
|
||||
@@ -29,6 +27,21 @@ namespace FlaxEditor.Content
|
||||
return targetLocation.ShortName == "Source" && prevTargetLocation.ShortName == "Shaders";
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override EditorWindow Open(Editor editor, ContentItem item)
|
||||
{
|
||||
Editor.Instance.CodeEditing.OpenFile(item.Path);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Context proxy object for shader source files (represented by <see cref="ShaderSourceItem"/>).
|
||||
/// </summary>
|
||||
/// <seealso cref="FlaxEditor.Content.ContentProxy" />
|
||||
[ContentContextMenu("New/Shader Source (.shader)")]
|
||||
public class ShaderSourceProxy : ShaderBaseProxy
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void Create(string outputPath, object arg)
|
||||
{
|
||||
@@ -44,13 +57,6 @@ namespace FlaxEditor.Content
|
||||
File.WriteAllText(outputPath, shaderTemplate, Encoding.UTF8);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override EditorWindow Open(Editor editor, ContentItem item)
|
||||
{
|
||||
Editor.Instance.CodeEditing.OpenFile(item.Path);
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override Color AccentColor => Color.FromRGB(0x7542f5);
|
||||
|
||||
@@ -66,4 +72,33 @@ namespace FlaxEditor.Content
|
||||
return item is ShaderSourceItem;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Context proxy object for shader header files.
|
||||
/// </summary>
|
||||
/// <seealso cref="FlaxEditor.Content.ContentProxy" />
|
||||
[ContentContextMenu("New/Shader Header (.hlsl)")]
|
||||
public class ShaderHeaderProxy : ShaderBaseProxy
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void Create(string outputPath, object arg)
|
||||
{
|
||||
File.WriteAllText(outputPath, "\n", Encoding.UTF8);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override Color AccentColor => Color.FromRGB(0x2545a5);
|
||||
|
||||
/// <inheritdoc />
|
||||
public override string FileExtension => "hlsl";
|
||||
|
||||
/// <inheritdoc />
|
||||
public override string Name => "Shader Header";
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool IsProxyFor(ContentItem item)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,8 +18,8 @@ namespace FlaxEditor
|
||||
private readonly CustomEditorPresenter _presenter;
|
||||
private CustomEditorWindow _customEditor;
|
||||
|
||||
public Win(CustomEditorWindow customEditor)
|
||||
: base(Editor.Instance, false, ScrollBars.Vertical)
|
||||
public Win(CustomEditorWindow customEditor, bool hideOnClose, ScrollBars scrollBars)
|
||||
: base(Editor.Instance, hideOnClose, scrollBars)
|
||||
{
|
||||
Title = customEditor.GetType().Name;
|
||||
_customEditor = customEditor;
|
||||
@@ -64,9 +64,9 @@ namespace FlaxEditor
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="CustomEditorWindow"/> class.
|
||||
/// </summary>
|
||||
protected CustomEditorWindow()
|
||||
protected CustomEditorWindow(bool hideOnClose = false, ScrollBars scrollBars = ScrollBars.Vertical)
|
||||
{
|
||||
_win = new Win(this);
|
||||
_win = new Win(this, hideOnClose, scrollBars);
|
||||
ScriptsBuilder.ScriptsReloadBegin += OnScriptsReloadBegin;
|
||||
}
|
||||
|
||||
|
||||
@@ -749,6 +749,15 @@ namespace FlaxEditor.CustomEditors
|
||||
}
|
||||
}
|
||||
|
||||
private Actor FindActor(CustomEditor editor)
|
||||
{
|
||||
if (editor.Values[0] is Actor actor)
|
||||
return actor;
|
||||
if (editor.ParentEditor != null)
|
||||
return FindActor(editor.ParentEditor);
|
||||
return null;
|
||||
}
|
||||
|
||||
private Actor FindPrefabRoot(CustomEditor editor)
|
||||
{
|
||||
if (editor.Values[0] is Actor actor)
|
||||
@@ -767,32 +776,35 @@ namespace FlaxEditor.CustomEditors
|
||||
return FindPrefabRoot(actor.Parent);
|
||||
}
|
||||
|
||||
private SceneObject FindObjectWithPrefabObjectId(Actor actor, ref Guid prefabObjectId)
|
||||
private SceneObject FindObjectWithPrefabObjectId(Actor actor, ref Guid prefabObjectId, Actor endPoint)
|
||||
{
|
||||
var visited = new HashSet<Actor>();
|
||||
return FindObjectWithPrefabObjectId(actor, ref prefabObjectId, endPoint, visited);
|
||||
}
|
||||
|
||||
private SceneObject FindObjectWithPrefabObjectId(Actor actor, ref Guid prefabObjectId, Actor endPoint, HashSet<Actor> visited)
|
||||
{
|
||||
if (visited.Contains(actor) || actor is Scene || actor == endPoint)
|
||||
return null;
|
||||
if (actor.PrefabObjectID == prefabObjectId)
|
||||
return actor;
|
||||
|
||||
for (int i = 0; i < actor.ScriptsCount; i++)
|
||||
{
|
||||
if (actor.GetScript(i).PrefabObjectID == prefabObjectId)
|
||||
{
|
||||
var a = actor.GetScript(i);
|
||||
if (a != null)
|
||||
return a;
|
||||
}
|
||||
var script = actor.GetScript(i);
|
||||
if (script != null && script.PrefabObjectID == prefabObjectId)
|
||||
return script;
|
||||
}
|
||||
|
||||
for (int i = 0; i < actor.ChildrenCount; i++)
|
||||
{
|
||||
if (actor.GetChild(i).PrefabObjectID == prefabObjectId)
|
||||
{
|
||||
var a = actor.GetChild(i);
|
||||
if (a != null)
|
||||
return a;
|
||||
}
|
||||
var child = actor.GetChild(i);
|
||||
if (child != null && child.PrefabObjectID == prefabObjectId)
|
||||
return child;
|
||||
}
|
||||
|
||||
return null;
|
||||
// Go up in the hierarchy
|
||||
return FindObjectWithPrefabObjectId(actor.Parent, ref prefabObjectId, endPoint, visited);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -826,7 +838,7 @@ namespace FlaxEditor.CustomEditors
|
||||
}
|
||||
|
||||
var prefabObjectId = referenceSceneObject.PrefabObjectID;
|
||||
var prefabInstanceRef = FindObjectWithPrefabObjectId(prefabInstanceRoot, ref prefabObjectId);
|
||||
var prefabInstanceRef = FindObjectWithPrefabObjectId(FindActor(this), ref prefabObjectId, prefabInstanceRoot);
|
||||
if (prefabInstanceRef == null)
|
||||
{
|
||||
Editor.LogWarning("Missing prefab instance reference in the prefab instance. Cannot revert to it.");
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using FlaxEditor.SceneGraph;
|
||||
using FlaxEditor.Scripting;
|
||||
using FlaxEngine;
|
||||
using FlaxEngine.GUI;
|
||||
@@ -52,6 +53,21 @@ namespace FlaxEditor.CustomEditors
|
||||
/// </summary>
|
||||
/// <param name="nodes">The nodes to select</param>
|
||||
public void Select(List<SceneGraph.SceneGraphNode> nodes);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current selection.
|
||||
/// </summary>
|
||||
public List<SceneGraphNode> Selection { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Indication of if the properties window is locked on specific objects.
|
||||
/// </summary>
|
||||
public bool LockSelection { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the scene editing context.
|
||||
/// </summary>
|
||||
public ISceneEditingContext SceneContext { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -81,6 +97,8 @@ namespace FlaxEditor.CustomEditors
|
||||
Offsets = Margin.Zero;
|
||||
Pivot = Float2.Zero;
|
||||
IsScrollable = true;
|
||||
Spacing = Utilities.Constants.UIMargin;
|
||||
Margin = new Margin(Utilities.Constants.UIMargin);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@@ -95,7 +113,7 @@ namespace FlaxEditor.CustomEditors
|
||||
{
|
||||
FlaxEditor.Editor.LogWarning(ex);
|
||||
|
||||
// Refresh layout on errors to reduce lgo spam
|
||||
// Refresh layout on errors to reduce log spam
|
||||
_presenter.BuildLayout();
|
||||
}
|
||||
|
||||
|
||||
@@ -87,8 +87,11 @@ namespace FlaxEditor.CustomEditors
|
||||
var targetTypeType = TypeUtils.GetType(targetType);
|
||||
if (canUseRefPicker)
|
||||
{
|
||||
// TODO: add generic way of CustomEditor for ref pickers (use it on AssetRefEditor/GPUTextureEditor/...)
|
||||
if (typeof(Asset).IsAssignableFrom(targetTypeType))
|
||||
return new AssetRefEditor();
|
||||
if (typeof(GPUTexture).IsAssignableFrom(targetTypeType))
|
||||
return new GPUTextureEditor();
|
||||
if (typeof(FlaxEngine.Object).IsAssignableFrom(targetTypeType))
|
||||
return new FlaxObjectRefEditor();
|
||||
}
|
||||
|
||||
@@ -1,22 +1,20 @@
|
||||
// Copyright (c) Wojciech Figat. All rights reserved.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using FlaxEditor.Actions;
|
||||
using FlaxEditor.CustomEditors.Editors;
|
||||
using FlaxEditor.CustomEditors.Elements;
|
||||
using FlaxEditor.GUI;
|
||||
using FlaxEditor.GUI.ContextMenu;
|
||||
using FlaxEditor.GUI.Tree;
|
||||
using FlaxEditor.Modules;
|
||||
using FlaxEditor.Scripting;
|
||||
using FlaxEditor.Windows;
|
||||
using FlaxEditor.Windows.Assets;
|
||||
using FlaxEngine;
|
||||
using FlaxEngine.GUI;
|
||||
using FlaxEngine.Json;
|
||||
using FlaxEngine.Utilities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace FlaxEditor.CustomEditors.Dedicated
|
||||
{
|
||||
@@ -71,14 +69,14 @@ namespace FlaxEditor.CustomEditors.Dedicated
|
||||
// Display prefab UI (when displaying object inside Prefab Window then display only nested prefabs)
|
||||
prefab.GetNestedObject(ref prefabObjectId, out var nestedPrefabId, out var nestedPrefabObjectId);
|
||||
var nestedPrefab = FlaxEngine.Content.Load<Prefab>(nestedPrefabId);
|
||||
var panel = layout.CustomContainer<UniformGridPanel>();
|
||||
var panel = layout.UniformGrid();
|
||||
panel.CustomControl.Height = 20.0f;
|
||||
panel.CustomControl.SlotsVertically = 1;
|
||||
if (Presenter == Editor.Instance.Windows.PropertiesWin.Presenter || nestedPrefab)
|
||||
{
|
||||
var targetPrefab = nestedPrefab ?? prefab;
|
||||
panel.CustomControl.SlotsHorizontally = 3;
|
||||
|
||||
|
||||
// Selecting actor prefab asset
|
||||
var selectPrefab = panel.Button("Select Prefab");
|
||||
selectPrefab.Button.Clicked += () =>
|
||||
@@ -133,35 +131,22 @@ namespace FlaxEditor.CustomEditors.Dedicated
|
||||
var actor = (Actor)Values[0];
|
||||
var scriptType = TypeUtils.GetType(actor.TypeName);
|
||||
var item = scriptType.ContentItem;
|
||||
if (Presenter.Owner is PropertiesWindow propertiesWindow)
|
||||
if (Presenter.Owner != null)
|
||||
{
|
||||
var lockButton = cm.AddButton(propertiesWindow.LockObjects ? "Unlock" : "Lock");
|
||||
var lockButton = cm.AddButton(Presenter.Owner.LockSelection ? "Unlock" : "Lock");
|
||||
lockButton.ButtonClicked += button =>
|
||||
{
|
||||
propertiesWindow.LockObjects = !propertiesWindow.LockObjects;
|
||||
var owner = Presenter?.Owner;
|
||||
if (owner == null)
|
||||
return;
|
||||
owner.LockSelection = !owner.LockSelection;
|
||||
|
||||
// Reselect current selection
|
||||
if (!propertiesWindow.LockObjects && Editor.Instance.SceneEditing.SelectionCount > 0)
|
||||
if (!owner.LockSelection && owner.Selection.Count > 0)
|
||||
{
|
||||
var cachedSelection = Editor.Instance.SceneEditing.Selection.ToArray();
|
||||
Editor.Instance.SceneEditing.Select(null);
|
||||
Editor.Instance.SceneEditing.Select(cachedSelection);
|
||||
}
|
||||
};
|
||||
}
|
||||
else if (Presenter.Owner is PrefabWindow prefabWindow)
|
||||
{
|
||||
var lockButton = cm.AddButton(prefabWindow.LockSelectedObjects ? "Unlock" : "Lock");
|
||||
lockButton.ButtonClicked += button =>
|
||||
{
|
||||
prefabWindow.LockSelectedObjects = !prefabWindow.LockSelectedObjects;
|
||||
|
||||
// Reselect current selection
|
||||
if (!prefabWindow.LockSelectedObjects && prefabWindow.Selection.Count > 0)
|
||||
{
|
||||
var cachedSelection = prefabWindow.Selection.ToList();
|
||||
prefabWindow.Select(null);
|
||||
prefabWindow.Select(cachedSelection);
|
||||
var cachedSelection = owner.Selection.ToList();
|
||||
owner.Select(null);
|
||||
owner.Select(cachedSelection);
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -254,11 +239,27 @@ namespace FlaxEditor.CustomEditors.Dedicated
|
||||
node.TextColor = Color.OrangeRed;
|
||||
node.Text = Utilities.Utils.GetPropertyNameUI(removed.PrefabObject.GetType().Name);
|
||||
}
|
||||
// Removed Actor
|
||||
else if (editor is RemovedActorDummy removedActor)
|
||||
{
|
||||
node.TextColor = Color.OrangeRed;
|
||||
node.Text = $"{removedActor.PrefabObject.Name} ({Utilities.Utils.GetPropertyNameUI(removedActor.PrefabObject.GetType().Name)})";
|
||||
}
|
||||
// Actor or Script
|
||||
else if (editor.Values[0] is SceneObject sceneObject)
|
||||
{
|
||||
node.TextColor = sceneObject.HasPrefabLink ? FlaxEngine.GUI.Style.Current.ProgressNormal : FlaxEngine.GUI.Style.Current.BackgroundSelected;
|
||||
node.Text = Utilities.Utils.GetPropertyNameUI(sceneObject.GetType().Name);
|
||||
if (editor.Values.Info != ScriptMemberInfo.Null)
|
||||
{
|
||||
if (editor.Values.GetAttributes().FirstOrDefault(x => x is EditorDisplayAttribute) is EditorDisplayAttribute editorDisplayAttribute && !string.IsNullOrEmpty(editorDisplayAttribute.Name))
|
||||
node.Text = $"{Utilities.Utils.GetPropertyNameUI(editorDisplayAttribute.Name)} ({Utilities.Utils.GetPropertyNameUI(editor.Values.Info.Name)})";
|
||||
else
|
||||
node.Text = Utilities.Utils.GetPropertyNameUI(editor.Values.Info.Name);
|
||||
}
|
||||
else if (sceneObject is Actor actor)
|
||||
node.Text = $"{actor.Name} ({Utilities.Utils.GetPropertyNameUI(sceneObject.GetType().Name)})";
|
||||
else
|
||||
node.Text = Utilities.Utils.GetPropertyNameUI(sceneObject.GetType().Name);
|
||||
}
|
||||
// Array Item
|
||||
else if (editor.ParentEditor is CollectionEditor)
|
||||
@@ -268,7 +269,12 @@ namespace FlaxEditor.CustomEditors.Dedicated
|
||||
// Common type
|
||||
else if (editor.Values.Info != ScriptMemberInfo.Null)
|
||||
{
|
||||
node.Text = Utilities.Utils.GetPropertyNameUI(editor.Values.Info.Name);
|
||||
if (editor.Values.GetAttributes().FirstOrDefault(x => x is EditorDisplayAttribute) is EditorDisplayAttribute editorDisplayAttribute
|
||||
&& !string.IsNullOrEmpty(editorDisplayAttribute.Name)
|
||||
&& !editorDisplayAttribute.Name.Contains("_inline"))
|
||||
node.Text = $"{Utilities.Utils.GetPropertyNameUI(editorDisplayAttribute.Name)} ({Utilities.Utils.GetPropertyNameUI(editor.Values.Info.Name)})";
|
||||
else
|
||||
node.Text = Utilities.Utils.GetPropertyNameUI(editor.Values.Info.Name);
|
||||
}
|
||||
// Custom type
|
||||
else if (editor.Values[0] != null)
|
||||
@@ -294,16 +300,40 @@ namespace FlaxEditor.CustomEditors.Dedicated
|
||||
// Not used
|
||||
}
|
||||
}
|
||||
|
||||
private class RemovedActorDummy : CustomEditor
|
||||
{
|
||||
/// <summary>
|
||||
/// The removed prefab object (from the prefab default instance).
|
||||
/// </summary>
|
||||
public Actor PrefabObject;
|
||||
|
||||
/// <summary>
|
||||
/// The prefab instance's parent.
|
||||
/// </summary>
|
||||
public Actor ParentActor;
|
||||
|
||||
/// <summary>
|
||||
/// The order of the removed actor in the parent.
|
||||
/// </summary>
|
||||
public int OrderInParent;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void Initialize(LayoutElementsContainer layout)
|
||||
{
|
||||
// Not used
|
||||
}
|
||||
}
|
||||
|
||||
private TreeNode ProcessDiff(CustomEditor editor, bool skipIfNotModified = true)
|
||||
{
|
||||
// Special case for new Script added to actor
|
||||
if (editor.Values[0] is Script script && !script.HasPrefabLink)
|
||||
// Special case for new Script or child actor added to actor
|
||||
if ((editor.Values[0] is Script script && !script.HasPrefabLink) || (editor.Values[0] is Actor a && !a.HasPrefabLink))
|
||||
return CreateDiffNode(editor);
|
||||
|
||||
// Skip if no change detected
|
||||
var isRefEdited = editor.Values.IsReferenceValueModified;
|
||||
if (!isRefEdited && skipIfNotModified)
|
||||
if (!isRefEdited && skipIfNotModified && editor is not ScriptsEditor)
|
||||
return null;
|
||||
|
||||
TreeNode result = null;
|
||||
@@ -316,7 +346,7 @@ namespace FlaxEditor.CustomEditors.Dedicated
|
||||
var childEditor = editor.ChildrenEditors[i];
|
||||
|
||||
// Special case for root actor transformation (can be applied only in Prefab editor, not in Level)
|
||||
if (isActorEditorInLevel && childEditor.Values.Info.Name is "LocalPosition" or "LocalOrientation" or "LocalScale")
|
||||
if (isActorEditorInLevel && childEditor.Values.Info.Name is "LocalPosition" or "LocalOrientation" or "LocalScale" or "Name")
|
||||
continue;
|
||||
|
||||
var child = ProcessDiff(childEditor, !isScriptEditorWithRefValue);
|
||||
@@ -358,16 +388,80 @@ namespace FlaxEditor.CustomEditors.Dedicated
|
||||
}
|
||||
}
|
||||
|
||||
// Compare child actors for removed actors.
|
||||
if (editor is ActorEditor && editor.Values.HasReferenceValue && editor.Values.ReferenceValue is Actor prefabObjectActor)
|
||||
{
|
||||
var thisActor = editor.Values[0] as Actor;
|
||||
for (int i = 0; i < prefabObjectActor.ChildrenCount; i++)
|
||||
{
|
||||
var prefabActorChild = prefabObjectActor.Children[i];
|
||||
if (thisActor == null)
|
||||
continue;
|
||||
bool isRemoved = true;
|
||||
for (int j = 0; j < thisActor.ChildrenCount; j++)
|
||||
{
|
||||
var actorChild = thisActor.Children[j];
|
||||
if (actorChild.PrefabObjectID == prefabActorChild.PrefabObjectID)
|
||||
{
|
||||
isRemoved = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (isRemoved)
|
||||
{
|
||||
var dummy = new RemovedActorDummy
|
||||
{
|
||||
PrefabObject = prefabActorChild,
|
||||
ParentActor = thisActor,
|
||||
OrderInParent = prefabActorChild.OrderInParent,
|
||||
};
|
||||
var child = CreateDiffNode(dummy);
|
||||
if (result == null)
|
||||
result = CreateDiffNode(editor);
|
||||
result.AddChild(child);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (editor is ScriptsEditor && result != null && result.ChildrenCount == 0)
|
||||
return null;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private TreeNode CreateDiffTree(Actor actor, CustomEditorPresenter presenter, LayoutElementsContainer layout)
|
||||
{
|
||||
var actorNode = Editor.Instance.Scene.GetActorNode(actor);
|
||||
ValueContainer vc = new ValueContainer(ScriptMemberInfo.Null);
|
||||
vc.SetType(new ScriptType(actorNode.EditableObject.GetType()));
|
||||
vc.Add(actorNode.EditableObject);
|
||||
var editor = CustomEditorsUtil.CreateEditor(vc, null, false);
|
||||
editor.Initialize(presenter, layout, vc);
|
||||
var node = ProcessDiff(editor, false);
|
||||
layout.ClearLayout();
|
||||
foreach (var child in actor.Children)
|
||||
{
|
||||
var childNode = CreateDiffTree(child, presenter, layout);
|
||||
if (childNode == null)
|
||||
continue;
|
||||
if (node == null)
|
||||
node = CreateDiffNode(editor);
|
||||
node.AddChild(childNode);
|
||||
}
|
||||
return node;
|
||||
}
|
||||
|
||||
private void ViewChanges(Control target, Float2 targetLocation)
|
||||
{
|
||||
// Build a tree out of modified properties
|
||||
var rootNode = ProcessDiff(this, false);
|
||||
var thisActor = (Actor)Values[0];
|
||||
var rootActor = thisActor.IsPrefabRoot ? thisActor : thisActor.GetPrefabRoot();
|
||||
var presenter = new CustomEditorPresenter(null);
|
||||
var layout = new CustomElementsContainer<ContainerControl>();
|
||||
var rootNode = CreateDiffTree(rootActor, presenter, layout);
|
||||
|
||||
// Skip if no changes detected
|
||||
if (rootNode == null || rootNode.ChildrenCount == 0)
|
||||
if (rootNode == null)
|
||||
{
|
||||
var cm1 = new ContextMenu();
|
||||
cm1.AddButton("No changes detected");
|
||||
@@ -411,6 +505,15 @@ namespace FlaxEditor.CustomEditors.Dedicated
|
||||
Presenter.BuildLayoutOnUpdate();
|
||||
}
|
||||
|
||||
private static void GetAllPrefabObjects(List<object> objects, Actor actor)
|
||||
{
|
||||
objects.Add(actor);
|
||||
objects.AddRange(actor.Scripts);
|
||||
var children = actor.Children;
|
||||
foreach (var child in children)
|
||||
GetAllPrefabObjects(objects, child);
|
||||
}
|
||||
|
||||
private void OnDiffRevert(CustomEditor editor)
|
||||
{
|
||||
// Special case for removed Script from actor
|
||||
@@ -432,6 +535,22 @@ namespace FlaxEditor.CustomEditors.Dedicated
|
||||
return;
|
||||
}
|
||||
|
||||
// Special case for reverting removed Actors
|
||||
if (editor is RemovedActorDummy removedActor)
|
||||
{
|
||||
Editor.Log("Reverting removed actor changes to prefab (adding it)");
|
||||
|
||||
var parentActor = removedActor.ParentActor;
|
||||
var restored = parentActor.AddChild(removedActor.PrefabObject.GetType());
|
||||
var prefabId = parentActor.PrefabID;
|
||||
var prefabObjectId = removedActor.PrefabObject.PrefabObjectID;
|
||||
string data = JsonSerializer.Serialize(removedActor.PrefabObject);
|
||||
JsonSerializer.Deserialize(restored, data);
|
||||
Presenter.Owner.SceneContext.Spawn(restored, parentActor, removedActor.OrderInParent);
|
||||
Actor.Internal_LinkPrefab(FlaxEngine.Object.GetUnmanagedPtr(restored), ref prefabId, ref prefabObjectId);
|
||||
return;
|
||||
}
|
||||
|
||||
// Special case for new Script added to actor
|
||||
if (editor.Values[0] is Script script && !script.HasPrefabLink)
|
||||
{
|
||||
@@ -443,8 +562,37 @@ namespace FlaxEditor.CustomEditors.Dedicated
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Special case for new Actor added to actor
|
||||
if (editor.Values[0] is Actor a && !a.HasPrefabLink)
|
||||
{
|
||||
Editor.Log("Reverting added actor changes to prefab (removing it)");
|
||||
|
||||
editor.RevertToReferenceValue();
|
||||
// TODO: Keep previous selection.
|
||||
var context = Presenter.Owner.SceneContext;
|
||||
context.Select(SceneGraph.SceneGraphFactory.FindNode(a.ID));
|
||||
context.DeleteSelection();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (Presenter.Undo != null && Presenter.Undo.Enabled)
|
||||
{
|
||||
var thisActor = (Actor)Values[0];
|
||||
var rootActor = thisActor.IsPrefabRoot ? thisActor : thisActor.GetPrefabRoot();
|
||||
var prefabObjects = new List<object>();
|
||||
GetAllPrefabObjects(prefabObjects, rootActor);
|
||||
using (new UndoMultiBlock(Presenter.Undo, prefabObjects, "Revert to Prefab"))
|
||||
{
|
||||
editor.RevertToReferenceValue();
|
||||
editor.RefreshInternal();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
editor.RevertToReferenceValue();
|
||||
editor.RefreshInternal();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,8 @@ namespace FlaxEditor.CustomEditors.Dedicated
|
||||
public class AudioSourceEditor : ActorEditor
|
||||
{
|
||||
private Label _infoLabel;
|
||||
private Slider _slider;
|
||||
private AudioSource.States _slideStartState;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void Initialize(LayoutElementsContainer layout)
|
||||
@@ -28,7 +30,14 @@ namespace FlaxEditor.CustomEditors.Dedicated
|
||||
_infoLabel = playbackGroup.Label(string.Empty).Label;
|
||||
_infoLabel.AutoHeight = true;
|
||||
|
||||
var grid = playbackGroup.CustomContainer<UniformGridPanel>();
|
||||
// Play back slider
|
||||
var sliderElement = playbackGroup.CustomContainer<Slider>();
|
||||
_slider = sliderElement.CustomControl;
|
||||
_slider.ThumbSize = new Float2(_slider.ThumbSize.X * 0.5f, _slider.ThumbSize.Y);
|
||||
_slider.SlidingStart += OnSlidingStart;
|
||||
_slider.SlidingEnd += OnSlidingEnd;
|
||||
|
||||
var grid = playbackGroup.UniformGrid();
|
||||
var gridControl = grid.CustomControl;
|
||||
gridControl.ClipChildren = false;
|
||||
gridControl.Height = Button.DefaultHeight;
|
||||
@@ -40,6 +49,38 @@ namespace FlaxEditor.CustomEditors.Dedicated
|
||||
}
|
||||
}
|
||||
|
||||
private void OnSlidingEnd()
|
||||
{
|
||||
foreach (var value in Values)
|
||||
{
|
||||
if (value is AudioSource audioSource && audioSource.Clip)
|
||||
{
|
||||
switch (_slideStartState)
|
||||
{
|
||||
case AudioSource.States.Playing:
|
||||
audioSource.Play();
|
||||
break;
|
||||
case AudioSource.States.Paused:
|
||||
case AudioSource.States.Stopped:
|
||||
audioSource.Pause();
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void OnSlidingStart()
|
||||
{
|
||||
foreach (var value in Values)
|
||||
{
|
||||
if (value is AudioSource audioSource && audioSource.Clip)
|
||||
{
|
||||
_slideStartState = audioSource.State;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void Refresh()
|
||||
{
|
||||
@@ -51,7 +92,29 @@ namespace FlaxEditor.CustomEditors.Dedicated
|
||||
foreach (var value in Values)
|
||||
{
|
||||
if (value is AudioSource audioSource && audioSource.Clip)
|
||||
{
|
||||
text += $"Time: {audioSource.Time:##0.0}s / {audioSource.Clip.Length:##0.0}s\n";
|
||||
_slider.Maximum = audioSource.Clip.Length;
|
||||
_slider.Minimum = 0;
|
||||
if (_slider.IsSliding)
|
||||
{
|
||||
if (audioSource.State != AudioSource.States.Playing)
|
||||
{
|
||||
// Play to move slider correctly
|
||||
audioSource.Play();
|
||||
audioSource.Time = _slider.Value;
|
||||
}
|
||||
else
|
||||
{
|
||||
audioSource.Time = _slider.Value;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_slider.Value = audioSource.Time;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
_infoLabel.Text = text;
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace FlaxEditor.CustomEditors.Dedicated
|
||||
var paintValue = new ReadOnlyValueContainer(new ScriptType(typeof(ClothPaintingGizmoMode)), _gizmoMode);
|
||||
paintGroup.Object(paintValue);
|
||||
{
|
||||
var grid = paintGroup.CustomContainer<UniformGridPanel>();
|
||||
var grid = paintGroup.UniformGrid();
|
||||
var gridControl = grid.CustomControl;
|
||||
gridControl.ClipChildren = false;
|
||||
gridControl.Height = Button.DefaultHeight;
|
||||
|
||||
68
Source/Editor/CustomEditors/Dedicated/GPUTextureEditor.cs
Normal file
68
Source/Editor/CustomEditors/Dedicated/GPUTextureEditor.cs
Normal file
@@ -0,0 +1,68 @@
|
||||
// Copyright (c) Wojciech Figat. All rights reserved.
|
||||
|
||||
using FlaxEditor.GUI.ContextMenu;
|
||||
using FlaxEngine;
|
||||
using FlaxEngine.GUI;
|
||||
|
||||
namespace FlaxEditor.CustomEditors.Dedicated
|
||||
{
|
||||
/// <summary>
|
||||
/// Basic editor/viewer for <see cref="GPUTexture"/>.
|
||||
/// </summary>
|
||||
[CustomEditor(typeof(GPUTexture)), DefaultEditor]
|
||||
public class GPUTextureEditor : CustomEditor
|
||||
{
|
||||
private Image _image;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override DisplayStyle Style => DisplayStyle.Inline;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void Initialize(LayoutElementsContainer layout)
|
||||
{
|
||||
_image = new Image
|
||||
{
|
||||
Brush = new GPUTextureBrush(),
|
||||
Size = new Float2(200, 100),
|
||||
Parent = layout.ContainerControl,
|
||||
};
|
||||
_image.Clicked += OnImageClicked;
|
||||
}
|
||||
|
||||
private void OnImageClicked(Image image, MouseButton button)
|
||||
{
|
||||
var texture = Values[0] as GPUTexture;
|
||||
if (!texture || button != MouseButton.Right)
|
||||
return;
|
||||
var menu = new ContextMenu();
|
||||
menu.AddButton("Save...", () => Screenshot.Capture(Values[0] as GPUTexture));
|
||||
menu.AddButton("Enlarge", () => _image.Size *= 2);
|
||||
menu.AddButton("Shrink", () => _image.Size /= 2).Enabled = _image.Height > 32;
|
||||
var location = image.PointFromScreen(Input.MouseScreenPosition);
|
||||
menu.Show(image, location);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void Refresh()
|
||||
{
|
||||
base.Refresh();
|
||||
|
||||
var texture = Values[0] as GPUTexture;
|
||||
((GPUTextureBrush)_image.Brush).Texture = texture;
|
||||
if (texture)
|
||||
{
|
||||
var desc = texture.Description;
|
||||
#if BUILD_RELEASE
|
||||
var name = string.Empty;
|
||||
#else
|
||||
var name = texture.Name;
|
||||
#endif
|
||||
_image.TooltipText = $"{name}\nType: {texture.ResourceType}\nSize: {desc.Width}x{desc.Height}\nFormat: {desc.Format}\nMemory: {Utilities.Utils.FormatBytesCount(texture.MemoryUsage)}";
|
||||
}
|
||||
else
|
||||
{
|
||||
_image.TooltipText = "None";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright (c) Wojciech Figat. All rights reserved.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using FlaxEditor.Content.Settings;
|
||||
using FlaxEngine;
|
||||
@@ -16,6 +15,11 @@ namespace FlaxEditor.CustomEditors.Dedicated
|
||||
{
|
||||
private int _layersCount;
|
||||
private List<CheckBox> _checkBoxes;
|
||||
private VerticalPanel _upperRightCell;
|
||||
private VerticalPanel _bottomLeftCell;
|
||||
private UniformGridPanel _grid;
|
||||
private Border _horizontalHighlight;
|
||||
private Border _verticalHighlight;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override DisplayStyle Style => DisplayStyle.InlineIntoParent;
|
||||
@@ -37,12 +41,29 @@ namespace FlaxEditor.CustomEditors.Dedicated
|
||||
Parent = panel,
|
||||
};
|
||||
|
||||
var style = FlaxEngine.GUI.Style.Current;
|
||||
_horizontalHighlight = new Border()
|
||||
{
|
||||
Parent = panel,
|
||||
BorderColor = style.Foreground,
|
||||
BorderWidth = 1.0f,
|
||||
Visible = false,
|
||||
};
|
||||
|
||||
_verticalHighlight = new Border()
|
||||
{
|
||||
Parent = panel,
|
||||
BorderColor = style.Foreground,
|
||||
BorderWidth = 1.0f,
|
||||
Visible = false,
|
||||
};
|
||||
|
||||
var upperLeftCell = new Label
|
||||
{
|
||||
Parent = gridPanel,
|
||||
};
|
||||
|
||||
var upperRightCell = new VerticalPanel
|
||||
_upperRightCell = new VerticalPanel
|
||||
{
|
||||
ClipChildren = false,
|
||||
Pivot = new Float2(0.00001f, 0.0f),
|
||||
@@ -54,7 +75,7 @@ namespace FlaxEditor.CustomEditors.Dedicated
|
||||
Parent = gridPanel,
|
||||
};
|
||||
|
||||
var bottomLeftCell = new VerticalPanel
|
||||
_bottomLeftCell = new VerticalPanel
|
||||
{
|
||||
Pivot = Float2.Zero,
|
||||
Spacing = 0,
|
||||
@@ -63,7 +84,7 @@ namespace FlaxEditor.CustomEditors.Dedicated
|
||||
Parent = gridPanel,
|
||||
};
|
||||
|
||||
var grid = new UniformGridPanel(0)
|
||||
_grid = new UniformGridPanel(0)
|
||||
{
|
||||
SlotsHorizontally = layersCount,
|
||||
SlotsVertically = layersCount,
|
||||
@@ -74,13 +95,13 @@ namespace FlaxEditor.CustomEditors.Dedicated
|
||||
int layerIndex = 0;
|
||||
for (; layerIndex < layerNames.Length; layerIndex++)
|
||||
{
|
||||
upperRightCell.AddChild(new Label
|
||||
_upperRightCell.AddChild(new Label
|
||||
{
|
||||
Height = labelsHeight,
|
||||
Text = layerNames[layerNames.Length - layerIndex - 1],
|
||||
HorizontalAlignment = TextAlignment.Near,
|
||||
});
|
||||
bottomLeftCell.AddChild(new Label
|
||||
_bottomLeftCell.AddChild(new Label
|
||||
{
|
||||
Height = labelsHeight,
|
||||
Text = layerNames[layerIndex],
|
||||
@@ -90,13 +111,13 @@ namespace FlaxEditor.CustomEditors.Dedicated
|
||||
for (; layerIndex < layersCount; layerIndex++)
|
||||
{
|
||||
string name = "Layer " + layerIndex;
|
||||
upperRightCell.AddChild(new Label
|
||||
_upperRightCell.AddChild(new Label
|
||||
{
|
||||
Height = labelsHeight,
|
||||
Text = name,
|
||||
HorizontalAlignment = TextAlignment.Near,
|
||||
});
|
||||
bottomLeftCell.AddChild(new Label
|
||||
_bottomLeftCell.AddChild(new Label
|
||||
{
|
||||
Height = labelsHeight,
|
||||
Text = name,
|
||||
@@ -118,7 +139,7 @@ namespace FlaxEditor.CustomEditors.Dedicated
|
||||
var box = new CheckBox(0, 0, true)
|
||||
{
|
||||
Tag = new Float2(_layersCount - column - 1, row),
|
||||
Parent = grid,
|
||||
Parent = _grid,
|
||||
Checked = GetBit(column, row),
|
||||
};
|
||||
box.StateChanged += OnCheckBoxChanged;
|
||||
@@ -126,7 +147,7 @@ namespace FlaxEditor.CustomEditors.Dedicated
|
||||
}
|
||||
for (; column < layersCount; column++)
|
||||
{
|
||||
grid.AddChild(new Label());
|
||||
_grid.AddChild(new Label());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -141,6 +162,18 @@ namespace FlaxEditor.CustomEditors.Dedicated
|
||||
/// <inheritdoc />
|
||||
public override void Refresh()
|
||||
{
|
||||
int selectedColumn = -1;
|
||||
int selectedRow = -1;
|
||||
var style = FlaxEngine.GUI.Style.Current;
|
||||
bool mouseOverGrid = _grid.IsMouseOver;
|
||||
|
||||
// Only hide highlights if mouse is not over the grid to reduce flickering
|
||||
if (!mouseOverGrid)
|
||||
{
|
||||
_horizontalHighlight.Visible = false;
|
||||
_verticalHighlight.Visible = false;
|
||||
}
|
||||
|
||||
// Sync check boxes
|
||||
for (int i = 0; i < _checkBoxes.Count; i++)
|
||||
{
|
||||
@@ -148,6 +181,39 @@ namespace FlaxEditor.CustomEditors.Dedicated
|
||||
int column = (int)((Float2)box.Tag).X;
|
||||
int row = (int)((Float2)box.Tag).Y;
|
||||
box.Checked = GetBit(column, row);
|
||||
|
||||
if (box.IsMouseOver)
|
||||
{
|
||||
selectedColumn = column;
|
||||
selectedRow = row;
|
||||
|
||||
_horizontalHighlight.X = _grid.X - _bottomLeftCell.Width;
|
||||
_horizontalHighlight.Y = _grid.Y + box.Y;
|
||||
_horizontalHighlight.Width = _bottomLeftCell.Width + box.Width + box.X;
|
||||
_horizontalHighlight.Height = box.Height;
|
||||
_horizontalHighlight.Visible = true;
|
||||
|
||||
_verticalHighlight.X = _grid.X + box.X;
|
||||
_verticalHighlight.Y = _grid.Y - _upperRightCell.Height;
|
||||
_verticalHighlight.Width = box.Width;
|
||||
_verticalHighlight.Height = _upperRightCell.Height + box.Height + box.Y;
|
||||
_verticalHighlight.Visible = true;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < _checkBoxes.Count; i++)
|
||||
{
|
||||
var box = _checkBoxes[i];
|
||||
int column = (int)((Float2)box.Tag).X;
|
||||
int row = (int)((Float2)box.Tag).Y;
|
||||
|
||||
if (!mouseOverGrid)
|
||||
box.ImageColor = style.BorderSelected;
|
||||
else if (selectedColumn > -1 && selectedRow > -1)
|
||||
{
|
||||
bool isRowOrColumn = column == selectedColumn || row == selectedRow;
|
||||
box.ImageColor = style.BorderSelected * (isRowOrColumn ? 1.2f : 0.75f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -92,12 +92,14 @@ namespace FlaxEditor.CustomEditors.Dedicated
|
||||
|
||||
// Update add button
|
||||
var update = group.Button("Update").Button;
|
||||
group.Space(0);
|
||||
update.TooltipText = "Refreshes the dashboard statistics";
|
||||
update.Height = 16.0f;
|
||||
update.Clicked += RebuildLayout;
|
||||
|
||||
// New locale add button
|
||||
var addLocale = group.Button("Add Locale...").Button;
|
||||
group.Space(0);
|
||||
addLocale.TooltipText = "Shows a locale picker and creates new localization for it with not translated string tables";
|
||||
addLocale.Height = 16.0f;
|
||||
addLocale.ButtonClicked += delegate(Button button)
|
||||
@@ -167,12 +169,14 @@ namespace FlaxEditor.CustomEditors.Dedicated
|
||||
|
||||
// Export button
|
||||
var exportLocalization = group.Button("Export...").Button;
|
||||
group.Space(0);
|
||||
exportLocalization.TooltipText = "Exports the localization strings into .pot file for translation";
|
||||
exportLocalization.Height = 16.0f;
|
||||
exportLocalization.Clicked += () => Export(tableEntries, allKeys);
|
||||
|
||||
// Find localized strings in code button
|
||||
var findStringsCode = group.Button("Find localized strings in code").Button;
|
||||
group.Space(0);
|
||||
findStringsCode.TooltipText = "Searches for localized string usage in inside a project source files";
|
||||
findStringsCode.Height = 16.0f;
|
||||
findStringsCode.Clicked += delegate
|
||||
@@ -186,12 +190,12 @@ namespace FlaxEditor.CustomEditors.Dedicated
|
||||
foreach (var file in files)
|
||||
FindNewKeysCSharp(file, newKeys, allKeys);
|
||||
|
||||
// C++
|
||||
files = Directory.GetFiles(Globals.ProjectSourceFolder, "*.cpp", SearchOption.AllDirectories);
|
||||
// C/C++
|
||||
files = Directory.GetFiles(Globals.ProjectSourceFolder, "*.cpp", SearchOption.AllDirectories).Concat(Directory.GetFiles(Globals.ProjectSourceFolder, "*.c", SearchOption.AllDirectories)).ToArray();
|
||||
filesCount += files.Length;
|
||||
foreach (var file in files)
|
||||
FindNewKeysCpp(file, newKeys, allKeys);
|
||||
files = Directory.GetFiles(Globals.ProjectSourceFolder, "*.h", SearchOption.AllDirectories);
|
||||
files = Directory.GetFiles(Globals.ProjectSourceFolder, "*.h", SearchOption.AllDirectories).Concat(Directory.GetFiles(Globals.ProjectSourceFolder, "*.hpp", SearchOption.AllDirectories)).ToArray();;
|
||||
filesCount += files.Length;
|
||||
foreach (var file in files)
|
||||
FindNewKeysCpp(file, newKeys, allKeys);
|
||||
|
||||
@@ -54,7 +54,8 @@ public class ModelPrefabEditor : GenericEditor
|
||||
}
|
||||
|
||||
// Creates the import path UI
|
||||
Utilities.Utils.CreateImportPathUI(layout, modelPrefab.ImportPath, false);
|
||||
var group = layout.Group("Import Path");
|
||||
Utilities.Utils.CreateImportPathUI(group, modelPrefab.ImportPath);
|
||||
|
||||
var button = layout.Button("Reimport", "Reimports the source asset as prefab.");
|
||||
_reimportButton = button.Button;
|
||||
|
||||
@@ -92,7 +92,7 @@ namespace FlaxEditor.CustomEditors.Dedicated
|
||||
_infoLabel = playbackGroup.Label(string.Empty).Label;
|
||||
_infoLabel.AutoHeight = true;
|
||||
|
||||
var grid = playbackGroup.CustomContainer<UniformGridPanel>();
|
||||
var grid = playbackGroup.UniformGrid();
|
||||
var gridControl = grid.CustomControl;
|
||||
gridControl.ClipChildren = false;
|
||||
gridControl.Height = Button.DefaultHeight;
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace FlaxEditor.CustomEditors.Dedicated
|
||||
if (ragdoll.Parent is AnimatedModel animatedModel && animatedModel.SkinnedModel)
|
||||
{
|
||||
// Builder
|
||||
var grid = editorGroup.CustomContainer<UniformGridPanel>();
|
||||
var grid = editorGroup.UniformGrid();
|
||||
var gridControl = grid.CustomControl;
|
||||
gridControl.ClipChildren = false;
|
||||
gridControl.Height = Button.DefaultHeight;
|
||||
@@ -53,7 +53,7 @@ namespace FlaxEditor.CustomEditors.Dedicated
|
||||
if (Presenter.Owner != null)
|
||||
{
|
||||
// Selection
|
||||
var grid = editorGroup.CustomContainer<UniformGridPanel>();
|
||||
var grid = editorGroup.UniformGrid();
|
||||
var gridControl = grid.CustomControl;
|
||||
gridControl.ClipChildren = false;
|
||||
gridControl.Height = Button.DefaultHeight;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// Copyright (c) Wojciech Figat. All rights reserved.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection.Emit;
|
||||
using FlaxEditor.CustomEditors.GUI;
|
||||
using FlaxEngine;
|
||||
using FlaxEngine.GUI;
|
||||
@@ -93,8 +94,10 @@ namespace FlaxEditor.CustomEditors.Dedicated
|
||||
// Add info box
|
||||
if (IsSingleObject && Values[0] is RigidBody && Editor.IsPlayMode)
|
||||
{
|
||||
_infoLabel = layout.Label(string.Empty).Label;
|
||||
var group = layout.Group("Info");
|
||||
_infoLabel = group.Label(string.Empty).Label;
|
||||
_infoLabel.AutoHeight = true;
|
||||
_infoLabel.Margin = new Margin(3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace FlaxEditor.CustomEditors.Dedicated
|
||||
_infoLabel = playbackGroup.Label(string.Empty).Label;
|
||||
_infoLabel.AutoHeight = true;
|
||||
|
||||
var grid = playbackGroup.CustomContainer<UniformGridPanel>();
|
||||
var grid = playbackGroup.UniformGrid();
|
||||
var gridControl = grid.CustomControl;
|
||||
gridControl.ClipChildren = false;
|
||||
gridControl.Height = Button.DefaultHeight;
|
||||
|
||||
@@ -36,6 +36,7 @@ namespace FlaxEditor.CustomEditors.Dedicated
|
||||
{
|
||||
ScriptName = scriptName;
|
||||
TooltipText = "Create a new script";
|
||||
DrawHighlights = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,7 +71,7 @@ namespace FlaxEditor.CustomEditors.Dedicated
|
||||
var buttonHeight = (textSize.Y < 18) ? 18 : textSize.Y + 4;
|
||||
_addScriptsButton = new Button
|
||||
{
|
||||
TooltipText = "Add new scripts to the actor",
|
||||
TooltipText = "Add new scripts to the actor.",
|
||||
AnchorPreset = AnchorPresets.MiddleCenter,
|
||||
Text = buttonText,
|
||||
Parent = this,
|
||||
@@ -114,7 +115,16 @@ namespace FlaxEditor.CustomEditors.Dedicated
|
||||
cm.TextChanged += text =>
|
||||
{
|
||||
if (!IsValidScriptName(text))
|
||||
{
|
||||
// Remove NewScriptItems
|
||||
List<Control> newScriptItems = cm.ItemsPanel.Children.FindAll(c => c is NewScriptItem);
|
||||
foreach (var item in newScriptItems)
|
||||
{
|
||||
cm.ItemsPanel.RemoveChild(item);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
if (!cm.ItemsPanel.Children.Any(x => x.Visible && x is not NewScriptItem))
|
||||
{
|
||||
// If there are no visible items, that means the search failed so we can find the create script button or create one if it's the first time
|
||||
@@ -876,7 +886,7 @@ namespace FlaxEditor.CustomEditors.Dedicated
|
||||
// Add drag button to the group
|
||||
var scriptDrag = new DragImage
|
||||
{
|
||||
TooltipText = "Script reference",
|
||||
TooltipText = "Script reference.",
|
||||
AutoFocus = true,
|
||||
IsScrollable = false,
|
||||
Color = FlaxEngine.GUI.Style.Current.ForegroundGrey,
|
||||
|
||||
@@ -682,7 +682,7 @@ namespace FlaxEditor.CustomEditors.Dedicated
|
||||
|
||||
private CustomElementsContainer<UniformGridPanel> UniformGridTwoByOne(LayoutElementsContainer cont)
|
||||
{
|
||||
var grid = cont.CustomContainer<UniformGridPanel>();
|
||||
var grid = cont.UniformGrid();
|
||||
grid.CustomControl.SlotsHorizontally = 2;
|
||||
grid.CustomControl.SlotsVertically = 1;
|
||||
grid.CustomControl.SlotPadding = Margin.Zero;
|
||||
|
||||
@@ -41,13 +41,9 @@ namespace FlaxEditor.CustomEditors.Editors
|
||||
public override void Initialize(LayoutElementsContainer layout)
|
||||
{
|
||||
base.Initialize(layout);
|
||||
|
||||
|
||||
if (XElement.ValueBox.Parent is UniformGridPanel ug)
|
||||
{
|
||||
ug.Height += 2;
|
||||
ug.SlotSpacing = new Float2(4);
|
||||
ug.SlotPadding = new Margin(0, 0, 1, 1);
|
||||
}
|
||||
CheckLayout(ug);
|
||||
|
||||
// Override colors
|
||||
var back = FlaxEngine.GUI.Style.Current.TextBoxBackground;
|
||||
@@ -75,11 +71,7 @@ namespace FlaxEditor.CustomEditors.Editors
|
||||
base.Initialize(layout);
|
||||
|
||||
if (XElement.ValueBox.Parent is UniformGridPanel ug)
|
||||
{
|
||||
ug.Height += 2;
|
||||
ug.SlotSpacing = new Float2(4);
|
||||
ug.SlotPadding = new Margin(0, 0, 1, 1);
|
||||
}
|
||||
CheckLayout(ug);
|
||||
|
||||
// Override colors
|
||||
var back = FlaxEngine.GUI.Style.Current.TextBoxBackground;
|
||||
@@ -114,7 +106,6 @@ namespace FlaxEditor.CustomEditors.Editors
|
||||
|
||||
_linkButton = new Button
|
||||
{
|
||||
BackgroundBrush = new SpriteBrush(Editor.Instance.Icons.Link32),
|
||||
Parent = LinkedLabel,
|
||||
Width = 18,
|
||||
Height = 18,
|
||||
@@ -136,13 +127,9 @@ namespace FlaxEditor.CustomEditors.Editors
|
||||
menu.AddButton("Link", ToggleLink).LinkTooltip("Links scale components for uniform scaling");
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
if (XElement.ValueBox.Parent is UniformGridPanel ug)
|
||||
{
|
||||
ug.Height += 2;
|
||||
ug.SlotSpacing = new Float2(4);
|
||||
ug.SlotPadding = new Margin(0, 0, 1, 1);
|
||||
}
|
||||
CheckLayout(ug);
|
||||
|
||||
// Override colors
|
||||
var back = FlaxEngine.GUI.Style.Current.TextBoxBackground;
|
||||
@@ -201,7 +188,16 @@ namespace FlaxEditor.CustomEditors.Editors
|
||||
_linkButton.SetColors(backgroundColor);
|
||||
_linkButton.BorderColor = _linkButton.BorderColorSelected = _linkButton.BorderColorHighlighted = Color.Transparent;
|
||||
_linkButton.TooltipText = LinkValues ? "Unlinks scale components from uniform scaling" : "Links scale components for uniform scaling";
|
||||
_linkButton.BackgroundBrush = new SpriteBrush(LinkValues ? Editor.Instance.Icons.Link32 : Editor.Instance.Icons.BrokenLink32);
|
||||
}
|
||||
}
|
||||
|
||||
private static void CheckLayout(UniformGridPanel ug)
|
||||
{
|
||||
// Enlarge to fix border visibility
|
||||
ug.Height += 2;
|
||||
ug.SlotSpacing += new Float2(2);
|
||||
ug.SlotPadding += new Margin(0, 0, 1, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,7 +70,9 @@ namespace FlaxEditor.CustomEditors.Editors
|
||||
menu.ItemsContainer.RemoveChildren();
|
||||
|
||||
menu.AddButton("Copy", linkedEditor.Copy);
|
||||
var b = menu.AddButton("Paste", linkedEditor.Paste);
|
||||
var b = menu.AddButton("Duplicate", () => Editor.Duplicate(Index));
|
||||
b.Enabled = linkedEditor.CanPaste && !Editor._readOnly && Editor._canResize;
|
||||
b = menu.AddButton("Paste", linkedEditor.Paste);
|
||||
b.Enabled = linkedEditor.CanPaste && !Editor._readOnly;
|
||||
|
||||
menu.AddSeparator();
|
||||
@@ -404,8 +406,10 @@ namespace FlaxEditor.CustomEditors.Editors
|
||||
var menu = new ContextMenu();
|
||||
|
||||
menu.AddButton("Copy", linkedEditor.Copy);
|
||||
var b = menu.AddButton("Duplicate", () => Editor.Duplicate(Index));
|
||||
b.Enabled = linkedEditor.CanPaste && !Editor._readOnly && Editor._canResize;
|
||||
var paste = menu.AddButton("Paste", linkedEditor.Paste);
|
||||
paste.Enabled = linkedEditor.CanPaste;
|
||||
paste.Enabled = linkedEditor.CanPaste && !Editor._readOnly;
|
||||
|
||||
if (_canReorder)
|
||||
{
|
||||
@@ -418,7 +422,8 @@ namespace FlaxEditor.CustomEditors.Editors
|
||||
moveDownButton.Enabled = Index + 1 < Editor.Count;
|
||||
}
|
||||
|
||||
menu.AddButton("Remove", OnRemoveClicked);
|
||||
b = menu.AddButton("Remove", OnRemoveClicked);
|
||||
b.Enabled = !Editor._readOnly && Editor._canResize;
|
||||
|
||||
menu.Show(panel, location);
|
||||
}
|
||||
@@ -642,10 +647,10 @@ namespace FlaxEditor.CustomEditors.Editors
|
||||
if (_canResize && !_readOnly)
|
||||
{
|
||||
var panel = dragArea.HorizontalPanel();
|
||||
panel.Panel.Size = new Float2(0, 20);
|
||||
panel.Panel.Margin = new Margin(2);
|
||||
panel.Panel.Size = new Float2(0, 18);
|
||||
panel.Panel.Margin = new Margin(0, 0, Utilities.Constants.UIMargin, 0);
|
||||
|
||||
var removeButton = panel.Button("-", "Remove last item");
|
||||
var removeButton = panel.Button("-", "Remove the last item");
|
||||
removeButton.Button.Size = new Float2(16, 16);
|
||||
removeButton.Button.Enabled = size > _minCount;
|
||||
removeButton.Button.AnchorPreset = AnchorPresets.TopRight;
|
||||
@@ -656,7 +661,7 @@ namespace FlaxEditor.CustomEditors.Editors
|
||||
Resize(Count - 1);
|
||||
};
|
||||
|
||||
var addButton = panel.Button("+", "Add new item");
|
||||
var addButton = panel.Button("+", "Add a new item");
|
||||
addButton.Button.Size = new Float2(16, 16);
|
||||
addButton.Button.Enabled = (!NotNullItems || size > 0) && size < _maxCount;
|
||||
addButton.Button.AnchorPreset = AnchorPresets.TopRight;
|
||||
@@ -741,6 +746,34 @@ namespace FlaxEditor.CustomEditors.Editors
|
||||
cloned[srcIndex] = tmp;
|
||||
SetValue(cloned);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Duplicates the list item.
|
||||
/// </summary>
|
||||
/// <param name="index">The index to duplicate.</param>
|
||||
public void Duplicate(int index)
|
||||
{
|
||||
if (IsSetBlocked)
|
||||
return;
|
||||
|
||||
var count = Count;
|
||||
var newValues = Allocate(count + 1);
|
||||
var oldValues = (IList)Values[0];
|
||||
|
||||
for (int i = 0; i <= index; i++)
|
||||
{
|
||||
newValues[i] = oldValues[i];
|
||||
}
|
||||
|
||||
newValues[index + 1] = Utilities.Utils.CloneValue(oldValues[index]);
|
||||
|
||||
for (int i = index + 1; i < count; i++)
|
||||
{
|
||||
newValues[i + 1] = oldValues[i];
|
||||
}
|
||||
|
||||
SetValue(newValues);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shifts the specified item at the given index and moves it through the list to the other item. It supports undo.
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace FlaxEditor.CustomEditors.Editors
|
||||
/// <inheritdoc />
|
||||
public override void Initialize(LayoutElementsContainer layout)
|
||||
{
|
||||
float trackBallSize = 80.0f;
|
||||
float trackBallSize = 100f;
|
||||
float margin = 4.0f;
|
||||
|
||||
// Panel
|
||||
@@ -50,7 +50,7 @@ namespace FlaxEditor.CustomEditors.Editors
|
||||
|
||||
// Scale editor
|
||||
{
|
||||
var grid = masterPanel.CustomContainer<UniformGridPanel>();
|
||||
var grid = masterPanel.UniformGrid();
|
||||
var gridControl = grid.CustomControl;
|
||||
gridControl.SlotPadding = new Margin(4, 2, 2, 2);
|
||||
gridControl.ClipChildren = false;
|
||||
|
||||
@@ -26,6 +26,7 @@ namespace FlaxEditor.CustomEditors.Editors
|
||||
new OptionType("Texture 9-Slicing", typeof(Texture9SlicingBrush)),
|
||||
new OptionType("Sprite 9-Slicing", typeof(Sprite9SlicingBrush)),
|
||||
new OptionType("Video", typeof(VideoBrush)),
|
||||
new OptionType("UI Brush", typeof(UIBrush)),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ namespace FlaxEditor.CustomEditors.Editors
|
||||
public sealed class LocalizedStringEditor : GenericEditor
|
||||
{
|
||||
private TextBoxElement _idElement, _valueElement;
|
||||
private Button _viewStringButton;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override DisplayStyle Style => DisplayStyle.Inline;
|
||||
@@ -70,6 +71,21 @@ namespace FlaxEditor.CustomEditors.Editors
|
||||
};
|
||||
addString.SetAnchorPreset(AnchorPresets.MiddleRight, false, true);
|
||||
addString.ButtonClicked += OnAddStringClicked;
|
||||
|
||||
var viewString = new Button
|
||||
{
|
||||
Visible = false,
|
||||
Width = 16.0f,
|
||||
BackgroundColor = Color.White,
|
||||
BackgroundColorHighlighted = Color.Gray,
|
||||
BackgroundBrush = new SpriteBrush(Editor.Instance.Icons.Search12),
|
||||
TooltipText = "Find localized text in Localized String Table asset for the current locale...",
|
||||
Parent = valueElement.TextBox,
|
||||
};
|
||||
viewString.SetAnchorPreset(AnchorPresets.MiddleRight, false, true);
|
||||
viewString.LocalX -= 16.0f;
|
||||
viewString.ButtonClicked += OnViewStringClicked;
|
||||
_viewStringButton = viewString;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@@ -80,6 +96,7 @@ namespace FlaxEditor.CustomEditors.Editors
|
||||
if (_valueElement != null)
|
||||
{
|
||||
_valueElement.TextBox.WatermarkText = Localization.GetString(_idElement.Text);
|
||||
_viewStringButton.Visible = !string.IsNullOrEmpty(_valueElement.TextBox.WatermarkText);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,14 +109,21 @@ namespace FlaxEditor.CustomEditors.Editors
|
||||
_valueElement = null;
|
||||
}
|
||||
|
||||
private void OnSelectStringClicked(Button button)
|
||||
private bool GetSettings(out LocalizationSettings settings)
|
||||
{
|
||||
var settings = GameSettings.Load<LocalizationSettings>();
|
||||
settings = GameSettings.Load<LocalizationSettings>();
|
||||
if (settings?.LocalizedStringTables == null || settings.LocalizedStringTables.Length == 0)
|
||||
{
|
||||
MessageBox.Show("No valid localization settings setup.");
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void OnSelectStringClicked(Button button)
|
||||
{
|
||||
if (GetSettings(out var settings))
|
||||
return;
|
||||
Profiler.BeginEvent("LocalizedStringEditor.OnSelectStringClicked");
|
||||
var allKeys = new HashSet<string>();
|
||||
for (int i = 0; i < settings.LocalizedStringTables.Length; i++)
|
||||
@@ -136,6 +160,7 @@ namespace FlaxEditor.CustomEditors.Editors
|
||||
{
|
||||
menu.Hide();
|
||||
_idElement.TextBox.SetTextAsUser(after[0].Text);
|
||||
_valueElement.TextBox.SetTextAsUser(string.Empty);
|
||||
}
|
||||
};
|
||||
searchBox.TextChanged += delegate
|
||||
@@ -158,12 +183,8 @@ namespace FlaxEditor.CustomEditors.Editors
|
||||
|
||||
private void OnAddStringClicked(Button button)
|
||||
{
|
||||
var settings = GameSettings.Load<LocalizationSettings>();
|
||||
if (settings?.LocalizedStringTables == null || settings.LocalizedStringTables.Length == 0)
|
||||
{
|
||||
MessageBox.Show("No valid localization settings setup.");
|
||||
if (GetSettings(out var settings))
|
||||
return;
|
||||
}
|
||||
Profiler.BeginEvent("LocalizedStringEditor.OnAddStringClicked");
|
||||
var allKeys = new HashSet<string>();
|
||||
for (int i = 0; i < settings.LocalizedStringTables.Length; i++)
|
||||
@@ -231,5 +252,30 @@ namespace FlaxEditor.CustomEditors.Editors
|
||||
_idElement.TextBox.SetTextAsUser(newKey);
|
||||
Profiler.EndEvent();
|
||||
}
|
||||
|
||||
private void OnViewStringClicked(Button button)
|
||||
{
|
||||
if (GetSettings(out var settings))
|
||||
return;
|
||||
var id = _idElement.TextBox.Text;
|
||||
var value = _valueElement.TextBox.WatermarkText;
|
||||
for (int i = 0; i < settings.LocalizedStringTables.Length; i++)
|
||||
{
|
||||
var table = settings.LocalizedStringTables[i];
|
||||
if (table && !table.WaitForLoaded())
|
||||
{
|
||||
var entries = table.Entries;
|
||||
if (entries.TryGetValue(id, out var messages))
|
||||
{
|
||||
if (messages.Length != 0 && messages[0] == value)
|
||||
{
|
||||
Editor.Instance.ContentEditing.Open(table);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
MessageBox.Show("Unable to find localized string table.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
using System;
|
||||
using FlaxEditor.GUI;
|
||||
using FlaxEditor.Scripting;
|
||||
using FlaxEngine;
|
||||
using FlaxEngine.Utilities;
|
||||
|
||||
namespace FlaxEditor.CustomEditors.Editors
|
||||
@@ -81,9 +82,13 @@ namespace FlaxEditor.CustomEditors.Editors
|
||||
|
||||
private OptionType[] _options;
|
||||
private ScriptType _type;
|
||||
private Elements.PropertiesListElement _typeItem;
|
||||
|
||||
private ScriptType Type => Values[0] == null ? Values.Type : TypeUtils.GetObjectType(Values[0]);
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool RevertValueWithChildren => false; // Always revert value for a whole object
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void Initialize(LayoutElementsContainer layout)
|
||||
{
|
||||
@@ -98,7 +103,8 @@ namespace FlaxEditor.CustomEditors.Editors
|
||||
_type = type;
|
||||
|
||||
// Type
|
||||
var typeEditor = layout.ComboBox(TypeComboBoxName, "Type of the object value. Use it to change the object.");
|
||||
_typeItem = layout.AddPropertyItem(TypeComboBoxName, "Type of the object value. Use it to change the object.");
|
||||
var typeEditor = _typeItem.ComboBox();
|
||||
for (int i = 0; i < _options.Length; i++)
|
||||
{
|
||||
typeEditor.ComboBox.AddItem(_options[i].Name);
|
||||
@@ -126,6 +132,8 @@ namespace FlaxEditor.CustomEditors.Editors
|
||||
|
||||
// Value
|
||||
var values = new CustomValueContainer(type, (instance, index) => instance);
|
||||
if (Values.HasReferenceValue)
|
||||
values.SetReferenceValue(Values.ReferenceValue);
|
||||
values.AddRange(Values);
|
||||
var editor = CustomEditorsUtil.CreateEditor(type);
|
||||
var style = editor.Style;
|
||||
@@ -170,6 +178,12 @@ namespace FlaxEditor.CustomEditors.Editors
|
||||
{
|
||||
base.Refresh();
|
||||
|
||||
// Show prefab diff when reference value type is different
|
||||
var color = Color.Transparent;
|
||||
if (Values.HasReferenceValue && CanRevertReferenceValue && Values[0]?.GetType() != Values.ReferenceValue?.GetType())
|
||||
color = FlaxEngine.GUI.Style.Current.BackgroundSelected;
|
||||
_typeItem.Labels[0].HighlightStripColor = color;
|
||||
|
||||
// Check if type has been modified outside the editor (eg. from code)
|
||||
if (Type != _type)
|
||||
{
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace FlaxEditor.CustomEditors.Editors
|
||||
/// <inheritdoc />
|
||||
public override void Initialize(LayoutElementsContainer layout)
|
||||
{
|
||||
var grid = layout.CustomContainer<UniformGridPanel>();
|
||||
var grid = layout.UniformGrid();
|
||||
var gridControl = grid.CustomControl;
|
||||
gridControl.ClipChildren = false;
|
||||
gridControl.Height = TextBox.DefaultHeight;
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace FlaxEditor.CustomEditors.Editors
|
||||
}
|
||||
|
||||
_element = layout.TextBox(isMultiLine);
|
||||
_defaultWatermarkColor = _element.TextBox.WatermarkTextColor;
|
||||
_watermarkColor = _defaultWatermarkColor = _element.TextBox.WatermarkTextColor;
|
||||
if (watermarkAttribute is WatermarkAttribute watermark)
|
||||
{
|
||||
_watermarkText = watermark.WatermarkText;
|
||||
|
||||
@@ -604,6 +604,9 @@ namespace FlaxEditor.CustomEditors.Editors
|
||||
root.SortChildrenRecursive();
|
||||
root.Expand(true);
|
||||
|
||||
if (Input.GetKey(KeyboardKeys.Shift))
|
||||
root.ExpandAll(true);
|
||||
|
||||
return menu;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace FlaxEditor.CustomEditors.Editors
|
||||
/// <inheritdoc />
|
||||
public override void Initialize(LayoutElementsContainer layout)
|
||||
{
|
||||
var grid = layout.CustomContainer<UniformGridPanel>();
|
||||
var grid = layout.UniformGrid();
|
||||
var gridControl = grid.CustomControl;
|
||||
gridControl.ClipChildren = false;
|
||||
gridControl.Height = TextBox.DefaultHeight;
|
||||
@@ -131,7 +131,7 @@ namespace FlaxEditor.CustomEditors.Editors
|
||||
/// <inheritdoc />
|
||||
public override void Initialize(LayoutElementsContainer layout)
|
||||
{
|
||||
var grid = layout.CustomContainer<UniformGridPanel>();
|
||||
var grid = layout.UniformGrid();
|
||||
var gridControl = grid.CustomControl;
|
||||
gridControl.ClipChildren = false;
|
||||
gridControl.Height = TextBox.DefaultHeight;
|
||||
@@ -220,7 +220,7 @@ namespace FlaxEditor.CustomEditors.Editors
|
||||
/// <inheritdoc />
|
||||
public override void Initialize(LayoutElementsContainer layout)
|
||||
{
|
||||
var grid = layout.CustomContainer<UniformGridPanel>();
|
||||
var grid = layout.UniformGrid();
|
||||
var gridControl = grid.CustomControl;
|
||||
gridControl.ClipChildren = false;
|
||||
gridControl.Height = TextBox.DefaultHeight;
|
||||
|
||||
@@ -82,7 +82,7 @@ namespace FlaxEditor.CustomEditors.Editors
|
||||
/// <inheritdoc />
|
||||
public override void Initialize(LayoutElementsContainer layout)
|
||||
{
|
||||
var grid = layout.CustomContainer<UniformGridPanel>();
|
||||
var grid = layout.UniformGrid();
|
||||
var gridControl = grid.CustomControl;
|
||||
gridControl.ClipChildren = false;
|
||||
gridControl.Height = TextBox.DefaultHeight;
|
||||
@@ -469,7 +469,7 @@ namespace FlaxEditor.CustomEditors.Editors
|
||||
/// <inheritdoc />
|
||||
public override void Initialize(LayoutElementsContainer layout)
|
||||
{
|
||||
var grid = layout.CustomContainer<UniformGridPanel>();
|
||||
var grid = layout.UniformGrid();
|
||||
var gridControl = grid.CustomControl;
|
||||
gridControl.ClipChildren = false;
|
||||
gridControl.Height = TextBox.DefaultHeight;
|
||||
@@ -783,7 +783,7 @@ namespace FlaxEditor.CustomEditors.Editors
|
||||
/// <inheritdoc />
|
||||
public override void Initialize(LayoutElementsContainer layout)
|
||||
{
|
||||
var grid = layout.CustomContainer<UniformGridPanel>();
|
||||
var grid = layout.UniformGrid();
|
||||
var gridControl = grid.CustomControl;
|
||||
gridControl.ClipChildren = false;
|
||||
gridControl.Height = TextBox.DefaultHeight;
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace FlaxEditor.CustomEditors.Editors
|
||||
/// <inheritdoc />
|
||||
public override void Initialize(LayoutElementsContainer layout)
|
||||
{
|
||||
var grid = layout.CustomContainer<UniformGridPanel>();
|
||||
var grid = layout.UniformGrid();
|
||||
var gridControl = grid.CustomControl;
|
||||
gridControl.ClipChildren = false;
|
||||
gridControl.Height = TextBox.DefaultHeight;
|
||||
@@ -163,7 +163,7 @@ namespace FlaxEditor.CustomEditors.Editors
|
||||
/// <inheritdoc />
|
||||
public override void Initialize(LayoutElementsContainer layout)
|
||||
{
|
||||
var grid = layout.CustomContainer<UniformGridPanel>();
|
||||
var grid = layout.UniformGrid();
|
||||
var gridControl = grid.CustomControl;
|
||||
gridControl.ClipChildren = false;
|
||||
gridControl.Height = TextBox.DefaultHeight;
|
||||
@@ -274,7 +274,7 @@ namespace FlaxEditor.CustomEditors.Editors
|
||||
/// <inheritdoc />
|
||||
public override void Initialize(LayoutElementsContainer layout)
|
||||
{
|
||||
var grid = layout.CustomContainer<UniformGridPanel>();
|
||||
var grid = layout.UniformGrid();
|
||||
var gridControl = grid.CustomControl;
|
||||
gridControl.ClipChildren = false;
|
||||
gridControl.Height = TextBox.DefaultHeight;
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace FlaxEditor.CustomEditors.Editors
|
||||
/// <inheritdoc />
|
||||
public override void Initialize(LayoutElementsContainer layout)
|
||||
{
|
||||
var grid = layout.CustomContainer<UniformGridPanel>();
|
||||
var grid = layout.UniformGrid();
|
||||
var gridControl = grid.CustomControl;
|
||||
gridControl.ClipChildren = false;
|
||||
gridControl.Height = TextBox.DefaultHeight;
|
||||
|
||||
@@ -22,7 +22,8 @@ namespace FlaxEditor.CustomEditors.Elements
|
||||
ArrowImageClosed = new SpriteBrush(Style.Current.ArrowRight),
|
||||
ArrowImageOpened = new SpriteBrush(Style.Current.ArrowDown),
|
||||
EnableDropDownIcon = true,
|
||||
ItemsMargin = new Margin(7, 7, 3, 3),
|
||||
ItemsMargin = new Margin(Utilities.Constants.UIMargin),
|
||||
ItemsSpacing = Utilities.Constants.UIMargin,
|
||||
HeaderHeight = 18.0f,
|
||||
EnableContainmentLines = true,
|
||||
};
|
||||
|
||||
@@ -14,24 +14,21 @@ namespace FlaxEditor.CustomEditors.GUI
|
||||
public class PropertiesList : PanelWithMargins
|
||||
{
|
||||
// TODO: sync splitter for whole presenter
|
||||
|
||||
private const float SplitterPadding = 15;
|
||||
private const float EditorsMinWidthRatio = 0.4f;
|
||||
|
||||
/// <summary>
|
||||
/// The splitter size (in pixels).
|
||||
/// </summary>
|
||||
public const int SplitterSize = 2;
|
||||
|
||||
/// <summary>
|
||||
/// The splitter margin (in pixels).
|
||||
/// </summary>
|
||||
public const int SplitterMargin = 4;
|
||||
|
||||
private const int SplitterSizeHalf = SplitterSize / 2;
|
||||
|
||||
private PropertiesListElement _element;
|
||||
private float _splitterValue;
|
||||
private Rectangle _splitterRect;
|
||||
private bool _splitterClicked, _mouseOverSplitter;
|
||||
private bool _cursorChanged;
|
||||
private bool _hasCustomSplitterValue;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the splitter value (always in range [0; 1]).
|
||||
@@ -65,16 +62,38 @@ namespace FlaxEditor.CustomEditors.GUI
|
||||
/// <param name="element">The element.</param>
|
||||
public PropertiesList(PropertiesListElement element)
|
||||
{
|
||||
ClipChildren = false;
|
||||
_element = element;
|
||||
_splitterValue = 0.4f;
|
||||
BottomMargin = TopMargin = RightMargin = SplitterMargin;
|
||||
Margin = new Margin();
|
||||
Spacing = Utilities.Constants.UIMargin;
|
||||
UpdateSplitRect();
|
||||
}
|
||||
|
||||
private void AutoSizeSplitter()
|
||||
{
|
||||
if (_hasCustomSplitterValue || !Editor.Instance.Options.Options.Interface.AutoSizePropertiesPanelSplitter)
|
||||
return;
|
||||
|
||||
Font font = Style.Current.FontMedium;
|
||||
|
||||
float largestWidth = 0f;
|
||||
for (int i = 0; i < _element.Labels.Count; i++)
|
||||
{
|
||||
Label currentLabel = _element.Labels[i];
|
||||
Float2 dimensions = font.MeasureText(currentLabel.Text);
|
||||
float width = dimensions.X + currentLabel.Margin.Left + SplitterPadding;
|
||||
|
||||
largestWidth = Mathf.Max(largestWidth, width);
|
||||
}
|
||||
|
||||
SplitterValue = Mathf.Clamp(largestWidth / Width, 0, 1 - EditorsMinWidthRatio);
|
||||
}
|
||||
|
||||
private void UpdateSplitRect()
|
||||
{
|
||||
_splitterRect = new Rectangle(Mathf.Clamp(_splitterValue * Width - SplitterSizeHalf, 0.0f, Width), 0, SplitterSize, Height);
|
||||
LeftMargin = _splitterValue * Width + SplitterMargin;
|
||||
_splitterRect = new Rectangle(Mathf.Clamp(_splitterValue * Width - SplitterSize * 0.5f, 0.0f, Width), 0, SplitterSize, Height);
|
||||
LeftMargin = _splitterValue * Width + _spacing;
|
||||
}
|
||||
|
||||
private void StartTracking()
|
||||
@@ -127,6 +146,7 @@ namespace FlaxEditor.CustomEditors.GUI
|
||||
SplitterValue = location.X / Width;
|
||||
Cursor = CursorType.SizeWE;
|
||||
_cursorChanged = true;
|
||||
_hasCustomSplitterValue = true;
|
||||
}
|
||||
else if (_mouseOverSplitter)
|
||||
{
|
||||
@@ -200,6 +220,7 @@ namespace FlaxEditor.CustomEditors.GUI
|
||||
// Refresh
|
||||
UpdateSplitRect();
|
||||
PerformLayout(true);
|
||||
AutoSizeSplitter();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@@ -222,23 +243,33 @@ namespace FlaxEditor.CustomEditors.GUI
|
||||
/// <inheritdoc />
|
||||
protected override void PerformLayoutAfterChildren()
|
||||
{
|
||||
// Sort controls from up to down into two columns: one for labels and one for the rest of the stuff
|
||||
|
||||
// Place non-label controls from top to down
|
||||
float y = _margin.Top;
|
||||
float w = Width - _margin.Width;
|
||||
bool firstItem = true;
|
||||
for (int i = 0; i < _children.Count; i++)
|
||||
{
|
||||
Control c = _children[i];
|
||||
if (!(c is PropertyNameLabel))
|
||||
{
|
||||
var h = c.Height;
|
||||
c.Bounds = new Rectangle(_margin.Left, y + _spacing, w, h);
|
||||
var rect = new Rectangle(_margin.Left, y, w, c.Height);
|
||||
if (c.Visible)
|
||||
{
|
||||
if (firstItem)
|
||||
firstItem = false;
|
||||
else
|
||||
rect.Y += _spacing;
|
||||
}
|
||||
else if (!firstItem)
|
||||
rect.Y += _spacing;
|
||||
c.Bounds = rect;
|
||||
if (c.Visible)
|
||||
y = c.Bottom;
|
||||
}
|
||||
}
|
||||
y += _margin.Bottom;
|
||||
|
||||
// Place labels accordingly to their respective controls placement
|
||||
float namesWidth = _splitterValue * Width;
|
||||
int count = _element.Labels.Count;
|
||||
float[] yStarts = new float[count + 1];
|
||||
@@ -271,7 +302,9 @@ namespace FlaxEditor.CustomEditors.GUI
|
||||
{
|
||||
var label = _element.Labels[i];
|
||||
|
||||
var rect = new Rectangle(0, yStarts[i] + 1, namesWidth, yStarts[i + 1] - yStarts[i] - 2);
|
||||
var rect = new Rectangle(0, yStarts[i], namesWidth, yStarts[i + 1] - yStarts[i]);
|
||||
if (i != count - 1)
|
||||
rect.Height -= _spacing;
|
||||
//label.Parent = this;
|
||||
label.Bounds = rect;
|
||||
}
|
||||
|
||||
@@ -202,6 +202,17 @@ namespace FlaxEditor.CustomEditors
|
||||
return element;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds new uniform grid control.
|
||||
/// </summary>
|
||||
/// <returns>The created element.</returns>
|
||||
public CustomElementsContainer<UniformGridPanel> UniformGrid()
|
||||
{
|
||||
var grid = CustomContainer<UniformGridPanel>();
|
||||
grid.CustomControl.SlotSpacing = new Float2(Utilities.Constants.UIMargin);
|
||||
return grid;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds new custom element.
|
||||
/// </summary>
|
||||
@@ -276,10 +287,7 @@ namespace FlaxEditor.CustomEditors
|
||||
/// <returns>The created element.</returns>
|
||||
public ImageElement Image(SpriteHandle sprite)
|
||||
{
|
||||
var element = new ImageElement();
|
||||
element.Image.Brush = new SpriteBrush(sprite);
|
||||
OnAddElement(element);
|
||||
return element;
|
||||
return Image(new SpriteBrush(sprite));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -289,10 +297,7 @@ namespace FlaxEditor.CustomEditors
|
||||
/// <returns>The created element.</returns>
|
||||
public ImageElement Image(Texture texture)
|
||||
{
|
||||
var element = new ImageElement();
|
||||
element.Image.Brush = new TextureBrush(texture);
|
||||
OnAddElement(element);
|
||||
return element;
|
||||
return Image(new TextureBrush(texture));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -301,9 +306,19 @@ namespace FlaxEditor.CustomEditors
|
||||
/// <param name="texture">The GPU texture.</param>
|
||||
/// <returns>The created element.</returns>
|
||||
public ImageElement Image(GPUTexture texture)
|
||||
{
|
||||
return Image(new GPUTextureBrush(texture));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds brush image to the layout.
|
||||
/// </summary>
|
||||
/// <param name="brush">The brush.</param>
|
||||
/// <returns>The created element.</returns>
|
||||
public ImageElement Image(IBrush brush)
|
||||
{
|
||||
var element = new ImageElement();
|
||||
element.Image.Brush = new GPUTextureBrush(texture);
|
||||
element.Image.Brush = brush;
|
||||
OnAddElement(element);
|
||||
return element;
|
||||
}
|
||||
|
||||
@@ -51,6 +51,7 @@ namespace FlaxEditor
|
||||
private readonly List<EditorModule> _modules = new List<EditorModule>(16);
|
||||
private bool _isAfterInit, _areModulesInited, _areModulesAfterInitEnd, _isHeadlessMode, _autoExit;
|
||||
private string _projectToOpen;
|
||||
private bool _projectIsNew;
|
||||
private float _lastAutoSaveTimer, _autoExitTimeout = 0.1f;
|
||||
private Button _saveNowButton;
|
||||
private Button _cancelSaveButton;
|
||||
@@ -528,7 +529,11 @@ namespace FlaxEditor
|
||||
var timeSinceLastSave = Time.UnscaledGameTime - _lastAutoSaveTimer;
|
||||
var timeToNextSave = options.AutoSaveFrequency * 60.0f - timeSinceLastSave;
|
||||
|
||||
if (timeToNextSave <= 0.0f || _autoSaveNow)
|
||||
if (timeToNextSave <= 0.0f && GetWindows().Any(x => x.GUI.Children.Any(c => c is GUI.ContextMenu.ContextMenuBase)))
|
||||
{
|
||||
// Skip aut-save if any context menu is opened to wait for user to end interaction
|
||||
}
|
||||
else if (timeToNextSave <= 0.0f || _autoSaveNow)
|
||||
{
|
||||
Log("Auto save");
|
||||
_lastAutoSaveTimer = Time.UnscaledGameTime;
|
||||
@@ -670,6 +675,8 @@ namespace FlaxEditor
|
||||
{
|
||||
FlaxEngine.Networking.NetworkManager.Stop(); // Shutdown any multiplayer from playmode
|
||||
PlayModeEnding?.Invoke();
|
||||
for (int i = 0; i < _modules.Count; i++)
|
||||
_modules[i].OnPlayEnding();
|
||||
}
|
||||
|
||||
internal void OnPlayEnd()
|
||||
@@ -731,11 +738,12 @@ namespace FlaxEditor
|
||||
var procSettings = new CreateProcessSettings
|
||||
{
|
||||
FileName = Platform.ExecutableFilePath,
|
||||
Arguments = string.Format("-project \"{0}\"", _projectToOpen),
|
||||
Arguments = string.Format("-project \"{0}\"" + (_projectIsNew ? " -new" : string.Empty), _projectToOpen),
|
||||
ShellExecute = true,
|
||||
WaitForEnd = false,
|
||||
HiddenWindow = false,
|
||||
};
|
||||
_projectIsNew = false;
|
||||
_projectToOpen = null;
|
||||
Platform.CreateProcess(ref procSettings);
|
||||
}
|
||||
@@ -784,6 +792,24 @@ namespace FlaxEditor
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates the given project. Afterwards closes this project with running editor and opens the given project.
|
||||
/// </summary>
|
||||
/// <param name="projectFilePath">The project file path.</param>
|
||||
public void NewProject(string projectFilePath)
|
||||
{
|
||||
if (projectFilePath == null)
|
||||
{
|
||||
MessageBox.Show("Missing project");
|
||||
return;
|
||||
}
|
||||
|
||||
// Cache project path and start editor exit (it will open new instance on valid closing)
|
||||
_projectToOpen = StringUtils.NormalizePath(Path.GetDirectoryName(projectFilePath));
|
||||
_projectIsNew = true;
|
||||
Windows.MainWindow.Close(ClosingReason.User);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Closes this project with running editor and opens the given project.
|
||||
/// </summary>
|
||||
@@ -1031,6 +1057,8 @@ namespace FlaxEditor
|
||||
{
|
||||
Internal_GetEditorBoxWithChildren(FlaxEngine.Object.GetUnmanagedPtr(actor), out var box);
|
||||
BoundingSphere.FromBox(ref box, out sphere);
|
||||
if (sphere == BoundingSphere.Empty)
|
||||
sphere = new BoundingSphere(actor.Position, sphere.Radius);
|
||||
sphere.Radius = Math.Max(sphere.Radius, 15.0f);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -39,6 +39,7 @@ namespace FlaxEditor
|
||||
public SpriteHandle Globe32;
|
||||
public SpriteHandle CamSpeed32;
|
||||
public SpriteHandle Link32;
|
||||
public SpriteHandle BrokenLink32;
|
||||
public SpriteHandle Add32;
|
||||
public SpriteHandle Left32;
|
||||
public SpriteHandle Right32;
|
||||
@@ -94,6 +95,7 @@ namespace FlaxEditor
|
||||
public SpriteHandle Search64;
|
||||
public SpriteHandle Bone64;
|
||||
public SpriteHandle Link64;
|
||||
public SpriteHandle BrokenLink64;
|
||||
public SpriteHandle Build64;
|
||||
public SpriteHandle Add64;
|
||||
public SpriteHandle ShipIt64;
|
||||
|
||||
@@ -299,6 +299,7 @@ namespace FlaxEditor.GUI
|
||||
{
|
||||
// Select asset
|
||||
Editor.Instance.Windows.ContentWin.Select(Validator.SelectedItem);
|
||||
Editor.Instance.Windows.ContentWin.ClearItemsSearch();
|
||||
}
|
||||
}
|
||||
else if (Button1Rect.Contains(location))
|
||||
@@ -312,6 +313,7 @@ namespace FlaxEditor.GUI
|
||||
{
|
||||
// Select asset
|
||||
Editor.Instance.Windows.ContentWin.Select(Validator.SelectedItem);
|
||||
Editor.Instance.Windows.ContentWin.ClearItemsSearch();
|
||||
}
|
||||
else if (Button3Rect.Contains(location))
|
||||
{
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
#if PLATFORM_WINDOWS
|
||||
#if PLATFORM_WINDOWS || PLATFORM_SDL
|
||||
#define USE_IS_FOREGROUND
|
||||
#else
|
||||
#endif
|
||||
#if PLATFORM_SDL
|
||||
#define USE_SDL_WORKAROUNDS
|
||||
#endif
|
||||
// Copyright (c) Wojciech Figat. All rights reserved.
|
||||
|
||||
using System.Collections.Generic;
|
||||
@@ -121,7 +124,7 @@ namespace FlaxEditor.GUI.ContextMenu
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shows the empty menu popup o na screen.
|
||||
/// Shows the empty menu popup on a screen.
|
||||
/// </summary>
|
||||
/// <param name="control">The target control.</param>
|
||||
/// <param name="area">The target control area to cover.</param>
|
||||
@@ -256,7 +259,9 @@ namespace FlaxEditor.GUI.ContextMenu
|
||||
desc.AllowMaximize = false;
|
||||
desc.AllowDragAndDrop = false;
|
||||
desc.IsTopmost = true;
|
||||
desc.IsRegularWindow = false;
|
||||
desc.Type = WindowType.Popup;
|
||||
desc.Parent = parentWin.Window;
|
||||
desc.Title = "ContextMenu";
|
||||
desc.HasSizingFrame = false;
|
||||
OnWindowCreating(ref desc);
|
||||
_window = Platform.CreateWindow(ref desc);
|
||||
@@ -265,6 +270,12 @@ namespace FlaxEditor.GUI.ContextMenu
|
||||
_window.GotFocus += OnWindowGotFocus;
|
||||
_window.LostFocus += OnWindowLostFocus;
|
||||
}
|
||||
|
||||
#if USE_IS_FOREGROUND && USE_SDL_WORKAROUNDS
|
||||
// The focus between popup and parent windows doesn't change, force hide the popup when clicked on parent
|
||||
parentWin.Window.MouseDown += OnWindowMouseDown;
|
||||
_window.Closed += () => parentWin.Window.MouseDown -= OnWindowMouseDown;
|
||||
#endif
|
||||
|
||||
// Attach to the window
|
||||
_parentCM = parent as ContextMenuBase;
|
||||
@@ -285,6 +296,17 @@ namespace FlaxEditor.GUI.ContextMenu
|
||||
}
|
||||
}
|
||||
|
||||
private static void ForceDefocus(ContainerControl c)
|
||||
{
|
||||
foreach (var cc in c.Children)
|
||||
{
|
||||
if (cc.ContainsFocus)
|
||||
cc.Defocus();
|
||||
if (cc is ContainerControl ccc)
|
||||
ForceDefocus(ccc);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Hide popup menu and all child menus.
|
||||
/// </summary>
|
||||
@@ -299,6 +321,9 @@ namespace FlaxEditor.GUI.ContextMenu
|
||||
// Close child
|
||||
HideChild();
|
||||
|
||||
// Force defocus
|
||||
ForceDefocus(this);
|
||||
|
||||
// Unlink from window
|
||||
Parent = null;
|
||||
|
||||
@@ -426,6 +451,17 @@ namespace FlaxEditor.GUI.ContextMenu
|
||||
}
|
||||
}
|
||||
|
||||
#if USE_SDL_WORKAROUNDS
|
||||
private void OnWindowGotFocus()
|
||||
{
|
||||
}
|
||||
|
||||
private void OnWindowMouseDown(ref Float2 mousePosition, MouseButton button, ref bool handled)
|
||||
{
|
||||
// The user clicked outside the popup window
|
||||
Hide();
|
||||
}
|
||||
#else
|
||||
private void OnWindowGotFocus()
|
||||
{
|
||||
var child = _childCM;
|
||||
@@ -439,6 +475,7 @@ namespace FlaxEditor.GUI.ContextMenu
|
||||
});
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
private void OnWindowLostFocus()
|
||||
{
|
||||
@@ -537,7 +574,12 @@ namespace FlaxEditor.GUI.ContextMenu
|
||||
// Let root context menu to check if none of the popup windows
|
||||
if (_parentCM == null && UseVisibilityControl && !IsForeground)
|
||||
{
|
||||
#if USE_SDL_WORKAROUNDS
|
||||
if (!IsMouseOver)
|
||||
Hide();
|
||||
#else
|
||||
Hide();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -326,8 +326,11 @@ namespace FlaxEditor.GUI.Dialogs
|
||||
// Update eye dropper tool
|
||||
if (_activeEyedropper)
|
||||
{
|
||||
// Try reading the color under the cursor in realtime if supported by the platform
|
||||
Float2 mousePosition = Platform.MousePosition;
|
||||
SelectedColor = ScreenUtilities.GetColorAt(mousePosition);
|
||||
Color color = ScreenUtilities.GetColorAt(mousePosition);
|
||||
if (color != Color.Transparent)
|
||||
SelectedColor = color;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,545 +0,0 @@
|
||||
// Copyright (c) Wojciech Figat. All rights reserved.
|
||||
|
||||
using System;
|
||||
using FlaxEngine;
|
||||
using FlaxEngine.GUI;
|
||||
|
||||
namespace FlaxEditor.GUI.Docking
|
||||
{
|
||||
/// <summary>
|
||||
/// Helper class used to handle docking windows dragging and docking.
|
||||
/// </summary>
|
||||
public class DockHintWindow
|
||||
{
|
||||
private FloatWindowDockPanel _toMove;
|
||||
|
||||
private Float2 _dragOffset;
|
||||
private Float2 _defaultWindowSize;
|
||||
private Rectangle _rectDock;
|
||||
private Rectangle _rectWindow;
|
||||
private Float2 _mouse;
|
||||
private DockState _toSet;
|
||||
private DockPanel _toDock;
|
||||
private bool _lateDragOffsetUpdate;
|
||||
|
||||
private Rectangle _rLeft, _rRight, _rBottom, _rUpper, _rCenter;
|
||||
|
||||
private DockHintWindow(FloatWindowDockPanel toMove)
|
||||
{
|
||||
_toMove = toMove;
|
||||
_toSet = DockState.Float;
|
||||
var window = toMove.Window.Window;
|
||||
|
||||
// Remove focus from drag target
|
||||
_toMove.Focus();
|
||||
_toMove.Defocus();
|
||||
|
||||
// Focus window
|
||||
window.Focus();
|
||||
|
||||
// Check if window is maximized and restore window.
|
||||
if (window.IsMaximized)
|
||||
{
|
||||
// Restore window and set position to mouse.
|
||||
var mousePos = window.MousePosition;
|
||||
var previousSize = window.Size;
|
||||
window.Restore();
|
||||
window.Position = Platform.MousePosition - mousePos * window.Size / previousSize;
|
||||
}
|
||||
|
||||
// Calculate dragging offset and move window to the destination position
|
||||
var mouseScreenPosition = Platform.MousePosition;
|
||||
|
||||
// If the _toMove window was not focused when initializing this window, the result vector only contains zeros
|
||||
// and to prevent a failure, we need to perform an update for the drag offset at later time which will be done in the OnMouseMove event handler.
|
||||
if (mouseScreenPosition != Float2.Zero)
|
||||
CalculateDragOffset(mouseScreenPosition);
|
||||
else
|
||||
_lateDragOffsetUpdate = true;
|
||||
|
||||
// Get initial size
|
||||
_defaultWindowSize = window.Size;
|
||||
|
||||
// Init proxy window
|
||||
Proxy.Init(ref _defaultWindowSize);
|
||||
|
||||
// Bind events
|
||||
Proxy.Window.MouseUp += OnMouseUp;
|
||||
Proxy.Window.MouseMove += OnMouseMove;
|
||||
Proxy.Window.LostFocus += OnLostFocus;
|
||||
|
||||
// Start tracking mouse
|
||||
Proxy.Window.StartTrackingMouse(false);
|
||||
|
||||
// Update window GUI
|
||||
Proxy.Window.GUI.PerformLayout();
|
||||
|
||||
// Update rectangles
|
||||
UpdateRects();
|
||||
|
||||
// Hide base window
|
||||
window.Hide();
|
||||
|
||||
// Enable hit window presentation
|
||||
Proxy.Window.RenderingEnabled = true;
|
||||
Proxy.Window.Show();
|
||||
Proxy.Window.Focus();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Releases unmanaged and - optionally - managed resources.
|
||||
/// </summary>
|
||||
public void Dispose()
|
||||
{
|
||||
// End tracking mouse
|
||||
Proxy.Window.EndTrackingMouse();
|
||||
|
||||
// Disable rendering
|
||||
Proxy.Window.RenderingEnabled = false;
|
||||
|
||||
// Unbind events
|
||||
Proxy.Window.MouseUp -= OnMouseUp;
|
||||
Proxy.Window.MouseMove -= OnMouseMove;
|
||||
Proxy.Window.LostFocus -= OnLostFocus;
|
||||
|
||||
// Hide the proxy
|
||||
Proxy.Hide();
|
||||
|
||||
if (_toMove == null)
|
||||
return;
|
||||
|
||||
// Check if window won't be docked
|
||||
if (_toSet == DockState.Float)
|
||||
{
|
||||
var window = _toMove.Window?.Window;
|
||||
if (window == null)
|
||||
return;
|
||||
var mouse = Platform.MousePosition;
|
||||
|
||||
// Move base window
|
||||
window.Position = mouse - _dragOffset;
|
||||
|
||||
// Show base window
|
||||
window.Show();
|
||||
}
|
||||
else
|
||||
{
|
||||
bool hasNoChildPanels = _toMove.ChildPanelsCount == 0;
|
||||
|
||||
// Check if window has only single tab
|
||||
if (hasNoChildPanels && _toMove.TabsCount == 1)
|
||||
{
|
||||
// Dock window
|
||||
_toMove.GetTab(0).Show(_toSet, _toDock);
|
||||
}
|
||||
// Check if dock as tab and has no child panels
|
||||
else if (hasNoChildPanels && _toSet == DockState.DockFill)
|
||||
{
|
||||
// Dock all tabs
|
||||
while (_toMove.TabsCount > 0)
|
||||
{
|
||||
_toMove.GetTab(0).Show(DockState.DockFill, _toDock);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var selectedTab = _toMove.SelectedTab;
|
||||
|
||||
// Dock the first tab into the target location
|
||||
var firstTab = _toMove.GetTab(0);
|
||||
firstTab.Show(_toSet, _toDock);
|
||||
|
||||
// Dock rest of the tabs
|
||||
while (_toMove.TabsCount > 0)
|
||||
{
|
||||
_toMove.GetTab(0).Show(DockState.DockFill, firstTab);
|
||||
}
|
||||
|
||||
// Keep selected tab being selected
|
||||
selectedTab?.SelectTab();
|
||||
}
|
||||
|
||||
// Focus target window
|
||||
_toDock.Root.Focus();
|
||||
}
|
||||
|
||||
_toMove = null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates the new dragging hit window.
|
||||
/// </summary>
|
||||
/// <param name="toMove">Floating dock panel to move.</param>
|
||||
/// <returns>The dock hint window object.</returns>
|
||||
public static DockHintWindow Create(FloatWindowDockPanel toMove)
|
||||
{
|
||||
if (toMove == null)
|
||||
throw new ArgumentNullException();
|
||||
|
||||
return new DockHintWindow(toMove);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates the new dragging hit window.
|
||||
/// </summary>
|
||||
/// <param name="toMove">Dock window to move.</param>
|
||||
/// <returns>The dock hint window object.</returns>
|
||||
public static DockHintWindow Create(DockWindow toMove)
|
||||
{
|
||||
if (toMove == null)
|
||||
throw new ArgumentNullException();
|
||||
|
||||
// Show floating
|
||||
toMove.ShowFloating();
|
||||
|
||||
// Move window to the mouse position (with some offset for caption bar)
|
||||
var window = (WindowRootControl)toMove.Root;
|
||||
var mouse = Platform.MousePosition;
|
||||
window.Window.Position = mouse - new Float2(8, 8);
|
||||
|
||||
// Get floating panel
|
||||
var floatingPanelToMove = window.GetChild(0) as FloatWindowDockPanel;
|
||||
|
||||
return new DockHintWindow(floatingPanelToMove);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calculates window rectangle in the dock window.
|
||||
/// </summary>
|
||||
/// <param name="state">Window dock state.</param>
|
||||
/// <param name="rect">Dock panel rectangle.</param>
|
||||
/// <returns>Calculated window rectangle.</returns>
|
||||
public static Rectangle CalculateDockRect(DockState state, ref Rectangle rect)
|
||||
{
|
||||
Rectangle result = rect;
|
||||
switch (state)
|
||||
{
|
||||
case DockState.DockFill:
|
||||
result.Location.Y += DockPanel.DefaultHeaderHeight;
|
||||
result.Size.Y -= DockPanel.DefaultHeaderHeight;
|
||||
break;
|
||||
case DockState.DockTop:
|
||||
result.Size.Y *= DockPanel.DefaultSplitterValue;
|
||||
break;
|
||||
case DockState.DockLeft:
|
||||
result.Size.X *= DockPanel.DefaultSplitterValue;
|
||||
break;
|
||||
case DockState.DockBottom:
|
||||
result.Location.Y += result.Size.Y * (1 - DockPanel.DefaultSplitterValue);
|
||||
result.Size.Y *= DockPanel.DefaultSplitterValue;
|
||||
break;
|
||||
case DockState.DockRight:
|
||||
result.Location.X += result.Size.X * (1 - DockPanel.DefaultSplitterValue);
|
||||
result.Size.X *= DockPanel.DefaultSplitterValue;
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private void CalculateDragOffset(Float2 mouseScreenPosition)
|
||||
{
|
||||
var baseWinPos = _toMove.Window.Window.Position;
|
||||
_dragOffset = mouseScreenPosition - baseWinPos;
|
||||
}
|
||||
|
||||
private void UpdateRects()
|
||||
{
|
||||
// Cache mouse position
|
||||
_mouse = Platform.MousePosition;
|
||||
|
||||
// Check intersection with any dock panel
|
||||
var uiMouse = _mouse;
|
||||
_toDock = _toMove.MasterPanel.HitTest(ref uiMouse, _toMove);
|
||||
|
||||
// Check dock state to use
|
||||
bool showProxyHints = _toDock != null;
|
||||
bool showBorderHints = showProxyHints;
|
||||
bool showCenterHint = showProxyHints;
|
||||
if (showProxyHints)
|
||||
{
|
||||
// If moved window has not only tabs but also child panels disable docking as tab
|
||||
if (_toMove.ChildPanelsCount > 0)
|
||||
showCenterHint = false;
|
||||
|
||||
// Disable docking windows with one or more dock panels inside
|
||||
if (_toMove.ChildPanelsCount > 0)
|
||||
showBorderHints = false;
|
||||
|
||||
// Get dock area
|
||||
_rectDock = _toDock.DockAreaBounds;
|
||||
|
||||
// Cache dock rectangles
|
||||
var size = _rectDock.Size;
|
||||
var offset = _rectDock.Location;
|
||||
var borderMargin = 4.0f;
|
||||
var hintWindowsSize = Proxy.HintWindowsSize * Platform.DpiScale;
|
||||
var hintWindowsSize2 = hintWindowsSize * 0.5f;
|
||||
var centerX = size.X * 0.5f;
|
||||
var centerY = size.Y * 0.5f;
|
||||
_rUpper = new Rectangle(centerX - hintWindowsSize2, borderMargin, hintWindowsSize, hintWindowsSize) + offset;
|
||||
_rBottom = new Rectangle(centerX - hintWindowsSize2, size.Y - hintWindowsSize - borderMargin, hintWindowsSize, hintWindowsSize) + offset;
|
||||
_rLeft = new Rectangle(borderMargin, centerY - hintWindowsSize2, hintWindowsSize, hintWindowsSize) + offset;
|
||||
_rRight = new Rectangle(size.X - hintWindowsSize - borderMargin, centerY - hintWindowsSize2, hintWindowsSize, hintWindowsSize) + offset;
|
||||
_rCenter = new Rectangle(centerX - hintWindowsSize2, centerY - hintWindowsSize2, hintWindowsSize, hintWindowsSize) + offset;
|
||||
|
||||
// Hit test
|
||||
DockState toSet = DockState.Float;
|
||||
if (showBorderHints)
|
||||
{
|
||||
if (_rUpper.Contains(_mouse))
|
||||
toSet = DockState.DockTop;
|
||||
else if (_rBottom.Contains(_mouse))
|
||||
toSet = DockState.DockBottom;
|
||||
else if (_rLeft.Contains(_mouse))
|
||||
toSet = DockState.DockLeft;
|
||||
else if (_rRight.Contains(_mouse))
|
||||
toSet = DockState.DockRight;
|
||||
}
|
||||
if (showCenterHint && _rCenter.Contains(_mouse))
|
||||
toSet = DockState.DockFill;
|
||||
_toSet = toSet;
|
||||
|
||||
// Show proxy hint windows
|
||||
Proxy.Down.Position = _rBottom.Location;
|
||||
Proxy.Left.Position = _rLeft.Location;
|
||||
Proxy.Right.Position = _rRight.Location;
|
||||
Proxy.Up.Position = _rUpper.Location;
|
||||
Proxy.Center.Position = _rCenter.Location;
|
||||
}
|
||||
else
|
||||
{
|
||||
_toSet = DockState.Float;
|
||||
}
|
||||
|
||||
// Update proxy hint windows visibility
|
||||
Proxy.Down.IsVisible = showProxyHints & showBorderHints;
|
||||
Proxy.Left.IsVisible = showProxyHints & showBorderHints;
|
||||
Proxy.Right.IsVisible = showProxyHints & showBorderHints;
|
||||
Proxy.Up.IsVisible = showProxyHints & showBorderHints;
|
||||
Proxy.Center.IsVisible = showProxyHints & showCenterHint;
|
||||
|
||||
// Calculate proxy/dock/window rectangles
|
||||
if (_toDock == null)
|
||||
{
|
||||
// Floating window over nothing
|
||||
_rectWindow = new Rectangle(_mouse - _dragOffset, _defaultWindowSize);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_toSet == DockState.Float)
|
||||
{
|
||||
// Floating window over dock panel
|
||||
_rectWindow = new Rectangle(_mouse - _dragOffset, _defaultWindowSize);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Use only part of the dock panel to show hint
|
||||
_rectWindow = CalculateDockRect(_toSet, ref _rectDock);
|
||||
}
|
||||
}
|
||||
|
||||
// Update proxy window
|
||||
Proxy.Window.ClientBounds = _rectWindow;
|
||||
}
|
||||
|
||||
private void OnMouseUp(ref Float2 location, MouseButton button, ref bool handled)
|
||||
{
|
||||
if (button == MouseButton.Left)
|
||||
{
|
||||
Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnMouseMove(ref Float2 mousePos)
|
||||
{
|
||||
// Recalculate the drag offset because the current mouse screen position was invalid when we initialized the window
|
||||
if (_lateDragOffsetUpdate)
|
||||
{
|
||||
// Calculate dragging offset and move window to the destination position
|
||||
CalculateDragOffset(mousePos);
|
||||
|
||||
// Reset state
|
||||
_lateDragOffsetUpdate = false;
|
||||
}
|
||||
|
||||
UpdateRects();
|
||||
}
|
||||
|
||||
private void OnLostFocus()
|
||||
{
|
||||
Dispose();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Contains helper proxy windows shared across docking panels. They are used to visualize docking window locations.
|
||||
/// </summary>
|
||||
public static class Proxy
|
||||
{
|
||||
/// <summary>
|
||||
/// The drag proxy window.
|
||||
/// </summary>
|
||||
public static Window Window;
|
||||
|
||||
/// <summary>
|
||||
/// The left hint proxy window.
|
||||
/// </summary>
|
||||
public static Window Left;
|
||||
|
||||
/// <summary>
|
||||
/// The right hint proxy window.
|
||||
/// </summary>
|
||||
public static Window Right;
|
||||
|
||||
/// <summary>
|
||||
/// The up hint proxy window.
|
||||
/// </summary>
|
||||
public static Window Up;
|
||||
|
||||
/// <summary>
|
||||
/// The down hint proxy window.
|
||||
/// </summary>
|
||||
public static Window Down;
|
||||
|
||||
/// <summary>
|
||||
/// The center hint proxy window.
|
||||
/// </summary>
|
||||
public static Window Center;
|
||||
|
||||
/// <summary>
|
||||
/// The hint windows size.
|
||||
/// </summary>
|
||||
public const float HintWindowsSize = 32.0f;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes the hit proxy windows. Those windows are used to indicate drag target areas (left, right, top, bottom, etc.).
|
||||
/// </summary>
|
||||
public static void InitHitProxy()
|
||||
{
|
||||
CreateProxy(ref Left, "DockHint.Left");
|
||||
CreateProxy(ref Right, "DockHint.Right");
|
||||
CreateProxy(ref Up, "DockHint.Up");
|
||||
CreateProxy(ref Down, "DockHint.Down");
|
||||
CreateProxy(ref Center, "DockHint.Center");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes the hint window.
|
||||
/// </summary>
|
||||
/// <param name="initSize">Initial size of the proxy window.</param>
|
||||
public static void Init(ref Float2 initSize)
|
||||
{
|
||||
if (Window == null)
|
||||
{
|
||||
var settings = CreateWindowSettings.Default;
|
||||
settings.Title = "DockHint.Window";
|
||||
settings.Size = initSize;
|
||||
settings.AllowInput = true;
|
||||
settings.AllowMaximize = false;
|
||||
settings.AllowMinimize = false;
|
||||
settings.HasBorder = false;
|
||||
settings.HasSizingFrame = false;
|
||||
settings.IsRegularWindow = false;
|
||||
settings.SupportsTransparency = true;
|
||||
settings.ShowInTaskbar = false;
|
||||
settings.ShowAfterFirstPaint = false;
|
||||
settings.IsTopmost = true;
|
||||
|
||||
Window = Platform.CreateWindow(ref settings);
|
||||
Window.Opacity = 0.6f;
|
||||
Window.GUI.BackgroundColor = Style.Current.Selection;
|
||||
Window.GUI.AddChild<DragVisuals>();
|
||||
}
|
||||
else
|
||||
{
|
||||
// Resize proxy
|
||||
Window.ClientSize = initSize;
|
||||
}
|
||||
|
||||
InitHitProxy();
|
||||
}
|
||||
|
||||
private sealed class DragVisuals : Control
|
||||
{
|
||||
public DragVisuals()
|
||||
{
|
||||
AnchorPreset = AnchorPresets.StretchAll;
|
||||
Offsets = Margin.Zero;
|
||||
}
|
||||
|
||||
public override void Draw()
|
||||
{
|
||||
Render2D.DrawRectangle(new Rectangle(Float2.Zero, Size), Style.Current.SelectionBorder);
|
||||
}
|
||||
}
|
||||
|
||||
private static void CreateProxy(ref Window win, string name)
|
||||
{
|
||||
if (win != null)
|
||||
return;
|
||||
|
||||
var settings = CreateWindowSettings.Default;
|
||||
settings.Title = name;
|
||||
settings.Size = new Float2(HintWindowsSize * Platform.DpiScale);
|
||||
settings.AllowInput = false;
|
||||
settings.AllowMaximize = false;
|
||||
settings.AllowMinimize = false;
|
||||
settings.HasBorder = false;
|
||||
settings.HasSizingFrame = false;
|
||||
settings.IsRegularWindow = false;
|
||||
settings.SupportsTransparency = true;
|
||||
settings.ShowInTaskbar = false;
|
||||
settings.ActivateWhenFirstShown = false;
|
||||
settings.IsTopmost = true;
|
||||
settings.ShowAfterFirstPaint = false;
|
||||
|
||||
win = Platform.CreateWindow(ref settings);
|
||||
win.Opacity = 0.6f;
|
||||
win.GUI.BackgroundColor = Style.Current.Selection;
|
||||
win.GUI.AddChild<DragVisuals>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Hides proxy windows.
|
||||
/// </summary>
|
||||
public static void Hide()
|
||||
{
|
||||
HideProxy(ref Window);
|
||||
HideProxy(ref Left);
|
||||
HideProxy(ref Right);
|
||||
HideProxy(ref Up);
|
||||
HideProxy(ref Down);
|
||||
HideProxy(ref Center);
|
||||
}
|
||||
|
||||
private static void HideProxy(ref Window win)
|
||||
{
|
||||
if (win)
|
||||
{
|
||||
win.Hide();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Releases proxy data and windows.
|
||||
/// </summary>
|
||||
public static void Dispose()
|
||||
{
|
||||
DisposeProxy(ref Window);
|
||||
DisposeProxy(ref Left);
|
||||
DisposeProxy(ref Right);
|
||||
DisposeProxy(ref Up);
|
||||
DisposeProxy(ref Down);
|
||||
DisposeProxy(ref Center);
|
||||
}
|
||||
|
||||
private static void DisposeProxy(ref Window win)
|
||||
{
|
||||
if (win)
|
||||
{
|
||||
win.Close(ClosingReason.User);
|
||||
win = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user