mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-14 13:16:11 +01:00
Compare commits
194
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e26bb4efe0 | ||
|
|
66cf1fd223 | ||
|
|
335cd4d699 | ||
|
|
95fa5bc1a5 | ||
|
|
1598ae973f | ||
|
|
69f3a95379 | ||
|
|
3846cbab4a | ||
|
|
30e87743fc | ||
|
|
fe4afdcbf0 | ||
|
|
ef2a47e756 | ||
|
|
c2d625e1ed | ||
|
|
d33990bdb4 | ||
|
|
96482d4268 | ||
|
|
8b527f2333 | ||
|
|
f56c31fb48 | ||
|
|
7d164e415a | ||
|
|
b3a9f0889e | ||
|
|
6d24ed92d0 | ||
|
|
d287e66265 | ||
|
|
ac29d1ead0 | ||
|
|
b6c3fdc4e9 | ||
|
|
4efdaaf7c9 | ||
|
|
87b6a36520 | ||
|
|
cf38cb3a6e | ||
|
|
9cb5113f6e | ||
|
|
7dd1c0c32a | ||
|
|
03233f3fdc | ||
|
|
377159c298 | ||
|
|
d8431fb620 | ||
|
|
0546ddefbd | ||
|
|
26f6889012 | ||
|
|
3ad6088565 | ||
|
|
b6fd568cc6 | ||
|
|
3861b07aef | ||
|
|
2bf57e2c72 | ||
|
|
744c6654cf | ||
|
|
b82e905757 | ||
|
|
c42e5b7dc3 | ||
|
|
b716218ecd | ||
|
|
511346e4bb | ||
|
|
5c2e49453e | ||
|
|
5d397de766 | ||
|
|
aa763f65d1 | ||
|
|
94cbd95509 | ||
|
|
f3762e356f | ||
|
|
5747d7549f | ||
|
|
aea4905d20 | ||
|
|
1558b69931 | ||
|
|
a560a3d3ae | ||
|
|
b620110d0f | ||
|
|
23ea72bf40 | ||
|
|
aaee0b7965 | ||
|
|
347523f9e7 | ||
|
|
3205630a0f | ||
|
|
8446e3fbbd | ||
|
|
6d25a97fc8 | ||
|
|
bdbfce0e18 | ||
|
|
8033e8f7cc | ||
|
|
f98c801d6c | ||
|
|
339663adaf | ||
|
|
2b15357dee | ||
|
|
1e05717daf | ||
|
|
c20f8c5040 | ||
|
|
f22f4eeccd | ||
|
|
79c450798c | ||
|
|
d247e67690 | ||
|
|
69b2035cfc | ||
|
|
62fed63310 | ||
|
|
7c29046390 | ||
|
|
b65c3c1d93 | ||
|
|
87f5d8fe8f | ||
|
|
54c7b6b476 | ||
|
|
7bdaf9ca93 | ||
|
|
525b9377cc | ||
|
|
94cba0c9ba | ||
|
|
4ddf77fc7f | ||
|
|
ae6dc259dc | ||
|
|
c2e95f6ef6 | ||
|
|
868812e578 | ||
|
|
b5064f9e8b | ||
|
|
a0eb0d54f0 | ||
|
|
e47b1315a9 | ||
|
|
60025365c4 | ||
|
|
cde6904513 | ||
|
|
997d1df8f9 | ||
|
|
9f15ded0c9 | ||
|
|
b2ee97b3d4 | ||
|
|
03d819a6c1 | ||
|
|
8ff26d57f6 | ||
|
|
c243ebd19a | ||
|
|
40f5042896 | ||
|
|
21130b29f8 | ||
|
|
d50b054243 | ||
|
|
6b7f8049fe | ||
|
|
e6029157aa | ||
|
|
ba656eb603 | ||
|
|
e8dd26b2ba | ||
|
|
897da9479d | ||
|
|
291395718f | ||
|
|
42e860b171 | ||
|
|
3b6d339310 | ||
|
|
728fd5b824 | ||
|
|
34217b2754 | ||
|
|
1e7acc2775 | ||
|
|
0b5c88531f | ||
|
|
e145d7c6e8 | ||
|
|
af13e3f184 | ||
|
|
19a2492555 | ||
|
|
3c51f4f94a | ||
|
|
86f4712b87 | ||
|
|
ea90ca21b1 | ||
|
|
b3046d8655 | ||
|
|
8f9e537a5e | ||
|
|
9368d058f2 | ||
|
|
31b628049a | ||
|
|
072e913433 | ||
|
|
e3f131cdfd | ||
|
|
5cab394ced | ||
|
|
2033fab21a | ||
|
|
7471567147 | ||
|
|
43aee373ea | ||
|
|
993083665b | ||
|
|
f2c25424d9 | ||
|
|
bbe53deb98 | ||
|
|
1f07c2be74 | ||
|
|
ea744b673a | ||
|
|
d8a6cac52f | ||
|
|
1524b9a35d | ||
|
|
36738f57a9 | ||
|
|
fca6cb23d1 | ||
|
|
a704b291fd | ||
|
|
e1b5b21fae | ||
|
|
097f2792ae | ||
|
|
089d0e9682 | ||
|
|
6a92b3ae80 | ||
|
|
1e91065033 | ||
|
|
b20bb97ea3 | ||
|
|
ba97a9f28b | ||
|
|
81e480f983 | ||
|
|
40e4e0a274 | ||
|
|
83b7de77de | ||
|
|
20f7119854 | ||
|
|
275ddcc7a6 | ||
|
|
4858f31da4 | ||
|
|
4bc255a624 | ||
|
|
17755641a1 | ||
|
|
0e6b0087ce | ||
|
|
fcd084a86f | ||
|
|
af699ff5b7 | ||
|
|
93665df223 | ||
|
|
f8b4f9372a | ||
|
|
e84e15daf4 | ||
|
|
d7af7e19dd | ||
|
|
c5cf172e42 | ||
|
|
2e8cac885c | ||
|
|
9ed4a856bf | ||
|
|
eedd4b3f27 | ||
|
|
3b7fe0b114 | ||
|
|
a6d66b94f5 | ||
|
|
c7a7bbb809 | ||
|
|
02ce6ba8d9 | ||
|
|
9dd057d594 | ||
|
|
64ec981496 | ||
|
|
8afafdeece | ||
|
|
6b9fd1d392 | ||
|
|
c1efc50134 | ||
|
|
b4b1f4e916 | ||
|
|
3de0c40ce3 | ||
|
|
893bfa8393 | ||
|
|
cc25535c34 | ||
|
|
a4cdf16fcd | ||
|
|
36588b11e6 | ||
|
|
e927838c14 | ||
|
|
5197ebb6a7 | ||
|
|
51089a3e91 | ||
|
|
c6121fd4bd | ||
|
|
7dca9d3244 | ||
|
|
abebfcf6c6 | ||
|
|
470869418c | ||
|
|
cd2bad3b27 | ||
|
|
5e9555aa57 | ||
|
|
084d55b853 | ||
|
|
a3879f3fa7 | ||
|
|
135a2d74c4 | ||
|
|
233f866c9e | ||
|
|
9e880ff24f | ||
|
|
36039563e0 | ||
|
|
022e970537 | ||
|
|
51e99ec442 | ||
|
|
caeba34ba1 | ||
|
|
6d6a634973 | ||
|
|
55e6599eaa | ||
|
|
e146366385 | ||
|
|
b1dd319c1e |
No files matched your search
@@ -29,7 +29,7 @@ concurrency:
|
|||||||
|
|
||||||
env:
|
env:
|
||||||
DISCORD_CLIENT_ID: ${{ secrets.DISCORD_CLIENT_ID }}
|
DISCORD_CLIENT_ID: ${{ secrets.DISCORD_CLIENT_ID }}
|
||||||
GH_TOKEN: ${{ secrets.ASSET_BOT }}
|
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
||||||
DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }}
|
DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }}
|
||||||
DATABASE_URL: ${{ secrets.DATABASE_URL }}
|
DATABASE_URL: ${{ secrets.DATABASE_URL }}
|
||||||
VIDEOS_SHEET: ${{ secrets.VIDEOS_SHEET }}
|
VIDEOS_SHEET: ${{ secrets.VIDEOS_SHEET }}
|
||||||
@@ -37,8 +37,8 @@ env:
|
|||||||
WOTB_GLOSSARY: ${{ secrets.WOTB_GLOSSARY }}
|
WOTB_GLOSSARY: ${{ secrets.WOTB_GLOSSARY }}
|
||||||
WOTB_DLC_CDN: ${{ secrets.WOTB_DLC_CDN }}
|
WOTB_DLC_CDN: ${{ secrets.WOTB_DLC_CDN }}
|
||||||
PUBLIC_WARGAMING_APPLICATION_ID: ${{ secrets.PUBLIC_WARGAMING_APPLICATION_ID }}
|
PUBLIC_WARGAMING_APPLICATION_ID: ${{ secrets.PUBLIC_WARGAMING_APPLICATION_ID }}
|
||||||
PUBLIC_ASSET_REPO: ${{ secrets.PUBLIC_ASSET_REPO }}
|
PUBLIC_ASSET_REPO: blitzkit/assets
|
||||||
PUBLIC_ASSET_BRANCH: ${{ github.event.inputs.cdn_branch || secrets.PUBLIC_ASSET_BRANCH }}
|
PUBLIC_ASSET_BRANCH: main
|
||||||
WOTB_GLOSSARY_DOMAIN: ${{ secrets.WOTB_GLOSSARY_DOMAIN }}
|
WOTB_GLOSSARY_DOMAIN: ${{ secrets.WOTB_GLOSSARY_DOMAIN }}
|
||||||
WOTB_GLOSSARY_PATH: ${{ secrets.WOTB_GLOSSARY_PATH }}
|
WOTB_GLOSSARY_PATH: ${{ secrets.WOTB_GLOSSARY_PATH }}
|
||||||
PUBLIC_PROMOTE_OPENTEST: ${{ secrets.PUBLIC_PROMOTE_OPENTEST }}
|
PUBLIC_PROMOTE_OPENTEST: ${{ secrets.PUBLIC_PROMOTE_OPENTEST }}
|
||||||
@@ -51,8 +51,9 @@ env:
|
|||||||
PUBLIC_NITROPAY_ID: ${{ secrets.PUBLIC_NITROPAY_ID }}
|
PUBLIC_NITROPAY_ID: ${{ secrets.PUBLIC_NITROPAY_ID }}
|
||||||
PUBLIC_DEBUG_MISSING_I18N: false
|
PUBLIC_DEBUG_MISSING_I18N: false
|
||||||
PUBLIC_DISCORD_SERVER_ID: ${{ secrets.PUBLIC_DISCORD_SERVER_ID }}
|
PUBLIC_DISCORD_SERVER_ID: ${{ secrets.PUBLIC_DISCORD_SERVER_ID }}
|
||||||
PUBLIC_ASSET_FAST_USER: ${{ secrets.PUBLIC_ASSET_FAST_USER }}
|
PUBLIC_ASSET_FAST_USER: blitzkit
|
||||||
PUBLIC_ASSET_FAST_REPO: ${{ secrets.PUBLIC_ASSET_FAST_REPO }}
|
PUBLIC_ASSET_FAST_REPO: assets
|
||||||
|
PUBLIC_ASSET_BASE: ${{ secrets.PUBLIC_ASSET_BASE }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
download_client:
|
download_client:
|
||||||
|
|||||||
@@ -14,6 +14,17 @@ env:
|
|||||||
PUBLIC_WARGAMING_APPLICATION_ID: ${{ secrets.PUBLIC_WARGAMING_APPLICATION_ID }}
|
PUBLIC_WARGAMING_APPLICATION_ID: ${{ secrets.PUBLIC_WARGAMING_APPLICATION_ID }}
|
||||||
PUBLIC_ASSET_FAST_USER: ${{ secrets.PUBLIC_ASSET_FAST_USER }}
|
PUBLIC_ASSET_FAST_USER: ${{ secrets.PUBLIC_ASSET_FAST_USER }}
|
||||||
PUBLIC_ASSET_FAST_REPO: ${{ secrets.PUBLIC_ASSET_FAST_REPO }}
|
PUBLIC_ASSET_FAST_REPO: ${{ secrets.PUBLIC_ASSET_FAST_REPO }}
|
||||||
|
PUBLIC_PROMOTE_OPENTEST: ${{ secrets.PUBLIC_PROMOTE_OPENTEST }}
|
||||||
|
ALLOW_ROBOTS: 'true'
|
||||||
|
WOTB_GLOSSARY: ${{ secrets.WOTB_GLOSSARY }}
|
||||||
|
PUBLIC_GOOGLE_TAG_MANAGER_ID: ${{ secrets.PUBLIC_GOOGLE_TAG_MANAGER_ID }}
|
||||||
|
PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID: ${{ secrets.PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID }}
|
||||||
|
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
|
||||||
|
WOTB_GLOSSARY_DOMAIN: ${{ secrets.WOTB_GLOSSARY_DOMAIN }}
|
||||||
|
WOTB_GLOSSARY_PATH: ${{ secrets.WOTB_GLOSSARY_PATH }}
|
||||||
|
PUBLIC_DISCORD_SERVER_ID: ${{ secrets.PUBLIC_DISCORD_SERVER_ID }}
|
||||||
|
PUBLIC_ASSET_BASE: ${{ secrets.PUBLIC_ASSET_BASE }}
|
||||||
|
PUBLIC_BRANCH: ${{ secrets.PUBLIC_BRANCH }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|||||||
@@ -22,6 +22,19 @@ env:
|
|||||||
PUBLIC_WARGAMING_APPLICATION_ID: ${{ secrets.PUBLIC_WARGAMING_APPLICATION_ID }}
|
PUBLIC_WARGAMING_APPLICATION_ID: ${{ secrets.PUBLIC_WARGAMING_APPLICATION_ID }}
|
||||||
PUBLIC_ASSET_FAST_USER: ${{ secrets.PUBLIC_ASSET_FAST_USER }}
|
PUBLIC_ASSET_FAST_USER: ${{ secrets.PUBLIC_ASSET_FAST_USER }}
|
||||||
PUBLIC_ASSET_FAST_REPO: ${{ secrets.PUBLIC_ASSET_FAST_REPO }}
|
PUBLIC_ASSET_FAST_REPO: ${{ secrets.PUBLIC_ASSET_FAST_REPO }}
|
||||||
|
PUBLIC_PROMOTE_OPENTEST: ${{ secrets.PUBLIC_PROMOTE_OPENTEST }}
|
||||||
|
ALLOW_ROBOTS: ${{ secrets.ALLOW_ROBOTS }}
|
||||||
|
WOTB_GLOSSARY: ${{ secrets.WOTB_GLOSSARY }}
|
||||||
|
PUBLIC_GOOGLE_TAG_MANAGER_ID: ${{ secrets.PUBLIC_GOOGLE_TAG_MANAGER_ID }}
|
||||||
|
PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID: ${{ secrets.PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID }}
|
||||||
|
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
|
||||||
|
WOTB_GLOSSARY_DOMAIN: ${{ secrets.WOTB_GLOSSARY_DOMAIN }}
|
||||||
|
WOTB_GLOSSARY_PATH: ${{ secrets.WOTB_GLOSSARY_PATH }}
|
||||||
|
PUBLIC_DISCORD_SERVER_ID: ${{ secrets.PUBLIC_DISCORD_SERVER_ID }}
|
||||||
|
PUBLIC_ASSET_BASE: ${{ secrets.PUBLIC_ASSET_BASE }}
|
||||||
|
PUBLIC_BRANCH: ${{ secrets.PUBLIC_BRANCH }}
|
||||||
|
PUBLIC_GUIDE_WEBSITE: ${{ secrets.PUBLIC_GUIDE_WEBSITE }}
|
||||||
|
SERVICING: ${{ secrets.SERVICING }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
host:
|
host:
|
||||||
@@ -34,7 +47,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Download release assets
|
- name: Download release assets
|
||||||
run: |
|
run: |
|
||||||
DOWNLOAD_URL=$(curl -s https://api.github.com/repos/tresabhi/blitzkit/releases/latest \
|
DOWNLOAD_URL=$(curl -s https://api.github.com/repos/blitzkit/blitzkit/releases/latest \
|
||||||
| grep "browser_download_url.*bot.zip" \
|
| grep "browser_download_url.*bot.zip" \
|
||||||
| cut -d : -f 2,3 \
|
| cut -d : -f 2,3 \
|
||||||
| tr -d \")
|
| tr -d \")
|
||||||
|
|||||||
@@ -27,4 +27,15 @@ jobs:
|
|||||||
PUBLIC_WARGAMING_APPLICATION_ID: ${{ secrets.PUBLIC_WARGAMING_APPLICATION_ID }}
|
PUBLIC_WARGAMING_APPLICATION_ID: ${{ secrets.PUBLIC_WARGAMING_APPLICATION_ID }}
|
||||||
PUBLIC_ASSET_FAST_USER: ${{ secrets.PUBLIC_ASSET_FAST_USER }}
|
PUBLIC_ASSET_FAST_USER: ${{ secrets.PUBLIC_ASSET_FAST_USER }}
|
||||||
PUBLIC_ASSET_FAST_REPO: ${{ secrets.PUBLIC_ASSET_FAST_REPO }}
|
PUBLIC_ASSET_FAST_REPO: ${{ secrets.PUBLIC_ASSET_FAST_REPO }}
|
||||||
|
PUBLIC_PROMOTE_OPENTEST: ${{ secrets.PUBLIC_PROMOTE_OPENTEST }}
|
||||||
|
ALLOW_ROBOTS: 'true'
|
||||||
|
WOTB_GLOSSARY: ${{ secrets.WOTB_GLOSSARY }}
|
||||||
|
PUBLIC_GOOGLE_TAG_MANAGER_ID: ${{ secrets.PUBLIC_GOOGLE_TAG_MANAGER_ID }}
|
||||||
|
PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID: ${{ secrets.PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID }}
|
||||||
|
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
|
||||||
|
WOTB_GLOSSARY_DOMAIN: ${{ secrets.WOTB_GLOSSARY_DOMAIN }}
|
||||||
|
WOTB_GLOSSARY_PATH: ${{ secrets.WOTB_GLOSSARY_PATH }}
|
||||||
|
PUBLIC_DISCORD_SERVER_ID: ${{ secrets.PUBLIC_DISCORD_SERVER_ID }}
|
||||||
|
PUBLIC_ASSET_BASE: ${{ secrets.PUBLIC_ASSET_BASE }}
|
||||||
|
PUBLIC_BRANCH: ${{ secrets.PUBLIC_BRANCH }}
|
||||||
run: bun build:ratingleaderboard --region=asia
|
run: bun build:ratingleaderboard --region=asia
|
||||||
@@ -27,4 +27,15 @@ jobs:
|
|||||||
PUBLIC_WARGAMING_APPLICATION_ID: ${{ secrets.PUBLIC_WARGAMING_APPLICATION_ID }}
|
PUBLIC_WARGAMING_APPLICATION_ID: ${{ secrets.PUBLIC_WARGAMING_APPLICATION_ID }}
|
||||||
PUBLIC_ASSET_FAST_USER: ${{ secrets.PUBLIC_ASSET_FAST_USER }}
|
PUBLIC_ASSET_FAST_USER: ${{ secrets.PUBLIC_ASSET_FAST_USER }}
|
||||||
PUBLIC_ASSET_FAST_REPO: ${{ secrets.PUBLIC_ASSET_FAST_REPO }}
|
PUBLIC_ASSET_FAST_REPO: ${{ secrets.PUBLIC_ASSET_FAST_REPO }}
|
||||||
|
PUBLIC_PROMOTE_OPENTEST: ${{ secrets.PUBLIC_PROMOTE_OPENTEST }}
|
||||||
|
ALLOW_ROBOTS: 'true'
|
||||||
|
WOTB_GLOSSARY: ${{ secrets.WOTB_GLOSSARY }}
|
||||||
|
PUBLIC_GOOGLE_TAG_MANAGER_ID: ${{ secrets.PUBLIC_GOOGLE_TAG_MANAGER_ID }}
|
||||||
|
PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID: ${{ secrets.PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID }}
|
||||||
|
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
|
||||||
|
WOTB_GLOSSARY_DOMAIN: ${{ secrets.WOTB_GLOSSARY_DOMAIN }}
|
||||||
|
WOTB_GLOSSARY_PATH: ${{ secrets.WOTB_GLOSSARY_PATH }}
|
||||||
|
PUBLIC_DISCORD_SERVER_ID: ${{ secrets.PUBLIC_DISCORD_SERVER_ID }}
|
||||||
|
PUBLIC_ASSET_BASE: ${{ secrets.PUBLIC_ASSET_BASE }}
|
||||||
|
PUBLIC_BRANCH: ${{ secrets.PUBLIC_BRANCH }}
|
||||||
run: bun build:ratingleaderboard --region=eu
|
run: bun build:ratingleaderboard --region=eu
|
||||||
@@ -27,4 +27,15 @@ jobs:
|
|||||||
PUBLIC_WARGAMING_APPLICATION_ID: ${{ secrets.PUBLIC_WARGAMING_APPLICATION_ID }}
|
PUBLIC_WARGAMING_APPLICATION_ID: ${{ secrets.PUBLIC_WARGAMING_APPLICATION_ID }}
|
||||||
PUBLIC_ASSET_FAST_USER: ${{ secrets.PUBLIC_ASSET_FAST_USER }}
|
PUBLIC_ASSET_FAST_USER: ${{ secrets.PUBLIC_ASSET_FAST_USER }}
|
||||||
PUBLIC_ASSET_FAST_REPO: ${{ secrets.PUBLIC_ASSET_FAST_REPO }}
|
PUBLIC_ASSET_FAST_REPO: ${{ secrets.PUBLIC_ASSET_FAST_REPO }}
|
||||||
|
PUBLIC_PROMOTE_OPENTEST: ${{ secrets.PUBLIC_PROMOTE_OPENTEST }}
|
||||||
|
ALLOW_ROBOTS: 'true'
|
||||||
|
WOTB_GLOSSARY: ${{ secrets.WOTB_GLOSSARY }}
|
||||||
|
PUBLIC_GOOGLE_TAG_MANAGER_ID: ${{ secrets.PUBLIC_GOOGLE_TAG_MANAGER_ID }}
|
||||||
|
PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID: ${{ secrets.PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID }}
|
||||||
|
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
|
||||||
|
WOTB_GLOSSARY_DOMAIN: ${{ secrets.WOTB_GLOSSARY_DOMAIN }}
|
||||||
|
WOTB_GLOSSARY_PATH: ${{ secrets.WOTB_GLOSSARY_PATH }}
|
||||||
|
PUBLIC_DISCORD_SERVER_ID: ${{ secrets.PUBLIC_DISCORD_SERVER_ID }}
|
||||||
|
PUBLIC_ASSET_BASE: ${{ secrets.PUBLIC_ASSET_BASE }}
|
||||||
|
PUBLIC_BRANCH: ${{ secrets.PUBLIC_BRANCH }}
|
||||||
run: bun build:ratingleaderboard --region=com
|
run: bun build:ratingleaderboard --region=com
|
||||||
@@ -18,10 +18,8 @@ concurrency:
|
|||||||
|
|
||||||
env:
|
env:
|
||||||
PUBLIC_WARGAMING_APPLICATION_ID: ${{ secrets.PUBLIC_WARGAMING_APPLICATION_ID }}
|
PUBLIC_WARGAMING_APPLICATION_ID: ${{ secrets.PUBLIC_WARGAMING_APPLICATION_ID }}
|
||||||
PUBLIC_ASSET_REPO: ${{ secrets.PUBLIC_ASSET_REPO }}
|
|
||||||
PUBLIC_ASSET_BRANCH: ${{ secrets.PUBLIC_ASSET_BRANCH }}
|
|
||||||
PUBLIC_PROMOTE_OPENTEST: ${{ secrets.PUBLIC_PROMOTE_OPENTEST }}
|
PUBLIC_PROMOTE_OPENTEST: ${{ secrets.PUBLIC_PROMOTE_OPENTEST }}
|
||||||
ALLOW_ROBOTS: 'true'
|
ALLOW_ROBOTS: ${{ secrets.ALLOW_ROBOTS }}
|
||||||
WOTB_GLOSSARY: ${{ secrets.WOTB_GLOSSARY }}
|
WOTB_GLOSSARY: ${{ secrets.WOTB_GLOSSARY }}
|
||||||
PUBLIC_GOOGLE_TAG_MANAGER_ID: ${{ secrets.PUBLIC_GOOGLE_TAG_MANAGER_ID }}
|
PUBLIC_GOOGLE_TAG_MANAGER_ID: ${{ secrets.PUBLIC_GOOGLE_TAG_MANAGER_ID }}
|
||||||
PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID: ${{ secrets.PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID }}
|
PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID: ${{ secrets.PUBLIC_GOOGLE_ANALYTICS_PROPERTY_ID }}
|
||||||
@@ -29,8 +27,10 @@ env:
|
|||||||
WOTB_GLOSSARY_DOMAIN: ${{ secrets.WOTB_GLOSSARY_DOMAIN }}
|
WOTB_GLOSSARY_DOMAIN: ${{ secrets.WOTB_GLOSSARY_DOMAIN }}
|
||||||
WOTB_GLOSSARY_PATH: ${{ secrets.WOTB_GLOSSARY_PATH }}
|
WOTB_GLOSSARY_PATH: ${{ secrets.WOTB_GLOSSARY_PATH }}
|
||||||
PUBLIC_DISCORD_SERVER_ID: ${{ secrets.PUBLIC_DISCORD_SERVER_ID }}
|
PUBLIC_DISCORD_SERVER_ID: ${{ secrets.PUBLIC_DISCORD_SERVER_ID }}
|
||||||
PUBLIC_ASSET_FAST_USER: ${{ secrets.PUBLIC_ASSET_FAST_USER }}
|
PUBLIC_ASSET_BASE: ${{ secrets.PUBLIC_ASSET_BASE }}
|
||||||
PUBLIC_ASSET_FAST_REPO: ${{ secrets.PUBLIC_ASSET_FAST_REPO }}
|
PUBLIC_BRANCH: ${{ secrets.PUBLIC_BRANCH }}
|
||||||
|
PUBLIC_GUIDE_WEBSITE: ${{ secrets.PUBLIC_GUIDE_WEBSITE }}
|
||||||
|
SERVICING: ${{ secrets.SERVICING }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
node_modules
|
node_modules
|
||||||
_node_modules
|
_node_modules
|
||||||
package-lock.json
|
package-lock.json
|
||||||
.env
|
*.env
|
||||||
/test-results/
|
/test-results/
|
||||||
/playwright-report/
|
/playwright-report/
|
||||||
/playwright/.cache/
|
/playwright/.cache/
|
||||||
|
|||||||
@@ -4,3 +4,6 @@
|
|||||||
[submodule "submodules/CUE4Parse"]
|
[submodule "submodules/CUE4Parse"]
|
||||||
path = submodules/CUE4Parse
|
path = submodules/CUE4Parse
|
||||||
url = https://github.com/FabianFG/CUE4Parse
|
url = https://github.com/FabianFG/CUE4Parse
|
||||||
|
[submodule "submodules/blitzkit-internal"]
|
||||||
|
path = submodules/blitzkit-internal
|
||||||
|
url = https://github.com/blitzkit/internal
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
{
|
|
||||||
"trailingComma": "all",
|
|
||||||
"tabWidth": 2,
|
|
||||||
"semi": true,
|
|
||||||
"singleQuote": true,
|
|
||||||
"printWidth": 80
|
|
||||||
}
|
|
||||||
Vendored
+5
-6
@@ -86,6 +86,7 @@
|
|||||||
"gameplay",
|
"gameplay",
|
||||||
"glsl",
|
"glsl",
|
||||||
"GLTF",
|
"GLTF",
|
||||||
|
"gtag",
|
||||||
"haha",
|
"haha",
|
||||||
"highp",
|
"highp",
|
||||||
"iife",
|
"iife",
|
||||||
@@ -108,6 +109,7 @@
|
|||||||
"Maddoxkkm",
|
"Maddoxkkm",
|
||||||
"malum",
|
"malum",
|
||||||
"mantlets",
|
"mantlets",
|
||||||
|
"mediump",
|
||||||
"metallicness",
|
"metallicness",
|
||||||
"metalness",
|
"metalness",
|
||||||
"minitelrose",
|
"minitelrose",
|
||||||
@@ -165,6 +167,7 @@
|
|||||||
"searchtanks",
|
"searchtanks",
|
||||||
"SHAREDEXP",
|
"SHAREDEXP",
|
||||||
"SKLLD",
|
"SKLLD",
|
||||||
|
"smoothstep",
|
||||||
"Smri",
|
"Smri",
|
||||||
"Specularity",
|
"Specularity",
|
||||||
"SSAO",
|
"SSAO",
|
||||||
@@ -220,11 +223,7 @@
|
|||||||
"yolo",
|
"yolo",
|
||||||
"youtuber",
|
"youtuber",
|
||||||
"youtubers",
|
"youtubers",
|
||||||
"zustand"
|
"zoomable"
|
||||||
],
|
],
|
||||||
"deno.enable": false,
|
"typescript.tsdk": "node_modules\\typescript\\lib"
|
||||||
"deno.unstable": false,
|
|
||||||
"cSpell.enableFiletypes": ["glsl", "proto3"],
|
|
||||||
"typescript.tsdk": "node_modules\\typescript\\lib",
|
|
||||||
"liveServer.settings.multiRootWorkspaceName": "blitzkit"
|
|
||||||
}
|
}
|
||||||
@@ -1,661 +0,0 @@
|
|||||||
GNU AFFERO GENERAL PUBLIC LICENSE
|
|
||||||
Version 3, 19 November 2007
|
|
||||||
|
|
||||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
|
||||||
of this license document, but changing it is not allowed.
|
|
||||||
|
|
||||||
Preamble
|
|
||||||
|
|
||||||
The GNU Affero General Public License is a free, copyleft license for
|
|
||||||
software and other kinds of works, specifically designed to ensure
|
|
||||||
cooperation with the community in the case of network server software.
|
|
||||||
|
|
||||||
The licenses for most software and other practical works are designed
|
|
||||||
to take away your freedom to share and change the works. By contrast,
|
|
||||||
our General Public Licenses are intended to guarantee your freedom to
|
|
||||||
share and change all versions of a program--to make sure it remains free
|
|
||||||
software for all its users.
|
|
||||||
|
|
||||||
When we speak of free software, we are referring to freedom, not
|
|
||||||
price. Our General Public Licenses are designed to make sure that you
|
|
||||||
have the freedom to distribute copies of free software (and charge for
|
|
||||||
them if you wish), that you receive source code or can get it if you
|
|
||||||
want it, that you can change the software or use pieces of it in new
|
|
||||||
free programs, and that you know you can do these things.
|
|
||||||
|
|
||||||
Developers that use our General Public Licenses protect your rights
|
|
||||||
with two steps: (1) assert copyright on the software, and (2) offer
|
|
||||||
you this License which gives you legal permission to copy, distribute
|
|
||||||
and/or modify the software.
|
|
||||||
|
|
||||||
A secondary benefit of defending all users' freedom is that
|
|
||||||
improvements made in alternate versions of the program, if they
|
|
||||||
receive widespread use, become available for other developers to
|
|
||||||
incorporate. Many developers of free software are heartened and
|
|
||||||
encouraged by the resulting cooperation. However, in the case of
|
|
||||||
software used on network servers, this result may fail to come about.
|
|
||||||
The GNU General Public License permits making a modified version and
|
|
||||||
letting the public access it on a server without ever releasing its
|
|
||||||
source code to the public.
|
|
||||||
|
|
||||||
The GNU Affero General Public License is designed specifically to
|
|
||||||
ensure that, in such cases, the modified source code becomes available
|
|
||||||
to the community. It requires the operator of a network server to
|
|
||||||
provide the source code of the modified version running there to the
|
|
||||||
users of that server. Therefore, public use of a modified version, on
|
|
||||||
a publicly accessible server, gives the public access to the source
|
|
||||||
code of the modified version.
|
|
||||||
|
|
||||||
An older license, called the Affero General Public License and
|
|
||||||
published by Affero, was designed to accomplish similar goals. This is
|
|
||||||
a different license, not a version of the Affero GPL, but Affero has
|
|
||||||
released a new version of the Affero GPL which permits relicensing under
|
|
||||||
this license.
|
|
||||||
|
|
||||||
The precise terms and conditions for copying, distribution and
|
|
||||||
modification follow.
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
0. Definitions.
|
|
||||||
|
|
||||||
"This License" refers to version 3 of the GNU Affero General Public License.
|
|
||||||
|
|
||||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
|
||||||
works, such as semiconductor masks.
|
|
||||||
|
|
||||||
"The Program" refers to any copyrightable work licensed under this
|
|
||||||
License. Each licensee is addressed as "you". "Licensees" and
|
|
||||||
"recipients" may be individuals or organizations.
|
|
||||||
|
|
||||||
To "modify" a work means to copy from or adapt all or part of the work
|
|
||||||
in a fashion requiring copyright permission, other than the making of an
|
|
||||||
exact copy. The resulting work is called a "modified version" of the
|
|
||||||
earlier work or a work "based on" the earlier work.
|
|
||||||
|
|
||||||
A "covered work" means either the unmodified Program or a work based
|
|
||||||
on the Program.
|
|
||||||
|
|
||||||
To "propagate" a work means to do anything with it that, without
|
|
||||||
permission, would make you directly or secondarily liable for
|
|
||||||
infringement under applicable copyright law, except executing it on a
|
|
||||||
computer or modifying a private copy. Propagation includes copying,
|
|
||||||
distribution (with or without modification), making available to the
|
|
||||||
public, and in some countries other activities as well.
|
|
||||||
|
|
||||||
To "convey" a work means any kind of propagation that enables other
|
|
||||||
parties to make or receive copies. Mere interaction with a user through
|
|
||||||
a computer network, with no transfer of a copy, is not conveying.
|
|
||||||
|
|
||||||
An interactive user interface displays "Appropriate Legal Notices"
|
|
||||||
to the extent that it includes a convenient and prominently visible
|
|
||||||
feature that (1) displays an appropriate copyright notice, and (2)
|
|
||||||
tells the user that there is no warranty for the work (except to the
|
|
||||||
extent that warranties are provided), that licensees may convey the
|
|
||||||
work under this License, and how to view a copy of this License. If
|
|
||||||
the interface presents a list of user commands or options, such as a
|
|
||||||
menu, a prominent item in the list meets this criterion.
|
|
||||||
|
|
||||||
1. Source Code.
|
|
||||||
|
|
||||||
The "source code" for a work means the preferred form of the work
|
|
||||||
for making modifications to it. "Object code" means any non-source
|
|
||||||
form of a work.
|
|
||||||
|
|
||||||
A "Standard Interface" means an interface that either is an official
|
|
||||||
standard defined by a recognized standards body, or, in the case of
|
|
||||||
interfaces specified for a particular programming language, one that
|
|
||||||
is widely used among developers working in that language.
|
|
||||||
|
|
||||||
The "System Libraries" of an executable work include anything, other
|
|
||||||
than the work as a whole, that (a) is included in the normal form of
|
|
||||||
packaging a Major Component, but which is not part of that Major
|
|
||||||
Component, and (b) serves only to enable use of the work with that
|
|
||||||
Major Component, or to implement a Standard Interface for which an
|
|
||||||
implementation is available to the public in source code form. A
|
|
||||||
"Major Component", in this context, means a major essential component
|
|
||||||
(kernel, window system, and so on) of the specific operating system
|
|
||||||
(if any) on which the executable work runs, or a compiler used to
|
|
||||||
produce the work, or an object code interpreter used to run it.
|
|
||||||
|
|
||||||
The "Corresponding Source" for a work in object code form means all
|
|
||||||
the source code needed to generate, install, and (for an executable
|
|
||||||
work) run the object code and to modify the work, including scripts to
|
|
||||||
control those activities. However, it does not include the work's
|
|
||||||
System Libraries, or general-purpose tools or generally available free
|
|
||||||
programs which are used unmodified in performing those activities but
|
|
||||||
which are not part of the work. For example, Corresponding Source
|
|
||||||
includes interface definition files associated with source files for
|
|
||||||
the work, and the source code for shared libraries and dynamically
|
|
||||||
linked subprograms that the work is specifically designed to require,
|
|
||||||
such as by intimate data communication or control flow between those
|
|
||||||
subprograms and other parts of the work.
|
|
||||||
|
|
||||||
The Corresponding Source need not include anything that users
|
|
||||||
can regenerate automatically from other parts of the Corresponding
|
|
||||||
Source.
|
|
||||||
|
|
||||||
The Corresponding Source for a work in source code form is that
|
|
||||||
same work.
|
|
||||||
|
|
||||||
2. Basic Permissions.
|
|
||||||
|
|
||||||
All rights granted under this License are granted for the term of
|
|
||||||
copyright on the Program, and are irrevocable provided the stated
|
|
||||||
conditions are met. This License explicitly affirms your unlimited
|
|
||||||
permission to run the unmodified Program. The output from running a
|
|
||||||
covered work is covered by this License only if the output, given its
|
|
||||||
content, constitutes a covered work. This License acknowledges your
|
|
||||||
rights of fair use or other equivalent, as provided by copyright law.
|
|
||||||
|
|
||||||
You may make, run and propagate covered works that you do not
|
|
||||||
convey, without conditions so long as your license otherwise remains
|
|
||||||
in force. You may convey covered works to others for the sole purpose
|
|
||||||
of having them make modifications exclusively for you, or provide you
|
|
||||||
with facilities for running those works, provided that you comply with
|
|
||||||
the terms of this License in conveying all material for which you do
|
|
||||||
not control copyright. Those thus making or running the covered works
|
|
||||||
for you must do so exclusively on your behalf, under your direction
|
|
||||||
and control, on terms that prohibit them from making any copies of
|
|
||||||
your copyrighted material outside their relationship with you.
|
|
||||||
|
|
||||||
Conveying under any other circumstances is permitted solely under
|
|
||||||
the conditions stated below. Sublicensing is not allowed; section 10
|
|
||||||
makes it unnecessary.
|
|
||||||
|
|
||||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
|
||||||
|
|
||||||
No covered work shall be deemed part of an effective technological
|
|
||||||
measure under any applicable law fulfilling obligations under article
|
|
||||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
|
||||||
similar laws prohibiting or restricting circumvention of such
|
|
||||||
measures.
|
|
||||||
|
|
||||||
When you convey a covered work, you waive any legal power to forbid
|
|
||||||
circumvention of technological measures to the extent such circumvention
|
|
||||||
is effected by exercising rights under this License with respect to
|
|
||||||
the covered work, and you disclaim any intention to limit operation or
|
|
||||||
modification of the work as a means of enforcing, against the work's
|
|
||||||
users, your or third parties' legal rights to forbid circumvention of
|
|
||||||
technological measures.
|
|
||||||
|
|
||||||
4. Conveying Verbatim Copies.
|
|
||||||
|
|
||||||
You may convey verbatim copies of the Program's source code as you
|
|
||||||
receive it, in any medium, provided that you conspicuously and
|
|
||||||
appropriately publish on each copy an appropriate copyright notice;
|
|
||||||
keep intact all notices stating that this License and any
|
|
||||||
non-permissive terms added in accord with section 7 apply to the code;
|
|
||||||
keep intact all notices of the absence of any warranty; and give all
|
|
||||||
recipients a copy of this License along with the Program.
|
|
||||||
|
|
||||||
You may charge any price or no price for each copy that you convey,
|
|
||||||
and you may offer support or warranty protection for a fee.
|
|
||||||
|
|
||||||
5. Conveying Modified Source Versions.
|
|
||||||
|
|
||||||
You may convey a work based on the Program, or the modifications to
|
|
||||||
produce it from the Program, in the form of source code under the
|
|
||||||
terms of section 4, provided that you also meet all of these conditions:
|
|
||||||
|
|
||||||
a) The work must carry prominent notices stating that you modified
|
|
||||||
it, and giving a relevant date.
|
|
||||||
|
|
||||||
b) The work must carry prominent notices stating that it is
|
|
||||||
released under this License and any conditions added under section
|
|
||||||
7. This requirement modifies the requirement in section 4 to
|
|
||||||
"keep intact all notices".
|
|
||||||
|
|
||||||
c) You must license the entire work, as a whole, under this
|
|
||||||
License to anyone who comes into possession of a copy. This
|
|
||||||
License will therefore apply, along with any applicable section 7
|
|
||||||
additional terms, to the whole of the work, and all its parts,
|
|
||||||
regardless of how they are packaged. This License gives no
|
|
||||||
permission to license the work in any other way, but it does not
|
|
||||||
invalidate such permission if you have separately received it.
|
|
||||||
|
|
||||||
d) If the work has interactive user interfaces, each must display
|
|
||||||
Appropriate Legal Notices; however, if the Program has interactive
|
|
||||||
interfaces that do not display Appropriate Legal Notices, your
|
|
||||||
work need not make them do so.
|
|
||||||
|
|
||||||
A compilation of a covered work with other separate and independent
|
|
||||||
works, which are not by their nature extensions of the covered work,
|
|
||||||
and which are not combined with it such as to form a larger program,
|
|
||||||
in or on a volume of a storage or distribution medium, is called an
|
|
||||||
"aggregate" if the compilation and its resulting copyright are not
|
|
||||||
used to limit the access or legal rights of the compilation's users
|
|
||||||
beyond what the individual works permit. Inclusion of a covered work
|
|
||||||
in an aggregate does not cause this License to apply to the other
|
|
||||||
parts of the aggregate.
|
|
||||||
|
|
||||||
6. Conveying Non-Source Forms.
|
|
||||||
|
|
||||||
You may convey a covered work in object code form under the terms
|
|
||||||
of sections 4 and 5, provided that you also convey the
|
|
||||||
machine-readable Corresponding Source under the terms of this License,
|
|
||||||
in one of these ways:
|
|
||||||
|
|
||||||
a) Convey the object code in, or embodied in, a physical product
|
|
||||||
(including a physical distribution medium), accompanied by the
|
|
||||||
Corresponding Source fixed on a durable physical medium
|
|
||||||
customarily used for software interchange.
|
|
||||||
|
|
||||||
b) Convey the object code in, or embodied in, a physical product
|
|
||||||
(including a physical distribution medium), accompanied by a
|
|
||||||
written offer, valid for at least three years and valid for as
|
|
||||||
long as you offer spare parts or customer support for that product
|
|
||||||
model, to give anyone who possesses the object code either (1) a
|
|
||||||
copy of the Corresponding Source for all the software in the
|
|
||||||
product that is covered by this License, on a durable physical
|
|
||||||
medium customarily used for software interchange, for a price no
|
|
||||||
more than your reasonable cost of physically performing this
|
|
||||||
conveying of source, or (2) access to copy the
|
|
||||||
Corresponding Source from a network server at no charge.
|
|
||||||
|
|
||||||
c) Convey individual copies of the object code with a copy of the
|
|
||||||
written offer to provide the Corresponding Source. This
|
|
||||||
alternative is allowed only occasionally and noncommercially, and
|
|
||||||
only if you received the object code with such an offer, in accord
|
|
||||||
with subsection 6b.
|
|
||||||
|
|
||||||
d) Convey the object code by offering access from a designated
|
|
||||||
place (gratis or for a charge), and offer equivalent access to the
|
|
||||||
Corresponding Source in the same way through the same place at no
|
|
||||||
further charge. You need not require recipients to copy the
|
|
||||||
Corresponding Source along with the object code. If the place to
|
|
||||||
copy the object code is a network server, the Corresponding Source
|
|
||||||
may be on a different server (operated by you or a third party)
|
|
||||||
that supports equivalent copying facilities, provided you maintain
|
|
||||||
clear directions next to the object code saying where to find the
|
|
||||||
Corresponding Source. Regardless of what server hosts the
|
|
||||||
Corresponding Source, you remain obligated to ensure that it is
|
|
||||||
available for as long as needed to satisfy these requirements.
|
|
||||||
|
|
||||||
e) Convey the object code using peer-to-peer transmission, provided
|
|
||||||
you inform other peers where the object code and Corresponding
|
|
||||||
Source of the work are being offered to the general public at no
|
|
||||||
charge under subsection 6d.
|
|
||||||
|
|
||||||
A separable portion of the object code, whose source code is excluded
|
|
||||||
from the Corresponding Source as a System Library, need not be
|
|
||||||
included in conveying the object code work.
|
|
||||||
|
|
||||||
A "User Product" is either (1) a "consumer product", which means any
|
|
||||||
tangible personal property which is normally used for personal, family,
|
|
||||||
or household purposes, or (2) anything designed or sold for incorporation
|
|
||||||
into a dwelling. In determining whether a product is a consumer product,
|
|
||||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
|
||||||
product received by a particular user, "normally used" refers to a
|
|
||||||
typical or common use of that class of product, regardless of the status
|
|
||||||
of the particular user or of the way in which the particular user
|
|
||||||
actually uses, or expects or is expected to use, the product. A product
|
|
||||||
is a consumer product regardless of whether the product has substantial
|
|
||||||
commercial, industrial or non-consumer uses, unless such uses represent
|
|
||||||
the only significant mode of use of the product.
|
|
||||||
|
|
||||||
"Installation Information" for a User Product means any methods,
|
|
||||||
procedures, authorization keys, or other information required to install
|
|
||||||
and execute modified versions of a covered work in that User Product from
|
|
||||||
a modified version of its Corresponding Source. The information must
|
|
||||||
suffice to ensure that the continued functioning of the modified object
|
|
||||||
code is in no case prevented or interfered with solely because
|
|
||||||
modification has been made.
|
|
||||||
|
|
||||||
If you convey an object code work under this section in, or with, or
|
|
||||||
specifically for use in, a User Product, and the conveying occurs as
|
|
||||||
part of a transaction in which the right of possession and use of the
|
|
||||||
User Product is transferred to the recipient in perpetuity or for a
|
|
||||||
fixed term (regardless of how the transaction is characterized), the
|
|
||||||
Corresponding Source conveyed under this section must be accompanied
|
|
||||||
by the Installation Information. But this requirement does not apply
|
|
||||||
if neither you nor any third party retains the ability to install
|
|
||||||
modified object code on the User Product (for example, the work has
|
|
||||||
been installed in ROM).
|
|
||||||
|
|
||||||
The requirement to provide Installation Information does not include a
|
|
||||||
requirement to continue to provide support service, warranty, or updates
|
|
||||||
for a work that has been modified or installed by the recipient, or for
|
|
||||||
the User Product in which it has been modified or installed. Access to a
|
|
||||||
network may be denied when the modification itself materially and
|
|
||||||
adversely affects the operation of the network or violates the rules and
|
|
||||||
protocols for communication across the network.
|
|
||||||
|
|
||||||
Corresponding Source conveyed, and Installation Information provided,
|
|
||||||
in accord with this section must be in a format that is publicly
|
|
||||||
documented (and with an implementation available to the public in
|
|
||||||
source code form), and must require no special password or key for
|
|
||||||
unpacking, reading or copying.
|
|
||||||
|
|
||||||
7. Additional Terms.
|
|
||||||
|
|
||||||
"Additional permissions" are terms that supplement the terms of this
|
|
||||||
License by making exceptions from one or more of its conditions.
|
|
||||||
Additional permissions that are applicable to the entire Program shall
|
|
||||||
be treated as though they were included in this License, to the extent
|
|
||||||
that they are valid under applicable law. If additional permissions
|
|
||||||
apply only to part of the Program, that part may be used separately
|
|
||||||
under those permissions, but the entire Program remains governed by
|
|
||||||
this License without regard to the additional permissions.
|
|
||||||
|
|
||||||
When you convey a copy of a covered work, you may at your option
|
|
||||||
remove any additional permissions from that copy, or from any part of
|
|
||||||
it. (Additional permissions may be written to require their own
|
|
||||||
removal in certain cases when you modify the work.) You may place
|
|
||||||
additional permissions on material, added by you to a covered work,
|
|
||||||
for which you have or can give appropriate copyright permission.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, for material you
|
|
||||||
add to a covered work, you may (if authorized by the copyright holders of
|
|
||||||
that material) supplement the terms of this License with terms:
|
|
||||||
|
|
||||||
a) Disclaiming warranty or limiting liability differently from the
|
|
||||||
terms of sections 15 and 16 of this License; or
|
|
||||||
|
|
||||||
b) Requiring preservation of specified reasonable legal notices or
|
|
||||||
author attributions in that material or in the Appropriate Legal
|
|
||||||
Notices displayed by works containing it; or
|
|
||||||
|
|
||||||
c) Prohibiting misrepresentation of the origin of that material, or
|
|
||||||
requiring that modified versions of such material be marked in
|
|
||||||
reasonable ways as different from the original version; or
|
|
||||||
|
|
||||||
d) Limiting the use for publicity purposes of names of licensors or
|
|
||||||
authors of the material; or
|
|
||||||
|
|
||||||
e) Declining to grant rights under trademark law for use of some
|
|
||||||
trade names, trademarks, or service marks; or
|
|
||||||
|
|
||||||
f) Requiring indemnification of licensors and authors of that
|
|
||||||
material by anyone who conveys the material (or modified versions of
|
|
||||||
it) with contractual assumptions of liability to the recipient, for
|
|
||||||
any liability that these contractual assumptions directly impose on
|
|
||||||
those licensors and authors.
|
|
||||||
|
|
||||||
All other non-permissive additional terms are considered "further
|
|
||||||
restrictions" within the meaning of section 10. If the Program as you
|
|
||||||
received it, or any part of it, contains a notice stating that it is
|
|
||||||
governed by this License along with a term that is a further
|
|
||||||
restriction, you may remove that term. If a license document contains
|
|
||||||
a further restriction but permits relicensing or conveying under this
|
|
||||||
License, you may add to a covered work material governed by the terms
|
|
||||||
of that license document, provided that the further restriction does
|
|
||||||
not survive such relicensing or conveying.
|
|
||||||
|
|
||||||
If you add terms to a covered work in accord with this section, you
|
|
||||||
must place, in the relevant source files, a statement of the
|
|
||||||
additional terms that apply to those files, or a notice indicating
|
|
||||||
where to find the applicable terms.
|
|
||||||
|
|
||||||
Additional terms, permissive or non-permissive, may be stated in the
|
|
||||||
form of a separately written license, or stated as exceptions;
|
|
||||||
the above requirements apply either way.
|
|
||||||
|
|
||||||
8. Termination.
|
|
||||||
|
|
||||||
You may not propagate or modify a covered work except as expressly
|
|
||||||
provided under this License. Any attempt otherwise to propagate or
|
|
||||||
modify it is void, and will automatically terminate your rights under
|
|
||||||
this License (including any patent licenses granted under the third
|
|
||||||
paragraph of section 11).
|
|
||||||
|
|
||||||
However, if you cease all violation of this License, then your
|
|
||||||
license from a particular copyright holder is reinstated (a)
|
|
||||||
provisionally, unless and until the copyright holder explicitly and
|
|
||||||
finally terminates your license, and (b) permanently, if the copyright
|
|
||||||
holder fails to notify you of the violation by some reasonable means
|
|
||||||
prior to 60 days after the cessation.
|
|
||||||
|
|
||||||
Moreover, your license from a particular copyright holder is
|
|
||||||
reinstated permanently if the copyright holder notifies you of the
|
|
||||||
violation by some reasonable means, this is the first time you have
|
|
||||||
received notice of violation of this License (for any work) from that
|
|
||||||
copyright holder, and you cure the violation prior to 30 days after
|
|
||||||
your receipt of the notice.
|
|
||||||
|
|
||||||
Termination of your rights under this section does not terminate the
|
|
||||||
licenses of parties who have received copies or rights from you under
|
|
||||||
this License. If your rights have been terminated and not permanently
|
|
||||||
reinstated, you do not qualify to receive new licenses for the same
|
|
||||||
material under section 10.
|
|
||||||
|
|
||||||
9. Acceptance Not Required for Having Copies.
|
|
||||||
|
|
||||||
You are not required to accept this License in order to receive or
|
|
||||||
run a copy of the Program. Ancillary propagation of a covered work
|
|
||||||
occurring solely as a consequence of using peer-to-peer transmission
|
|
||||||
to receive a copy likewise does not require acceptance. However,
|
|
||||||
nothing other than this License grants you permission to propagate or
|
|
||||||
modify any covered work. These actions infringe copyright if you do
|
|
||||||
not accept this License. Therefore, by modifying or propagating a
|
|
||||||
covered work, you indicate your acceptance of this License to do so.
|
|
||||||
|
|
||||||
10. Automatic Licensing of Downstream Recipients.
|
|
||||||
|
|
||||||
Each time you convey a covered work, the recipient automatically
|
|
||||||
receives a license from the original licensors, to run, modify and
|
|
||||||
propagate that work, subject to this License. You are not responsible
|
|
||||||
for enforcing compliance by third parties with this License.
|
|
||||||
|
|
||||||
An "entity transaction" is a transaction transferring control of an
|
|
||||||
organization, or substantially all assets of one, or subdividing an
|
|
||||||
organization, or merging organizations. If propagation of a covered
|
|
||||||
work results from an entity transaction, each party to that
|
|
||||||
transaction who receives a copy of the work also receives whatever
|
|
||||||
licenses to the work the party's predecessor in interest had or could
|
|
||||||
give under the previous paragraph, plus a right to possession of the
|
|
||||||
Corresponding Source of the work from the predecessor in interest, if
|
|
||||||
the predecessor has it or can get it with reasonable efforts.
|
|
||||||
|
|
||||||
You may not impose any further restrictions on the exercise of the
|
|
||||||
rights granted or affirmed under this License. For example, you may
|
|
||||||
not impose a license fee, royalty, or other charge for exercise of
|
|
||||||
rights granted under this License, and you may not initiate litigation
|
|
||||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
|
||||||
any patent claim is infringed by making, using, selling, offering for
|
|
||||||
sale, or importing the Program or any portion of it.
|
|
||||||
|
|
||||||
11. Patents.
|
|
||||||
|
|
||||||
A "contributor" is a copyright holder who authorizes use under this
|
|
||||||
License of the Program or a work on which the Program is based. The
|
|
||||||
work thus licensed is called the contributor's "contributor version".
|
|
||||||
|
|
||||||
A contributor's "essential patent claims" are all patent claims
|
|
||||||
owned or controlled by the contributor, whether already acquired or
|
|
||||||
hereafter acquired, that would be infringed by some manner, permitted
|
|
||||||
by this License, of making, using, or selling its contributor version,
|
|
||||||
but do not include claims that would be infringed only as a
|
|
||||||
consequence of further modification of the contributor version. For
|
|
||||||
purposes of this definition, "control" includes the right to grant
|
|
||||||
patent sublicenses in a manner consistent with the requirements of
|
|
||||||
this License.
|
|
||||||
|
|
||||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
|
||||||
patent license under the contributor's essential patent claims, to
|
|
||||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
|
||||||
propagate the contents of its contributor version.
|
|
||||||
|
|
||||||
In the following three paragraphs, a "patent license" is any express
|
|
||||||
agreement or commitment, however denominated, not to enforce a patent
|
|
||||||
(such as an express permission to practice a patent or covenant not to
|
|
||||||
sue for patent infringement). To "grant" such a patent license to a
|
|
||||||
party means to make such an agreement or commitment not to enforce a
|
|
||||||
patent against the party.
|
|
||||||
|
|
||||||
If you convey a covered work, knowingly relying on a patent license,
|
|
||||||
and the Corresponding Source of the work is not available for anyone
|
|
||||||
to copy, free of charge and under the terms of this License, through a
|
|
||||||
publicly available network server or other readily accessible means,
|
|
||||||
then you must either (1) cause the Corresponding Source to be so
|
|
||||||
available, or (2) arrange to deprive yourself of the benefit of the
|
|
||||||
patent license for this particular work, or (3) arrange, in a manner
|
|
||||||
consistent with the requirements of this License, to extend the patent
|
|
||||||
license to downstream recipients. "Knowingly relying" means you have
|
|
||||||
actual knowledge that, but for the patent license, your conveying the
|
|
||||||
covered work in a country, or your recipient's use of the covered work
|
|
||||||
in a country, would infringe one or more identifiable patents in that
|
|
||||||
country that you have reason to believe are valid.
|
|
||||||
|
|
||||||
If, pursuant to or in connection with a single transaction or
|
|
||||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
|
||||||
covered work, and grant a patent license to some of the parties
|
|
||||||
receiving the covered work authorizing them to use, propagate, modify
|
|
||||||
or convey a specific copy of the covered work, then the patent license
|
|
||||||
you grant is automatically extended to all recipients of the covered
|
|
||||||
work and works based on it.
|
|
||||||
|
|
||||||
A patent license is "discriminatory" if it does not include within
|
|
||||||
the scope of its coverage, prohibits the exercise of, or is
|
|
||||||
conditioned on the non-exercise of one or more of the rights that are
|
|
||||||
specifically granted under this License. You may not convey a covered
|
|
||||||
work if you are a party to an arrangement with a third party that is
|
|
||||||
in the business of distributing software, under which you make payment
|
|
||||||
to the third party based on the extent of your activity of conveying
|
|
||||||
the work, and under which the third party grants, to any of the
|
|
||||||
parties who would receive the covered work from you, a discriminatory
|
|
||||||
patent license (a) in connection with copies of the covered work
|
|
||||||
conveyed by you (or copies made from those copies), or (b) primarily
|
|
||||||
for and in connection with specific products or compilations that
|
|
||||||
contain the covered work, unless you entered into that arrangement,
|
|
||||||
or that patent license was granted, prior to 28 March 2007.
|
|
||||||
|
|
||||||
Nothing in this License shall be construed as excluding or limiting
|
|
||||||
any implied license or other defenses to infringement that may
|
|
||||||
otherwise be available to you under applicable patent law.
|
|
||||||
|
|
||||||
12. No Surrender of Others' Freedom.
|
|
||||||
|
|
||||||
If conditions are imposed on you (whether by court order, agreement or
|
|
||||||
otherwise) that contradict the conditions of this License, they do not
|
|
||||||
excuse you from the conditions of this License. If you cannot convey a
|
|
||||||
covered work so as to satisfy simultaneously your obligations under this
|
|
||||||
License and any other pertinent obligations, then as a consequence you may
|
|
||||||
not convey it at all. For example, if you agree to terms that obligate you
|
|
||||||
to collect a royalty for further conveying from those to whom you convey
|
|
||||||
the Program, the only way you could satisfy both those terms and this
|
|
||||||
License would be to refrain entirely from conveying the Program.
|
|
||||||
|
|
||||||
13. Remote Network Interaction; Use with the GNU General Public License.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, if you modify the
|
|
||||||
Program, your modified version must prominently offer all users
|
|
||||||
interacting with it remotely through a computer network (if your version
|
|
||||||
supports such interaction) an opportunity to receive the Corresponding
|
|
||||||
Source of your version by providing access to the Corresponding Source
|
|
||||||
from a network server at no charge, through some standard or customary
|
|
||||||
means of facilitating copying of software. This Corresponding Source
|
|
||||||
shall include the Corresponding Source for any work covered by version 3
|
|
||||||
of the GNU General Public License that is incorporated pursuant to the
|
|
||||||
following paragraph.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, you have
|
|
||||||
permission to link or combine any covered work with a work licensed
|
|
||||||
under version 3 of the GNU General Public License into a single
|
|
||||||
combined work, and to convey the resulting work. The terms of this
|
|
||||||
License will continue to apply to the part which is the covered work,
|
|
||||||
but the work with which it is combined will remain governed by version
|
|
||||||
3 of the GNU General Public License.
|
|
||||||
|
|
||||||
14. Revised Versions of this License.
|
|
||||||
|
|
||||||
The Free Software Foundation may publish revised and/or new versions of
|
|
||||||
the GNU Affero General Public License from time to time. Such new versions
|
|
||||||
will be similar in spirit to the present version, but may differ in detail to
|
|
||||||
address new problems or concerns.
|
|
||||||
|
|
||||||
Each version is given a distinguishing version number. If the
|
|
||||||
Program specifies that a certain numbered version of the GNU Affero General
|
|
||||||
Public License "or any later version" applies to it, you have the
|
|
||||||
option of following the terms and conditions either of that numbered
|
|
||||||
version or of any later version published by the Free Software
|
|
||||||
Foundation. If the Program does not specify a version number of the
|
|
||||||
GNU Affero General Public License, you may choose any version ever published
|
|
||||||
by the Free Software Foundation.
|
|
||||||
|
|
||||||
If the Program specifies that a proxy can decide which future
|
|
||||||
versions of the GNU Affero General Public License can be used, that proxy's
|
|
||||||
public statement of acceptance of a version permanently authorizes you
|
|
||||||
to choose that version for the Program.
|
|
||||||
|
|
||||||
Later license versions may give you additional or different
|
|
||||||
permissions. However, no additional obligations are imposed on any
|
|
||||||
author or copyright holder as a result of your choosing to follow a
|
|
||||||
later version.
|
|
||||||
|
|
||||||
15. Disclaimer of Warranty.
|
|
||||||
|
|
||||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
|
||||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
|
||||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
|
||||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
|
||||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
|
||||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
|
||||||
|
|
||||||
16. Limitation of Liability.
|
|
||||||
|
|
||||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
|
||||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
|
||||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
|
||||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
|
||||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
|
||||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
|
||||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
|
||||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
|
||||||
SUCH DAMAGES.
|
|
||||||
|
|
||||||
17. Interpretation of Sections 15 and 16.
|
|
||||||
|
|
||||||
If the disclaimer of warranty and limitation of liability provided
|
|
||||||
above cannot be given local legal effect according to their terms,
|
|
||||||
reviewing courts shall apply local law that most closely approximates
|
|
||||||
an absolute waiver of all civil liability in connection with the
|
|
||||||
Program, unless a warranty or assumption of liability accompanies a
|
|
||||||
copy of the Program in return for a fee.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
How to Apply These Terms to Your New Programs
|
|
||||||
|
|
||||||
If you develop a new program, and you want it to be of the greatest
|
|
||||||
possible use to the public, the best way to achieve this is to make it
|
|
||||||
free software which everyone can redistribute and change under these terms.
|
|
||||||
|
|
||||||
To do so, attach the following notices to the program. It is safest
|
|
||||||
to attach them to the start of each source file to most effectively
|
|
||||||
state the exclusion of warranty; and each file should have at least
|
|
||||||
the "copyright" line and a pointer to where the full notice is found.
|
|
||||||
|
|
||||||
<one line to give the program's name and a brief idea of what it does.>
|
|
||||||
Copyright (C) <year> <name of author>
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Affero General Public License as published
|
|
||||||
by the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Affero General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Affero General Public License
|
|
||||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
|
||||||
|
|
||||||
If your software can interact with users remotely through a computer
|
|
||||||
network, you should also make sure that it provides a way for users to
|
|
||||||
get its source. For example, if your program is a web application, its
|
|
||||||
interface could display a "Source" link that leads users to an archive
|
|
||||||
of the code. There are many ways you could offer source, and different
|
|
||||||
solutions will be better for different programs; see section 13 for the
|
|
||||||
specific requirements.
|
|
||||||
|
|
||||||
You should also get your employer (if you work as a programmer) or school,
|
|
||||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
|
||||||
For more information on this, and how to apply and follow the GNU AGPL, see
|
|
||||||
<https://www.gnu.org/licenses/>.
|
|
||||||
+50
@@ -0,0 +1,50 @@
|
|||||||
|
# BlitzKit License
|
||||||
|
|
||||||
|
Version 1.1, August 5th, 2025. Copyright (c) TrèsAbhi.
|
||||||
|
|
||||||
|
Permission is hereby granted to anyone to:
|
||||||
|
|
||||||
|
- Fork, clone, and download the contents of this repository.
|
||||||
|
- Modify the code locally in private.
|
||||||
|
- Use and run the code **only for personal, non-public testing, or educational purposes**.
|
||||||
|
|
||||||
|
The following restrictions apply:
|
||||||
|
|
||||||
|
- You may **not** deploy, host, or make this project or any derivative publicly accessible.
|
||||||
|
- You may **not** share screenshots, recordings, or any form of media from this project unless you intend to merge your changes back into BlitzKit.
|
||||||
|
- You may **not** use this project or its contents in any public or commercial product.
|
||||||
|
- You may **not** redistribute modified or unmodified versions of this project.
|
||||||
|
|
||||||
|
Contributions:
|
||||||
|
|
||||||
|
- You are encouraged to propose changes or improvements via pull requests to the original BlitzKit repository.
|
||||||
|
- Any such contributions will be considered under the same license terms unless explicitly stated otherwise.
|
||||||
|
|
||||||
|
Violations of this license may result in revocation of usage rights and takedown requests.
|
||||||
|
|
||||||
|
For questions or licensing inquiries, contact support@blitzkit.app.
|
||||||
|
|
||||||
|
## Notes on Existing Forks
|
||||||
|
|
||||||
|
All forks fall under these categories:
|
||||||
|
|
||||||
|
- If your fork was made from commit `8462901` (Apr 17, 2023) or between commits `2958124` (Jul 3, 2023) and `85e483e` (Jul 13, 2024), your fork falls under the **MIT license**.
|
||||||
|
- If your fork was made from commits between `5646093` (Jul 13, 2024) and `e3f131c` (Aug 5, 2025), your fork falls under the **AGPL-3.0 license**.
|
||||||
|
- If your fork was made between commit `f7c356d` (Apr 17, 2023) and `2958124` (Jul 3, 2023), your fork falls under **a default exclusive copyright**.
|
||||||
|
- If your fork was made from commits between `e3f131c` (Aug 5, 2025) and today, your fork falls under **this license**.
|
||||||
|
|
||||||
|
MIT and AGPL-3.0 licensed fork owners:
|
||||||
|
|
||||||
|
- You may continue to use your fork of BlitzKit under the corresponding license.
|
||||||
|
- You may upgrade your fork up to commit `5cab394` (Aug 4, 2025) and keep the AGPL-3.0 license.
|
||||||
|
- You may upgrade to commit `e3f131c` (Aug 5, 2025) or beyond but have to **switch to this license** where all rules apply.
|
||||||
|
- If you upgrade to commit `e3f131c` (Aug 5, 2025) or beyond, you must retract all public deployments of BlitzKit.
|
||||||
|
- Existing screenshots, recordings, or any form of media can remain.
|
||||||
|
|
||||||
|
Default exclusive copyright fork owners:
|
||||||
|
|
||||||
|
- You may continue to use their forks under the AGPL-3.0 license as no license was applied to BlitzKit at the time of forking.
|
||||||
|
|
||||||
|
BlitzKit licensed fork owners:
|
||||||
|
|
||||||
|
- You may continue to upgrade to the latest commits only under the conditions of this license.
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
# BlitzKit 1.27.12
|
||||||
|
|
||||||
|
This update only affects the website.
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- Added the ability to sort by HE shell penetration
|
||||||
|
- The Tankopedia compare bars now account for equipment and selected shells
|
||||||
|
- Made the hero section of the Tankopedia a bit shorter to show users that the page is scrollable
|
||||||
|
|
||||||
|
## Fixes
|
||||||
|
|
||||||
|
- The "Clear filters" button no longer shows up after clearing the search bar
|
||||||
|
- Guns for some tanks no longer go transparent when far away from the camera
|
||||||
|
- The dynamic armor tab no longer lags and flickers when rotating the turret of a tank
|
||||||
|
- Reimplemented the missing tool backgrounds in the navigation bar hamburger menu
|
||||||
|
- The navigation bar now properly goes transparent for pages that request like the Tankopedia pages
|
||||||
|
- Removed the tank name text outline because it doesn't work on most devices
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
# BlitzKit 1.27.13
|
||||||
|
|
||||||
|
This update adds a feature for a future version of WoTB 👁️👃👁️
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- Added compatibility for the new mechanic for the upcoming Polish Tank Destroyers
|
||||||
|
- This code will remain dormant until the update for WoTB is released
|
||||||
|
- Added a progress bar to the hero section of the Tankopedia to show that the model is loading
|
||||||
|
- Reordered some Tankopedia statistics to bring important statistics like Damage to the very top
|
||||||
|
|
||||||
|
## Fixes
|
||||||
|
|
||||||
|
- The second column in the footer is now aligned on mobile devices
|
||||||
|
- Fixed an issue that stopped the armor highlighting from working on the Kiwi browser and on older devices
|
||||||
|
|
||||||
|
## Technical Changes
|
||||||
|
|
||||||
|
- Removed permissions for robots to crawl non-blitzkit.app domains
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
# BlitzKit 1.27.14
|
||||||
|
|
||||||
|
This is the 14th patch for `1.27`, making it the new longest lasting version beating the previous record of `1.15.13`!
|
||||||
|
|
||||||
|
## Fixes
|
||||||
|
|
||||||
|
- Optimized the rendering of the shells in the Tankopedia search
|
||||||
|
- The Assault Shells cursor now works on iOS devices
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
# BlitzKit 1.27.15
|
||||||
|
|
||||||
|
I did not see this coming
|
||||||
|
|
||||||
|
## Fixes
|
||||||
|
|
||||||
|
- The Assault Shell graph now supports damage factors of above 100% now
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
# BlitzKit 1.27.16
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- Added links to GuidesBlitz to Tankopedia to aid users understand tanks beyond just numbers and stats
|
||||||
|
- Added a gun depression and yaw visualizer
|
||||||
|
|
||||||
|
## Changes
|
||||||
|
|
||||||
|
- Made the colors of the advanced highlighting mode more subtle
|
||||||
|
- Made the Tankopedia stat lines more condensed
|
||||||
|
- You can now scroll the page even with your cursor on the Tankopedia sandbox
|
||||||
|
|
||||||
|
## Fixes
|
||||||
|
|
||||||
|
- Fixed a bug where the range of increased gun depression was incorrectly doubled
|
||||||
|
- Removed an unintended space before the "x" in the "Gun damaged" stat
|
||||||
|
- Fixed an issue causing the 3D renderer to render frames even when off screen
|
||||||
|
- Fixed a differential issue causing excessive rerendering of the stat lines
|
||||||
|
- Images no longer exceed the width of the device in the docs
|
||||||
|
- Assault shells no longer scale the module damage with distance
|
||||||
|
|
||||||
|
## Technical Changes
|
||||||
|
|
||||||
|
- Removed all code relating to the canceled "Shooting Range" mode
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
# BlitzKit 1.27.17
|
||||||
|
|
||||||
|
This update was released early for the website. Today, it'll be officially announced and released for the bot
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- Added the shell reload visualizer to aid people in getting a feel for how long shell reloads really are
|
||||||
|
- Added lines of stats for the burst shells
|
||||||
|
|
||||||
|
## Changes
|
||||||
|
|
||||||
|
- Removed the redundant word "Shell" from "Shell reload" and "Shell reloads"
|
||||||
|
- Removed the penetration over distance slider
|
||||||
|
|
||||||
|
## Fixes
|
||||||
|
|
||||||
|
- Fixed the DPM of tanks with burst shells like the ATAC
|
||||||
|
- The DPM will still be different from the game due to a bug in World of Tanks Blitz; I am trying to get Wargaming to fix it; trust BlitzKit!
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
# BlitzKit 1.27.18
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- Added a mini-game to BlitzKit similar to "Guess Who's That Pokemon" but with tanks: http://blitzkit.vercel.app/guess
|
||||||
|
- Switched to a new renderer for better lighting for the Tankopedia
|
||||||
|
|
||||||
|
## Fixes
|
||||||
|
|
||||||
|
- The loading bar for the Tankopedia sandbox now shows up again
|
||||||
|
- Removed a lot of dead code, improving performance
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
# BlitzKit 1.27.19
|
||||||
|
|
||||||
|
Two updates in a day? I just got a little excited by the new Tankopedia lighting.
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- The camera is now lower town in the Tankopedia, giving the tank a more heroic feel
|
||||||
|
- Tanks are better framed across all devices, minimizing whitespace
|
||||||
|
- Added a skip button for the reload visualizer to skip to the next event
|
||||||
|
|
||||||
|
## Fixes
|
||||||
|
|
||||||
|
- Removed the useless "show grid" setting
|
||||||
|
- Taking screenshots now no longer includes the scene props like the floor
|
||||||
|
- The subtler color contrast for the advanced highlighting has now been reverted back to the higher contrast
|
||||||
|
- The shot display card is now properly aligned as a proper table again
|
||||||
|
- Tank modules are once again considered in the penetration tester
|
||||||
|
- Tank filters in the antagonist selector in the Tankopedia sandbox are now properly aligned
|
||||||
+3
-1
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "blitzkit",
|
"name": "blitzkit",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "1.27.11",
|
"version": "1.27.19",
|
||||||
"description": "🎉 Tools for everything World of Tanks Blitz",
|
"description": "🎉 Tools for everything World of Tanks Blitz",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"types": "./types.d.ts",
|
"types": "./types.d.ts",
|
||||||
@@ -21,6 +21,7 @@
|
|||||||
"start:bot": "bun dist/bot/main.js",
|
"start:bot": "bun dist/bot/main.js",
|
||||||
"dev:docs": "vitepress dev docs",
|
"dev:docs": "vitepress dev docs",
|
||||||
"dev:website": "cd packages/website && bun run dev",
|
"dev:website": "cd packages/website && bun run dev",
|
||||||
|
"dev": "bun run dev:website",
|
||||||
"dev:api": "bun --filter=@blitzkit/api run dev",
|
"dev:api": "bun --filter=@blitzkit/api run dev",
|
||||||
"setup:depotdownloader": "bun --filter=@blitzkit/scripts run setup:depotdownloader",
|
"setup:depotdownloader": "bun --filter=@blitzkit/scripts run setup:depotdownloader",
|
||||||
"setup:patches": "bun --filter=@blitzkit/scripts run setup:patches",
|
"setup:patches": "bun --filter=@blitzkit/scripts run setup:patches",
|
||||||
@@ -40,6 +41,7 @@
|
|||||||
},
|
},
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"cheerio": "^1.1.2",
|
||||||
"googleapis": "^144.0.0",
|
"googleapis": "^144.0.0",
|
||||||
"lodash-es": "^4.17.21",
|
"lodash-es": "^4.17.21",
|
||||||
"protobufjs": "^7.5.2",
|
"protobufjs": "^7.5.2",
|
||||||
|
|||||||
@@ -197,15 +197,10 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
|
|||||||
|
|
||||||
turret.guns.forEach((gun) => {
|
turret.guns.forEach((gun) => {
|
||||||
if (
|
if (
|
||||||
gun.gun_type!.value.base.research_cost !== undefined &&
|
gun.research_cost !== undefined &&
|
||||||
typeof gun.gun_type!.value.base.research_cost
|
typeof gun.research_cost.research_cost_type!.value === 'number'
|
||||||
.research_cost_type!.value === 'number'
|
|
||||||
) {
|
) {
|
||||||
gunXps.set(
|
gunXps.set(gun.id, gun.research_cost.research_cost_type!.value);
|
||||||
gun.gun_type!.value.base.id,
|
|
||||||
gun.gun_type!.value.base.research_cost.research_cost_type!
|
|
||||||
.value,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { ReadStream } from '@blitzkit/core';
|
import { ReadStream } from "@blitzkit/core";
|
||||||
import AdmZip from 'adm-zip';
|
import AdmZip from "adm-zip";
|
||||||
import { readFile, writeFile } from 'fs/promises';
|
import { readFile } from "fs/promises";
|
||||||
import { Parser } from 'pickleparser';
|
import { Parser } from "pickleparser";
|
||||||
import protobuf from 'protobufjs';
|
import protobuf from "protobufjs";
|
||||||
|
|
||||||
interface WotbReplayMetaJson {
|
interface WotbReplayMetaJson {
|
||||||
version: string;
|
version: string;
|
||||||
@@ -24,26 +24,24 @@ export class WotbReplayReadStream extends ReadStream {
|
|||||||
async wotbReplay() {
|
async wotbReplay() {
|
||||||
const pickleParser = new Parser();
|
const pickleParser = new Parser();
|
||||||
const zip = new AdmZip(Buffer.from(this.buffer));
|
const zip = new AdmZip(Buffer.from(this.buffer));
|
||||||
const metaJsonBuffer = zip.getEntry('meta.json')?.getData();
|
const metaJsonBuffer = zip.getEntry("meta.json")?.getData();
|
||||||
const battleResultsDat = zip.getEntry('battle_results.dat')?.getData();
|
const battleResultsDat = zip.getEntry("battle_results.dat")?.getData();
|
||||||
|
|
||||||
if (!metaJsonBuffer || !battleResultsDat)
|
if (!metaJsonBuffer || !battleResultsDat)
|
||||||
throw new SyntaxError('meta.json not found');
|
throw new SyntaxError("meta.json not found");
|
||||||
|
|
||||||
const metaJson = JSON.parse(
|
const metaJson = JSON.parse(
|
||||||
metaJsonBuffer.toString(),
|
metaJsonBuffer.toString()
|
||||||
) as WotbReplayMetaJson;
|
) as WotbReplayMetaJson;
|
||||||
const unpickledBattleResults = pickleParser.parse(battleResultsDat);
|
const unpickledBattleResults = pickleParser.parse(battleResultsDat);
|
||||||
const [, battleResultsString] = unpickledBattleResults as [number, string];
|
const [, battleResultsString] = unpickledBattleResults as [number, string];
|
||||||
const root = await protobuf.load(
|
const root = await protobuf.load(
|
||||||
`${__dirname}/../../protos/BattleResultsClient.proto`,
|
`${__dirname}/../../protos/BattleResultsClient.proto`
|
||||||
);
|
);
|
||||||
const BattleResults = root.lookupType(
|
const BattleResults = root.lookupType(
|
||||||
'BattleResultsGenerated.BattleResultsClient',
|
"BattleResultsGenerated.BattleResultsClient"
|
||||||
);
|
);
|
||||||
|
|
||||||
writeFile('test.dat', Buffer.from(battleResultsString));
|
|
||||||
|
|
||||||
const reader = protobuf.Reader.create(Buffer.from(battleResultsString));
|
const reader = protobuf.Reader.create(Buffer.from(battleResultsString));
|
||||||
|
|
||||||
// const decodedBattleResults = BattleResults.decodeDelimited(
|
// const decodedBattleResults = BattleResults.decodeDelimited(
|
||||||
@@ -53,7 +51,7 @@ export class WotbReplayReadStream extends ReadStream {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const replay = await readFile('temp/test3.wotbreplay');
|
const replay = await readFile("temp/test3.wotbreplay");
|
||||||
const stream = new WotbReplayReadStream(replay.buffer as ArrayBuffer);
|
const stream = new WotbReplayReadStream(replay.buffer as ArrayBuffer);
|
||||||
|
|
||||||
stream.wotbReplay();
|
stream.wotbReplay();
|
||||||
@@ -1,12 +1,5 @@
|
|||||||
import { assertSecret } from './assertSecret';
|
import { assertSecret } from './assertSecret';
|
||||||
|
|
||||||
const repo = assertSecret(import.meta.env.PUBLIC_ASSET_REPO);
|
|
||||||
const branch = assertSecret(import.meta.env.PUBLIC_ASSET_BRANCH);
|
|
||||||
const fastUser = assertSecret(import.meta.env.PUBLIC_ASSET_FAST_USER);
|
|
||||||
const fastRepo = assertSecret(import.meta.env.PUBLIC_ASSET_FAST_REPO);
|
|
||||||
|
|
||||||
export function asset(path: string) {
|
export function asset(path: string) {
|
||||||
return branch === 'main'
|
return `${assertSecret(import.meta.env.PUBLIC_ASSET_BASE)}/${path}`;
|
||||||
? `https://${fastUser}.github.io/${fastRepo}/${path}`
|
|
||||||
: `https://raw.githubusercontent.com/${repo}/${branch}/${path}`;
|
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import {
|
import {
|
||||||
GunDefinition,
|
GunDefinition,
|
||||||
GunDefinitionAutoReloaderProperties,
|
GunDefinitionAutoReloader,
|
||||||
ShellDefinition,
|
ShellDefinition,
|
||||||
} from '../protos';
|
} from '../protos';
|
||||||
|
|
||||||
@@ -15,34 +15,46 @@ export function resolveDpm(
|
|||||||
let dps: number;
|
let dps: number;
|
||||||
|
|
||||||
if (gun.gun_type!.$case === 'regular') {
|
if (gun.gun_type!.$case === 'regular') {
|
||||||
dps = alpha / (reloadCoefficient * gun.gun_type!.value.extension.reload);
|
dps = alpha / (reloadCoefficient * gun.gun_type!.value.reload);
|
||||||
} else if (gun.gun_type!.$case === 'auto_loader') {
|
} else if (gun.gun_type!.$case === 'auto_loader') {
|
||||||
dps =
|
const damage = alpha * gun.gun_type!.value.shell_count;
|
||||||
(alpha * gun.gun_type!.value.extension.shell_count) /
|
let time = gun.gun_type!.value.clip_reload * reloadCoefficient;
|
||||||
(gun.gun_type!.value.extension.clip_reload * reloadCoefficient +
|
|
||||||
(gun.gun_type!.value.extension.shell_count - 1) *
|
|
||||||
gun.gun_type!.value.extension.intra_clip *
|
|
||||||
intraClipCoefficient);
|
|
||||||
} else {
|
|
||||||
const mostOptimalShell =
|
|
||||||
gun.gun_type!.value.extension.shell_reloads.reduce<null | {
|
|
||||||
index: number;
|
|
||||||
reload: number;
|
|
||||||
}>((current, reloadRaw, index) => {
|
|
||||||
const reload =
|
|
||||||
reloadRaw * reloadCoefficient +
|
|
||||||
(index > 0
|
|
||||||
? (
|
|
||||||
gun.gun_type!.value
|
|
||||||
.extension as GunDefinitionAutoReloaderProperties
|
|
||||||
).intra_clip * intraClipCoefficient
|
|
||||||
: 0);
|
|
||||||
|
|
||||||
if (current === null || reload < current.reload) {
|
if (gun.burst) {
|
||||||
return { index, reload };
|
time +=
|
||||||
}
|
(gun.gun_type!.value.shell_count / gun.burst.count - 1) *
|
||||||
return current;
|
gun.gun_type!.value.intra_clip *
|
||||||
}, null)!;
|
intraClipCoefficient;
|
||||||
|
|
||||||
|
time +=
|
||||||
|
(gun.gun_type!.value.shell_count / gun.burst.count) *
|
||||||
|
(gun.burst.count - 1) *
|
||||||
|
gun.burst.interval;
|
||||||
|
} else {
|
||||||
|
time +=
|
||||||
|
(gun.gun_type!.value.shell_count - 1) *
|
||||||
|
gun.gun_type!.value.intra_clip *
|
||||||
|
intraClipCoefficient;
|
||||||
|
}
|
||||||
|
|
||||||
|
dps = damage / time;
|
||||||
|
} else {
|
||||||
|
const mostOptimalShell = gun.gun_type!.value.shell_reloads.reduce<null | {
|
||||||
|
index: number;
|
||||||
|
reload: number;
|
||||||
|
}>((current, reloadRaw, index) => {
|
||||||
|
const reload =
|
||||||
|
reloadRaw * reloadCoefficient +
|
||||||
|
(index > 0
|
||||||
|
? (gun.gun_type!.value as GunDefinitionAutoReloader).intra_clip *
|
||||||
|
intraClipCoefficient
|
||||||
|
: 0);
|
||||||
|
|
||||||
|
if (current === null || reload < current.reload) {
|
||||||
|
return { index, reload };
|
||||||
|
}
|
||||||
|
return current;
|
||||||
|
}, null)!;
|
||||||
|
|
||||||
dps = alpha / mostOptimalShell?.reload;
|
dps = alpha / mostOptimalShell?.reload;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ export function uniqueGuns(turrets: TurretDefinition[]) {
|
|||||||
|
|
||||||
forEachRight(turrets, (turret) => {
|
forEachRight(turrets, (turret) => {
|
||||||
forEachRight(turret.guns, (gun) => {
|
forEachRight(turret.guns, (gun) => {
|
||||||
if (!gunIds.has(gun.gun_type!.value.base.id)) {
|
if (!gunIds.has(gun.id)) {
|
||||||
gunIds.add(gun.gun_type!.value.base.id);
|
gunIds.add(gun.id);
|
||||||
guns.push({ turret, gun });
|
guns.push({ turret, gun });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -4,4 +4,6 @@ export const youtubers = [
|
|||||||
{ id: 'UCxRpZqMElssTdPYDK3x7wyg', name: 'N90' },
|
{ id: 'UCxRpZqMElssTdPYDK3x7wyg', name: 'N90' },
|
||||||
{ id: 'UC28Hc6p2MGoB5s78eHCYkQg', name: 'GuidesBlitz' },
|
{ id: 'UC28Hc6p2MGoB5s78eHCYkQg', name: 'GuidesBlitz' },
|
||||||
{ id: 'UCLMEfqtlwLDN-UXX21RiEww', name: 'WoT Blitz Best Replays' },
|
{ id: 'UCLMEfqtlwLDN-UXX21RiEww', name: 'WoT Blitz Best Replays' },
|
||||||
|
{ id: 'UC3fZbetRUFoJL0IEN7IhG0Q', name: 'EconomicsMate' },
|
||||||
|
{ id: 'UCtsUVwBlhEnUunAKLn2dtsg', name: 'Megalion69' },
|
||||||
];
|
];
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
import { MessageFns } from '../protos';
|
|
||||||
|
|
||||||
export function encodePBBuffer<Type>(message: MessageFns<Type>, data: Type) {
|
|
||||||
return Buffer.from(message.encode(data).finish());
|
|
||||||
}
|
|
||||||
@@ -1,3 +1,2 @@
|
|||||||
export * from './encodePBBuffer';
|
|
||||||
export * from './fetchPB';
|
export * from './fetchPB';
|
||||||
export * from './pbMap';
|
export * from './pbMap';
|
||||||
@@ -5,10 +5,10 @@
|
|||||||
// source: packages/core/src/protos/camouflage_definitions.proto
|
// source: packages/core/src/protos/camouflage_definitions.proto
|
||||||
|
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
import { BinaryReader, BinaryWriter } from '@bufbuild/protobuf/wire';
|
||||||
import { createBaseI18nString, I18nString } from "./i18n";
|
import { createBaseI18nString, I18nString } from './i18n';
|
||||||
|
|
||||||
export const protobufPackage = "blitzkit";
|
export const protobufPackage = 'blitzkit';
|
||||||
|
|
||||||
export interface CamouflageDefinitions {
|
export interface CamouflageDefinitions {
|
||||||
camouflages: { [key: number]: Camouflage };
|
camouflages: { [key: number]: Camouflage };
|
||||||
@@ -22,8 +22,8 @@ export interface CamouflageDefinitions_CamouflagesEntry {
|
|||||||
export interface Camouflage {
|
export interface Camouflage {
|
||||||
id: number;
|
id: number;
|
||||||
name: I18nString;
|
name: I18nString;
|
||||||
tank_name?: I18nString | undefined;
|
tank_name?: I18nString;
|
||||||
tank_name_full?: I18nString | undefined;
|
tank_name_full?: I18nString;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function createBaseCamouflageDefinitions(): CamouflageDefinitions {
|
export function createBaseCamouflageDefinitions(): CamouflageDefinitions {
|
||||||
@@ -31,15 +31,25 @@ export function createBaseCamouflageDefinitions(): CamouflageDefinitions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const CamouflageDefinitions: MessageFns<CamouflageDefinitions> = {
|
export const CamouflageDefinitions: MessageFns<CamouflageDefinitions> = {
|
||||||
encode(message: CamouflageDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(
|
||||||
|
message: CamouflageDefinitions,
|
||||||
|
writer: BinaryWriter = new BinaryWriter(),
|
||||||
|
): BinaryWriter {
|
||||||
Object.entries(message.camouflages).forEach(([key, value]) => {
|
Object.entries(message.camouflages).forEach(([key, value]) => {
|
||||||
CamouflageDefinitions_CamouflagesEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
CamouflageDefinitions_CamouflagesEntry.encode(
|
||||||
|
{ key: key as any, value },
|
||||||
|
writer.uint32(10).fork(),
|
||||||
|
).join();
|
||||||
});
|
});
|
||||||
return writer;
|
return writer;
|
||||||
},
|
},
|
||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): CamouflageDefinitions {
|
decode(
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
input: BinaryReader | Uint8Array,
|
||||||
|
length?: number,
|
||||||
|
): CamouflageDefinitions {
|
||||||
|
const reader =
|
||||||
|
input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
let end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseCamouflageDefinitions();
|
const message = createBaseCamouflageDefinitions();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
@@ -50,7 +60,10 @@ export const CamouflageDefinitions: MessageFns<CamouflageDefinitions> = {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
const entry1 = CamouflageDefinitions_CamouflagesEntry.decode(reader, reader.uint32());
|
const entry1 = CamouflageDefinitions_CamouflagesEntry.decode(
|
||||||
|
reader,
|
||||||
|
reader.uint32(),
|
||||||
|
);
|
||||||
if (entry1.value !== undefined) {
|
if (entry1.value !== undefined) {
|
||||||
message.camouflages[entry1.key] = entry1.value;
|
message.camouflages[entry1.key] = entry1.value;
|
||||||
}
|
}
|
||||||
@@ -68,10 +81,12 @@ export const CamouflageDefinitions: MessageFns<CamouflageDefinitions> = {
|
|||||||
fromJSON(object: any): CamouflageDefinitions {
|
fromJSON(object: any): CamouflageDefinitions {
|
||||||
return {
|
return {
|
||||||
camouflages: isObject(object.camouflages)
|
camouflages: isObject(object.camouflages)
|
||||||
? Object.entries(object.camouflages).reduce<{ [key: number]: Camouflage }>((acc, [key, value]) => {
|
? Object.entries(object.camouflages).reduce<{
|
||||||
acc[globalThis.Number(key)] = Camouflage.fromJSON(value);
|
[key: number]: Camouflage;
|
||||||
return acc;
|
}>((acc, [key, value]) => {
|
||||||
}, {})
|
acc[globalThis.Number(key)] = Camouflage.fromJSON(value);
|
||||||
|
return acc;
|
||||||
|
}, {})
|
||||||
: {},
|
: {},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -90,20 +105,23 @@ export const CamouflageDefinitions: MessageFns<CamouflageDefinitions> = {
|
|||||||
return obj;
|
return obj;
|
||||||
},
|
},
|
||||||
|
|
||||||
create<I extends Exact<DeepPartial<CamouflageDefinitions>, I>>(base?: I): CamouflageDefinitions {
|
create<I extends Exact<DeepPartial<CamouflageDefinitions>, I>>(
|
||||||
|
base?: I,
|
||||||
|
): CamouflageDefinitions {
|
||||||
return CamouflageDefinitions.fromPartial(base ?? ({} as any));
|
return CamouflageDefinitions.fromPartial(base ?? ({} as any));
|
||||||
},
|
},
|
||||||
fromPartial<I extends Exact<DeepPartial<CamouflageDefinitions>, I>>(object: I): CamouflageDefinitions {
|
fromPartial<I extends Exact<DeepPartial<CamouflageDefinitions>, I>>(
|
||||||
|
object: I,
|
||||||
|
): CamouflageDefinitions {
|
||||||
const message = createBaseCamouflageDefinitions();
|
const message = createBaseCamouflageDefinitions();
|
||||||
message.camouflages = Object.entries(object.camouflages ?? {}).reduce<{ [key: number]: Camouflage }>(
|
message.camouflages = Object.entries(object.camouflages ?? {}).reduce<{
|
||||||
(acc, [key, value]) => {
|
[key: number]: Camouflage;
|
||||||
if (value !== undefined) {
|
}>((acc, [key, value]) => {
|
||||||
acc[globalThis.Number(key)] = Camouflage.fromPartial(value);
|
if (value !== undefined) {
|
||||||
}
|
acc[globalThis.Number(key)] = Camouflage.fromPartial(value);
|
||||||
return acc;
|
}
|
||||||
},
|
return acc;
|
||||||
{},
|
}, {});
|
||||||
);
|
|
||||||
return message;
|
return message;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -112,90 +130,116 @@ export function createBaseCamouflageDefinitions_CamouflagesEntry(): CamouflageDe
|
|||||||
return { key: 0, value: createBaseCamouflage() };
|
return { key: 0, value: createBaseCamouflage() };
|
||||||
}
|
}
|
||||||
|
|
||||||
export const CamouflageDefinitions_CamouflagesEntry: MessageFns<CamouflageDefinitions_CamouflagesEntry> = {
|
export const CamouflageDefinitions_CamouflagesEntry: MessageFns<CamouflageDefinitions_CamouflagesEntry> =
|
||||||
encode(message: CamouflageDefinitions_CamouflagesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
{
|
||||||
if (message.key !== undefined) {
|
encode(
|
||||||
writer.uint32(8).uint32(message.key);
|
message: CamouflageDefinitions_CamouflagesEntry,
|
||||||
}
|
writer: BinaryWriter = new BinaryWriter(),
|
||||||
if (message.value !== undefined) {
|
): BinaryWriter {
|
||||||
Camouflage.encode(message.value, writer.uint32(18).fork()).join();
|
if (message.key !== undefined) {
|
||||||
}
|
writer.uint32(8).uint32(message.key);
|
||||||
return writer;
|
|
||||||
},
|
|
||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): CamouflageDefinitions_CamouflagesEntry {
|
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
|
||||||
const message = createBaseCamouflageDefinitions_CamouflagesEntry();
|
|
||||||
while (reader.pos < end) {
|
|
||||||
const tag = reader.uint32();
|
|
||||||
switch (tag >>> 3) {
|
|
||||||
case 1: {
|
|
||||||
if (tag !== 8) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
message.key = reader.uint32();
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
case 2: {
|
|
||||||
if (tag !== 18) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
message.value = Camouflage.decode(reader, reader.uint32());
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if ((tag & 7) === 4 || tag === 0) {
|
if (message.value !== undefined) {
|
||||||
break;
|
Camouflage.encode(message.value, writer.uint32(18).fork()).join();
|
||||||
}
|
}
|
||||||
reader.skip(tag & 7);
|
return writer;
|
||||||
}
|
},
|
||||||
return message;
|
|
||||||
},
|
|
||||||
|
|
||||||
fromJSON(object: any): CamouflageDefinitions_CamouflagesEntry {
|
decode(
|
||||||
return {
|
input: BinaryReader | Uint8Array,
|
||||||
key: globalThis.Number(assertSet("CamouflageDefinitions_CamouflagesEntry.key", object.key)),
|
length?: number,
|
||||||
value: Camouflage.fromJSON(assertSet("CamouflageDefinitions_CamouflagesEntry.value", object.value)),
|
): CamouflageDefinitions_CamouflagesEntry {
|
||||||
};
|
const reader =
|
||||||
},
|
input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
|
let end = length === undefined ? reader.len : reader.pos + length;
|
||||||
|
const message = createBaseCamouflageDefinitions_CamouflagesEntry();
|
||||||
|
while (reader.pos < end) {
|
||||||
|
const tag = reader.uint32();
|
||||||
|
switch (tag >>> 3) {
|
||||||
|
case 1: {
|
||||||
|
if (tag !== 8) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
toJSON(message: CamouflageDefinitions_CamouflagesEntry): unknown {
|
message.key = reader.uint32();
|
||||||
const obj: any = {};
|
continue;
|
||||||
if (message.key !== undefined) {
|
}
|
||||||
obj.key = Math.round(message.key);
|
case 2: {
|
||||||
}
|
if (tag !== 18) {
|
||||||
if (message.value !== undefined) {
|
break;
|
||||||
obj.value = Camouflage.toJSON(message.value);
|
}
|
||||||
}
|
|
||||||
return obj;
|
|
||||||
},
|
|
||||||
|
|
||||||
create<I extends Exact<DeepPartial<CamouflageDefinitions_CamouflagesEntry>, I>>(
|
message.value = Camouflage.decode(reader, reader.uint32());
|
||||||
base?: I,
|
continue;
|
||||||
): CamouflageDefinitions_CamouflagesEntry {
|
}
|
||||||
return CamouflageDefinitions_CamouflagesEntry.fromPartial(base ?? ({} as any));
|
}
|
||||||
},
|
if ((tag & 7) === 4 || tag === 0) {
|
||||||
fromPartial<I extends Exact<DeepPartial<CamouflageDefinitions_CamouflagesEntry>, I>>(
|
break;
|
||||||
object: I,
|
}
|
||||||
): CamouflageDefinitions_CamouflagesEntry {
|
reader.skip(tag & 7);
|
||||||
const message = createBaseCamouflageDefinitions_CamouflagesEntry();
|
}
|
||||||
message.key = object.key ?? 0;
|
return message;
|
||||||
message.value = (object.value !== undefined && object.value !== null)
|
},
|
||||||
? Camouflage.fromPartial(object.value)
|
|
||||||
: createBaseCamouflage();
|
fromJSON(object: any): CamouflageDefinitions_CamouflagesEntry {
|
||||||
return message;
|
return {
|
||||||
},
|
key: globalThis.Number(
|
||||||
};
|
assertSet('CamouflageDefinitions_CamouflagesEntry.key', object.key),
|
||||||
|
),
|
||||||
|
value: Camouflage.fromJSON(
|
||||||
|
assertSet(
|
||||||
|
'CamouflageDefinitions_CamouflagesEntry.value',
|
||||||
|
object.value,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
toJSON(message: CamouflageDefinitions_CamouflagesEntry): unknown {
|
||||||
|
const obj: any = {};
|
||||||
|
if (message.key !== undefined) {
|
||||||
|
obj.key = Math.round(message.key);
|
||||||
|
}
|
||||||
|
if (message.value !== undefined) {
|
||||||
|
obj.value = Camouflage.toJSON(message.value);
|
||||||
|
}
|
||||||
|
return obj;
|
||||||
|
},
|
||||||
|
|
||||||
|
create<
|
||||||
|
I extends Exact<DeepPartial<CamouflageDefinitions_CamouflagesEntry>, I>,
|
||||||
|
>(base?: I): CamouflageDefinitions_CamouflagesEntry {
|
||||||
|
return CamouflageDefinitions_CamouflagesEntry.fromPartial(
|
||||||
|
base ?? ({} as any),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
fromPartial<
|
||||||
|
I extends Exact<DeepPartial<CamouflageDefinitions_CamouflagesEntry>, I>,
|
||||||
|
>(object: I): CamouflageDefinitions_CamouflagesEntry {
|
||||||
|
const message = createBaseCamouflageDefinitions_CamouflagesEntry();
|
||||||
|
message.key = object.key ?? 0;
|
||||||
|
message.value =
|
||||||
|
object.value !== undefined && object.value !== null
|
||||||
|
? Camouflage.fromPartial(object.value)
|
||||||
|
: createBaseCamouflage();
|
||||||
|
return message;
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
export function createBaseCamouflage(): Camouflage {
|
export function createBaseCamouflage(): Camouflage {
|
||||||
return { id: 0, name: createBaseI18nString(), tank_name: undefined, tank_name_full: undefined };
|
return {
|
||||||
|
id: 0,
|
||||||
|
name: createBaseI18nString(),
|
||||||
|
tank_name: undefined,
|
||||||
|
tank_name_full: undefined,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export const Camouflage: MessageFns<Camouflage> = {
|
export const Camouflage: MessageFns<Camouflage> = {
|
||||||
encode(message: Camouflage, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
encode(
|
||||||
|
message: Camouflage,
|
||||||
|
writer: BinaryWriter = new BinaryWriter(),
|
||||||
|
): BinaryWriter {
|
||||||
if (message.id !== 0) {
|
if (message.id !== 0) {
|
||||||
writer.uint32(8).uint32(message.id);
|
writer.uint32(8).uint32(message.id);
|
||||||
}
|
}
|
||||||
@@ -206,13 +250,17 @@ export const Camouflage: MessageFns<Camouflage> = {
|
|||||||
I18nString.encode(message.tank_name, writer.uint32(26).fork()).join();
|
I18nString.encode(message.tank_name, writer.uint32(26).fork()).join();
|
||||||
}
|
}
|
||||||
if (message.tank_name_full !== undefined) {
|
if (message.tank_name_full !== undefined) {
|
||||||
I18nString.encode(message.tank_name_full, writer.uint32(34).fork()).join();
|
I18nString.encode(
|
||||||
|
message.tank_name_full,
|
||||||
|
writer.uint32(34).fork(),
|
||||||
|
).join();
|
||||||
}
|
}
|
||||||
return writer;
|
return writer;
|
||||||
},
|
},
|
||||||
|
|
||||||
decode(input: BinaryReader | Uint8Array, length?: number): Camouflage {
|
decode(input: BinaryReader | Uint8Array, length?: number): Camouflage {
|
||||||
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
const reader =
|
||||||
|
input instanceof BinaryReader ? input : new BinaryReader(input);
|
||||||
let end = length === undefined ? reader.len : reader.pos + length;
|
let end = length === undefined ? reader.len : reader.pos + length;
|
||||||
const message = createBaseCamouflage();
|
const message = createBaseCamouflage();
|
||||||
while (reader.pos < end) {
|
while (reader.pos < end) {
|
||||||
@@ -261,10 +309,14 @@ export const Camouflage: MessageFns<Camouflage> = {
|
|||||||
|
|
||||||
fromJSON(object: any): Camouflage {
|
fromJSON(object: any): Camouflage {
|
||||||
return {
|
return {
|
||||||
id: globalThis.Number(assertSet("Camouflage.id", object.id)),
|
id: globalThis.Number(assertSet('Camouflage.id', object.id)),
|
||||||
name: I18nString.fromJSON(assertSet("Camouflage.name", object.name)),
|
name: I18nString.fromJSON(assertSet('Camouflage.name', object.name)),
|
||||||
tank_name: isSet(object.tank_name) ? I18nString.fromJSON(object.tank_name) : undefined,
|
tank_name: isSet(object.tank_name)
|
||||||
tank_name_full: isSet(object.tank_name_full) ? I18nString.fromJSON(object.tank_name_full) : undefined,
|
? I18nString.fromJSON(object.tank_name)
|
||||||
|
: undefined,
|
||||||
|
tank_name_full: isSet(object.tank_name_full)
|
||||||
|
? I18nString.fromJSON(object.tank_name_full)
|
||||||
|
: undefined,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -288,37 +340,57 @@ export const Camouflage: MessageFns<Camouflage> = {
|
|||||||
create<I extends Exact<DeepPartial<Camouflage>, I>>(base?: I): Camouflage {
|
create<I extends Exact<DeepPartial<Camouflage>, I>>(base?: I): Camouflage {
|
||||||
return Camouflage.fromPartial(base ?? ({} as any));
|
return Camouflage.fromPartial(base ?? ({} as any));
|
||||||
},
|
},
|
||||||
fromPartial<I extends Exact<DeepPartial<Camouflage>, I>>(object: I): Camouflage {
|
fromPartial<I extends Exact<DeepPartial<Camouflage>, I>>(
|
||||||
|
object: I,
|
||||||
|
): Camouflage {
|
||||||
const message = createBaseCamouflage();
|
const message = createBaseCamouflage();
|
||||||
message.id = object.id ?? 0;
|
message.id = object.id ?? 0;
|
||||||
message.name = (object.name !== undefined && object.name !== null)
|
message.name =
|
||||||
? I18nString.fromPartial(object.name)
|
object.name !== undefined && object.name !== null
|
||||||
: createBaseI18nString();
|
? I18nString.fromPartial(object.name)
|
||||||
message.tank_name = (object.tank_name !== undefined && object.tank_name !== null)
|
: createBaseI18nString();
|
||||||
? I18nString.fromPartial(object.tank_name)
|
message.tank_name =
|
||||||
: undefined;
|
object.tank_name !== undefined && object.tank_name !== null
|
||||||
message.tank_name_full = (object.tank_name_full !== undefined && object.tank_name_full !== null)
|
? I18nString.fromPartial(object.tank_name)
|
||||||
? I18nString.fromPartial(object.tank_name_full)
|
: undefined;
|
||||||
: undefined;
|
message.tank_name_full =
|
||||||
|
object.tank_name_full !== undefined && object.tank_name_full !== null
|
||||||
|
? I18nString.fromPartial(object.tank_name_full)
|
||||||
|
: undefined;
|
||||||
return message;
|
return message;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
type Builtin =
|
||||||
|
| Date
|
||||||
|
| Function
|
||||||
|
| Uint8Array
|
||||||
|
| string
|
||||||
|
| number
|
||||||
|
| boolean
|
||||||
|
| undefined;
|
||||||
|
|
||||||
export type DeepPartial<T> = T extends Builtin ? T
|
export type DeepPartial<T> = T extends Builtin
|
||||||
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
|
? T
|
||||||
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
: T extends globalThis.Array<infer U>
|
||||||
: T extends { $case: string; value: unknown } ? { $case: T["$case"]; value?: DeepPartial<T["value"]> }
|
? globalThis.Array<DeepPartial<U>>
|
||||||
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
: T extends ReadonlyArray<infer U>
|
||||||
: Partial<T>;
|
? ReadonlyArray<DeepPartial<U>>
|
||||||
|
: T extends { $case: string; value: unknown }
|
||||||
|
? { $case: T['$case']; value?: DeepPartial<T['value']> }
|
||||||
|
: T extends {}
|
||||||
|
? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||||
|
: Partial<T>;
|
||||||
|
|
||||||
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
||||||
export type Exact<P, I extends P> = P extends Builtin ? P
|
export type Exact<P, I extends P> = P extends Builtin
|
||||||
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
? P
|
||||||
|
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
|
||||||
|
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
||||||
|
};
|
||||||
|
|
||||||
function isObject(value: any): boolean {
|
function isObject(value: any): boolean {
|
||||||
return typeof value === "object" && value !== null;
|
return typeof value === 'object' && value !== null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function isSet(value: any): boolean {
|
function isSet(value: any): boolean {
|
||||||
|
|||||||
@@ -108,55 +108,55 @@ message GunDefinition {
|
|||||||
GunDefinitionAutoLoader auto_loader = 2;
|
GunDefinitionAutoLoader auto_loader = 2;
|
||||||
GunDefinitionAutoReloader auto_reloader = 3;
|
GunDefinitionAutoReloader auto_reloader = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
required uint32 id = 4;
|
||||||
|
required float rotation_speed = 5;
|
||||||
|
optional ResearchCost research_cost = 6;
|
||||||
|
required uint32 weight = 7;
|
||||||
|
required I18nString name = 8;
|
||||||
|
required uint32 tier = 9;
|
||||||
|
repeated ShellDefinition shells = 10;
|
||||||
|
required float camouflage_loss = 11;
|
||||||
|
required float aim_time = 12;
|
||||||
|
required float dispersion_base = 13;
|
||||||
|
required float dispersion_traverse = 14;
|
||||||
|
required float dispersion_shot = 15;
|
||||||
|
required float dispersion_damaged = 16;
|
||||||
|
repeated Unlock unlocks = 17;
|
||||||
|
required uint32 shell_capacity = 18;
|
||||||
|
optional AssaultRanges assault_ranges = 19;
|
||||||
|
optional Burst burst = 20;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GunDefinitionRegular {
|
message GunDefinitionRegular {
|
||||||
required GunDefinitionBase base = 1;
|
|
||||||
required GunDefinitionRegularProperties extension = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
message GunDefinitionRegularProperties {
|
|
||||||
required float reload = 1;
|
required float reload = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GunDefinitionAutoLoader {
|
message GunDefinitionAutoLoader {
|
||||||
required GunDefinitionBase base = 1;
|
|
||||||
required GunDefinitionAutoLoaderProperties extension = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
message GunDefinitionAutoLoaderProperties {
|
|
||||||
required float clip_reload = 1;
|
required float clip_reload = 1;
|
||||||
required float intra_clip = 2;
|
required float intra_clip = 2;
|
||||||
required float shell_count = 3;
|
required float shell_count = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GunDefinitionAutoReloader {
|
message Burst {
|
||||||
required GunDefinitionBase base = 1;
|
required uint32 count = 1;
|
||||||
required GunDefinitionAutoReloaderProperties extension = 2;
|
required float interval = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GunDefinitionAutoReloaderProperties {
|
message GunDefinitionAutoReloader {
|
||||||
repeated float shell_reloads = 1;
|
repeated float shell_reloads = 1;
|
||||||
required float intra_clip = 2;
|
required float intra_clip = 2;
|
||||||
required float shell_count = 3;
|
required float shell_count = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GunDefinitionBase {
|
message AssaultRanges {
|
||||||
required uint32 id = 1;
|
repeated AssaultRange ranges = 1;
|
||||||
required float rotation_speed = 2;
|
repeated ShellType types = 2;
|
||||||
optional ResearchCost research_cost = 3;
|
}
|
||||||
required uint32 weight = 4;
|
|
||||||
required I18nString name = 5;
|
message AssaultRange {
|
||||||
required uint32 tier = 6;
|
required float distance = 1;
|
||||||
repeated ShellDefinition shells = 7;
|
required float factor = 2;
|
||||||
required float camouflage_loss = 8;
|
|
||||||
required float aim_time = 9;
|
|
||||||
required float dispersion_base = 10;
|
|
||||||
required float dispersion_traverse = 11;
|
|
||||||
required float dispersion_shot = 12;
|
|
||||||
required float dispersion_damaged = 13;
|
|
||||||
repeated Unlock unlocks = 14;
|
|
||||||
required uint32 shell_capacity = 15;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
message ShellDefinition {
|
message ShellDefinition {
|
||||||
|
|||||||
File diff suppressed because it is too large.
Load diff
@@ -790,6 +790,7 @@
|
|||||||
"fire.caliber": "caliber",
|
"fire.caliber": "caliber",
|
||||||
"fire.standardPenetration": "standard penetration",
|
"fire.standardPenetration": "standard penetration",
|
||||||
"fire.premiumPenetration": "premium penetration",
|
"fire.premiumPenetration": "premium penetration",
|
||||||
|
"fire.tertiaryPenetration": "tertiary penetration",
|
||||||
"fire.damage": "damage",
|
"fire.damage": "damage",
|
||||||
"fire.moduleDamage": "module damage",
|
"fire.moduleDamage": "module damage",
|
||||||
"fire.shellVelocity": "shell velocity",
|
"fire.shellVelocity": "shell velocity",
|
||||||
@@ -860,6 +861,13 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
"tools": {
|
"tools": {
|
||||||
|
"mixer": {
|
||||||
|
"name": "Mixer",
|
||||||
|
"button": "Mix and match",
|
||||||
|
"description": "Mix tank modules",
|
||||||
|
"seo_description": "Mix and match hulls, turrets, and guns of tanks in World of Tanks Blitz"
|
||||||
|
},
|
||||||
|
|
||||||
"guess": {
|
"guess": {
|
||||||
"name": "Guess the tank",
|
"name": "Guess the tank",
|
||||||
"button": "Guess away",
|
"button": "Guess away",
|
||||||
@@ -886,6 +894,14 @@
|
|||||||
"tank_seo_description": "%s1 armor, statistics, equipment, provisions, and more. %s2 DPM, %s3hp alpha, %s4mm penetration, %s5kph top speed, %s6hp health.",
|
"tank_seo_description": "%s1 armor, statistics, equipment, provisions, and more. %s2 DPM, %s3hp alpha, %s4mm penetration, %s5kph top speed, %s6hp health.",
|
||||||
|
|
||||||
"visualizers": {
|
"visualizers": {
|
||||||
|
"reload": {
|
||||||
|
"skip": "Skip"
|
||||||
|
},
|
||||||
|
|
||||||
|
"assault": {
|
||||||
|
"title": "Assault shells"
|
||||||
|
},
|
||||||
|
|
||||||
"rotator": {
|
"rotator": {
|
||||||
"hull": "Hull",
|
"hull": "Hull",
|
||||||
"turret": "Turret",
|
"turret": "Turret",
|
||||||
@@ -908,6 +924,13 @@
|
|||||||
"percentage": "%s1%",
|
"percentage": "%s1%",
|
||||||
"ghost_factory": "Ghost Factory",
|
"ghost_factory": "Ghost Factory",
|
||||||
"dead_rail": "Dead Rail"
|
"dead_rail": "Dead Rail"
|
||||||
|
},
|
||||||
|
|
||||||
|
"flexibility": {
|
||||||
|
"yaw": "Yaw",
|
||||||
|
"pitch": "Pitch",
|
||||||
|
"min": "Min",
|
||||||
|
"max": "Max"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -923,9 +946,7 @@
|
|||||||
"green_penetration": "Green penetration",
|
"green_penetration": "Green penetration",
|
||||||
"hide_model_under_armor": "Hide model under armor",
|
"hide_model_under_armor": "Hide model under armor",
|
||||||
"opaque": "Opaque",
|
"opaque": "Opaque",
|
||||||
"dev_wireframe": "DEV: wireframe",
|
"dev_wireframe": "DEV: wireframe"
|
||||||
"environment": "Environment",
|
|
||||||
"show_grid": "Show grid"
|
|
||||||
},
|
},
|
||||||
|
|
||||||
"screenshot": {
|
"screenshot": {
|
||||||
@@ -1021,7 +1042,6 @@
|
|||||||
|
|
||||||
"review": {
|
"review": {
|
||||||
"title": "Review videos",
|
"title": "Review videos",
|
||||||
"disclaimer": "BlitzKit does not endorse any review videos.",
|
|
||||||
"join": "Apply to %s1 YouTuber program"
|
"join": "Apply to %s1 YouTuber program"
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -1078,7 +1098,6 @@
|
|||||||
"hull_traverse_speed": "Hull traverse speed",
|
"hull_traverse_speed": "Hull traverse speed",
|
||||||
"camouflage": "Camouflage",
|
"camouflage": "Camouflage",
|
||||||
"reload": "Reload",
|
"reload": "Reload",
|
||||||
|
|
||||||
"crewCount": "Crew count",
|
"crewCount": "Crew count",
|
||||||
"shellNormalization": "Normalization",
|
"shellNormalization": "Normalization",
|
||||||
"shellRicochet": "Ricochet",
|
"shellRicochet": "Ricochet",
|
||||||
@@ -1086,12 +1105,13 @@
|
|||||||
"dpmEffective": "Effective at 60s",
|
"dpmEffective": "Effective at 60s",
|
||||||
"shells": "Shells",
|
"shells": "Shells",
|
||||||
"mostOptimalShellIndex": "Most optimal shell",
|
"mostOptimalShellIndex": "Most optimal shell",
|
||||||
"shellReloads": "Shell reloads",
|
"shellReloads": "Reloads",
|
||||||
"shellReload": "Shell reload",
|
"shellReload": "Reload",
|
||||||
"intraClip": "Intra-clip",
|
"intraClip": "Intra-clip",
|
||||||
"caliber": "Caliber",
|
"caliber": "Caliber",
|
||||||
"penetration": "Penetration",
|
"penetration": "Penetration",
|
||||||
"damage": "Damage",
|
"damage": "Damage",
|
||||||
|
"damageWithoutAssault": "Damage without assault shells",
|
||||||
"clipDamage": "Clipping potential",
|
"clipDamage": "Clipping potential",
|
||||||
"moduleDamage": "Module damage",
|
"moduleDamage": "Module damage",
|
||||||
"explosionRadius": "Explosion radius",
|
"explosionRadius": "Explosion radius",
|
||||||
@@ -1144,7 +1164,9 @@
|
|||||||
"shellRange": "Shell range",
|
"shellRange": "Shell range",
|
||||||
"shellCapacity": "Shell capacity",
|
"shellCapacity": "Shell capacity",
|
||||||
"gunType": "Gun type",
|
"gunType": "Gun type",
|
||||||
"penetrationAt250m": "Penetration at 250m"
|
"penetrationAt250m": "Penetration at 250m",
|
||||||
|
"burstShells": "Burst shell count",
|
||||||
|
"burstInterShell": "Burst inter-shell"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -698,6 +698,7 @@
|
|||||||
"fire.caliber": "calibre",
|
"fire.caliber": "calibre",
|
||||||
"fire.standardPenetration": "penetración estándar",
|
"fire.standardPenetration": "penetración estándar",
|
||||||
"fire.premiumPenetration": "penetración prémium",
|
"fire.premiumPenetration": "penetración prémium",
|
||||||
|
"fire.tertiaryPenetration": "tertiary penetration",
|
||||||
"fire.damage": "daño",
|
"fire.damage": "daño",
|
||||||
"fire.moduleDamage": "daño al módulo",
|
"fire.moduleDamage": "daño al módulo",
|
||||||
"fire.shellVelocity": "velocidad del proyectil",
|
"fire.shellVelocity": "velocidad del proyectil",
|
||||||
@@ -786,6 +787,9 @@
|
|||||||
"tank_seo_title": "%s1 - Nivel %s2 %s3 %s4 | %s5 Tankopedia | World of Tanks Blitz (WoTB)",
|
"tank_seo_title": "%s1 - Nivel %s2 %s3 %s4 | %s5 Tankopedia | World of Tanks Blitz (WoTB)",
|
||||||
"tank_seo_description": "%s1 blindaje, estadisticas, equipamiento, proviciones y mas.\n%s2 DPM, %3hp alfa, %s4mm penetracion, %s5kph velocidad maxima, %s6 hp salud",
|
"tank_seo_description": "%s1 blindaje, estadisticas, equipamiento, proviciones y mas.\n%s2 DPM, %3hp alfa, %s4mm penetracion, %s5kph velocidad maxima, %s6 hp salud",
|
||||||
"visualizers": {
|
"visualizers": {
|
||||||
|
"assault": {
|
||||||
|
"title": "Assault shells"
|
||||||
|
},
|
||||||
"rotator": {
|
"rotator": {
|
||||||
"hull": "Hull",
|
"hull": "Hull",
|
||||||
"turret": "Turret",
|
"turret": "Turret",
|
||||||
@@ -806,6 +810,12 @@
|
|||||||
"percentage": "%s1%",
|
"percentage": "%s1%",
|
||||||
"ghost_factory": "Ghost Factory",
|
"ghost_factory": "Ghost Factory",
|
||||||
"dead_rail": "Dead Rail"
|
"dead_rail": "Dead Rail"
|
||||||
|
},
|
||||||
|
"flexibility": {
|
||||||
|
"yaw": "Yaw",
|
||||||
|
"pitch": "Pitch",
|
||||||
|
"min": "Min",
|
||||||
|
"max": "Max"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"sandbox": {
|
"sandbox": {
|
||||||
@@ -908,7 +918,6 @@
|
|||||||
},
|
},
|
||||||
"review": {
|
"review": {
|
||||||
"title": "Vídeos de reseña",
|
"title": "Vídeos de reseña",
|
||||||
"disclaimer": "BlitzKit no respalda ningún vídeo de reseñas.",
|
|
||||||
"join": "Aplica para el programa de YouTube de %s1"
|
"join": "Aplica para el programa de YouTube de %s1"
|
||||||
},
|
},
|
||||||
"configuration": {
|
"configuration": {
|
||||||
@@ -969,12 +978,13 @@
|
|||||||
"dpmEffective": "Effective at 60s",
|
"dpmEffective": "Effective at 60s",
|
||||||
"shells": "Proyectiles",
|
"shells": "Proyectiles",
|
||||||
"mostOptimalShellIndex": "Proyectil más óptimo",
|
"mostOptimalShellIndex": "Proyectil más óptimo",
|
||||||
"shellReloads": "Tiempos de recarga",
|
"shellReloads": "Reloads",
|
||||||
"shellReload": "Tiempo de recarga",
|
"shellReload": "Recarga",
|
||||||
"intraClip": "Intra-clip",
|
"intraClip": "Intra-clip",
|
||||||
"caliber": "Calibre",
|
"caliber": "Calibre",
|
||||||
"penetration": "Penetración",
|
"penetration": "Penetración",
|
||||||
"damage": "Daño",
|
"damage": "Daño",
|
||||||
|
"damageWithoutAssault": "Damage without assault shells",
|
||||||
"clipDamage": "Clipping potential",
|
"clipDamage": "Clipping potential",
|
||||||
"moduleDamage": "Daño a módulos",
|
"moduleDamage": "Daño a módulos",
|
||||||
"explosionRadius": "Radio de Explosión",
|
"explosionRadius": "Radio de Explosión",
|
||||||
@@ -1027,7 +1037,9 @@
|
|||||||
"shellRange": "Rango del proyectil",
|
"shellRange": "Rango del proyectil",
|
||||||
"shellCapacity": "Capacidad de proyectiles",
|
"shellCapacity": "Capacidad de proyectiles",
|
||||||
"gunType": "Tipo de cañón",
|
"gunType": "Tipo de cañón",
|
||||||
"penetrationAt250m": "Penetración a 250 m"
|
"penetrationAt250m": "Penetración a 250 m",
|
||||||
|
"burstShells": "Burst shell count",
|
||||||
|
"burstInterShell": "Burst inter-shell"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"firepower": {
|
"firepower": {
|
||||||
|
|||||||
@@ -698,6 +698,7 @@
|
|||||||
"fire.caliber": "caliber",
|
"fire.caliber": "caliber",
|
||||||
"fire.standardPenetration": "standard penetration",
|
"fire.standardPenetration": "standard penetration",
|
||||||
"fire.premiumPenetration": "premium penetration",
|
"fire.premiumPenetration": "premium penetration",
|
||||||
|
"fire.tertiaryPenetration": "tertiary penetration",
|
||||||
"fire.damage": "damage",
|
"fire.damage": "damage",
|
||||||
"fire.moduleDamage": "module damage",
|
"fire.moduleDamage": "module damage",
|
||||||
"fire.shellVelocity": "shell velocity",
|
"fire.shellVelocity": "shell velocity",
|
||||||
@@ -786,6 +787,9 @@
|
|||||||
"tank_seo_title": "%s1 - Tier %s2 %s3 %s4 | %s5 Tankopedia | World of Tanks Blitz (WoTB)",
|
"tank_seo_title": "%s1 - Tier %s2 %s3 %s4 | %s5 Tankopedia | World of Tanks Blitz (WoTB)",
|
||||||
"tank_seo_description": "%s1 armor, statistics, equipment, provisions, and more. %s2 DPM, %s3hp alpha, %s4mm penetration, %s5kph top speed, %s6hp health.",
|
"tank_seo_description": "%s1 armor, statistics, equipment, provisions, and more. %s2 DPM, %s3hp alpha, %s4mm penetration, %s5kph top speed, %s6hp health.",
|
||||||
"visualizers": {
|
"visualizers": {
|
||||||
|
"assault": {
|
||||||
|
"title": "Assault shells"
|
||||||
|
},
|
||||||
"rotator": {
|
"rotator": {
|
||||||
"hull": "Hull",
|
"hull": "Hull",
|
||||||
"turret": "Turret",
|
"turret": "Turret",
|
||||||
@@ -806,6 +810,12 @@
|
|||||||
"percentage": "%s1%",
|
"percentage": "%s1%",
|
||||||
"ghost_factory": "Ghost Factory",
|
"ghost_factory": "Ghost Factory",
|
||||||
"dead_rail": "Dead Rail"
|
"dead_rail": "Dead Rail"
|
||||||
|
},
|
||||||
|
"flexibility": {
|
||||||
|
"yaw": "Yaw",
|
||||||
|
"pitch": "Pitch",
|
||||||
|
"min": "Min",
|
||||||
|
"max": "Max"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"sandbox": {
|
"sandbox": {
|
||||||
@@ -908,7 +918,6 @@
|
|||||||
},
|
},
|
||||||
"review": {
|
"review": {
|
||||||
"title": "Review videos",
|
"title": "Review videos",
|
||||||
"disclaimer": "BlitzKit does not endorse any review videos.",
|
|
||||||
"join": "Apply to %s1 YouTuber program"
|
"join": "Apply to %s1 YouTuber program"
|
||||||
},
|
},
|
||||||
"configuration": {
|
"configuration": {
|
||||||
@@ -969,12 +978,13 @@
|
|||||||
"dpmEffective": "Effective at 60s",
|
"dpmEffective": "Effective at 60s",
|
||||||
"shells": "Shells",
|
"shells": "Shells",
|
||||||
"mostOptimalShellIndex": "Most optimal shell",
|
"mostOptimalShellIndex": "Most optimal shell",
|
||||||
"shellReloads": "Shell reloads",
|
"shellReloads": "Reloads",
|
||||||
"shellReload": "Shell reload",
|
"shellReload": "Reload",
|
||||||
"intraClip": "Intra-clip",
|
"intraClip": "Intra-clip",
|
||||||
"caliber": "Caliber",
|
"caliber": "Caliber",
|
||||||
"penetration": "Penetration",
|
"penetration": "Penetration",
|
||||||
"damage": "Dégâts",
|
"damage": "Dégâts",
|
||||||
|
"damageWithoutAssault": "Damage without assault shells",
|
||||||
"clipDamage": "Clipping potential",
|
"clipDamage": "Clipping potential",
|
||||||
"moduleDamage": "Module damage",
|
"moduleDamage": "Module damage",
|
||||||
"explosionRadius": "Explosion radius",
|
"explosionRadius": "Explosion radius",
|
||||||
@@ -1027,7 +1037,9 @@
|
|||||||
"shellRange": "Shell range",
|
"shellRange": "Shell range",
|
||||||
"shellCapacity": "Shell capacity",
|
"shellCapacity": "Shell capacity",
|
||||||
"gunType": "Gun type",
|
"gunType": "Gun type",
|
||||||
"penetrationAt250m": "Penetration at 250m"
|
"penetrationAt250m": "Penetration at 250m",
|
||||||
|
"burstShells": "Burst shell count",
|
||||||
|
"burstInterShell": "Burst inter-shell"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"firepower": {
|
"firepower": {
|
||||||
|
|||||||
@@ -698,6 +698,7 @@
|
|||||||
"fire.caliber": "砲口径",
|
"fire.caliber": "砲口径",
|
||||||
"fire.standardPenetration": "通常弾貫通力",
|
"fire.standardPenetration": "通常弾貫通力",
|
||||||
"fire.premiumPenetration": "課金弾貫通力",
|
"fire.premiumPenetration": "課金弾貫通力",
|
||||||
|
"fire.tertiaryPenetration": "tertiary penetration",
|
||||||
"fire.damage": "ダメージ",
|
"fire.damage": "ダメージ",
|
||||||
"fire.moduleDamage": "モジュールダメージ",
|
"fire.moduleDamage": "モジュールダメージ",
|
||||||
"fire.shellVelocity": "弾速",
|
"fire.shellVelocity": "弾速",
|
||||||
@@ -786,6 +787,9 @@
|
|||||||
"tank_seo_title": "%s1 - Tier %s2 %s3 %s4 | %s5 Tankopedia | World of Tanks Blitz (WoTB)",
|
"tank_seo_title": "%s1 - Tier %s2 %s3 %s4 | %s5 Tankopedia | World of Tanks Blitz (WoTB)",
|
||||||
"tank_seo_description": "%s1 armor, statistics, equipment, provisions, and more. %s2 DPM, %s3hp alpha, %s4mm penetration, %s5kph top speed, %s6hp health.",
|
"tank_seo_description": "%s1 armor, statistics, equipment, provisions, and more. %s2 DPM, %s3hp alpha, %s4mm penetration, %s5kph top speed, %s6hp health.",
|
||||||
"visualizers": {
|
"visualizers": {
|
||||||
|
"assault": {
|
||||||
|
"title": "Assault shells"
|
||||||
|
},
|
||||||
"rotator": {
|
"rotator": {
|
||||||
"hull": "Hull",
|
"hull": "Hull",
|
||||||
"turret": "Turret",
|
"turret": "Turret",
|
||||||
@@ -806,6 +810,12 @@
|
|||||||
"percentage": "%s1%",
|
"percentage": "%s1%",
|
||||||
"ghost_factory": "Ghost Factory",
|
"ghost_factory": "Ghost Factory",
|
||||||
"dead_rail": "Dead Rail"
|
"dead_rail": "Dead Rail"
|
||||||
|
},
|
||||||
|
"flexibility": {
|
||||||
|
"yaw": "Yaw",
|
||||||
|
"pitch": "Pitch",
|
||||||
|
"min": "Min",
|
||||||
|
"max": "Max"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"sandbox": {
|
"sandbox": {
|
||||||
@@ -908,7 +918,6 @@
|
|||||||
},
|
},
|
||||||
"review": {
|
"review": {
|
||||||
"title": "Review videos",
|
"title": "Review videos",
|
||||||
"disclaimer": "BlitzKitはいかなるレビュー動画も後援していません。",
|
|
||||||
"join": "%s1 YouTuberプログラムに応募する"
|
"join": "%s1 YouTuberプログラムに応募する"
|
||||||
},
|
},
|
||||||
"configuration": {
|
"configuration": {
|
||||||
@@ -969,12 +978,13 @@
|
|||||||
"dpmEffective": "60秒での有効値",
|
"dpmEffective": "60秒での有効値",
|
||||||
"shells": "砲弾",
|
"shells": "砲弾",
|
||||||
"mostOptimalShellIndex": "最適な弾数",
|
"mostOptimalShellIndex": "最適な弾数",
|
||||||
"shellReloads": "自動装填時間",
|
"shellReloads": "Reloads",
|
||||||
"shellReload": "装填時間",
|
"shellReload": "装填時間",
|
||||||
"intraClip": "砲弾再装填時間",
|
"intraClip": "砲弾再装填時間",
|
||||||
"caliber": "口径",
|
"caliber": "口径",
|
||||||
"penetration": "貫通力",
|
"penetration": "貫通力",
|
||||||
"damage": "ダメージ",
|
"damage": "ダメージ",
|
||||||
|
"damageWithoutAssault": "Damage without assault shells",
|
||||||
"clipDamage": "弾倉火力",
|
"clipDamage": "弾倉火力",
|
||||||
"moduleDamage": "モジュールダメージ",
|
"moduleDamage": "モジュールダメージ",
|
||||||
"explosionRadius": "爆風半径",
|
"explosionRadius": "爆風半径",
|
||||||
@@ -1027,7 +1037,9 @@
|
|||||||
"shellRange": "射程",
|
"shellRange": "射程",
|
||||||
"shellCapacity": "総弾数",
|
"shellCapacity": "総弾数",
|
||||||
"gunType": "主砲タイプ",
|
"gunType": "主砲タイプ",
|
||||||
"penetrationAt250m": "250m での貫通力"
|
"penetrationAt250m": "250m での貫通力",
|
||||||
|
"burstShells": "Burst shell count",
|
||||||
|
"burstInterShell": "Burst inter-shell"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"firepower": {
|
"firepower": {
|
||||||
|
|||||||
@@ -380,7 +380,7 @@
|
|||||||
},
|
},
|
||||||
"embeds": {
|
"embeds": {
|
||||||
"name": "osadzenie",
|
"name": "osadzenie",
|
||||||
"description": "Jak działa osadzanie"
|
"description": "Jak działają osadzone"
|
||||||
},
|
},
|
||||||
"introduction": {
|
"introduction": {
|
||||||
"name": "wprowadzenie",
|
"name": "wprowadzenie",
|
||||||
@@ -698,6 +698,7 @@
|
|||||||
"fire.caliber": "caliber",
|
"fire.caliber": "caliber",
|
||||||
"fire.standardPenetration": "standard penetration",
|
"fire.standardPenetration": "standard penetration",
|
||||||
"fire.premiumPenetration": "premium penetration",
|
"fire.premiumPenetration": "premium penetration",
|
||||||
|
"fire.tertiaryPenetration": "tertiary penetration",
|
||||||
"fire.damage": "damage",
|
"fire.damage": "damage",
|
||||||
"fire.moduleDamage": "module damage",
|
"fire.moduleDamage": "module damage",
|
||||||
"fire.shellVelocity": "shell velocity",
|
"fire.shellVelocity": "shell velocity",
|
||||||
@@ -786,6 +787,9 @@
|
|||||||
"tank_seo_title": "%s1 - Tier %s2 %s3 %s4 | %s5 Tankopedia | World of Tanks Blitz (WoTB)",
|
"tank_seo_title": "%s1 - Tier %s2 %s3 %s4 | %s5 Tankopedia | World of Tanks Blitz (WoTB)",
|
||||||
"tank_seo_description": "%s1 armor, statistics, equipment, provisions, and more. %s2 DPM, %s3hp alpha, %s4mm penetration, %s5kph top speed, %s6hp health.",
|
"tank_seo_description": "%s1 armor, statistics, equipment, provisions, and more. %s2 DPM, %s3hp alpha, %s4mm penetration, %s5kph top speed, %s6hp health.",
|
||||||
"visualizers": {
|
"visualizers": {
|
||||||
|
"assault": {
|
||||||
|
"title": "Assault shells"
|
||||||
|
},
|
||||||
"rotator": {
|
"rotator": {
|
||||||
"hull": "Hull",
|
"hull": "Hull",
|
||||||
"turret": "Turret",
|
"turret": "Turret",
|
||||||
@@ -806,6 +810,12 @@
|
|||||||
"percentage": "%s1%",
|
"percentage": "%s1%",
|
||||||
"ghost_factory": "Ghost Factory",
|
"ghost_factory": "Ghost Factory",
|
||||||
"dead_rail": "Dead Rail"
|
"dead_rail": "Dead Rail"
|
||||||
|
},
|
||||||
|
"flexibility": {
|
||||||
|
"yaw": "Yaw",
|
||||||
|
"pitch": "Pitch",
|
||||||
|
"min": "Min",
|
||||||
|
"max": "Max"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"sandbox": {
|
"sandbox": {
|
||||||
@@ -908,7 +918,6 @@
|
|||||||
},
|
},
|
||||||
"review": {
|
"review": {
|
||||||
"title": "Review videos",
|
"title": "Review videos",
|
||||||
"disclaimer": "BlitzKit does not endorse any review videos.",
|
|
||||||
"join": "Apply to %s1 YouTuber program"
|
"join": "Apply to %s1 YouTuber program"
|
||||||
},
|
},
|
||||||
"configuration": {
|
"configuration": {
|
||||||
@@ -969,12 +978,13 @@
|
|||||||
"dpmEffective": "Effective at 60s",
|
"dpmEffective": "Effective at 60s",
|
||||||
"shells": "Shells",
|
"shells": "Shells",
|
||||||
"mostOptimalShellIndex": "Most optimal shell",
|
"mostOptimalShellIndex": "Most optimal shell",
|
||||||
"shellReloads": "Shell reloads",
|
"shellReloads": "Reloads",
|
||||||
"shellReload": "Shell reload",
|
"shellReload": "Reload",
|
||||||
"intraClip": "Intra-clip",
|
"intraClip": "Intra-clip",
|
||||||
"caliber": "Caliber",
|
"caliber": "Caliber",
|
||||||
"penetration": "Penetration",
|
"penetration": "Penetration",
|
||||||
"damage": "Uszkodzenia",
|
"damage": "Uszkodzenia",
|
||||||
|
"damageWithoutAssault": "Damage without assault shells",
|
||||||
"clipDamage": "Clipping potential",
|
"clipDamage": "Clipping potential",
|
||||||
"moduleDamage": "Module damage",
|
"moduleDamage": "Module damage",
|
||||||
"explosionRadius": "Explosion radius",
|
"explosionRadius": "Explosion radius",
|
||||||
@@ -1027,7 +1037,9 @@
|
|||||||
"shellRange": "Shell range",
|
"shellRange": "Shell range",
|
||||||
"shellCapacity": "Shell capacity",
|
"shellCapacity": "Shell capacity",
|
||||||
"gunType": "Gun type",
|
"gunType": "Gun type",
|
||||||
"penetrationAt250m": "Penetration at 250m"
|
"penetrationAt250m": "Penetration at 250m",
|
||||||
|
"burstShells": "Burst shell count",
|
||||||
|
"burstInterShell": "Burst inter-shell"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"firepower": {
|
"firepower": {
|
||||||
|
|||||||
@@ -698,6 +698,7 @@
|
|||||||
"fire.caliber": "calibre",
|
"fire.caliber": "calibre",
|
||||||
"fire.standardPenetration": "penetração padrão",
|
"fire.standardPenetration": "penetração padrão",
|
||||||
"fire.premiumPenetration": "penetração premium",
|
"fire.premiumPenetration": "penetração premium",
|
||||||
|
"fire.tertiaryPenetration": "tertiary penetration",
|
||||||
"fire.damage": "dano",
|
"fire.damage": "dano",
|
||||||
"fire.moduleDamage": "dano a módulos",
|
"fire.moduleDamage": "dano a módulos",
|
||||||
"fire.shellVelocity": "velocidade do projétil",
|
"fire.shellVelocity": "velocidade do projétil",
|
||||||
@@ -786,6 +787,9 @@
|
|||||||
"tank_seo_title": "%s1 - Nível %s2 %s3 %s4 | %s5 Tanquepedia | World of Tanks Blitz (WoTB)",
|
"tank_seo_title": "%s1 - Nível %s2 %s3 %s4 | %s5 Tanquepedia | World of Tanks Blitz (WoTB)",
|
||||||
"tank_seo_description": "%s1 blindagem, estatísticas, equipamentos, provisões e mais. %s2 DPM, %s3hp alfa, %s4mm de penetração, %s5km/h velocidade máxima, %s6hp vida.",
|
"tank_seo_description": "%s1 blindagem, estatísticas, equipamentos, provisões e mais. %s2 DPM, %s3hp alfa, %s4mm de penetração, %s5km/h velocidade máxima, %s6hp vida.",
|
||||||
"visualizers": {
|
"visualizers": {
|
||||||
|
"assault": {
|
||||||
|
"title": "Assault shells"
|
||||||
|
},
|
||||||
"rotator": {
|
"rotator": {
|
||||||
"hull": "Hull",
|
"hull": "Hull",
|
||||||
"turret": "Turret",
|
"turret": "Turret",
|
||||||
@@ -806,6 +810,12 @@
|
|||||||
"percentage": "%s1%",
|
"percentage": "%s1%",
|
||||||
"ghost_factory": "Ghost Factory",
|
"ghost_factory": "Ghost Factory",
|
||||||
"dead_rail": "Dead Rail"
|
"dead_rail": "Dead Rail"
|
||||||
|
},
|
||||||
|
"flexibility": {
|
||||||
|
"yaw": "Yaw",
|
||||||
|
"pitch": "Pitch",
|
||||||
|
"min": "Min",
|
||||||
|
"max": "Max"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"sandbox": {
|
"sandbox": {
|
||||||
@@ -908,7 +918,6 @@
|
|||||||
},
|
},
|
||||||
"review": {
|
"review": {
|
||||||
"title": "Vídeos de análise",
|
"title": "Vídeos de análise",
|
||||||
"disclaimer": "BlitzKit não aprova nenhum vídeo de análise.",
|
|
||||||
"join": "Candidate-se para %s1 um programa YouTuber"
|
"join": "Candidate-se para %s1 um programa YouTuber"
|
||||||
},
|
},
|
||||||
"configuration": {
|
"configuration": {
|
||||||
@@ -969,12 +978,13 @@
|
|||||||
"dpmEffective": "Efetivo aos 60s",
|
"dpmEffective": "Efetivo aos 60s",
|
||||||
"shells": "Projéteis",
|
"shells": "Projéteis",
|
||||||
"mostOptimalShellIndex": "Projétil mais ideal",
|
"mostOptimalShellIndex": "Projétil mais ideal",
|
||||||
"shellReloads": "Recarga de projétil",
|
"shellReloads": "Reloads",
|
||||||
"shellReload": "Recarregamento de projétil",
|
"shellReload": "Recarga",
|
||||||
"intraClip": "Intra-clipe",
|
"intraClip": "Intra-clipe",
|
||||||
"caliber": "Calibre",
|
"caliber": "Calibre",
|
||||||
"penetration": "Penetração",
|
"penetration": "Penetração",
|
||||||
"damage": "Dano",
|
"damage": "Dano",
|
||||||
|
"damageWithoutAssault": "Damage without assault shells",
|
||||||
"clipDamage": "Potencial de clipe",
|
"clipDamage": "Potencial de clipe",
|
||||||
"moduleDamage": "Dano a módulos",
|
"moduleDamage": "Dano a módulos",
|
||||||
"explosionRadius": "Raio de Explosão",
|
"explosionRadius": "Raio de Explosão",
|
||||||
@@ -1027,7 +1037,9 @@
|
|||||||
"shellRange": "Alcance de projétil",
|
"shellRange": "Alcance de projétil",
|
||||||
"shellCapacity": "Capacidade de projéteis",
|
"shellCapacity": "Capacidade de projéteis",
|
||||||
"gunType": "Tipo de arma",
|
"gunType": "Tipo de arma",
|
||||||
"penetrationAt250m": "Penetração à 250m"
|
"penetrationAt250m": "Penetração à 250m",
|
||||||
|
"burstShells": "Burst shell count",
|
||||||
|
"burstInterShell": "Burst inter-shell"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"firepower": {
|
"firepower": {
|
||||||
|
|||||||
@@ -697,7 +697,8 @@
|
|||||||
"fire.reload": "перезарядка",
|
"fire.reload": "перезарядка",
|
||||||
"fire.caliber": "калибр",
|
"fire.caliber": "калибр",
|
||||||
"fire.standardPenetration": "базовое пробитие",
|
"fire.standardPenetration": "базовое пробитие",
|
||||||
"fire.premiumPenetration": "улучшенное пробитие ",
|
"fire.premiumPenetration": "премиумное пробитие ",
|
||||||
|
"fire.tertiaryPenetration": "пробитие третьего снаряда",
|
||||||
"fire.damage": "урон",
|
"fire.damage": "урон",
|
||||||
"fire.moduleDamage": "урон по модулям",
|
"fire.moduleDamage": "урон по модулям",
|
||||||
"fire.shellVelocity": "скорость снаряда",
|
"fire.shellVelocity": "скорость снаряда",
|
||||||
@@ -786,12 +787,15 @@
|
|||||||
"tank_seo_title": "%s1 - %s4 %s3 %s2 уровня | Танкопедия %s5 | World of Tanks Blitz (WoTB)",
|
"tank_seo_title": "%s1 - %s4 %s3 %s2 уровня | Танкопедия %s5 | World of Tanks Blitz (WoTB)",
|
||||||
"tank_seo_description": "%s1 броня, статистика, оборудование, снабжение и многое другое. %s2 УВМ, %s3hp альфа, %s4mm пробитие, %s5км/ч лучшая скорость, %s6hp здоровье.",
|
"tank_seo_description": "%s1 броня, статистика, оборудование, снабжение и многое другое. %s2 УВМ, %s3hp альфа, %s4mm пробитие, %s5км/ч лучшая скорость, %s6hp здоровье.",
|
||||||
"visualizers": {
|
"visualizers": {
|
||||||
|
"assault": {
|
||||||
|
"title": "Штурмовые снаряды"
|
||||||
|
},
|
||||||
"rotator": {
|
"rotator": {
|
||||||
"hull": "Корпус",
|
"hull": "Корпус",
|
||||||
"turret": "Башня",
|
"turret": "Башня",
|
||||||
"hard": "Твёрдые",
|
"hard": "Твёрдые",
|
||||||
"medium": "Средний танк",
|
"medium": "Средние",
|
||||||
"soft": "На мягком грунте",
|
"soft": "Мягкие",
|
||||||
"effective": "Эффективно"
|
"effective": "Эффективно"
|
||||||
},
|
},
|
||||||
"ricochet": {
|
"ricochet": {
|
||||||
@@ -806,6 +810,12 @@
|
|||||||
"percentage": "%s1%",
|
"percentage": "%s1%",
|
||||||
"ghost_factory": "Промзона",
|
"ghost_factory": "Промзона",
|
||||||
"dead_rail": "Эшелон"
|
"dead_rail": "Эшелон"
|
||||||
|
},
|
||||||
|
"flexibility": {
|
||||||
|
"yaw": "Отклонение",
|
||||||
|
"pitch": "Наклон",
|
||||||
|
"min": "Вниз",
|
||||||
|
"max": "Вверх"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"sandbox": {
|
"sandbox": {
|
||||||
@@ -908,7 +918,6 @@
|
|||||||
},
|
},
|
||||||
"review": {
|
"review": {
|
||||||
"title": "Видеообзоры",
|
"title": "Видеообзоры",
|
||||||
"disclaimer": "BlitzKit не несёт ответственности за видеообзоры.",
|
|
||||||
"join": "Предложить ютубера для программы %s1"
|
"join": "Предложить ютубера для программы %s1"
|
||||||
},
|
},
|
||||||
"configuration": {
|
"configuration": {
|
||||||
@@ -969,12 +978,13 @@
|
|||||||
"dpmEffective": "Эффективность за 60с",
|
"dpmEffective": "Эффективность за 60с",
|
||||||
"shells": "Снарядов в барабане",
|
"shells": "Снарядов в барабане",
|
||||||
"mostOptimalShellIndex": "Самый эффективный снаряд",
|
"mostOptimalShellIndex": "Самый эффективный снаряд",
|
||||||
"shellReloads": "Перезарядка снарядов",
|
"shellReloads": "Reloads",
|
||||||
"shellReload": "Перезарядка",
|
"shellReload": "Перезарядка",
|
||||||
"intraClip": "Между снарядами",
|
"intraClip": "Между снарядами",
|
||||||
"caliber": "Калибр",
|
"caliber": "Калибр",
|
||||||
"penetration": "Пробитие",
|
"penetration": "Пробитие",
|
||||||
"damage": "Урон",
|
"damage": "Урон",
|
||||||
|
"damageWithoutAssault": "Урон без штурмовых снарядов",
|
||||||
"clipDamage": "Урон с барабана",
|
"clipDamage": "Урон с барабана",
|
||||||
"moduleDamage": "Урон по модулям",
|
"moduleDamage": "Урон по модулям",
|
||||||
"explosionRadius": "Разлет осколков",
|
"explosionRadius": "Разлет осколков",
|
||||||
@@ -1027,7 +1037,9 @@
|
|||||||
"shellRange": "Дальность снаряда",
|
"shellRange": "Дальность снаряда",
|
||||||
"shellCapacity": "Боезапас",
|
"shellCapacity": "Боезапас",
|
||||||
"gunType": "Тип орудия",
|
"gunType": "Тип орудия",
|
||||||
"penetrationAt250m": "Пробитие на 250м"
|
"penetrationAt250m": "Пробитие на 250м",
|
||||||
|
"burstShells": "Burst shell count",
|
||||||
|
"burstInterShell": "Burst inter-shell"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"firepower": {
|
"firepower": {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"test": {
|
"test": {
|
||||||
"default": "тест",
|
"default": "тест",
|
||||||
"long": "This is a long test string. You MUST NEVER see this in the UI. My favorite fruit is %s1 because it has the color of %s2. I like it so much that I will say its name 3 times! %s1! %s1! %s1! Once again, it's %s2, not %s3.",
|
"long": "This is a long test string. You MUST NEVER see this in the UI. My favorite fruit is %s1 because it has the color of %s2. I like it so much that I will say its name 3 times! %s1! %s1! %s1! Once again, it's %s2, not %s3.",
|
||||||
"fox": "The quick brown fox jumps over the lazy dog."
|
"fox": "Швидка бура лисиця перестрибує через лінивого собаку."
|
||||||
},
|
},
|
||||||
"common": {
|
"common": {
|
||||||
"units": {
|
"units": {
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
"hp": "%s1хп",
|
"hp": "%s1хп",
|
||||||
"x": "х%s1",
|
"x": "х%s1",
|
||||||
"percentage": "%s1%",
|
"percentage": "%s1%",
|
||||||
"deg_s": "%s1°/s"
|
"deg_s": "%s1°/с"
|
||||||
},
|
},
|
||||||
"gun_types": {
|
"gun_types": {
|
||||||
"auto_loader": "Магазинна система заряджання",
|
"auto_loader": "Магазинна система заряджання",
|
||||||
@@ -413,10 +413,10 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"debug": {
|
"debug": {
|
||||||
"name": "debug",
|
"name": "налагодження",
|
||||||
"description": "Debug information about the bot",
|
"description": "Інформація про налагодження бота",
|
||||||
"body": {
|
"body": {
|
||||||
"title": "# Debug\n\n",
|
"title": "# Налагодження\n\n",
|
||||||
"version": "Версія",
|
"version": "Версія",
|
||||||
"shard": {
|
"shard": {
|
||||||
"label": "Уламок",
|
"label": "Уламок",
|
||||||
@@ -499,7 +499,7 @@
|
|||||||
},
|
},
|
||||||
"embed": {
|
"embed": {
|
||||||
"title": "Невірний обліковий запис?",
|
"title": "Невірний обліковий запис?",
|
||||||
"description": "Use the command again and select a username from the search results."
|
"description": "Використайте команду ще раз і виберіть ім'я користувача з результатів пошуку."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"search_clans": {
|
"search_clans": {
|
||||||
@@ -508,7 +508,7 @@
|
|||||||
"options": {
|
"options": {
|
||||||
"limit": {
|
"limit": {
|
||||||
"name": "ліміт",
|
"name": "ліміт",
|
||||||
"description": "The max number of clan results (default: %s1)"
|
"description": "Максимальна кількість результатів клану (за замовчуванням: %s1)"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"body": {
|
"body": {
|
||||||
@@ -531,16 +531,16 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"rating_leaderboard": {
|
"rating_leaderboard": {
|
||||||
"name": "rating-leaderboard",
|
"name": "таблиця рейтингу",
|
||||||
"description": "Rating battles statistics",
|
"description": "Статистика рейтингових боїв",
|
||||||
"subcommands": {
|
"subcommands": {
|
||||||
"neighbors": {
|
"neighbors": {
|
||||||
"name": "neighbors",
|
"name": "neighbors",
|
||||||
"description": "Neighboring players on the leaderboard"
|
"description": "Neighboring players on the leaderboard"
|
||||||
},
|
},
|
||||||
"league": {
|
"league": {
|
||||||
"name": "league",
|
"name": "ліга",
|
||||||
"description": "Top players of a league"
|
"description": "Найкращий гравець ліги"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"options": {
|
"options": {
|
||||||
@@ -549,8 +549,8 @@
|
|||||||
"description": ""
|
"description": ""
|
||||||
},
|
},
|
||||||
"season": {
|
"season": {
|
||||||
"name": "season",
|
"name": "сезон",
|
||||||
"description": "Season number (default: current)",
|
"description": "Базова інформація про гравця",
|
||||||
"choices": {
|
"choices": {
|
||||||
"current": "%s1 (current)"
|
"current": "%s1 (current)"
|
||||||
}
|
}
|
||||||
@@ -578,14 +578,14 @@
|
|||||||
"description": "Коротка статистика за період"
|
"description": "Коротка статистика за період"
|
||||||
},
|
},
|
||||||
"owned_tanks": {
|
"owned_tanks": {
|
||||||
"name": "owned-tanks",
|
"name": "отримані танки",
|
||||||
"description": "Shows all own tanks in a tier",
|
"description": "Показує всі ваші танки даного рівня",
|
||||||
"body": {
|
"body": {
|
||||||
"title": "# %s1's owned tier %s2 tanks\n\n"
|
"title": "# %s1's owned tier %s2 tanks\n\n"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"permissions": {
|
"permissions": {
|
||||||
"name": "permissions",
|
"name": "дозволи",
|
||||||
"description": "Checks wether the bot has the required permissions to function",
|
"description": "Checks wether the bot has the required permissions to function",
|
||||||
"body": {
|
"body": {
|
||||||
"title": "# Permissions\n\n%s1",
|
"title": "# Permissions\n\n%s1",
|
||||||
@@ -615,7 +615,7 @@
|
|||||||
},
|
},
|
||||||
"player_info": {
|
"player_info": {
|
||||||
"name": "player-info",
|
"name": "player-info",
|
||||||
"description": "Basic information about a player",
|
"description": "Базова інформація про гравця",
|
||||||
"body": {
|
"body": {
|
||||||
"title": "%s1's information",
|
"title": "%s1's information",
|
||||||
"nickname": "Нік",
|
"nickname": "Нік",
|
||||||
@@ -635,7 +635,7 @@
|
|||||||
"description": "Today's rating statistics"
|
"description": "Today's rating statistics"
|
||||||
},
|
},
|
||||||
"season": {
|
"season": {
|
||||||
"name": "season",
|
"name": "сезон",
|
||||||
"description": "This season's rating statistics"
|
"description": "This season's rating statistics"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -698,6 +698,7 @@
|
|||||||
"fire.caliber": "калібр",
|
"fire.caliber": "калібр",
|
||||||
"fire.standardPenetration": "базове пробиття",
|
"fire.standardPenetration": "базове пробиття",
|
||||||
"fire.premiumPenetration": "преміум пробиття",
|
"fire.premiumPenetration": "преміум пробиття",
|
||||||
|
"fire.tertiaryPenetration": "tertiary penetration",
|
||||||
"fire.damage": "шкода",
|
"fire.damage": "шкода",
|
||||||
"fire.moduleDamage": "шкода по модулях",
|
"fire.moduleDamage": "шкода по модулях",
|
||||||
"fire.shellVelocity": "швидкість польоту снаряда",
|
"fire.shellVelocity": "швидкість польоту снаряда",
|
||||||
@@ -786,6 +787,9 @@
|
|||||||
"tank_seo_title": "%s1 - Рівень %s2 %s3 %s4 | %s5 Танкопедія | WoT Blitz",
|
"tank_seo_title": "%s1 - Рівень %s2 %s3 %s4 | %s5 Танкопедія | WoT Blitz",
|
||||||
"tank_seo_description": "%s1 броня, характеристики, обладнання, амуніція та більше. %s2 шкода на хвилину, %s3 разова шкода, %s4 мм пробиття, %s5 км/год максимальна швидкість, %s6 міцність.",
|
"tank_seo_description": "%s1 броня, характеристики, обладнання, амуніція та більше. %s2 шкода на хвилину, %s3 разова шкода, %s4 мм пробиття, %s5 км/год максимальна швидкість, %s6 міцність.",
|
||||||
"visualizers": {
|
"visualizers": {
|
||||||
|
"assault": {
|
||||||
|
"title": "Assault shells"
|
||||||
|
},
|
||||||
"rotator": {
|
"rotator": {
|
||||||
"hull": "Hull",
|
"hull": "Hull",
|
||||||
"turret": "Turret",
|
"turret": "Turret",
|
||||||
@@ -806,6 +810,12 @@
|
|||||||
"percentage": "%s1%",
|
"percentage": "%s1%",
|
||||||
"ghost_factory": "Ghost Factory",
|
"ghost_factory": "Ghost Factory",
|
||||||
"dead_rail": "Dead Rail"
|
"dead_rail": "Dead Rail"
|
||||||
|
},
|
||||||
|
"flexibility": {
|
||||||
|
"yaw": "Yaw",
|
||||||
|
"pitch": "Pitch",
|
||||||
|
"min": "Min",
|
||||||
|
"max": "Max"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"sandbox": {
|
"sandbox": {
|
||||||
@@ -908,7 +918,6 @@
|
|||||||
},
|
},
|
||||||
"review": {
|
"review": {
|
||||||
"title": "Review videos",
|
"title": "Review videos",
|
||||||
"disclaimer": "BlitzKit does not endorse any review videos.",
|
|
||||||
"join": "Apply to %s1 YouTuber program"
|
"join": "Apply to %s1 YouTuber program"
|
||||||
},
|
},
|
||||||
"configuration": {
|
"configuration": {
|
||||||
@@ -969,12 +978,13 @@
|
|||||||
"dpmEffective": "Effective at 60s",
|
"dpmEffective": "Effective at 60s",
|
||||||
"shells": "Снаряди",
|
"shells": "Снаряди",
|
||||||
"mostOptimalShellIndex": "Most optimal shell",
|
"mostOptimalShellIndex": "Most optimal shell",
|
||||||
"shellReloads": "Shell reloads",
|
"shellReloads": "Reloads",
|
||||||
"shellReload": "Shell reload",
|
"shellReload": "Час перезаряджання",
|
||||||
"intraClip": "Intra-clip",
|
"intraClip": "Intra-clip",
|
||||||
"caliber": "Калібр",
|
"caliber": "Калібр",
|
||||||
"penetration": "Бронепробиття",
|
"penetration": "Бронепробиття",
|
||||||
"damage": "Шкода",
|
"damage": "Шкода",
|
||||||
|
"damageWithoutAssault": "Damage without assault shells",
|
||||||
"clipDamage": "Clipping potential",
|
"clipDamage": "Clipping potential",
|
||||||
"moduleDamage": "Шкода по модулях",
|
"moduleDamage": "Шкода по модулях",
|
||||||
"explosionRadius": "Радіус розльоту уламків",
|
"explosionRadius": "Радіус розльоту уламків",
|
||||||
@@ -1027,7 +1037,9 @@
|
|||||||
"shellRange": "Shell range",
|
"shellRange": "Shell range",
|
||||||
"shellCapacity": "Shell capacity",
|
"shellCapacity": "Shell capacity",
|
||||||
"gunType": "Тип гармати",
|
"gunType": "Тип гармати",
|
||||||
"penetrationAt250m": "Penetration at 250m"
|
"penetrationAt250m": "Penetration at 250m",
|
||||||
|
"burstShells": "Burst shell count",
|
||||||
|
"burstInterShell": "Burst inter-shell"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"firepower": {
|
"firepower": {
|
||||||
|
|||||||
+689
-677
File diff suppressed because it is too large.
Load diff
@@ -3,7 +3,7 @@ import { mkdir, writeFile } from 'fs/promises';
|
|||||||
import { parse as parsePath } from 'path';
|
import { parse as parsePath } from 'path';
|
||||||
import ProgressBar from 'progress';
|
import ProgressBar from 'progress';
|
||||||
import { parse as parseYaml, stringify as stringifyYaml } from 'yaml';
|
import { parse as parseYaml, stringify as stringifyYaml } from 'yaml';
|
||||||
import { dvp } from '../../../submodules/blitzkit-closed/src/dvp';
|
import { dvp } from '../../../submodules/blitzkit-closed/src/dava/dvp';
|
||||||
import { readStringDVPL } from '../src/core/blitz/readStringDVPL';
|
import { readStringDVPL } from '../src/core/blitz/readStringDVPL';
|
||||||
import { DATA } from './buildAssets/constants';
|
import { DATA } from './buildAssets/constants';
|
||||||
import { readYAMLDVPL } from './core/blitz/readYAMLDVPL';
|
import { readYAMLDVPL } from './core/blitz/readYAMLDVPL';
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import {
|
|||||||
Samples,
|
Samples,
|
||||||
averageDefinitionsAllStatsKeys,
|
averageDefinitionsAllStatsKeys,
|
||||||
emptySamples,
|
emptySamples,
|
||||||
encodePBBuffer,
|
|
||||||
getAccountInfo,
|
getAccountInfo,
|
||||||
getTankStats,
|
getTankStats,
|
||||||
idToRegion,
|
idToRegion,
|
||||||
@@ -235,11 +234,11 @@ async function postWork() {
|
|||||||
commitAssets('averages', [
|
commitAssets('averages', [
|
||||||
{
|
{
|
||||||
path: `averages/${latest}.pb`,
|
path: `averages/${latest}.pb`,
|
||||||
content: encodePBBuffer(AverageDefinitions, averageDefinitions),
|
content: AverageDefinitions.encode(averageDefinitions).finish(),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'averages/manifest.json',
|
path: 'averages/manifest.json',
|
||||||
content: Buffer.from(JSON.stringify(manifest), 'utf-8'),
|
content: new TextEncoder().encode(JSON.stringify(manifest)),
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
@@ -7,7 +7,6 @@ import { FileChange } from '../core/github/commitMultipleFiles';
|
|||||||
export async function blitzkitTankIcons() {
|
export async function blitzkitTankIcons() {
|
||||||
console.log('Building blitzkit tank icons...');
|
console.log('Building blitzkit tank icons...');
|
||||||
|
|
||||||
console.log('Starting website dev server...');
|
|
||||||
const browser = await launch();
|
const browser = await launch();
|
||||||
const page = await browser.newPage();
|
const page = await browser.newPage();
|
||||||
const tanks = Object.values((await fetchTankDefinitions()).tanks);
|
const tanks = Object.values((await fetchTankDefinitions()).tanks);
|
||||||
@@ -19,12 +18,14 @@ export async function blitzkitTankIcons() {
|
|||||||
width: BLITZKIT_TANK_ICON_SIZE.width - 1,
|
width: BLITZKIT_TANK_ICON_SIZE.width - 1,
|
||||||
height: BLITZKIT_TANK_ICON_SIZE.height,
|
height: BLITZKIT_TANK_ICON_SIZE.height,
|
||||||
});
|
});
|
||||||
await page.goto(`http://localhost:4321/api/tankopedia/tank-icon/${id}/`, {
|
|
||||||
waitUntil: 'networkidle0',
|
|
||||||
});
|
|
||||||
|
|
||||||
if (index === 0) {
|
try {
|
||||||
console.log('Dev server started!');
|
await page.goto(`http://localhost:4321/api/tankopedia/tank-icon/${id}/`, {
|
||||||
|
waitUntil: 'networkidle0',
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
console.error(`${id} ${name} time out`, error);
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
const screenshot = await page.screenshot({
|
const screenshot = await page.screenshot({
|
||||||
|
|||||||
File diff suppressed because it is too large.
Load diff
@@ -1,4 +1,4 @@
|
|||||||
import { Avatar, encodePBBuffer, fetchGlossary, Gallery } from '@blitzkit/core';
|
import { Avatar, fetchGlossary, Gallery } from '@blitzkit/core';
|
||||||
import locales from '@blitzkit/i18n/locales.json';
|
import locales from '@blitzkit/i18n/locales.json';
|
||||||
import { extname } from 'path';
|
import { extname } from 'path';
|
||||||
import ProgressBar from 'progress';
|
import ProgressBar from 'progress';
|
||||||
@@ -68,13 +68,13 @@ export async function glossary() {
|
|||||||
|
|
||||||
gallery.avatars.push(avatar);
|
gallery.avatars.push(avatar);
|
||||||
|
|
||||||
const content = await fetch(url).then((response) =>
|
const content = await fetch(url)
|
||||||
response.arrayBuffer(),
|
.then((response) => response.arrayBuffer())
|
||||||
);
|
.then((buffer) => new Uint8Array(buffer));
|
||||||
|
|
||||||
changes.push({
|
changes.push({
|
||||||
path: `gallery/avatars/${key}${avatar.extension}`,
|
path: `gallery/avatars/${key}${avatar.extension}`,
|
||||||
content: Buffer.from(content),
|
content,
|
||||||
});
|
});
|
||||||
|
|
||||||
bar.tick();
|
bar.tick();
|
||||||
@@ -83,7 +83,7 @@ export async function glossary() {
|
|||||||
|
|
||||||
changes.push({
|
changes.push({
|
||||||
path: 'definitions/gallery.pb',
|
path: 'definitions/gallery.pb',
|
||||||
content: encodePBBuffer(Gallery, gallery),
|
content: Gallery.encode(gallery).finish(),
|
||||||
});
|
});
|
||||||
|
|
||||||
await commitAssets('glossary', changes);
|
await commitAssets('glossary', changes);
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ import { gameModeBanners } from './gameModeBanners';
|
|||||||
import { glossary } from './glossary';
|
import { glossary } from './glossary';
|
||||||
import { migration } from './migration';
|
import { migration } from './migration';
|
||||||
import { moduleIcons } from './moduleIcons';
|
import { moduleIcons } from './moduleIcons';
|
||||||
import { popularTanks } from './popularTanks';
|
|
||||||
import { shellIcons } from './shellIcons';
|
import { shellIcons } from './shellIcons';
|
||||||
import { skillIcons } from './skillIcons';
|
import { skillIcons } from './skillIcons';
|
||||||
import { tankArmors } from './tankArmors';
|
import { tankArmors } from './tankArmors';
|
||||||
@@ -47,7 +46,7 @@ const methods = [
|
|||||||
boosterIcons,
|
boosterIcons,
|
||||||
tankIcons,
|
tankIcons,
|
||||||
blitzkitTankIcons,
|
blitzkitTankIcons,
|
||||||
popularTanks,
|
// popularTanks,
|
||||||
glossary,
|
glossary,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ export async function migration() {
|
|||||||
await commitAssets('migration', [
|
await commitAssets('migration', [
|
||||||
{
|
{
|
||||||
path: 'definitions/migration.json',
|
path: 'definitions/migration.json',
|
||||||
content: Buffer.from(JSON.stringify(map)),
|
content: new TextEncoder().encode(JSON.stringify(map)),
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
import {
|
import {
|
||||||
assertSecret,
|
assertSecret,
|
||||||
encodePBBuffer,
|
|
||||||
fetchTankDefinitions,
|
fetchTankDefinitions,
|
||||||
PopularTanks,
|
PopularTanks,
|
||||||
} from '@blitzkit/core';
|
} from '@blitzkit/core';
|
||||||
@@ -70,7 +69,7 @@ export async function popularTanks() {
|
|||||||
await commitAssets('popular tanks', [
|
await commitAssets('popular tanks', [
|
||||||
{
|
{
|
||||||
path: 'definitions/popular-tanks.pb',
|
path: 'definitions/popular-tanks.pb',
|
||||||
content: encodePBBuffer(PopularTanks, popularTanks),
|
content: PopularTanks.encode(popularTanks).finish(),
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
@@ -29,10 +29,11 @@ export async function tankArmors() {
|
|||||||
|
|
||||||
const id = toUniqueId(nation, tank.id);
|
const id = toUniqueId(nation, tank.id);
|
||||||
const model = await extractArmor(DATA, `${nation}-${tankKey}`);
|
const model = await extractArmor(DATA, `${nation}-${tankKey}`);
|
||||||
|
const content = await nodeIO.writeBinary(model);
|
||||||
|
|
||||||
changes.push({
|
changes.push({
|
||||||
path: `3d/tanks/armor/${id}.glb`,
|
path: `3d/tanks/armor/${id}.glb`,
|
||||||
content: Buffer.from(await nodeIO.writeBinary(model)),
|
content,
|
||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ export async function tankIcons() {
|
|||||||
|
|
||||||
const nationVehicleId = tank.id;
|
const nationVehicleId = tank.id;
|
||||||
const id = (nationVehicleId << 8) + (NATION_IDS[nation] << 4) + 1;
|
const id = (nationVehicleId << 8) + (NATION_IDS[nation] << 4) + 1;
|
||||||
|
|
||||||
const parameters = await readYAMLDVPL<TankParameters>(
|
const parameters = await readYAMLDVPL<TankParameters>(
|
||||||
`${DATA}/3d/Tanks/Parameters/${nation}/${tankKey}.yaml`,
|
`${DATA}/3d/Tanks/Parameters/${nation}/${tankKey}.yaml`,
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,50 +1,52 @@
|
|||||||
import { toUniqueId } from '@blitzkit/core';
|
import { toUniqueId } from "@blitzkit/core";
|
||||||
import { NodeIO } from '@gltf-transform/core';
|
import { NodeIO } from "@gltf-transform/core";
|
||||||
import { ALL_EXTENSIONS } from '@gltf-transform/extensions';
|
import { ALL_EXTENSIONS } from "@gltf-transform/extensions";
|
||||||
import { readdir } from 'fs/promises';
|
import { readdir } from "fs/promises";
|
||||||
import { extractModel } from '../core/blitz/extractModel';
|
import { extractModel } from "../core/blitz/extractModel";
|
||||||
import { readXMLDVPL } from '../core/blitz/readXMLDVPL';
|
import { readXMLDVPL } from "../core/blitz/readXMLDVPL";
|
||||||
import { readYAMLDVPL } from '../core/blitz/readYAMLDVPL';
|
import { readYAMLDVPL } from "../core/blitz/readYAMLDVPL";
|
||||||
import { commitAssets } from '../core/github/commitAssets';
|
import { commitAssets } from "../core/github/commitAssets";
|
||||||
import { FileChange } from '../core/github/commitMultipleFiles';
|
import { FileChange } from "../core/github/commitMultipleFiles";
|
||||||
import { DATA } from './constants';
|
import { DATA } from "./constants";
|
||||||
import { VehicleDefinitionList } from './definitions';
|
import { VehicleDefinitionList } from "./definitions";
|
||||||
import { TankParameters } from './tankIcons';
|
import { TankParameters } from "./tankIcons";
|
||||||
|
|
||||||
export async function tankModels() {
|
export async function tankModels() {
|
||||||
console.log('Building tank models...');
|
console.log("Building tank models...");
|
||||||
|
|
||||||
const nodeIO = new NodeIO().registerExtensions(ALL_EXTENSIONS);
|
const nodeIO = new NodeIO().registerExtensions(ALL_EXTENSIONS);
|
||||||
const nations = await readdir(`${DATA}/XML/item_defs/vehicles`).then(
|
const nations = await readdir(`${DATA}/XML/item_defs/vehicles`).then(
|
||||||
(nations) => nations.filter((nation) => nation !== 'common'),
|
(nations) => nations.filter((nation) => nation !== "common")
|
||||||
);
|
);
|
||||||
|
|
||||||
for (const nationIndex in nations) {
|
for (const nationIndex in nations) {
|
||||||
const nation = nations[nationIndex];
|
const nation = nations[nationIndex];
|
||||||
const changes: FileChange[] = [];
|
const changes: FileChange[] = [];
|
||||||
const tanks = await readXMLDVPL<{ root: VehicleDefinitionList }>(
|
const tanks = await readXMLDVPL<{ root: VehicleDefinitionList }>(
|
||||||
`${DATA}/XML/item_defs/vehicles/${nation}/list.xml`,
|
`${DATA}/XML/item_defs/vehicles/${nation}/list.xml`
|
||||||
);
|
);
|
||||||
|
const entries = Object.entries(tanks.root);
|
||||||
|
|
||||||
console.log(`Building models for ${nation}`);
|
console.log(`Building models for ${nation}`);
|
||||||
|
|
||||||
for (const [tankKey, tank] of Object.entries(tanks.root)) {
|
let index = 0;
|
||||||
if (tankKey.includes('tutorial_bot')) continue;
|
for (const [tankKey, tank] of entries) {
|
||||||
|
console.log(` ${++index} / ${entries.length} : ${tankKey}`);
|
||||||
|
|
||||||
|
if (tankKey.includes("tutorial_bot")) continue;
|
||||||
|
|
||||||
const id = toUniqueId(nation, tank.id);
|
const id = toUniqueId(nation, tank.id);
|
||||||
|
|
||||||
const parameters = await readYAMLDVPL<TankParameters>(
|
const parameters = await readYAMLDVPL<TankParameters>(
|
||||||
`${DATA}/3d/Tanks/Parameters/${nation}/${tankKey}.yaml`,
|
`${DATA}/3d/Tanks/Parameters/${nation}/${tankKey}.yaml`
|
||||||
);
|
);
|
||||||
const model = await extractModel(
|
const model = await extractModel(
|
||||||
DATA,
|
DATA,
|
||||||
parameters.resourcesPath.blitzModelPath.replace(/\.sc2$/, ''),
|
parameters.resourcesPath.blitzModelPath.replace(/\.sc2$/, "")
|
||||||
);
|
);
|
||||||
|
const content = Buffer.from(await nodeIO.writeBinary(model));
|
||||||
|
|
||||||
changes.push({
|
changes.push({ path: `3d/tanks/models/${id}.glb`, content });
|
||||||
path: `3d/tanks/models/${id}.glb`,
|
|
||||||
content: Buffer.from(await nodeIO.writeBinary(model)),
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
await commitAssets(`tank models ${nation}`, changes);
|
await commitAssets(`tank models ${nation}`, changes);
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ const content = RatingLeaderboard.encode({
|
|||||||
const changes: FileChange[] = [
|
const changes: FileChange[] = [
|
||||||
{
|
{
|
||||||
path: `regions/${normalizedServer}/rating/${info.current_season}.pb`,
|
path: `regions/${normalizedServer}/rating/${info.current_season}.pb`,
|
||||||
content: Buffer.from(content),
|
content,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
import { VertexAttribute, vertexAttributeVectorSizes } from '@blitzkit/core';
|
import { VertexAttribute, vertexAttributeVectorSizes } from "@blitzkit/core";
|
||||||
|
|
||||||
export const vertexAttributeGLTFName: Partial<Record<VertexAttribute, string>> =
|
export const vertexAttributeGLTFName: Partial<Record<VertexAttribute, string>> =
|
||||||
{
|
{
|
||||||
[VertexAttribute.VERTEX]: 'POSITION',
|
[VertexAttribute.VERTEX]: "POSITION",
|
||||||
[VertexAttribute.NORMAL]: 'NORMAL',
|
[VertexAttribute.NORMAL]: "NORMAL",
|
||||||
[VertexAttribute.TEXCOORD0]: 'TEXCOORD_0',
|
[VertexAttribute.TEXCOORD0]: "TEXCOORD_0",
|
||||||
[VertexAttribute.TEXCOORD1]: 'TEXCOORD_0',
|
[VertexAttribute.TEXCOORD1]: "TEXCOORD_1",
|
||||||
[VertexAttribute.TEXCOORD2]: 'TEXCOORD_0',
|
[VertexAttribute.TEXCOORD2]: "TEXCOORD_2",
|
||||||
[VertexAttribute.TEXCOORD3]: 'TEXCOORD_0',
|
[VertexAttribute.TEXCOORD3]: "TEXCOORD_3",
|
||||||
};
|
};
|
||||||
export const vertexAttributeGltfVectorSizes = {
|
export const vertexAttributeGltfVectorSizes = {
|
||||||
...vertexAttributeVectorSizes,
|
...vertexAttributeVectorSizes,
|
||||||
|
|||||||
@@ -4,35 +4,35 @@ import {
|
|||||||
ScgReadStream,
|
ScgReadStream,
|
||||||
Textures,
|
Textures,
|
||||||
VertexAttribute,
|
VertexAttribute,
|
||||||
} from '@blitzkit/core';
|
} from "@blitzkit/core";
|
||||||
import { Document, Material, Node, Scene } from '@gltf-transform/core';
|
import { Document, Material, Node, Scene } from "@gltf-transform/core";
|
||||||
import { dedup, prune } from '@gltf-transform/functions';
|
import { dedup, prune } from "@gltf-transform/functions";
|
||||||
import { times } from 'lodash-es';
|
import { times } from "lodash-es";
|
||||||
import { dirname } from 'path';
|
import { dirname } from "path";
|
||||||
import { Matrix4, Quaternion, Vector3, Vector4Tuple } from 'three';
|
import { readBaseColor } from "../readBaseColor";
|
||||||
import { readDVPLFile } from '../readDVPLFile';
|
import { readDVPLFile } from "../readDVPLFile";
|
||||||
import { readTexture } from '../readTexture';
|
import { readNormal } from "../readNormal";
|
||||||
import { TextureMutation } from '../readTexture/constants';
|
import { readRoughnessMetallic } from "../readRoughnessMetallic";
|
||||||
import {
|
import {
|
||||||
vertexAttributeGLTFName,
|
vertexAttributeGLTFName,
|
||||||
vertexAttributeGltfVectorSizes,
|
vertexAttributeGltfVectorSizes,
|
||||||
} from './constants';
|
} from "./constants";
|
||||||
|
|
||||||
const ERROR_ON_UNKNOWN_COMPONENT = false;
|
const ERROR_ON_UNKNOWN_COMPONENT = false;
|
||||||
|
|
||||||
const omitMeshNames = {
|
const omitMeshNames = {
|
||||||
start: ['chassis_chassis_', 'chassis_track_crash_', 'HP_'],
|
start: ["chassis_chassis_", "chassis_track_crash_", "HP_"],
|
||||||
end: ['_POINT'],
|
end: ["_POINT"],
|
||||||
};
|
};
|
||||||
|
|
||||||
export async function extractModel(data: string, path: string) {
|
export async function extractModel(data: string, path: string) {
|
||||||
const sc2Path = `${data}/3d/${path}.sc2`;
|
const sc2Path = `${data}/3d/${path}.sc2`;
|
||||||
const scgPath = `${data}/3d/${path}.scg`;
|
const scgPath = `${data}/3d/${path}.scg`;
|
||||||
const sc2 = new Sc2ReadStream(
|
const sc2 = new Sc2ReadStream(
|
||||||
(await readDVPLFile(sc2Path)).buffer as ArrayBuffer,
|
(await readDVPLFile(sc2Path)).buffer as ArrayBuffer
|
||||||
).sc2();
|
).sc2();
|
||||||
const scg = new ScgReadStream(
|
const scg = new ScgReadStream(
|
||||||
(await readDVPLFile(scgPath)).buffer as ArrayBuffer,
|
(await readDVPLFile(scgPath)).buffer as ArrayBuffer
|
||||||
).scg();
|
).scg();
|
||||||
const document = new Document();
|
const document = new Document();
|
||||||
const scene = document.createScene();
|
const scene = document.createScene();
|
||||||
@@ -41,8 +41,8 @@ export async function extractModel(data: string, path: string) {
|
|||||||
|
|
||||||
// create materials
|
// create materials
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
sc2['#dataNodes'].map(async (node) => {
|
sc2["#dataNodes"].map(async (node) => {
|
||||||
const id = new DataView(node['#id']).getBigUint64(0, true);
|
const id = new DataView(node["#id"]).getBigUint64(0, true);
|
||||||
|
|
||||||
if (node.parentMaterialKey !== undefined) {
|
if (node.parentMaterialKey !== undefined) {
|
||||||
/**
|
/**
|
||||||
@@ -58,7 +58,7 @@ export async function extractModel(data: string, path: string) {
|
|||||||
|
|
||||||
if (node.textures) {
|
if (node.textures) {
|
||||||
textures = node.textures;
|
textures = node.textures;
|
||||||
} else if (typeof node.configCount === 'number') {
|
} else if (typeof node.configCount === "number") {
|
||||||
textures = node.configArchive_0.textures;
|
textures = node.configArchive_0.textures;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -66,26 +66,27 @@ export async function extractModel(data: string, path: string) {
|
|||||||
material.setBaseColorTexture(
|
material.setBaseColorTexture(
|
||||||
document
|
document
|
||||||
.createTexture(node.materialName)
|
.createTexture(node.materialName)
|
||||||
.setMimeType('image/jpeg')
|
.setMimeType("image/jpeg")
|
||||||
.setImage(
|
.setImage(
|
||||||
await readTexture(
|
await readBaseColor(
|
||||||
`${data}/3d/${dirname(path)}/${textures.albedo}`,
|
`${data}/3d/${dirname(path)}/${textures.baseColorMap ?? textures.albedo}`,
|
||||||
TextureMutation.Albedo,
|
textures.miscMap
|
||||||
),
|
? `${data}/3d/${dirname(path)}/${textures.miscMap}`
|
||||||
),
|
: undefined
|
||||||
|
)
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (textures.baseRMMap) {
|
if (textures.baseRMMap) {
|
||||||
material.setMetallicRoughnessTexture(
|
material.setMetallicRoughnessTexture(
|
||||||
document
|
document
|
||||||
.createTexture(node.materialName)
|
.createTexture(node.materialName)
|
||||||
.setMimeType('image/jpeg')
|
.setMimeType("image/jpeg")
|
||||||
.setImage(
|
.setImage(
|
||||||
await readTexture(
|
await readRoughnessMetallic(
|
||||||
`${data}/3d/${dirname(path)}/${textures.baseRMMap}`,
|
`${data}/3d/${dirname(path)}/${textures.baseRMMap}`
|
||||||
TextureMutation.RoughnessMetallicness,
|
)
|
||||||
),
|
)
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -95,47 +96,33 @@ export async function extractModel(data: string, path: string) {
|
|||||||
material.setNormalTexture(
|
material.setNormalTexture(
|
||||||
document
|
document
|
||||||
.createTexture(node.materialName)
|
.createTexture(node.materialName)
|
||||||
.setMimeType('image/jpeg')
|
.setMimeType("image/jpeg")
|
||||||
.setImage(
|
.setImage(
|
||||||
await readTexture(
|
await readNormal(
|
||||||
`${data}/3d/${dirname(path)}/${
|
`${data}/3d/${dirname(path)}/${
|
||||||
textures.baseNormalMap ?? textures.normalmap
|
textures.baseNormalMap ?? textures.normalmap
|
||||||
}`,
|
}`,
|
||||||
isBase ? TextureMutation.Normal : undefined,
|
isBase
|
||||||
),
|
)
|
||||||
),
|
)
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (textures.miscMap) {
|
|
||||||
material.setOcclusionTexture(
|
|
||||||
document
|
|
||||||
.createTexture(node.materialName)
|
|
||||||
.setMimeType('image/jpeg')
|
|
||||||
.setImage(
|
|
||||||
await readTexture(
|
|
||||||
`${data}/3d/${dirname(path)}/${textures.miscMap}`,
|
|
||||||
TextureMutation.Miscellaneous,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
materials.set(
|
materials.set(
|
||||||
new DataView(node['#id']).getBigUint64(0, true),
|
new DataView(node["#id"]).getBigUint64(0, true),
|
||||||
material,
|
material
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}),
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
// replace children materials with parents
|
// replace children materials with parents
|
||||||
materials.forEach((material, id) => {
|
materials.forEach((material, id) => {
|
||||||
if (typeof material !== 'bigint') return;
|
if (typeof material !== "bigint") return;
|
||||||
|
|
||||||
let resolvedMaterial: Material | bigint | undefined = material;
|
let resolvedMaterial: Material | bigint | undefined = material;
|
||||||
|
|
||||||
while (typeof resolvedMaterial === 'bigint') {
|
while (typeof resolvedMaterial === "bigint") {
|
||||||
const linkedParentMaterial = materials.get(resolvedMaterial);
|
const linkedParentMaterial = materials.get(resolvedMaterial);
|
||||||
|
|
||||||
resolvedMaterial = linkedParentMaterial;
|
resolvedMaterial = linkedParentMaterial;
|
||||||
@@ -155,36 +142,36 @@ export async function extractModel(data: string, path: string) {
|
|||||||
const node = document.createNode(hierarchy.name);
|
const node = document.createNode(hierarchy.name);
|
||||||
const components = times(
|
const components = times(
|
||||||
hierarchy.components.count,
|
hierarchy.components.count,
|
||||||
(index) => hierarchy.components[index.toString().padStart(4, '0')],
|
(index) => hierarchy.components[index.toString().padStart(4, "0")]
|
||||||
);
|
);
|
||||||
|
|
||||||
components.forEach((component) => {
|
components.forEach((component) => {
|
||||||
switch (component['comp.typename']) {
|
switch (component["comp.typename"]) {
|
||||||
case 'LodComponent':
|
case "LodComponent":
|
||||||
// found and used later by transform component
|
// found and used later by transform component
|
||||||
// TODO: lod component always shows up before transform component; cache it before parsing transform
|
// TODO: lod component always shows up before transform component; cache it before parsing transform
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'TransformComponent': {
|
case "TransformComponent": {
|
||||||
node.setTranslation(component['tc.localTranslation']);
|
node.setTranslation(component["tc.localTranslation"]);
|
||||||
node.setRotation(component['tc.localRotation']);
|
node.setRotation(component["tc.localRotation"]);
|
||||||
node.setScale(component['tc.localScale']);
|
node.setScale(component["tc.localScale"]);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case 'RenderComponent': {
|
case "RenderComponent": {
|
||||||
const renderObject = component['rc.renderObj'];
|
const renderObject = component["rc.renderObj"];
|
||||||
|
|
||||||
times(renderObject['ro.batchCount'], (batchIndex): void => {
|
times(renderObject["ro.batchCount"], (batchIndex): void => {
|
||||||
const lodIndex = renderObject[`rb${batchIndex}.lodIndex`];
|
const lodIndex = renderObject[`rb${batchIndex}.lodIndex`];
|
||||||
|
|
||||||
if (lodIndex !== 0) return;
|
if (lodIndex !== 0) return;
|
||||||
|
|
||||||
const batchKey = batchIndex.toString().padStart(4, '0');
|
const batchKey = batchIndex.toString().padStart(4, "0");
|
||||||
const batch = renderObject['ro.batches'][batchKey];
|
const batch = renderObject["ro.batches"][batchKey];
|
||||||
const material = materials.get(batch['rb.nmatname']);
|
const material = materials.get(batch["rb.nmatname"]);
|
||||||
const polygonGroup = scg.get(batch['rb.datasource']);
|
const polygonGroup = scg.get(batch["rb.datasource"]);
|
||||||
|
|
||||||
if (!(material instanceof Material)) {
|
if (!(material instanceof Material)) {
|
||||||
// probably shadow material
|
// probably shadow material
|
||||||
@@ -192,14 +179,14 @@ export async function extractModel(data: string, path: string) {
|
|||||||
}
|
}
|
||||||
if (polygonGroup === undefined) {
|
if (polygonGroup === undefined) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`Missing polygon group ${batch['rb.datasource']}`,
|
`Missing polygon group ${batch["rb.datasource"]}`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const lodNode = document.createNode(batchKey);
|
const lodNode = document.createNode(batchKey);
|
||||||
const indicesAccessor = document
|
const indicesAccessor = document
|
||||||
.createAccessor()
|
.createAccessor()
|
||||||
.setType('SCALAR')
|
.setType("SCALAR")
|
||||||
.setArray(new Uint16Array(polygonGroup.indices))
|
.setArray(new Uint16Array(polygonGroup.indices))
|
||||||
.setBuffer(buffer);
|
.setBuffer(buffer);
|
||||||
const primitive = document
|
const primitive = document
|
||||||
@@ -233,7 +220,7 @@ export async function extractModel(data: string, path: string) {
|
|||||||
const vertexSize = vertexAttributeGltfVectorSizes[attribute];
|
const vertexSize = vertexAttributeGltfVectorSizes[attribute];
|
||||||
const attributeAccessor = document
|
const attributeAccessor = document
|
||||||
.createAccessor(name)
|
.createAccessor(name)
|
||||||
.setType(vertexSize === 1 ? 'SCALAR' : `VEC${vertexSize}`)
|
.setType(vertexSize === 1 ? "SCALAR" : `VEC${vertexSize}`)
|
||||||
.setArray(new Float32Array(value.flat()))
|
.setArray(new Float32Array(value.flat()))
|
||||||
.setBuffer(buffer);
|
.setBuffer(buffer);
|
||||||
|
|
||||||
@@ -241,7 +228,7 @@ export async function extractModel(data: string, path: string) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const mesh = document
|
const mesh = document
|
||||||
.createMesh(batch['##name'])
|
.createMesh(batch["##name"])
|
||||||
.addPrimitive(primitive);
|
.addPrimitive(primitive);
|
||||||
lodNode.setMesh(mesh);
|
lodNode.setMesh(mesh);
|
||||||
node.addChild(lodNode);
|
node.addChild(lodNode);
|
||||||
@@ -253,24 +240,24 @@ export async function extractModel(data: string, path: string) {
|
|||||||
default: {
|
default: {
|
||||||
if (ERROR_ON_UNKNOWN_COMPONENT) {
|
if (ERROR_ON_UNKNOWN_COMPONENT) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`Unhandled component type: ${component['comp.typename']}`,
|
`Unhandled component type: ${component["comp.typename"]}`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (hierarchy['#hierarchy']) {
|
if (hierarchy["#hierarchy"]) {
|
||||||
parseHierarchies(hierarchy['#hierarchy'], node);
|
parseHierarchies(hierarchy["#hierarchy"], node);
|
||||||
}
|
}
|
||||||
|
|
||||||
parent.addChild(node);
|
parent.addChild(node);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
parseHierarchies(sc2['#hierarchy'], scene);
|
parseHierarchies(sc2["#hierarchy"], scene);
|
||||||
|
|
||||||
scene.addChild(document.createNode('test'));
|
scene.addChild(document.createNode("test"));
|
||||||
|
|
||||||
await document.transform(prune({ keepAttributes: true }), dedup());
|
await document.transform(prune({ keepAttributes: true }), dedup());
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,48 @@
|
|||||||
|
import sharp from "sharp";
|
||||||
|
import { readTexture } from "./readTexture";
|
||||||
|
|
||||||
|
export async function readBaseColor(path: string, occlusionPath?: string) {
|
||||||
|
const baseRaw = await readTexture(path);
|
||||||
|
const occlusionRaw = occlusionPath
|
||||||
|
? await readTexture(occlusionPath)
|
||||||
|
: undefined;
|
||||||
|
const base = await sharp(baseRaw.data, { raw: baseRaw })
|
||||||
|
.removeAlpha()
|
||||||
|
.raw()
|
||||||
|
.toBuffer();
|
||||||
|
const occlusion = occlusionRaw
|
||||||
|
? await sharp(occlusionRaw.data, { raw: occlusionRaw })
|
||||||
|
.extractChannel(3)
|
||||||
|
.raw()
|
||||||
|
.toBuffer()
|
||||||
|
: undefined;
|
||||||
|
|
||||||
|
const combined = Buffer.alloc(baseRaw.width * baseRaw.height * 3);
|
||||||
|
|
||||||
|
for (let i = 0; i < baseRaw.width * baseRaw.height; i++) {
|
||||||
|
let c = 1;
|
||||||
|
|
||||||
|
if (occlusionRaw) {
|
||||||
|
const x = i % baseRaw.width;
|
||||||
|
const y = Math.floor(i / baseRaw.width);
|
||||||
|
const u = Math.floor(x * (occlusionRaw.width / baseRaw.width));
|
||||||
|
const v = Math.floor(y * (occlusionRaw.height / baseRaw.height));
|
||||||
|
|
||||||
|
const occlusionI = u + v * occlusionRaw.width;
|
||||||
|
|
||||||
|
c = occlusion![occlusionI] / 255;
|
||||||
|
}
|
||||||
|
|
||||||
|
combined[i * 3 + 0] = Math.round(base[i * 3 + 0] * c);
|
||||||
|
combined[i * 3 + 1] = Math.round(base[i * 3 + 1] * c);
|
||||||
|
combined[i * 3 + 2] = Math.round(base[i * 3 + 2] * c);
|
||||||
|
}
|
||||||
|
|
||||||
|
const image = await sharp(combined, {
|
||||||
|
raw: { width: baseRaw.width, height: baseRaw.height, channels: 3 },
|
||||||
|
})
|
||||||
|
.jpeg()
|
||||||
|
.toBuffer();
|
||||||
|
|
||||||
|
return image;
|
||||||
|
}
|
||||||
@@ -1,9 +1,20 @@
|
|||||||
import { readFile } from 'fs/promises';
|
import { readFile } from 'fs/promises';
|
||||||
|
import { DATA_COMPRESSED } from '../../buildAssets/constants';
|
||||||
import { readDVPL } from './readDVPL';
|
import { readDVPL } from './readDVPL';
|
||||||
|
|
||||||
export async function readDVPLFile(file: string) {
|
export async function readDVPLFile(file: string) {
|
||||||
const path = `${file}${file.endsWith('.dvpl') ? '' : '.dvpl'}`;
|
let path: string;
|
||||||
|
|
||||||
|
if (DATA_COMPRESSED) {
|
||||||
|
path = file.endsWith('.dvpl') ? file : `${file}.dvpl`;
|
||||||
|
} else {
|
||||||
|
path = file.replace('.dvpl', '');
|
||||||
|
}
|
||||||
|
|
||||||
const content = await readFile(path);
|
const content = await readFile(path);
|
||||||
|
|
||||||
|
if (!DATA_COMPRESSED) return content;
|
||||||
|
|
||||||
const dvpl = readDVPL(content);
|
const dvpl = readDVPL(content);
|
||||||
|
|
||||||
return dvpl;
|
return dvpl;
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
import sharp from "sharp";
|
||||||
|
import { readTexture } from "./readTexture";
|
||||||
|
|
||||||
|
export async function readNormal(path: string, isBase: boolean) {
|
||||||
|
const raw = await readTexture(path);
|
||||||
|
|
||||||
|
if (!isBase) {
|
||||||
|
return await sharp(raw.data, { raw }).removeAlpha().jpeg().toBuffer();
|
||||||
|
}
|
||||||
|
|
||||||
|
const bytes = 4 * raw.width * raw.height;
|
||||||
|
|
||||||
|
for (let index = 0; index < bytes; index += 4) {
|
||||||
|
/**
|
||||||
|
* Red is always 255 and blue is always 0. Only alpha and green contain any
|
||||||
|
* sort of information.
|
||||||
|
*/
|
||||||
|
let x = raw.data[index + 3] * (2 / 255) - 1;
|
||||||
|
let y = raw.data[index + 1] * (2 / 255) - 1;
|
||||||
|
let z = Math.sqrt(Math.max(0, 1 - x ** 2 - y ** 2));
|
||||||
|
|
||||||
|
raw.data[index] = Math.round((x + 1) * (255 / 2));
|
||||||
|
raw.data[index + 1] = Math.round((y + 1) * (255 / 2));
|
||||||
|
raw.data[index + 2] = Math.round((z + 1) * (255 / 2));
|
||||||
|
raw.data[index + 3] = 255;
|
||||||
|
}
|
||||||
|
|
||||||
|
return await sharp(raw.data, { raw }).jpeg().toBuffer();
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
import sharp from "sharp";
|
||||||
|
import { readTexture } from "./readTexture";
|
||||||
|
|
||||||
|
export async function readRoughnessMetallic(path: string) {
|
||||||
|
const raw = await readTexture(path);
|
||||||
|
const blitz = sharp(raw.data, { raw: raw });
|
||||||
|
const metallicness = await blitz?.extractChannel(1).raw().toBuffer();
|
||||||
|
const roughness = await blitz?.extractChannel(3).raw().toBuffer();
|
||||||
|
|
||||||
|
const combined = Buffer.alloc(raw.width * raw.height * 3);
|
||||||
|
|
||||||
|
for (let i = 0; i < raw.width * raw.height; i++) {
|
||||||
|
combined[i * 3 + 1] = roughness[i];
|
||||||
|
combined[i * 3 + 2] = metallicness[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
const image = await sharp(combined, {
|
||||||
|
raw: { width: raw.width, height: raw.height, channels: 3 },
|
||||||
|
})
|
||||||
|
.jpeg()
|
||||||
|
.toBuffer();
|
||||||
|
|
||||||
|
return image;
|
||||||
|
}
|
||||||
@@ -1,79 +1,83 @@
|
|||||||
import { DdsReadStream, PvrReadStream } from '@blitzkit/core';
|
import { DdsReadStream, PvrReadStream } from "@blitzkit/core";
|
||||||
import { existsSync } from 'fs';
|
import { existsSync } from "fs";
|
||||||
import sharp from 'sharp';
|
import sharp from "sharp";
|
||||||
import { readDVPLFile } from '../readDVPLFile';
|
import { DATA_COMPRESSED } from "../../../buildAssets/constants";
|
||||||
import { TextureMutation } from './constants';
|
import { readDVPLFile } from "../readDVPLFile";
|
||||||
|
import { TextureMutation } from "./constants";
|
||||||
|
|
||||||
export async function readTexture(path: string, mutation?: TextureMutation) {
|
export async function readTexture(path: string) {
|
||||||
const ddsTexturePath = path.replace('.tex', '.dx11.dds');
|
const ddsTexturePath = path.replace(".tex", ".dx11.dds");
|
||||||
const isDds = existsSync(`${ddsTexturePath}.dvpl`);
|
const isDds = existsSync(
|
||||||
|
`${ddsTexturePath}${DATA_COMPRESSED ? ".dvpl" : ""}`
|
||||||
|
);
|
||||||
const resolvedTexturePath = isDds
|
const resolvedTexturePath = isDds
|
||||||
? ddsTexturePath
|
? ddsTexturePath
|
||||||
: ddsTexturePath.replace('.dds', '.pvr');
|
: ddsTexturePath.replace(".dds", ".pvr");
|
||||||
const decompressedDvpl = await readDVPLFile(`${resolvedTexturePath}.dvpl`);
|
const decompressedDvpl = await readDVPLFile(`${resolvedTexturePath}.dvpl`);
|
||||||
|
|
||||||
const raw = isDds
|
const raw = isDds
|
||||||
? await new DdsReadStream(decompressedDvpl.buffer as ArrayBuffer).dds()
|
? await new DdsReadStream(decompressedDvpl.buffer as ArrayBuffer).dds()
|
||||||
: new PvrReadStream(decompressedDvpl.buffer as ArrayBuffer).pvr();
|
: new PvrReadStream(decompressedDvpl.buffer as ArrayBuffer).pvr();
|
||||||
|
|
||||||
switch (mutation) {
|
return raw;
|
||||||
case TextureMutation.Normal: {
|
|
||||||
const bytes = 4 * raw.width * raw.height;
|
|
||||||
for (let index = 0; index < bytes; index += 4) {
|
|
||||||
/**
|
|
||||||
* Red is always 255 and blue is always 0. Only alpha and green contain any
|
|
||||||
* sort of information.
|
|
||||||
*/
|
|
||||||
let x = raw.data[index + 3] * (2 / 255) - 1;
|
|
||||||
let y = raw.data[index + 1] * (2 / 255) - 1;
|
|
||||||
const underSqrt = 1 - x ** 2 - y ** 2;
|
|
||||||
let z = underSqrt > 0 ? Math.sqrt(underSqrt) : -Math.sqrt(-underSqrt);
|
|
||||||
|
|
||||||
raw.data[index] = Math.round((x + 1) * (255 / 2));
|
// switch (mutation) {
|
||||||
raw.data[index + 1] = Math.round((y + 1) * (255 / 2));
|
// case TextureMutation.Normal: {
|
||||||
raw.data[index + 2] = Math.round((z + 1) * (255 / 2));
|
// const bytes = 4 * raw.width * raw.height;
|
||||||
raw.data[index + 3] = 255;
|
// for (let index = 0; index < bytes; index += 4) {
|
||||||
}
|
// /**
|
||||||
|
// * Red is always 255 and blue is always 0. Only alpha and green contain any
|
||||||
|
// * sort of information.
|
||||||
|
// */
|
||||||
|
// let x = raw.data[index + 3] * (2 / 255) - 1;
|
||||||
|
// let y = raw.data[index + 1] * (2 / 255) - 1;
|
||||||
|
// const underSqrt = 1 - x ** 2 - y ** 2;
|
||||||
|
// let z = underSqrt > 0 ? Math.sqrt(underSqrt) : -Math.sqrt(-underSqrt);
|
||||||
|
|
||||||
return await sharp(raw.data, { raw }).jpeg().toBuffer();
|
// raw.data[index] = Math.round((x + 1) * (255 / 2));
|
||||||
}
|
// raw.data[index + 1] = Math.round((y + 1) * (255 / 2));
|
||||||
|
// raw.data[index + 2] = Math.round((z + 1) * (255 / 2));
|
||||||
|
// raw.data[index + 3] = 255;
|
||||||
|
// }
|
||||||
|
|
||||||
case TextureMutation.RoughnessMetallicness: {
|
// return await sharp(raw.data, { raw }).jpeg().toBuffer();
|
||||||
const newImage = sharp(Buffer.alloc(raw.width * raw.height), {
|
// }
|
||||||
raw: { ...raw, channels: 1 },
|
|
||||||
});
|
|
||||||
const metallicness = sharp(raw.data, { raw })
|
|
||||||
.extractChannel('green')
|
|
||||||
.jpeg()
|
|
||||||
.toBuffer();
|
|
||||||
const roughness = sharp(raw.data, { raw })
|
|
||||||
.extractChannel('alpha')
|
|
||||||
.jpeg()
|
|
||||||
.toBuffer();
|
|
||||||
|
|
||||||
return await newImage
|
// case TextureMutation.RoughnessMetallicness: {
|
||||||
.joinChannel(await Promise.all([roughness, metallicness]))
|
// const newImage = sharp(Buffer.alloc(raw.width * raw.height), {
|
||||||
.jpeg()
|
// raw: { ...raw, channels: 1 },
|
||||||
.toBuffer();
|
// });
|
||||||
}
|
// const metallicness = sharp(raw.data, { raw })
|
||||||
|
// .extractChannel("green")
|
||||||
|
// .jpeg()
|
||||||
|
// .toBuffer();
|
||||||
|
// const roughness = sharp(raw.data, { raw })
|
||||||
|
// .extractChannel("alpha")
|
||||||
|
// .jpeg()
|
||||||
|
// .toBuffer();
|
||||||
|
|
||||||
case TextureMutation.Miscellaneous: {
|
// return await newImage
|
||||||
/**
|
// .joinChannel(await Promise.all([roughness, metallicness]))
|
||||||
* Alpha is ambient occlusion and green is emissive. But very few tanks
|
// .jpeg()
|
||||||
* use emissive so I am ignoring it for now.
|
// .toBuffer();
|
||||||
*/
|
// }
|
||||||
return await sharp(raw.data, { raw })
|
|
||||||
.extractChannel('alpha')
|
|
||||||
.jpeg()
|
|
||||||
.toBuffer();
|
|
||||||
}
|
|
||||||
|
|
||||||
case TextureMutation.Albedo: {
|
// case TextureMutation.Miscellaneous: {
|
||||||
return await sharp(raw.data, { raw }).removeAlpha().jpeg().toBuffer();
|
// /**
|
||||||
}
|
// * Alpha is ambient occlusion and green is emissive. But very few tanks
|
||||||
|
// * use emissive so I am ignoring it for now.
|
||||||
|
// */
|
||||||
|
// return await sharp(raw.data, { raw })
|
||||||
|
// .extractChannel("alpha")
|
||||||
|
// .jpeg()
|
||||||
|
// .toBuffer();
|
||||||
|
// }
|
||||||
|
|
||||||
default:
|
// case TextureMutation.Albedo: {
|
||||||
return await sharp(raw.data, { raw }).jpeg().toBuffer();
|
// return await sharp(raw.data, { raw }).removeAlpha().jpeg().toBuffer();
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
// default:
|
||||||
|
// return await sharp(raw.data, { raw }).jpeg().toBuffer();
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
@@ -1,10 +1,18 @@
|
|||||||
|
import { asset } from '@blitzkit/core';
|
||||||
import ProgressBar from 'progress';
|
import ProgressBar from 'progress';
|
||||||
|
import { compareUint8Arrays } from './compareUint8Arrays';
|
||||||
import { GithubChangeBlob, createBlob } from './createBlob';
|
import { GithubChangeBlob, createBlob } from './createBlob';
|
||||||
import { octokit } from './octokit';
|
import { octokit } from './octokit';
|
||||||
|
|
||||||
export interface FileChange {
|
export interface FileChange {
|
||||||
path: string;
|
path: string;
|
||||||
content: Buffer;
|
content: Uint8Array;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum DiffStatus {
|
||||||
|
New,
|
||||||
|
Changed,
|
||||||
|
Unchanged,
|
||||||
}
|
}
|
||||||
|
|
||||||
const heuristicFormats = ['glb', 'webp', 'jpg', 'png'];
|
const heuristicFormats = ['glb', 'webp', 'jpg', 'png'];
|
||||||
@@ -19,72 +27,61 @@ export async function commitMultipleFiles(
|
|||||||
|
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
changesRaw.map(async (change) => {
|
changesRaw.map(async (change) => {
|
||||||
const blobPath = `${repoRaw}/${branch}/${change.path}`;
|
const response = await fetch(asset(change.path), {
|
||||||
const response = await fetch(
|
headers: { 'Accept-Encoding': 'identity' },
|
||||||
`https://raw.githubusercontent.com/${blobPath}`,
|
});
|
||||||
);
|
let diff: { change: number; status: DiffStatus };
|
||||||
let isNew: boolean;
|
|
||||||
let isDifferent: boolean;
|
|
||||||
let diff: number;
|
|
||||||
|
|
||||||
if (response.status === 404) {
|
if (response.status === 404) {
|
||||||
isNew = true;
|
diff = { change: change.content.length, status: DiffStatus.New };
|
||||||
diff = change.content.length;
|
|
||||||
isDifferent = true;
|
|
||||||
} else if (
|
} else if (
|
||||||
response.headers.has('Content-Length') &&
|
response.headers.has('Content-Length') &&
|
||||||
parseInt(response.headers.get('Content-Length')!) !==
|
Number(response.headers.get('Content-Length')) !== change.content.length
|
||||||
change.content.length
|
|
||||||
) {
|
) {
|
||||||
isNew = false;
|
diff = {
|
||||||
diff =
|
change:
|
||||||
change.content.length -
|
change.content.length -
|
||||||
parseInt(response.headers.get('Content-Length')!);
|
Number(response.headers.get('Content-Length')),
|
||||||
isDifferent = true;
|
status: DiffStatus.Changed,
|
||||||
|
};
|
||||||
} else if (response.status === 200) {
|
} else if (response.status === 200) {
|
||||||
isNew = false;
|
if (
|
||||||
const buffer = Buffer.from(await response.arrayBuffer());
|
heuristicFormats.some((format) => change.path.endsWith(`.${format}`))
|
||||||
|
) {
|
||||||
if (buffer.equals(change.content)) {
|
/**
|
||||||
diff = 0;
|
* Heuristic: if it's a large blob like a .glb, a diff = 0 might end
|
||||||
isDifferent = false;
|
* up being a false positive with isDifferent = true. So, it's okay
|
||||||
|
* to assume it's unchanged.
|
||||||
|
*/
|
||||||
|
diff = { change: 0, status: DiffStatus.Unchanged };
|
||||||
} else {
|
} else {
|
||||||
diff = change.content.length - buffer.length;
|
const buffer = new Uint8Array(await response.arrayBuffer());
|
||||||
isDifferent = true;
|
|
||||||
|
if (compareUint8Arrays(buffer, change.content)) {
|
||||||
|
diff = { change: 0, status: DiffStatus.Unchanged };
|
||||||
|
} else {
|
||||||
|
diff = {
|
||||||
|
change: change.content.length - buffer.length,
|
||||||
|
status: DiffStatus.Changed,
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`Unexpected status code ${response.status} for ${blobPath}`,
|
`Unexpected status code ${response.status} for ${change.path}`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
if (diff.status === DiffStatus.Unchanged) {
|
||||||
* Heuristic: if it's a large blob like a .glb, a diff = 0 might end up
|
// just don't bother
|
||||||
* being a false positive with isDifferent = true. So, it's okay to
|
// console.log(`🔵 (${diff.change.toLocaleString()}B) ${change.path}`);
|
||||||
* assume it's unchanged.
|
|
||||||
*/
|
|
||||||
if (
|
|
||||||
diff === 0 &&
|
|
||||||
heuristicFormats.some((format) => change.path.endsWith(`.${format}`))
|
|
||||||
) {
|
|
||||||
isDifferent = false;
|
|
||||||
isNew = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isNew) {
|
|
||||||
console.log(
|
|
||||||
`🟢 (+${change.content.length.toLocaleString()}B) ${blobPath}`,
|
|
||||||
);
|
|
||||||
changes.push(change);
|
|
||||||
} else if (isDifferent) {
|
|
||||||
console.log(
|
|
||||||
`🟡 (${diff > 0 ? '+' : ''}${diff.toLocaleString()}B) ${blobPath}`,
|
|
||||||
);
|
|
||||||
changes.push(change);
|
|
||||||
} else {
|
} else {
|
||||||
console.log(
|
console.log(
|
||||||
`🔵 (${change.content.length.toLocaleString()}B) ${blobPath}`,
|
`${
|
||||||
|
diff.status === DiffStatus.New ? '🟢' : '🟡'
|
||||||
|
} (${diff.change > 0 ? '+' : ''}${diff.change.toLocaleString()}B) ${change.path}`,
|
||||||
);
|
);
|
||||||
|
changes.push(change);
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
export function compareUint8Arrays(a: Uint8Array, b: Uint8Array) {
|
||||||
|
if (a.length !== b.length) return false;
|
||||||
|
|
||||||
|
for (let index = 0; index < a.length; index++) {
|
||||||
|
if (a[index] !== b[index]) return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
@@ -20,7 +20,7 @@ export const createBlob = throttle(
|
|||||||
await octokit.git.createBlob({
|
await octokit.git.createBlob({
|
||||||
owner,
|
owner,
|
||||||
repo,
|
repo,
|
||||||
content: change.content.toString('base64'),
|
content: Buffer.from(change.content).toString('base64'),
|
||||||
encoding: 'base64',
|
encoding: 'base64',
|
||||||
})
|
})
|
||||||
).data;
|
).data;
|
||||||
@@ -34,6 +34,7 @@ export const createBlob = throttle(
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.warn(
|
console.warn(
|
||||||
`Failed blob ${change.path}; retrying in ${TIME_PER_BLOB}ms...`,
|
`Failed blob ${change.path}; retrying in ${TIME_PER_BLOB}ms...`,
|
||||||
|
error,
|
||||||
);
|
);
|
||||||
|
|
||||||
await new Promise((resolve) => setTimeout(resolve, TIME_PER_BLOB));
|
await new Promise((resolve) => setTimeout(resolve, TIME_PER_BLOB));
|
||||||
|
|||||||
@@ -134,14 +134,12 @@ function post() {
|
|||||||
const files = idsChunked.map((chunk, index) => {
|
const files = idsChunked.map((chunk, index) => {
|
||||||
const didsWriteStream = new DidsWriteStream().dids(chunk);
|
const didsWriteStream = new DidsWriteStream().dids(chunk);
|
||||||
const buffer = didsWriteStream.uint8Array;
|
const buffer = didsWriteStream.uint8Array;
|
||||||
const compressed = compress(buffer);
|
const content = compress(buffer);
|
||||||
|
|
||||||
console.log(
|
console.log(
|
||||||
`Chunk ${index} with ${chunk.length} ids (compressed: ${compressed.length}; uncompressed: ${buffer.length})`,
|
`Chunk ${index} with ${chunk.length} ids (compressed: ${content.length}; uncompressed: ${buffer.length})`,
|
||||||
);
|
);
|
||||||
|
|
||||||
const content = Buffer.from(compressed);
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
content,
|
content,
|
||||||
path: `ids/${index}.dids.lz4`,
|
path: `ids/${index}.dids.lz4`,
|
||||||
@@ -151,13 +149,12 @@ function post() {
|
|||||||
commitAssets('discovered ids', [
|
commitAssets('discovered ids', [
|
||||||
...files,
|
...files,
|
||||||
{
|
{
|
||||||
content: Buffer.from(
|
content: new TextEncoder().encode(
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
chunks: idsChunked.length,
|
chunks: idsChunked.length,
|
||||||
count: ids.length,
|
count: ids.length,
|
||||||
time: Date.now(),
|
time: Date.now(),
|
||||||
} satisfies DiscoveredIdsDefinitions),
|
} satisfies DiscoveredIdsDefinitions),
|
||||||
'utf-8',
|
|
||||||
),
|
),
|
||||||
path: 'ids/manifest.json',
|
path: 'ids/manifest.json',
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import {
|
import {
|
||||||
asset,
|
asset,
|
||||||
encodePBBuffer,
|
|
||||||
fetchTankDefinitions,
|
fetchTankDefinitions,
|
||||||
Reviews,
|
Reviews,
|
||||||
Video,
|
Video,
|
||||||
@@ -81,7 +80,7 @@ for (const tank of tanksSanitized) {
|
|||||||
}
|
}
|
||||||
await commitAssets('reviews', [
|
await commitAssets('reviews', [
|
||||||
{
|
{
|
||||||
content: encodePBBuffer(Reviews, reviews),
|
content: Reviews.encode(reviews).finish(),
|
||||||
path: 'definitions/reviews.pb',
|
path: 'definitions/reviews.pb',
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"name": "varuna",
|
||||||
|
"type": "module",
|
||||||
|
"main": "src/index.ts",
|
||||||
|
"dependencies": {
|
||||||
|
"react": "^18.3.1"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,115 @@
|
|||||||
|
import { produce } from "immer";
|
||||||
|
import { merge } from "lodash-es";
|
||||||
|
import { useEffect, useState } from "react";
|
||||||
|
|
||||||
|
export class Varuna<Type, Arguments = void> {
|
||||||
|
private listeners = new Set<(state: Type) => void>();
|
||||||
|
|
||||||
|
private initialized = false;
|
||||||
|
private _initial?: Type;
|
||||||
|
private _state?: Type;
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
private creator: Type | ((...args: Arguments[]) => Type),
|
||||||
|
private persistence?: string
|
||||||
|
) {
|
||||||
|
if (typeof creator !== "function") this.initialize(creator);
|
||||||
|
}
|
||||||
|
|
||||||
|
private initialize(initial: Type) {
|
||||||
|
let data = initial;
|
||||||
|
|
||||||
|
if (this.persistence && typeof localStorage !== "undefined") {
|
||||||
|
const instance = this;
|
||||||
|
const dehydrated = localStorage.getItem(this.persistence);
|
||||||
|
|
||||||
|
if (dehydrated) {
|
||||||
|
const rehydrated = JSON.parse(dehydrated) as unknown;
|
||||||
|
data = merge(data, rehydrated);
|
||||||
|
}
|
||||||
|
|
||||||
|
window.addEventListener("beforeunload", () => {
|
||||||
|
localStorage.setItem(this.persistence!, JSON.stringify(instance.state));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
this.initialized = true;
|
||||||
|
this._initial = data;
|
||||||
|
this._state = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
useInitialization(...args: Arguments[]) {
|
||||||
|
if (this.initialized) return;
|
||||||
|
|
||||||
|
if (typeof this.creator !== "function") {
|
||||||
|
throw new Error("Provider must be used with a function creator");
|
||||||
|
}
|
||||||
|
|
||||||
|
this.initialize((this.creator as (...args: Arguments[]) => Type)(...args));
|
||||||
|
}
|
||||||
|
|
||||||
|
private dispatch() {
|
||||||
|
const state = this.state;
|
||||||
|
this.listeners.forEach((callback) => callback(state));
|
||||||
|
}
|
||||||
|
|
||||||
|
on<Slice>(slicer: (state: Type) => Slice, callback: (state: Slice) => void) {
|
||||||
|
let last = slicer(this.state);
|
||||||
|
|
||||||
|
function listener(state: Type) {
|
||||||
|
const next = slicer(state);
|
||||||
|
|
||||||
|
if (next !== last) {
|
||||||
|
callback(next);
|
||||||
|
last = next;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.listeners.add(listener);
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
this.listeners.delete(listener);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
mutate(mutator: (state: Type) => void) {
|
||||||
|
this.set(produce(this.state, mutator));
|
||||||
|
}
|
||||||
|
|
||||||
|
private assertInitialized() {
|
||||||
|
if (!this.initialized) {
|
||||||
|
throw new Error("Varuna store used before initialization");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
get state() {
|
||||||
|
this.assertInitialized();
|
||||||
|
return this._state as Type;
|
||||||
|
}
|
||||||
|
|
||||||
|
set(state: Type) {
|
||||||
|
this.assertInitialized();
|
||||||
|
this._state = state;
|
||||||
|
this.dispatch();
|
||||||
|
}
|
||||||
|
|
||||||
|
get initial() {
|
||||||
|
this.assertInitialized();
|
||||||
|
return this._initial as Type;
|
||||||
|
}
|
||||||
|
|
||||||
|
use<Slice = Type>(
|
||||||
|
slicer: (state: Type) => Slice = (state) => state as unknown as Slice
|
||||||
|
) {
|
||||||
|
return this.useDeferred(slicer, slicer(this.state));
|
||||||
|
}
|
||||||
|
|
||||||
|
useDeferred<Slice = Type>(slicer: (state: Type) => Slice, initial: Slice) {
|
||||||
|
const instance = this;
|
||||||
|
const [slice, setSlice] = useState(initial);
|
||||||
|
|
||||||
|
useEffect(() => instance.on(slicer, setSlice), []);
|
||||||
|
|
||||||
|
return slice;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"extends": "../../tsconfig.json"
|
||||||
|
}
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
// @ts-check
|
// @ts-check
|
||||||
|
|
||||||
import partytown from '@astrojs/partytown';
|
|
||||||
import react from '@astrojs/react';
|
import react from '@astrojs/react';
|
||||||
import sitemap from '@astrojs/sitemap';
|
import sitemap from '@astrojs/sitemap';
|
||||||
import { SUPPORTED_LOCALES } from '@blitzkit/i18n';
|
import { SUPPORTED_LOCALES } from '@blitzkit/i18n';
|
||||||
@@ -21,7 +20,7 @@ export default defineConfig({
|
|||||||
outDir: '../../dist/website',
|
outDir: '../../dist/website',
|
||||||
prefetch: true,
|
prefetch: true,
|
||||||
|
|
||||||
integrations: [react(), sitemap(), partytown()],
|
integrations: [react(), sitemap()],
|
||||||
vite: {
|
vite: {
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
|
|||||||
@@ -10,10 +10,10 @@
|
|||||||
"astro": "astro"
|
"astro": "astro"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@astrojs/partytown": "^2.1.4",
|
|
||||||
"@astrolib/seo": "^1.0.0-beta.8",
|
"@astrolib/seo": "^1.0.0-beta.8",
|
||||||
"@blitzkit/core": "workspace:*",
|
"@blitzkit/core": "workspace:*",
|
||||||
"@blitzkit/i18n": "workspace:*",
|
"@blitzkit/i18n": "workspace:*",
|
||||||
|
"varuna": "workspace:*",
|
||||||
"@fontsource/inter": "^5.2.5",
|
"@fontsource/inter": "^5.2.5",
|
||||||
"@nanostores/persistent": "^0.10.2",
|
"@nanostores/persistent": "^0.10.2",
|
||||||
"@nanostores/react": "^0.7.3",
|
"@nanostores/react": "^0.7.3",
|
||||||
@@ -36,8 +36,7 @@
|
|||||||
"react-dom": "^18.3.1",
|
"react-dom": "^18.3.1",
|
||||||
"react-promise-suspense": "^0.3.4",
|
"react-promise-suspense": "^0.3.4",
|
||||||
"three": "^0.169.0",
|
"three": "^0.169.0",
|
||||||
"urlon": "^3.1.0",
|
"urlon": "^3.1.0"
|
||||||
"zustand": "^4.5.5"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@astrojs/check": "^0.9.4",
|
"@astrojs/check": "^0.9.4",
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
dh=ecd11a058908f58ccea092ed17aa43ace59 4b9a5
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 490 KiB After Width: | Height: | Size: 669 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 5.2 KiB |
@@ -1,4 +1,4 @@
|
|||||||
import { ReloadIcon } from '@radix-ui/react-icons';
|
import { ReloadIcon } from "@radix-ui/react-icons";
|
||||||
import {
|
import {
|
||||||
Card,
|
Card,
|
||||||
Code,
|
Code,
|
||||||
@@ -6,26 +6,21 @@ import {
|
|||||||
IconButton,
|
IconButton,
|
||||||
Text,
|
Text,
|
||||||
TextField,
|
TextField,
|
||||||
} from '@radix-ui/themes';
|
} from "@radix-ui/themes";
|
||||||
import { Html } from '@react-three/drei';
|
import { Html } from "@react-three/drei";
|
||||||
import { useRef } from 'react';
|
import { useRef } from "react";
|
||||||
import { radToDeg } from 'three/src/math/MathUtils.js';
|
import { radToDeg } from "three/src/math/MathUtils.js";
|
||||||
import { resolveArmorIndex } from '../../../core/blitzkit/resolveArmorIndex';
|
import { resolveArmorIndex } from "../../../core/blitzkit/resolveArmorIndex";
|
||||||
import { App } from '../../../stores/app';
|
import { App } from "../../../stores/app";
|
||||||
import { Duel } from '../../../stores/duel';
|
import { Duel } from "../../../stores/duel";
|
||||||
import { TankopediaEphemeral } from '../../../stores/tankopediaEphemeral';
|
import { Tankopedia } from "../../../stores/tankopedia";
|
||||||
import { layerTypeNames } from './ShotDisplayCard';
|
import { layerTypeNames } from "./ShotDisplayCard";
|
||||||
import { ArmorType } from './SpacedArmorScene';
|
import { ArmorType } from "./SpacedArmorScene";
|
||||||
|
|
||||||
export function ArmorPlateDisplay() {
|
export function ArmorPlateDisplay() {
|
||||||
const highlightArmor = TankopediaEphemeral.use(
|
const highlightArmor = Tankopedia.use((state) => state.highlightArmor);
|
||||||
(state) => state.highlightArmor,
|
|
||||||
);
|
|
||||||
const mutateTankopediaEphemeral = TankopediaEphemeral.useMutation();
|
|
||||||
const developerMode = App.useDeferred((state) => state.developerMode, false);
|
const developerMode = App.useDeferred((state) => state.developerMode, false);
|
||||||
const duelStore = Duel.useStore();
|
|
||||||
const input = useRef<HTMLInputElement>(null);
|
const input = useRef<HTMLInputElement>(null);
|
||||||
const tankopediaEphemeralStore = TankopediaEphemeral.useStore();
|
|
||||||
|
|
||||||
if (highlightArmor === undefined) return null;
|
if (highlightArmor === undefined) return null;
|
||||||
|
|
||||||
@@ -33,20 +28,20 @@ export function ArmorPlateDisplay() {
|
|||||||
<group position={highlightArmor.point}>
|
<group position={highlightArmor.point}>
|
||||||
<Html
|
<Html
|
||||||
center
|
center
|
||||||
style={{ pointerEvents: highlightArmor.editingPlate ? 'auto' : 'none' }}
|
style={{ pointerEvents: highlightArmor.editingPlate ? "auto" : "none" }}
|
||||||
>
|
>
|
||||||
<Card
|
<Card
|
||||||
variant="classic"
|
variant="classic"
|
||||||
mb="4"
|
mb="4"
|
||||||
style={{
|
style={{
|
||||||
whiteSpace: 'nowrap',
|
whiteSpace: "nowrap",
|
||||||
color: highlightArmor.color,
|
color: highlightArmor.color,
|
||||||
transform: 'translateY(-50%)',
|
transform: "translateY(-50%)",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Flex direction="column">
|
<Flex direction="column">
|
||||||
<Text weight="bold">
|
<Text weight="bold">
|
||||||
{layerTypeNames[highlightArmor.type]}{' '}
|
{layerTypeNames[highlightArmor.type]}{" "}
|
||||||
{highlightArmor.thickness.toFixed(0)}
|
{highlightArmor.thickness.toFixed(0)}
|
||||||
<Text size="1" weight="regular">
|
<Text size="1" weight="regular">
|
||||||
mm
|
mm
|
||||||
@@ -92,35 +87,34 @@ export function ArmorPlateDisplay() {
|
|||||||
|
|
||||||
if (isNaN(thickness) || thickness < 0) return;
|
if (isNaN(thickness) || thickness < 0) return;
|
||||||
|
|
||||||
if (event.key === 'Enter') {
|
if (event.key === "Enter") {
|
||||||
input.current?.blur();
|
input.current?.blur();
|
||||||
|
|
||||||
mutateTankopediaEphemeral((draft) => {
|
Tankopedia.mutate((draft) => {
|
||||||
draft.highlightArmor = undefined;
|
draft.highlightArmor = undefined;
|
||||||
const { protagonist } = duelStore.getState();
|
const { protagonist } = Duel.state;
|
||||||
const tank = draft.model;
|
const tank = draft.model;
|
||||||
const turret = tank.turrets[protagonist.turret.id];
|
const turret = tank.turrets[protagonist.turret.id];
|
||||||
const gun =
|
const gun = turret.guns[protagonist.gun.id];
|
||||||
turret.guns[protagonist.gun.gun_type!.value.base.id];
|
|
||||||
const track = tank.tracks[protagonist.track.id];
|
const track = tank.tracks[protagonist.track.id];
|
||||||
|
|
||||||
if (highlightArmor.name.startsWith('hull_')) {
|
if (highlightArmor.name.startsWith("hull_")) {
|
||||||
tank.armor.thickness[index] = thickness;
|
tank.armor.thickness[index] = thickness;
|
||||||
} else if (highlightArmor.name.startsWith('turret_')) {
|
} else if (highlightArmor.name.startsWith("turret_")) {
|
||||||
turret.armor.thickness[index] = thickness;
|
turret.armor.thickness[index] = thickness;
|
||||||
} else if (highlightArmor.name.startsWith('gun_')) {
|
} else if (highlightArmor.name.startsWith("gun_")) {
|
||||||
if (highlightArmor.name.includes('_armor_')) {
|
if (highlightArmor.name.includes("_armor_")) {
|
||||||
gun.armor.thickness[index] = thickness;
|
gun.armor.thickness[index] = thickness;
|
||||||
} else {
|
} else {
|
||||||
gun.thickness = thickness;
|
gun.thickness = thickness;
|
||||||
}
|
}
|
||||||
} else if (highlightArmor.name.startsWith('chassis_')) {
|
} else if (highlightArmor.name.startsWith("chassis_")) {
|
||||||
track.thickness = thickness;
|
track.thickness = thickness;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (event.key === 'Escape') {
|
} else if (event.key === "Escape") {
|
||||||
input.current?.blur();
|
input.current?.blur();
|
||||||
mutateTankopediaEphemeral((draft) => {
|
Tankopedia.mutate((draft) => {
|
||||||
draft.highlightArmor = undefined;
|
draft.highlightArmor = undefined;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -138,7 +132,7 @@ export function ArmorPlateDisplay() {
|
|||||||
mt="2"
|
mt="2"
|
||||||
color="red"
|
color="red"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
mutateTankopediaEphemeral((draft) => {
|
Tankopedia.mutate((draft) => {
|
||||||
if (!highlightArmor.editingPlate) return;
|
if (!highlightArmor.editingPlate) return;
|
||||||
|
|
||||||
const index = resolveArmorIndex(highlightArmor.name);
|
const index = resolveArmorIndex(highlightArmor.name);
|
||||||
@@ -146,38 +140,33 @@ export function ArmorPlateDisplay() {
|
|||||||
if (index === undefined) return;
|
if (index === undefined) return;
|
||||||
|
|
||||||
draft.highlightArmor = undefined;
|
draft.highlightArmor = undefined;
|
||||||
const initialState =
|
const initialState = Tankopedia.initial;
|
||||||
tankopediaEphemeralStore.getInitialState();
|
const { protagonist } = Duel.state;
|
||||||
const { protagonist } = duelStore.getState();
|
|
||||||
const tank = draft.model;
|
const tank = draft.model;
|
||||||
const initialTank = initialState.model;
|
const initialTank = initialState.model;
|
||||||
const turret = tank.turrets[protagonist.turret.id];
|
const turret = tank.turrets[protagonist.turret.id];
|
||||||
const initialTurret =
|
const initialTurret =
|
||||||
initialTank.turrets[protagonist.turret.id];
|
initialTank.turrets[protagonist.turret.id];
|
||||||
const gun =
|
const gun = turret.guns[protagonist.gun.id];
|
||||||
turret.guns[protagonist.gun.gun_type!.value.base.id];
|
const initialGun = initialTurret.guns[protagonist.gun.id];
|
||||||
const initialGun =
|
|
||||||
initialTurret.guns[
|
|
||||||
protagonist.gun.gun_type!.value.base.id
|
|
||||||
];
|
|
||||||
const track = tank.tracks[protagonist.track.id];
|
const track = tank.tracks[protagonist.track.id];
|
||||||
const initialTrack =
|
const initialTrack =
|
||||||
initialTank.tracks[protagonist.track.id];
|
initialTank.tracks[protagonist.track.id];
|
||||||
|
|
||||||
if (highlightArmor.name.startsWith('hull_')) {
|
if (highlightArmor.name.startsWith("hull_")) {
|
||||||
tank.armor.thickness[index] =
|
tank.armor.thickness[index] =
|
||||||
initialTank.armor.thickness[index];
|
initialTank.armor.thickness[index];
|
||||||
} else if (highlightArmor.name.startsWith('turret_')) {
|
} else if (highlightArmor.name.startsWith("turret_")) {
|
||||||
turret.armor.thickness[index] =
|
turret.armor.thickness[index] =
|
||||||
initialTurret.armor.thickness[index];
|
initialTurret.armor.thickness[index];
|
||||||
} else if (highlightArmor.name.startsWith('gun_')) {
|
} else if (highlightArmor.name.startsWith("gun_")) {
|
||||||
if (highlightArmor.name.includes('_armor_')) {
|
if (highlightArmor.name.includes("_armor_")) {
|
||||||
gun.armor.thickness[index] =
|
gun.armor.thickness[index] =
|
||||||
initialGun.armor.thickness[index];
|
initialGun.armor.thickness[index];
|
||||||
} else {
|
} else {
|
||||||
gun.thickness = initialGun.thickness;
|
gun.thickness = initialGun.thickness;
|
||||||
}
|
}
|
||||||
} else if (highlightArmor.name.startsWith('chassis_')) {
|
} else if (highlightArmor.name.startsWith("chassis_")) {
|
||||||
track.thickness = initialTrack.thickness;
|
track.thickness = initialTrack.thickness;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ export const PrimaryArmorScene = memo(() => {
|
|||||||
const wrapper = useRef<Group>(null);
|
const wrapper = useRef<Group>(null);
|
||||||
const turretContainer = useRef<Group>(null);
|
const turretContainer = useRef<Group>(null);
|
||||||
const gunContainer = useRef<Group>(null);
|
const gunContainer = useRef<Group>(null);
|
||||||
// const protagonist = Duel.use((draft) => draft.protagonist);
|
|
||||||
const tank = Duel.use((state) => state.protagonist.tank);
|
const tank = Duel.use((state) => state.protagonist.tank);
|
||||||
const track = Duel.use((state) => state.protagonist.track);
|
const track = Duel.use((state) => state.protagonist.track);
|
||||||
const turret = Duel.use((state) => state.protagonist.turret);
|
const turret = Duel.use((state) => state.protagonist.turret);
|
||||||
@@ -24,8 +23,7 @@ export const PrimaryArmorScene = memo(() => {
|
|||||||
const tankModelDefinition = useTankModelDefinition();
|
const tankModelDefinition = useTankModelDefinition();
|
||||||
const trackModelDefinition = tankModelDefinition.tracks[track.id];
|
const trackModelDefinition = tankModelDefinition.tracks[track.id];
|
||||||
const turretModelDefinition = tankModelDefinition.turrets[turret.id];
|
const turretModelDefinition = tankModelDefinition.turrets[turret.id];
|
||||||
const gunModelDefinition =
|
const gunModelDefinition = turretModelDefinition.guns[gun.id];
|
||||||
turretModelDefinition.guns[gun.gun_type!.value.base.id];
|
|
||||||
const hullOrigin = correctZYTuple(trackModelDefinition.origin);
|
const hullOrigin = correctZYTuple(trackModelDefinition.origin);
|
||||||
const turretOrigin = correctZYTuple(tankModelDefinition.turret_origin);
|
const turretOrigin = correctZYTuple(tankModelDefinition.turret_origin);
|
||||||
const gunOrigin = correctZYTuple(turretModelDefinition.gun_origin);
|
const gunOrigin = correctZYTuple(turretModelDefinition.gun_origin);
|
||||||
|
|||||||
+64
-71
@@ -2,26 +2,28 @@ import {
|
|||||||
canSplash,
|
canSplash,
|
||||||
isExplosive,
|
isExplosive,
|
||||||
resolvePenetrationCoefficient,
|
resolvePenetrationCoefficient,
|
||||||
} from '@blitzkit/core';
|
} from "@blitzkit/core";
|
||||||
import { invalidate, useFrame } from '@react-three/fiber';
|
import { invalidate, useFrame } from "@react-three/fiber";
|
||||||
import { useEffect } from 'react';
|
import { useEffect } from "react";
|
||||||
import {
|
import {
|
||||||
MeshBasicMaterial,
|
MeshBasicMaterial,
|
||||||
|
NormalBlending,
|
||||||
Object3D,
|
Object3D,
|
||||||
ShaderMaterial,
|
ShaderMaterial,
|
||||||
|
SubtractiveBlending,
|
||||||
UniformsLib,
|
UniformsLib,
|
||||||
UniformsUtils,
|
UniformsUtils,
|
||||||
Vector2,
|
Vector2,
|
||||||
} from 'three';
|
} from "three";
|
||||||
import { degToRad } from 'three/src/math/MathUtils.js';
|
import { degToRad } from "three/src/math/MathUtils.js";
|
||||||
import { hasEquipment } from '../../../../core/blitzkit/hasEquipment';
|
import { hasEquipment } from "../../../../core/blitzkit/hasEquipment";
|
||||||
import { jsxTree } from '../../../../core/blitzkit/jsxTree';
|
import { jsxTree } from "../../../../core/blitzkit/jsxTree";
|
||||||
import { Duel, type EquipmentMatrix } from '../../../../stores/duel';
|
import { Duel, type EquipmentMatrix } from "../../../../stores/duel";
|
||||||
import { TankopediaEphemeral } from '../../../../stores/tankopediaEphemeral';
|
import { Tankopedia } from "../../../../stores/tankopedia";
|
||||||
import { TankopediaPersistent } from '../../../../stores/tankopediaPersistent';
|
import { TankopediaPersistent } from "../../../../stores/tankopediaPersistent";
|
||||||
import fragmentShader from './shaders/fragment.glsl?raw';
|
import fragmentShader from "./shaders/fragment.glsl?raw";
|
||||||
import vertexShader from './shaders/vertex.glsl?raw';
|
import vertexShader from "./shaders/vertex.glsl?raw";
|
||||||
import { spacedArmorRenderTarget } from './target';
|
import { spacedArmorRenderTarget } from "./target";
|
||||||
|
|
||||||
interface PrimaryArmorSceneComponentProps {
|
interface PrimaryArmorSceneComponentProps {
|
||||||
thickness: number;
|
thickness: number;
|
||||||
@@ -32,13 +34,13 @@ const excludeMaterial = new MeshBasicMaterial({
|
|||||||
colorWrite: false,
|
colorWrite: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const date = new Date();
|
||||||
|
const isHalloween = date.getMonth() === 9 && date.getDate() === 31;
|
||||||
|
|
||||||
export function PrimaryArmorSceneComponent({
|
export function PrimaryArmorSceneComponent({
|
||||||
node,
|
node,
|
||||||
thickness,
|
thickness,
|
||||||
}: PrimaryArmorSceneComponentProps) {
|
}: PrimaryArmorSceneComponentProps) {
|
||||||
const tankopediaPersistentStore = TankopediaPersistent.useStore();
|
|
||||||
const duelStore = Duel.useStore();
|
|
||||||
const tankopediaEphemeralStore = TankopediaEphemeral.useStore();
|
|
||||||
const material = new ShaderMaterial({
|
const material = new ShaderMaterial({
|
||||||
fragmentShader,
|
fragmentShader,
|
||||||
vertexShader,
|
vertexShader,
|
||||||
@@ -46,6 +48,8 @@ export function PrimaryArmorSceneComponent({
|
|||||||
fog: true,
|
fog: true,
|
||||||
transparent: true,
|
transparent: true,
|
||||||
|
|
||||||
|
blending: isHalloween ? SubtractiveBlending : NormalBlending,
|
||||||
|
|
||||||
uniforms: UniformsUtils.merge([
|
uniforms: UniformsUtils.merge([
|
||||||
UniformsLib.common,
|
UniformsLib.common,
|
||||||
UniformsLib.fog,
|
UniformsLib.fog,
|
||||||
@@ -73,30 +77,30 @@ export function PrimaryArmorSceneComponent({
|
|||||||
});
|
});
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
async function handleShellChange() {
|
function handleShellChange() {
|
||||||
const duel = duelStore.getState();
|
const tankopediaEphemeral = Tankopedia.state;
|
||||||
const tankopediaEphemeral = tankopediaEphemeralStore.getState();
|
const shell =
|
||||||
const shell = tankopediaEphemeral.customShell ?? duel.antagonist.shell;
|
tankopediaEphemeral.customShell ?? Duel.state.antagonist.shell;
|
||||||
|
|
||||||
material.uniforms.caliber.value = shell.caliber;
|
material.uniforms.caliber.value = shell.caliber;
|
||||||
material.uniforms.ricochet.value = degToRad(
|
material.uniforms.ricochet.value = degToRad(
|
||||||
isExplosive(shell.type) ? 90 : shell.ricochet!,
|
isExplosive(shell.type) ? 90 : shell.ricochet!
|
||||||
);
|
);
|
||||||
material.uniforms.normalization.value = degToRad(
|
material.uniforms.normalization.value = degToRad(
|
||||||
shell.normalization ?? 0,
|
shell.normalization ?? 0
|
||||||
);
|
);
|
||||||
material.uniforms.isExplosive.value = isExplosive(shell.type);
|
material.uniforms.isExplosive.value = isExplosive(shell.type);
|
||||||
material.uniforms.canSplash.value = canSplash(shell.type);
|
material.uniforms.canSplash.value = canSplash(shell.type);
|
||||||
material.uniforms.damage.value = shell.armor_damage;
|
material.uniforms.damage.value = shell.armor_damage;
|
||||||
material.uniforms.explosionRadius.value = shell.explosion_radius;
|
material.uniforms.explosionRadius.value = shell.explosion_radius;
|
||||||
|
|
||||||
await handleProtagonistEquipmentChange(
|
handleProtagonistEquipmentChange(
|
||||||
duel.protagonist.equipmentMatrix,
|
Duel.state.protagonist.equipmentMatrix,
|
||||||
true,
|
true
|
||||||
);
|
);
|
||||||
await handleAntagonistEquipmentChange(
|
handleAntagonistEquipmentChange(
|
||||||
duel.antagonist.equipmentMatrix,
|
Duel.state.antagonist.equipmentMatrix,
|
||||||
true,
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
invalidate();
|
invalidate();
|
||||||
@@ -114,15 +118,14 @@ export function PrimaryArmorSceneComponent({
|
|||||||
function handleWireframeChange(wireframe: boolean) {
|
function handleWireframeChange(wireframe: boolean) {
|
||||||
material.wireframe = wireframe;
|
material.wireframe = wireframe;
|
||||||
}
|
}
|
||||||
async function handleProtagonistEquipmentChange(
|
function handleProtagonistEquipmentChange(
|
||||||
equipment: EquipmentMatrix,
|
equipment: EquipmentMatrix,
|
||||||
noInvalidate = false,
|
noInvalidate = false
|
||||||
) {
|
) {
|
||||||
const duel = duelStore.getState();
|
const hasEnhancedArmor = hasEquipment(
|
||||||
const hasEnhancedArmor = await hasEquipment(
|
|
||||||
110,
|
110,
|
||||||
duel.protagonist.tank.equipment_preset,
|
Duel.state.protagonist.tank.equipment_preset,
|
||||||
equipment,
|
equipment
|
||||||
);
|
);
|
||||||
material.uniforms.thickness.value = hasEnhancedArmor
|
material.uniforms.thickness.value = hasEnhancedArmor
|
||||||
? thickness * 1.03
|
? thickness * 1.03
|
||||||
@@ -130,18 +133,18 @@ export function PrimaryArmorSceneComponent({
|
|||||||
|
|
||||||
if (!noInvalidate) invalidate();
|
if (!noInvalidate) invalidate();
|
||||||
}
|
}
|
||||||
async function handleAntagonistEquipmentChange(
|
function handleAntagonistEquipmentChange(
|
||||||
equipment: EquipmentMatrix,
|
equipment: EquipmentMatrix,
|
||||||
noInvalidate = false,
|
noInvalidate = false
|
||||||
) {
|
) {
|
||||||
const duel = duelStore.getState();
|
const tankopediaEphemeral = Tankopedia.state;
|
||||||
const tankopediaEphemeral = tankopediaEphemeralStore.getState();
|
const shell =
|
||||||
const shell = tankopediaEphemeral.customShell ?? duel.antagonist.shell;
|
tankopediaEphemeral.customShell ?? Duel.state.antagonist.shell;
|
||||||
const penetration = shell.penetration.near;
|
const penetration = shell.penetration.near;
|
||||||
const hasCalibratedShells = await hasEquipment(
|
const hasCalibratedShells = hasEquipment(
|
||||||
103,
|
103,
|
||||||
duel.antagonist.tank.equipment_preset,
|
Duel.state.antagonist.tank.equipment_preset,
|
||||||
equipment,
|
equipment
|
||||||
);
|
);
|
||||||
|
|
||||||
material.uniforms.penetration.value =
|
material.uniforms.penetration.value =
|
||||||
@@ -151,45 +154,35 @@ export function PrimaryArmorSceneComponent({
|
|||||||
if (!noInvalidate) invalidate();
|
if (!noInvalidate) invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
const initialState = tankopediaPersistentStore.getState();
|
|
||||||
|
|
||||||
handleShellChange();
|
handleShellChange();
|
||||||
handleGreenPenetrationChange(initialState.greenPenetration);
|
handleGreenPenetrationChange(TankopediaPersistent.state.greenPenetration);
|
||||||
handleAdvancedHighlightingChange(initialState.advancedHighlighting);
|
handleAdvancedHighlightingChange(
|
||||||
handleOpaqueChange(initialState.opaque);
|
TankopediaPersistent.state.advancedHighlighting
|
||||||
handleWireframeChange(initialState.wireframe);
|
|
||||||
handleProtagonistEquipmentChange(
|
|
||||||
duelStore.getState().protagonist.equipmentMatrix,
|
|
||||||
);
|
|
||||||
handleAntagonistEquipmentChange(
|
|
||||||
duelStore.getState().antagonist.equipmentMatrix,
|
|
||||||
);
|
);
|
||||||
|
handleOpaqueChange(TankopediaPersistent.state.opaque);
|
||||||
|
handleWireframeChange(TankopediaPersistent.state.wireframe);
|
||||||
|
handleProtagonistEquipmentChange(Duel.state.protagonist.equipmentMatrix);
|
||||||
|
handleAntagonistEquipmentChange(Duel.state.antagonist.equipmentMatrix);
|
||||||
|
|
||||||
const unsubscribes = [
|
const unsubscribes = [
|
||||||
duelStore.subscribe((state) => state.antagonist.shell, handleShellChange),
|
Duel.on((state) => state.antagonist.shell, handleShellChange),
|
||||||
tankopediaEphemeralStore.subscribe(
|
Tankopedia.on((state) => state.customShell, handleShellChange),
|
||||||
(state) => state.customShell,
|
TankopediaPersistent.on(
|
||||||
handleShellChange,
|
|
||||||
),
|
|
||||||
tankopediaPersistentStore.subscribe(
|
|
||||||
(state) => state.greenPenetration,
|
(state) => state.greenPenetration,
|
||||||
handleGreenPenetrationChange,
|
handleGreenPenetrationChange
|
||||||
),
|
),
|
||||||
tankopediaPersistentStore.subscribe(
|
TankopediaPersistent.on(
|
||||||
(state) => state.advancedHighlighting,
|
(state) => state.advancedHighlighting,
|
||||||
handleAdvancedHighlightingChange,
|
handleAdvancedHighlightingChange
|
||||||
),
|
),
|
||||||
tankopediaPersistentStore.subscribe(
|
TankopediaPersistent.on((state) => state.opaque, handleOpaqueChange),
|
||||||
(state) => state.opaque,
|
Duel.on(
|
||||||
handleOpaqueChange,
|
|
||||||
),
|
|
||||||
duelStore.subscribe(
|
|
||||||
(state) => state.protagonist.equipmentMatrix,
|
(state) => state.protagonist.equipmentMatrix,
|
||||||
(equipment) => handleProtagonistEquipmentChange(equipment),
|
(equipment) => handleProtagonistEquipmentChange(equipment)
|
||||||
),
|
),
|
||||||
duelStore.subscribe(
|
Duel.on(
|
||||||
(state) => state.antagonist.equipmentMatrix,
|
(state) => state.antagonist.equipmentMatrix,
|
||||||
(equipment) => handleAntagonistEquipmentChange(equipment),
|
(equipment) => handleAntagonistEquipmentChange(equipment)
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -200,7 +193,7 @@ export function PrimaryArmorSceneComponent({
|
|||||||
|
|
||||||
useFrame(({ gl, camera }) => {
|
useFrame(({ gl, camera }) => {
|
||||||
gl.getSize(material.uniforms.resolution.value).multiplyScalar(
|
gl.getSize(material.uniforms.resolution.value).multiplyScalar(
|
||||||
gl.getPixelRatio(),
|
gl.getPixelRatio()
|
||||||
);
|
);
|
||||||
material.uniforms.spacedArmorBuffer.value = spacedArmorRenderTarget.texture;
|
material.uniforms.spacedArmorBuffer.value = spacedArmorRenderTarget.texture;
|
||||||
material.uniforms.spacedArmorDepth.value =
|
material.uniforms.spacedArmorDepth.value =
|
||||||
|
|||||||
+6
-5
@@ -1,3 +1,5 @@
|
|||||||
|
precision mediump float;
|
||||||
|
|
||||||
#define USE_FOG
|
#define USE_FOG
|
||||||
|
|
||||||
#include <fog_pars_fragment>
|
#include <fog_pars_fragment>
|
||||||
@@ -23,7 +25,6 @@ uniform mat4 inverseProjectionMatrix;
|
|||||||
uniform highp sampler2D spacedArmorBuffer;
|
uniform highp sampler2D spacedArmorBuffer;
|
||||||
uniform highp sampler2D spacedArmorDepth;
|
uniform highp sampler2D spacedArmorDepth;
|
||||||
|
|
||||||
const float HALF = 0.5;
|
|
||||||
const float EXPLOSION_DAMAGE_FACTOR = 1.1;
|
const float EXPLOSION_DAMAGE_FACTOR = 1.1;
|
||||||
const float RANDOMIZATION_FACTOR = 0.05;
|
const float RANDOMIZATION_FACTOR = 0.05;
|
||||||
const float GREEN_VALUE = 0.392;
|
const float GREEN_VALUE = 0.392;
|
||||||
@@ -79,12 +80,12 @@ void main() {
|
|||||||
float distFromArmor = primaryDist - spacedDist;
|
float distFromArmor = primaryDist - spacedDist;
|
||||||
|
|
||||||
if (canSplash) {
|
if (canSplash) {
|
||||||
float finalDamage = HALF * damage * (1.0 - distFromArmor / explosionRadius) - EXPLOSION_DAMAGE_FACTOR * (finalThickness + spacedArmorThickness);
|
float finalDamage = 0.5 * damage * (1.0 - distFromArmor / explosionRadius) - EXPLOSION_DAMAGE_FACTOR * (finalThickness + spacedArmorThickness);
|
||||||
splashChance = step(0.0, finalDamage);
|
splashChance = step(0.0, finalDamage);
|
||||||
penetrationChance = 0.0;
|
penetrationChance = 0.0;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
remainingPen -= HALF * remainingPen * distFromArmor;
|
remainingPen -= 0.5 * remainingPen * distFromArmor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -96,13 +97,13 @@ void main() {
|
|||||||
penetrationChance = clamp(1.0 - (delta + randomization) / (2.0 * randomization), 0.0, 1.0);
|
penetrationChance = clamp(1.0 - (delta + randomization) / (2.0 * randomization), 0.0, 1.0);
|
||||||
|
|
||||||
if (canSplash) {
|
if (canSplash) {
|
||||||
float splashDamage = HALF * damage - EXPLOSION_DAMAGE_FACTOR * finalThickness;
|
float splashDamage = 0.5 * damage - EXPLOSION_DAMAGE_FACTOR * finalThickness;
|
||||||
splashChance = step(0.0, splashDamage);
|
splashChance = step(0.0, splashDamage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
float alpha = opaque ? 1.0 : HALF;
|
float alpha = opaque ? 1.0 : 0.5;
|
||||||
vec3 baseColor = vec3(1.0, splashChance * GREEN_VALUE, 0.0);
|
vec3 baseColor = vec3(1.0, splashChance * GREEN_VALUE, 0.0);
|
||||||
|
|
||||||
if (advancedHighlighting && didRicochet) {
|
if (advancedHighlighting && didRicochet) {
|
||||||
|
|||||||
+2
@@ -1,3 +1,5 @@
|
|||||||
|
precision mediump float;
|
||||||
|
|
||||||
#define USE_FOG
|
#define USE_FOG
|
||||||
|
|
||||||
#include <fog_pars_vertex>
|
#include <fog_pars_vertex>
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import { J_HAT, K_HAT } from '@blitzkit/core';
|
import { J_HAT, K_HAT } from "@blitzkit/core";
|
||||||
import { Box, Flex, Text } from '@radix-ui/themes';
|
import { Box, Flex, Text } from "@radix-ui/themes";
|
||||||
import { Html } from '@react-three/drei';
|
import { Html } from "@react-three/drei";
|
||||||
import { invalidate, useFrame } from '@react-three/fiber';
|
import { invalidate, useFrame } from "@react-three/fiber";
|
||||||
import { clamp } from 'lodash-es';
|
import { clamp } from "lodash-es";
|
||||||
import { useEffect, useRef, type ComponentProps } from 'react';
|
import { useEffect, useRef, type ComponentProps } from "react";
|
||||||
import {
|
import {
|
||||||
BufferGeometry,
|
BufferGeometry,
|
||||||
DoubleSide,
|
DoubleSide,
|
||||||
@@ -15,23 +15,24 @@ import {
|
|||||||
MeshBasicMaterial,
|
MeshBasicMaterial,
|
||||||
Path,
|
Path,
|
||||||
Quaternion,
|
Quaternion,
|
||||||
} from 'three';
|
} from "three";
|
||||||
import { LocaleProvider, useLocale } from '../../../hooks/useLocale';
|
import { isHalloween } from "../../../core/blitzkit/isHalloween";
|
||||||
|
import { LocaleProvider, useLocale } from "../../../hooks/useLocale";
|
||||||
import {
|
import {
|
||||||
TankopediaEphemeral,
|
Tankopedia,
|
||||||
type ShotLayerNonExternal,
|
type ShotLayerNonExternal,
|
||||||
type ShotStatus,
|
type ShotStatus,
|
||||||
} from '../../../stores/tankopediaEphemeral';
|
} from "../../../stores/tankopedia";
|
||||||
import { ShotDisplayCard } from './ShotDisplayCard';
|
import { ShotDisplayCard } from "./ShotDisplayCard";
|
||||||
|
|
||||||
export const shotStatusColors: Record<
|
export const shotStatusColors: Record<
|
||||||
ShotStatus,
|
ShotStatus,
|
||||||
ComponentProps<typeof Text>['color']
|
ComponentProps<typeof Text>["color"]
|
||||||
> = {
|
> = {
|
||||||
blocked: 'red',
|
blocked: "red",
|
||||||
penetration: 'green',
|
penetration: "green",
|
||||||
ricochet: 'yellow',
|
ricochet: "yellow",
|
||||||
splash: 'orange',
|
splash: "orange",
|
||||||
};
|
};
|
||||||
|
|
||||||
const SURFACE_POINT_SIZE = 12;
|
const SURFACE_POINT_SIZE = 12;
|
||||||
@@ -40,7 +41,7 @@ const TRACER_THICK = 1 / 32;
|
|||||||
const TRACER_THIN = TRACER_THICK / 2;
|
const TRACER_THIN = TRACER_THICK / 2;
|
||||||
|
|
||||||
export function ShotDisplay() {
|
export function ShotDisplay() {
|
||||||
const shot = TankopediaEphemeral.use((state) => state.shot);
|
const shot = Tankopedia.use((state) => state.shot);
|
||||||
const inTracer = useRef<Mesh>(null);
|
const inTracer = useRef<Mesh>(null);
|
||||||
const outTracer = useRef<Mesh>(null);
|
const outTracer = useRef<Mesh>(null);
|
||||||
const splashRadiusWrapper = useRef<Group>(null);
|
const splashRadiusWrapper = useRef<Group>(null);
|
||||||
@@ -51,16 +52,16 @@ export function ShotDisplay() {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (shot?.splashRadius !== undefined) {
|
if (shot?.splashRadius !== undefined) {
|
||||||
const outlineGeometry = new BufferGeometry().setFromPoints(
|
const outlineGeometry = new BufferGeometry().setFromPoints(
|
||||||
new Path().absarc(0, 0, 1, 0, Math.PI * 2).getSpacedPoints(50),
|
new Path().absarc(0, 0, 1, 0, Math.PI * 2).getSpacedPoints(50)
|
||||||
);
|
);
|
||||||
const outlineMaterial = new LineDashedMaterial({
|
const outlineMaterial = new LineDashedMaterial({
|
||||||
color: 'orange',
|
color: "orange",
|
||||||
dashSize: 0.05,
|
dashSize: 0.05,
|
||||||
gapSize: 0.025,
|
gapSize: 0.025,
|
||||||
});
|
});
|
||||||
const outline = new Line(
|
const outline = new Line(
|
||||||
outlineGeometry,
|
outlineGeometry,
|
||||||
outlineMaterial,
|
outlineMaterial
|
||||||
).computeLineDistances();
|
).computeLineDistances();
|
||||||
|
|
||||||
splashRadiusWrapper.current?.add(outline);
|
splashRadiusWrapper.current?.add(outline);
|
||||||
@@ -72,15 +73,12 @@ export function ShotDisplay() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const data = new Date();
|
|
||||||
const isHalloween = data.getMonth() === 9 && data.getDate() === 31;
|
|
||||||
|
|
||||||
if (
|
if (
|
||||||
isHalloween &&
|
isHalloween() &&
|
||||||
shot?.splashRadius !== undefined &&
|
shot?.splashRadius !== undefined &&
|
||||||
shot.in.status === 'penetration'
|
shot.in.status === "penetration"
|
||||||
) {
|
) {
|
||||||
const audio = new Audio('/assets/audio/lotta-damage.mp3');
|
const audio = new Audio("/assets/audio/lotta-damage.mp3");
|
||||||
|
|
||||||
audio.currentTime = 0.7;
|
audio.currentTime = 0.7;
|
||||||
audio.volume = 0.25;
|
audio.volume = 0.25;
|
||||||
@@ -136,11 +134,11 @@ export function ShotDisplay() {
|
|||||||
const outLength =
|
const outLength =
|
||||||
shot.out && shot.out.layers.length > 0
|
shot.out && shot.out.layers.length > 0
|
||||||
? (shot.in.layers.at(-1) as ShotLayerNonExternal).point.distanceTo(
|
? (shot.in.layers.at(-1) as ShotLayerNonExternal).point.distanceTo(
|
||||||
(shot.out.layers.at(-1) as ShotLayerNonExternal).point,
|
(shot.out.layers.at(-1) as ShotLayerNonExternal).point
|
||||||
)
|
)
|
||||||
: SHOT_DISPLAY_LENGTH_INFINITY;
|
: SHOT_DISPLAY_LENGTH_INFINITY;
|
||||||
const inLast = shot.in.layers.findLast(
|
const inLast = shot.in.layers.findLast(
|
||||||
(layer) => layer.type !== null,
|
(layer) => layer.type !== null
|
||||||
) as ShotLayerNonExternal;
|
) as ShotLayerNonExternal;
|
||||||
const outTitleColor = shot.out
|
const outTitleColor = shot.out
|
||||||
? shotStatusColors[shot.out.status]
|
? shotStatusColors[shot.out.status]
|
||||||
@@ -156,7 +154,7 @@ export function ShotDisplay() {
|
|||||||
position={inLast.point}
|
position={inLast.point}
|
||||||
ref={splashRadiusWrapper}
|
ref={splashRadiusWrapper}
|
||||||
rotation={new Euler().setFromQuaternion(
|
rotation={new Euler().setFromQuaternion(
|
||||||
new Quaternion().setFromUnitVectors(K_HAT, shot.in.surfaceNormal),
|
new Quaternion().setFromUnitVectors(K_HAT, shot.in.surfaceNormal)
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<mesh>
|
<mesh>
|
||||||
@@ -174,13 +172,13 @@ export function ShotDisplay() {
|
|||||||
<Html position={inLast.point} center>
|
<Html position={inLast.point} center>
|
||||||
<Box
|
<Box
|
||||||
style={{
|
style={{
|
||||||
pointerEvents: 'none',
|
pointerEvents: "none",
|
||||||
transform: `translateY(${tracerGoingUp ? 50 : -50}%)`,
|
transform: `translateY(${tracerGoingUp ? 50 : -50}%)`,
|
||||||
}}
|
}}
|
||||||
mb={tracerGoingUp ? '0' : '9'}
|
mb={tracerGoingUp ? "0" : "9"}
|
||||||
pb={tracerGoingUp ? '0' : '4'}
|
pb={tracerGoingUp ? "0" : "4"}
|
||||||
mt={tracerGoingUp ? '9' : '0'}
|
mt={tracerGoingUp ? "9" : "0"}
|
||||||
pt={tracerGoingUp ? '4' : '0'}
|
pt={tracerGoingUp ? "4" : "0"}
|
||||||
>
|
>
|
||||||
<LocaleProvider locale={locale}>
|
<LocaleProvider locale={locale}>
|
||||||
<ShotDisplayCard shot={shot} />
|
<ShotDisplayCard shot={shot} />
|
||||||
@@ -192,7 +190,7 @@ export function ShotDisplay() {
|
|||||||
if (layer.type === null) return null;
|
if (layer.type === null) return null;
|
||||||
|
|
||||||
const shotStatusColor =
|
const shotStatusColor =
|
||||||
shot.in.status === 'splash'
|
shot.in.status === "splash"
|
||||||
? shotStatusColors.splash
|
? shotStatusColors.splash
|
||||||
: shotStatusColors[layer.status];
|
: shotStatusColors[layer.status];
|
||||||
|
|
||||||
@@ -201,8 +199,8 @@ export function ShotDisplay() {
|
|||||||
position={layer.point}
|
position={layer.point}
|
||||||
key={index}
|
key={index}
|
||||||
style={{
|
style={{
|
||||||
pointerEvents: 'none',
|
pointerEvents: "none",
|
||||||
transform: 'translateY(-50%)',
|
transform: "translateY(-50%)",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Flex
|
<Flex
|
||||||
@@ -227,7 +225,7 @@ export function ShotDisplay() {
|
|||||||
<group
|
<group
|
||||||
position={inLast.point}
|
position={inLast.point}
|
||||||
rotation={new Euler().setFromQuaternion(
|
rotation={new Euler().setFromQuaternion(
|
||||||
new Quaternion().setFromUnitVectors(J_HAT, shot.in.surfaceNormal),
|
new Quaternion().setFromUnitVectors(J_HAT, shot.in.surfaceNormal)
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<mesh position={[0, inLength / 2, 0]} renderOrder={2}>
|
<mesh position={[0, inLength / 2, 0]} renderOrder={2}>
|
||||||
@@ -255,8 +253,8 @@ export function ShotDisplay() {
|
|||||||
rotation={new Euler().setFromQuaternion(
|
rotation={new Euler().setFromQuaternion(
|
||||||
new Quaternion().setFromUnitVectors(
|
new Quaternion().setFromUnitVectors(
|
||||||
J_HAT,
|
J_HAT,
|
||||||
shot.out.surfaceNormal.clone(),
|
shot.out.surfaceNormal.clone()
|
||||||
),
|
)
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<mesh position={[0, outLength / 2, 0]} renderOrder={2}>
|
<mesh position={[0, outLength / 2, 0]} renderOrder={2}>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { literals } from '@blitzkit/i18n/src/literals';
|
import { literals } from "@blitzkit/i18n/src/literals";
|
||||||
import {
|
import {
|
||||||
Card,
|
Card,
|
||||||
Flex,
|
Flex,
|
||||||
@@ -6,19 +6,19 @@ import {
|
|||||||
Separator,
|
Separator,
|
||||||
Text,
|
Text,
|
||||||
type CardProps,
|
type CardProps,
|
||||||
} from '@radix-ui/themes';
|
} from "@radix-ui/themes";
|
||||||
import type { ComponentProps } from 'react';
|
import type { ComponentProps } from "react";
|
||||||
import { radToDeg } from 'three/src/math/MathUtils.js';
|
import { radToDeg } from "three/src/math/MathUtils.js";
|
||||||
import { useLocale } from '../../../hooks/useLocale';
|
import { useLocale } from "../../../hooks/useLocale";
|
||||||
import type { Shot, ShotLayer } from '../../../stores/tankopediaEphemeral';
|
import type { Shot, ShotLayer } from "../../../stores/tankopedia";
|
||||||
import { shotStatusColors } from './ShotDisplay';
|
import { shotStatusColors } from "./ShotDisplay";
|
||||||
import { ArmorType } from './SpacedArmorScene';
|
import { ArmorType } from "./SpacedArmorScene";
|
||||||
|
|
||||||
export const layerTypeNames = {
|
export const layerTypeNames = {
|
||||||
[ArmorType.Primary]: 'primary',
|
[ArmorType.Primary]: "primary",
|
||||||
[ArmorType.Spaced]: 'spaced',
|
[ArmorType.Spaced]: "spaced",
|
||||||
[ArmorType.External]: 'external',
|
[ArmorType.External]: "external",
|
||||||
null: 'gap',
|
null: "gap",
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
function LayerEntry({
|
function LayerEntry({
|
||||||
@@ -29,7 +29,7 @@ function LayerEntry({
|
|||||||
angle,
|
angle,
|
||||||
}: {
|
}: {
|
||||||
layerIndex?: string;
|
layerIndex?: string;
|
||||||
shotStatusColor: ComponentProps<typeof Text>['color'];
|
shotStatusColor: ComponentProps<typeof Text>["color"];
|
||||||
layerName: string;
|
layerName: string;
|
||||||
layer: ShotLayer;
|
layer: ShotLayer;
|
||||||
angle?: number;
|
angle?: number;
|
||||||
@@ -37,44 +37,38 @@ function LayerEntry({
|
|||||||
const { locale, strings } = useLocale();
|
const { locale, strings } = useLocale();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Flex align="center" gap="2">
|
<tr>
|
||||||
<Text size="1" color="gray" style={{ width: 12 }}>
|
<td>
|
||||||
{layerIndex}
|
<Text size="1" color="gray">
|
||||||
</Text>
|
{layerIndex}
|
||||||
<Text size="2" color={shotStatusColor} style={{ width: 48 }}>
|
</Text>
|
||||||
{layerName}
|
</td>
|
||||||
</Text>
|
|
||||||
|
|
||||||
{layer.type === null && (
|
<td>
|
||||||
<>
|
<Text size="2" color={shotStatusColor}>
|
||||||
<Text size="2" color={shotStatusColor} style={{ width: 64 }}>
|
{layerName}
|
||||||
|
</Text>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td>
|
||||||
|
{layer.type === null && (
|
||||||
|
<Text size="2" color={shotStatusColor}>
|
||||||
{literals(strings.common.units.mm, [
|
{literals(strings.common.units.mm, [
|
||||||
Math.round(layer.distance * 1000).toLocaleString(locale),
|
Math.round(layer.distance * 1000).toLocaleString(locale),
|
||||||
])}
|
])}
|
||||||
</Text>
|
</Text>
|
||||||
|
)}
|
||||||
|
|
||||||
<Text size="2" color="gray">
|
{layer.type === ArmorType.External && (
|
||||||
{literals(
|
<Text size="2" color={shotStatusColor}>
|
||||||
strings.website.tools.tankopedia.sandbox.dynamic.shot_card.stats
|
{literals(strings.common.units.mm, [
|
||||||
.ricochet_loss,
|
Math.round(layer.thickness).toLocaleString(locale),
|
||||||
[Math.max(-100, -50 * layer.distance).toFixed(0)],
|
])}
|
||||||
)}
|
|
||||||
</Text>
|
</Text>
|
||||||
</>
|
)}
|
||||||
)}
|
{(layer.type === ArmorType.Primary ||
|
||||||
|
layer.type === ArmorType.Spaced) && (
|
||||||
{layer.type === ArmorType.External && (
|
<Text size="2" color={shotStatusColor}>
|
||||||
<Text size="2" color={shotStatusColor} style={{ width: 64 }}>
|
|
||||||
{literals(strings.common.units.mm, [
|
|
||||||
Math.round(layer.thickness).toLocaleString(locale),
|
|
||||||
])}
|
|
||||||
</Text>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{(layer.type === ArmorType.Primary ||
|
|
||||||
layer.type === ArmorType.Spaced) && (
|
|
||||||
<>
|
|
||||||
<Text size="2" color={shotStatusColor} style={{ width: 80 }}>
|
|
||||||
{literals(
|
{literals(
|
||||||
angle === undefined
|
angle === undefined
|
||||||
? strings.common.units.mm
|
? strings.common.units.mm
|
||||||
@@ -83,20 +77,35 @@ function LayerEntry({
|
|||||||
[
|
[
|
||||||
Math.round(layer.thicknessAngled).toLocaleString(locale),
|
Math.round(layer.thicknessAngled).toLocaleString(locale),
|
||||||
radToDeg(angle ?? 0).toFixed(0),
|
radToDeg(angle ?? 0).toFixed(0),
|
||||||
],
|
]
|
||||||
)}
|
)}
|
||||||
</Text>
|
</Text>
|
||||||
|
)}
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td>
|
||||||
|
{layer.type === null && (
|
||||||
|
<Text size="2" color="gray">
|
||||||
|
{literals(
|
||||||
|
strings.website.tools.tankopedia.sandbox.dynamic.shot_card.stats
|
||||||
|
.ricochet_loss,
|
||||||
|
[Math.max(-100, -50 * layer.distance).toFixed(0)]
|
||||||
|
)}
|
||||||
|
</Text>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{(layer.type === ArmorType.Primary ||
|
||||||
|
layer.type === ArmorType.Spaced) && (
|
||||||
<Text size="2" color="gray">
|
<Text size="2" color="gray">
|
||||||
{literals(
|
{literals(
|
||||||
strings.website.tools.tankopedia.sandbox.dynamic.shot_card.stats
|
strings.website.tools.tankopedia.sandbox.dynamic.shot_card.stats
|
||||||
.nominal,
|
.nominal,
|
||||||
[Math.round(layer.thickness).toLocaleString(locale)],
|
[Math.round(layer.thickness).toLocaleString(locale)]
|
||||||
)}
|
)}
|
||||||
</Text>
|
</Text>
|
||||||
</>
|
)}
|
||||||
)}
|
</td>
|
||||||
</Flex>
|
</tr>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -115,7 +124,7 @@ export function ShotDisplayCard({ shot, ...props }: ShotDisplayCardProps) {
|
|||||||
const inTitleColor = shotStatusColors[shot.in.status];
|
const inTitleColor = shotStatusColors[shot.in.status];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card variant="classic" style={{ width: 300 }} {...props}>
|
<Card variant="classic" {...props}>
|
||||||
<Flex direction="column" gap="2">
|
<Flex direction="column" gap="2">
|
||||||
<Flex direction="column" gap="1">
|
<Flex direction="column" gap="1">
|
||||||
<Text color={inTitleColor} weight="bold">
|
<Text color={inTitleColor} weight="bold">
|
||||||
@@ -123,11 +132,16 @@ export function ShotDisplayCard({ shot, ...props }: ShotDisplayCardProps) {
|
|||||||
strings.website.tools.tankopedia.sandbox.dynamic.shot_card.status[
|
strings.website.tools.tankopedia.sandbox.dynamic.shot_card.status[
|
||||||
shot.in.status
|
shot.in.status
|
||||||
],
|
],
|
||||||
[Math.round(shot.damage).toLocaleString(locale)],
|
[Math.round(shot.damage).toLocaleString(locale)]
|
||||||
)}
|
)}
|
||||||
</Text>
|
</Text>
|
||||||
|
|
||||||
<Flex direction="column">
|
<table
|
||||||
|
style={{
|
||||||
|
whiteSpace: "nowrap",
|
||||||
|
borderSpacing: "var(--space-1) 0",
|
||||||
|
}}
|
||||||
|
>
|
||||||
{shot.in.layers.map((layer, index) => {
|
{shot.in.layers.map((layer, index) => {
|
||||||
const layerName =
|
const layerName =
|
||||||
strings.website.tools.tankopedia.sandbox.dynamic.shot_card
|
strings.website.tools.tankopedia.sandbox.dynamic.shot_card
|
||||||
@@ -141,7 +155,7 @@ export function ShotDisplayCard({ shot, ...props }: ShotDisplayCardProps) {
|
|||||||
? undefined
|
? undefined
|
||||||
: `${(shot.containsGaps ? index / 2 : index) + 1}.`;
|
: `${(shot.containsGaps ? index / 2 : index) + 1}.`;
|
||||||
const shotStatusColor =
|
const shotStatusColor =
|
||||||
shot.in.status === 'splash'
|
shot.in.status === "splash"
|
||||||
? shotStatusColors.splash
|
? shotStatusColors.splash
|
||||||
: shotStatusColors[layer.status];
|
: shotStatusColors[layer.status];
|
||||||
|
|
||||||
@@ -161,7 +175,7 @@ export function ShotDisplayCard({ shot, ...props }: ShotDisplayCardProps) {
|
|||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</Flex>
|
</table>
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|
||||||
{shot.out && shot.out.layers.length > 0 && (
|
{shot.out && shot.out.layers.length > 0 && (
|
||||||
@@ -188,7 +202,7 @@ export function ShotDisplayCard({ shot, ...props }: ShotDisplayCardProps) {
|
|||||||
{literals(
|
{literals(
|
||||||
strings.website.tools.tankopedia.sandbox.dynamic.shot_card
|
strings.website.tools.tankopedia.sandbox.dynamic.shot_card
|
||||||
.status[shot.out.status],
|
.status[shot.out.status],
|
||||||
[Math.round(shot.damage).toLocaleString(locale)],
|
[Math.round(shot.damage).toLocaleString(locale)]
|
||||||
)}
|
)}
|
||||||
</Text>
|
</Text>
|
||||||
|
|
||||||
@@ -210,7 +224,7 @@ export function ShotDisplayCard({ shot, ...props }: ShotDisplayCardProps) {
|
|||||||
1
|
1
|
||||||
}.`;
|
}.`;
|
||||||
const shotStatusColor =
|
const shotStatusColor =
|
||||||
shot.out!.status === 'splash'
|
shot.out!.status === "splash"
|
||||||
? shotStatusColors.splash
|
? shotStatusColors.splash
|
||||||
: shotStatusColors[layer.status];
|
: shotStatusColors[layer.status];
|
||||||
|
|
||||||
|
|||||||
@@ -36,8 +36,7 @@ export const SpacedArmorScene = memo<SpacedArmorSceneProps>(({ scene }) => {
|
|||||||
const tankModelDefinition = useTankModelDefinition();
|
const tankModelDefinition = useTankModelDefinition();
|
||||||
const trackModelDefinition = tankModelDefinition.tracks[track.id];
|
const trackModelDefinition = tankModelDefinition.tracks[track.id];
|
||||||
const turretModelDefinition = tankModelDefinition.turrets[turret.id];
|
const turretModelDefinition = tankModelDefinition.turrets[turret.id];
|
||||||
const gunModelDefinition =
|
const gunModelDefinition = turretModelDefinition.guns[gun.id];
|
||||||
turretModelDefinition.guns[gun.gun_type!.value.base.id];
|
|
||||||
const hullOrigin = correctZYTuple(trackModelDefinition.origin);
|
const hullOrigin = correctZYTuple(trackModelDefinition.origin);
|
||||||
const turretOrigin = correctZYTuple(tankModelDefinition.turret_origin);
|
const turretOrigin = correctZYTuple(tankModelDefinition.turret_origin);
|
||||||
const gunOrigin = correctZYTuple(turretModelDefinition.gun_origin);
|
const gunOrigin = correctZYTuple(turretModelDefinition.gun_origin);
|
||||||
|
|||||||
+34
-45
@@ -1,20 +1,20 @@
|
|||||||
import { resolvePenetrationCoefficient } from '@blitzkit/core';
|
import { resolvePenetrationCoefficient } from "@blitzkit/core";
|
||||||
import { useEffect } from 'react';
|
import { useEffect } from "react";
|
||||||
import {
|
import {
|
||||||
AdditiveBlending,
|
AdditiveBlending,
|
||||||
MeshBasicMaterial,
|
MeshBasicMaterial,
|
||||||
Object3D,
|
Object3D,
|
||||||
Plane,
|
Plane,
|
||||||
ShaderMaterial,
|
ShaderMaterial,
|
||||||
} from 'three';
|
} from "three";
|
||||||
import type { ArmorUserData, ExternalModuleVariant } from '../..';
|
import type { ArmorUserData, ExternalModuleVariant } from "../..";
|
||||||
import { hasEquipment } from '../../../../../../core/blitzkit/hasEquipment';
|
import { hasEquipment } from "../../../../../../core/blitzkit/hasEquipment";
|
||||||
import { jsxTree } from '../../../../../../core/blitzkit/jsxTree';
|
import { jsxTree } from "../../../../../../core/blitzkit/jsxTree";
|
||||||
import { Duel, type EquipmentMatrix } from '../../../../../../stores/duel';
|
import { Duel, type EquipmentMatrix } from "../../../../../../stores/duel";
|
||||||
import { TankopediaEphemeral } from '../../../../../../stores/tankopediaEphemeral';
|
import { Tankopedia } from "../../../../../../stores/tankopedia";
|
||||||
import { ArmorType } from '../../../SpacedArmorScene';
|
import { ArmorType } from "../../../SpacedArmorScene";
|
||||||
import fragmentShader from './shaders/fragment.glsl?raw';
|
import fragmentShader from "./shaders/fragment.glsl?raw";
|
||||||
import vertexShader from './shaders/vertex.glsl?raw';
|
import vertexShader from "./shaders/vertex.glsl?raw";
|
||||||
|
|
||||||
interface SpacedArmorSubExternalProps {
|
interface SpacedArmorSubExternalProps {
|
||||||
node: Object3D;
|
node: Object3D;
|
||||||
@@ -29,8 +29,6 @@ export function SpacedArmorSubExternal({
|
|||||||
variant,
|
variant,
|
||||||
clip,
|
clip,
|
||||||
}: SpacedArmorSubExternalProps) {
|
}: SpacedArmorSubExternalProps) {
|
||||||
const tankopediaEphemeralStore = TankopediaEphemeral.useStore();
|
|
||||||
const duelStore = Duel.useStore();
|
|
||||||
const material = new ShaderMaterial({
|
const material = new ShaderMaterial({
|
||||||
fragmentShader,
|
fragmentShader,
|
||||||
vertexShader,
|
vertexShader,
|
||||||
@@ -49,33 +47,30 @@ export function SpacedArmorSubExternal({
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
function handleShellChange() {
|
function handleShellChange() {
|
||||||
const duel = duelStore.getState();
|
const tankopediaEphemeral = Tankopedia.state;
|
||||||
const tankopediaEphemeral = tankopediaEphemeralStore.getState();
|
const shell =
|
||||||
const shell = tankopediaEphemeral.customShell ?? duel.antagonist.shell;
|
tankopediaEphemeral.customShell ?? Duel.state.antagonist.shell;
|
||||||
material.uniforms.penetration.value = shell.penetration.near;
|
material.uniforms.penetration.value = shell.penetration.near;
|
||||||
}
|
}
|
||||||
async function handleProtagonistEquipmentChange(
|
function handleProtagonistEquipmentChange(equipment: EquipmentMatrix) {
|
||||||
equipment: EquipmentMatrix,
|
const hasEnhancedArmor = hasEquipment(
|
||||||
) {
|
|
||||||
const duel = duelStore.getState();
|
|
||||||
const hasEnhancedArmor = await hasEquipment(
|
|
||||||
110,
|
110,
|
||||||
duel.protagonist.tank.equipment_preset,
|
Duel.state.protagonist.tank.equipment_preset,
|
||||||
equipment,
|
equipment
|
||||||
);
|
);
|
||||||
material.uniforms.thickness.value = hasEnhancedArmor
|
material.uniforms.thickness.value = hasEnhancedArmor
|
||||||
? thickness * 1.03
|
? thickness * 1.03
|
||||||
: thickness;
|
: thickness;
|
||||||
}
|
}
|
||||||
async function handleAntagonistEquipmentChange(equipment: EquipmentMatrix) {
|
function handleAntagonistEquipmentChange(equipment: EquipmentMatrix) {
|
||||||
const duel = duelStore.getState();
|
const tankopediaEphemeral = Tankopedia.state;
|
||||||
const tankopediaEphemeral = tankopediaEphemeralStore.getState();
|
const shell =
|
||||||
const shell = tankopediaEphemeral.customShell ?? duel.antagonist.shell;
|
tankopediaEphemeral.customShell ?? Duel.state.antagonist.shell;
|
||||||
const penetration = shell.penetration.near;
|
const penetration = shell.penetration.near;
|
||||||
const hasCalibratedShells = await hasEquipment(
|
const hasCalibratedShells = hasEquipment(
|
||||||
103,
|
103,
|
||||||
duel.antagonist.tank.equipment_preset,
|
Duel.state.antagonist.tank.equipment_preset,
|
||||||
equipment,
|
equipment
|
||||||
);
|
);
|
||||||
|
|
||||||
material.uniforms.penetration.value =
|
material.uniforms.penetration.value =
|
||||||
@@ -84,26 +79,19 @@ export function SpacedArmorSubExternal({
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleShellChange();
|
handleShellChange();
|
||||||
handleProtagonistEquipmentChange(
|
handleProtagonistEquipmentChange(Duel.state.protagonist.equipmentMatrix);
|
||||||
duelStore.getState().protagonist.equipmentMatrix,
|
handleAntagonistEquipmentChange(Duel.state.antagonist.equipmentMatrix);
|
||||||
);
|
|
||||||
handleAntagonistEquipmentChange(
|
|
||||||
duelStore.getState().antagonist.equipmentMatrix,
|
|
||||||
);
|
|
||||||
|
|
||||||
const unsubscribes = [
|
const unsubscribes = [
|
||||||
duelStore.subscribe((state) => state.antagonist.shell, handleShellChange),
|
Duel.on((state) => state.antagonist.shell, handleShellChange),
|
||||||
tankopediaEphemeralStore.subscribe(
|
Tankopedia.on((state) => state.customShell, handleShellChange),
|
||||||
(state) => state.customShell,
|
Duel.on(
|
||||||
handleShellChange,
|
|
||||||
),
|
|
||||||
duelStore.subscribe(
|
|
||||||
(state) => state.protagonist.equipmentMatrix,
|
(state) => state.protagonist.equipmentMatrix,
|
||||||
handleProtagonistEquipmentChange,
|
handleProtagonistEquipmentChange
|
||||||
),
|
),
|
||||||
duelStore.subscribe(
|
Duel.on(
|
||||||
(state) => state.antagonist.equipmentMatrix,
|
(state) => state.antagonist.equipmentMatrix,
|
||||||
handleAntagonistEquipmentChange,
|
handleAntagonistEquipmentChange
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -125,6 +113,7 @@ export function SpacedArmorSubExternal({
|
|||||||
return (
|
return (
|
||||||
<mesh
|
<mesh
|
||||||
{...props}
|
{...props}
|
||||||
|
onClick={() => {}}
|
||||||
key={`${key}-spaced-sub-external-exclude`}
|
key={`${key}-spaced-sub-external-exclude`}
|
||||||
renderOrder={3}
|
renderOrder={3}
|
||||||
material={
|
material={
|
||||||
|
|||||||
+2
@@ -1,3 +1,5 @@
|
|||||||
|
precision mediump float;
|
||||||
|
|
||||||
uniform float thickness;
|
uniform float thickness;
|
||||||
uniform float penetration;
|
uniform float penetration;
|
||||||
|
|
||||||
|
|||||||
+2
@@ -1,3 +1,5 @@
|
|||||||
|
precision mediump float;
|
||||||
|
|
||||||
#include <clipping_planes_pars_vertex>
|
#include <clipping_planes_pars_vertex>
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
|
|||||||
+36
-48
@@ -1,20 +1,20 @@
|
|||||||
import { isExplosive, resolvePenetrationCoefficient } from '@blitzkit/core';
|
import { isExplosive, resolvePenetrationCoefficient } from "@blitzkit/core";
|
||||||
import { useEffect } from 'react';
|
import { useEffect } from "react";
|
||||||
import {
|
import {
|
||||||
AdditiveBlending,
|
AdditiveBlending,
|
||||||
MeshBasicMaterial,
|
MeshBasicMaterial,
|
||||||
ShaderMaterial,
|
ShaderMaterial,
|
||||||
type Object3D,
|
type Object3D,
|
||||||
} from 'three';
|
} from "three";
|
||||||
import { degToRad } from 'three/src/math/MathUtils.js';
|
import { degToRad } from "three/src/math/MathUtils.js";
|
||||||
import type { ArmorUserData } from '../..';
|
import type { ArmorUserData } from "../..";
|
||||||
import { hasEquipment } from '../../../../../../core/blitzkit/hasEquipment';
|
import { hasEquipment } from "../../../../../../core/blitzkit/hasEquipment";
|
||||||
import { jsxTree } from '../../../../../../core/blitzkit/jsxTree';
|
import { jsxTree } from "../../../../../../core/blitzkit/jsxTree";
|
||||||
import { Duel, type EquipmentMatrix } from '../../../../../../stores/duel';
|
import { Duel, type EquipmentMatrix } from "../../../../../../stores/duel";
|
||||||
import { TankopediaEphemeral } from '../../../../../../stores/tankopediaEphemeral';
|
import { Tankopedia } from "../../../../../../stores/tankopedia";
|
||||||
import { ArmorType } from '../../../SpacedArmorScene';
|
import { ArmorType } from "../../../SpacedArmorScene";
|
||||||
import fragmentShader from './shaders/fragment.glsl?raw';
|
import fragmentShader from "./shaders/fragment.glsl?raw";
|
||||||
import vertexShader from './shaders/vertex.glsl?raw';
|
import vertexShader from "./shaders/vertex.glsl?raw";
|
||||||
|
|
||||||
interface SpacedArmorSubSpacedProps {
|
interface SpacedArmorSubSpacedProps {
|
||||||
node: Object3D;
|
node: Object3D;
|
||||||
@@ -30,8 +30,6 @@ export function SpacedArmorSubSpaced({
|
|||||||
node,
|
node,
|
||||||
thickness,
|
thickness,
|
||||||
}: SpacedArmorSubSpacedProps) {
|
}: SpacedArmorSubSpacedProps) {
|
||||||
const tankopediaEphemeralStore = TankopediaEphemeral.useStore();
|
|
||||||
const duelStore = Duel.useStore();
|
|
||||||
const material = new ShaderMaterial({
|
const material = new ShaderMaterial({
|
||||||
fragmentShader,
|
fragmentShader,
|
||||||
vertexShader,
|
vertexShader,
|
||||||
@@ -51,41 +49,38 @@ export function SpacedArmorSubSpaced({
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
function handleShellChange() {
|
function handleShellChange() {
|
||||||
const duel = duelStore.getState();
|
const tankopediaEphemeral = Tankopedia.state;
|
||||||
const tankopediaEphemeral = tankopediaEphemeralStore.getState();
|
const shell =
|
||||||
const shell = tankopediaEphemeral.customShell ?? duel.antagonist.shell;
|
tankopediaEphemeral.customShell ?? Duel.state.antagonist.shell;
|
||||||
|
|
||||||
material.uniforms.penetration.value = shell.penetration.near;
|
material.uniforms.penetration.value = shell.penetration.near;
|
||||||
material.uniforms.caliber.value = shell.caliber;
|
material.uniforms.caliber.value = shell.caliber;
|
||||||
material.uniforms.ricochet.value = degToRad(
|
material.uniforms.ricochet.value = degToRad(
|
||||||
isExplosive(shell.type) ? 90 : shell.ricochet!,
|
isExplosive(shell.type) ? 90 : shell.ricochet!
|
||||||
);
|
);
|
||||||
material.uniforms.normalization.value = degToRad(
|
material.uniforms.normalization.value = degToRad(
|
||||||
shell.normalization ?? 0,
|
shell.normalization ?? 0
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
async function handleProtagonistEquipmentChange(
|
function handleProtagonistEquipmentChange(equipment: EquipmentMatrix) {
|
||||||
equipment: EquipmentMatrix,
|
const hasEnhancedArmor = hasEquipment(
|
||||||
) {
|
|
||||||
const duel = duelStore.getState();
|
|
||||||
const hasEnhancedArmor = await hasEquipment(
|
|
||||||
110,
|
110,
|
||||||
duel.protagonist.tank.equipment_preset,
|
Duel.state.protagonist.tank.equipment_preset,
|
||||||
equipment,
|
equipment
|
||||||
);
|
);
|
||||||
material.uniforms.thickness.value = hasEnhancedArmor
|
material.uniforms.thickness.value = hasEnhancedArmor
|
||||||
? thickness * 1.03
|
? thickness * 1.03
|
||||||
: thickness;
|
: thickness;
|
||||||
}
|
}
|
||||||
async function handleAntagonistEquipmentChange(equipment: EquipmentMatrix) {
|
function handleAntagonistEquipmentChange(equipment: EquipmentMatrix) {
|
||||||
const duel = duelStore.getState();
|
const tankopediaEphemeral = Tankopedia.state;
|
||||||
const tankopediaEphemeral = tankopediaEphemeralStore.getState();
|
const shell =
|
||||||
const shell = tankopediaEphemeral.customShell ?? duel.antagonist.shell;
|
tankopediaEphemeral.customShell ?? Duel.state.antagonist.shell;
|
||||||
const penetration = shell.penetration.near;
|
const penetration = shell.penetration.near;
|
||||||
const hasCalibratedShells = await hasEquipment(
|
const hasCalibratedShells = hasEquipment(
|
||||||
103,
|
103,
|
||||||
duel.antagonist.tank.equipment_preset,
|
Duel.state.antagonist.tank.equipment_preset,
|
||||||
equipment,
|
equipment
|
||||||
);
|
);
|
||||||
|
|
||||||
material.uniforms.penetration.value =
|
material.uniforms.penetration.value =
|
||||||
@@ -94,26 +89,19 @@ export function SpacedArmorSubSpaced({
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleShellChange();
|
handleShellChange();
|
||||||
handleProtagonistEquipmentChange(
|
handleProtagonistEquipmentChange(Duel.state.protagonist.equipmentMatrix);
|
||||||
duelStore.getState().protagonist.equipmentMatrix,
|
handleAntagonistEquipmentChange(Duel.state.antagonist.equipmentMatrix);
|
||||||
);
|
|
||||||
handleAntagonistEquipmentChange(
|
|
||||||
duelStore.getState().antagonist.equipmentMatrix,
|
|
||||||
);
|
|
||||||
|
|
||||||
const unsubscribes = [
|
const unsubscribes = [
|
||||||
duelStore.subscribe((state) => state.antagonist.shell, handleShellChange),
|
Duel.on((state) => state.antagonist.shell, handleShellChange),
|
||||||
tankopediaEphemeralStore.subscribe(
|
Tankopedia.on((state) => state.customShell, handleShellChange),
|
||||||
(state) => state.customShell,
|
Duel.on(
|
||||||
handleShellChange,
|
|
||||||
),
|
|
||||||
duelStore.subscribe(
|
|
||||||
(state) => state.protagonist.equipmentMatrix,
|
(state) => state.protagonist.equipmentMatrix,
|
||||||
handleProtagonistEquipmentChange,
|
handleProtagonistEquipmentChange
|
||||||
),
|
),
|
||||||
duelStore.subscribe(
|
Duel.on(
|
||||||
(state) => state.antagonist.equipmentMatrix,
|
(state) => state.antagonist.equipmentMatrix,
|
||||||
handleAntagonistEquipmentChange,
|
handleAntagonistEquipmentChange
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
+2
@@ -1,3 +1,5 @@
|
|||||||
|
precision mediump float;
|
||||||
|
|
||||||
varying vec3 vNormal;
|
varying vec3 vNormal;
|
||||||
varying vec3 vViewPosition;
|
varying vec3 vViewPosition;
|
||||||
|
|
||||||
|
|||||||
+2
@@ -1,3 +1,5 @@
|
|||||||
|
precision mediump float;
|
||||||
|
|
||||||
varying vec3 vNormal;
|
varying vec3 vNormal;
|
||||||
varying vec3 vViewPosition;
|
varying vec3 vViewPosition;
|
||||||
|
|
||||||
|
|||||||
+64
-67
@@ -2,9 +2,9 @@ import {
|
|||||||
ShellType,
|
ShellType,
|
||||||
isExplosive,
|
isExplosive,
|
||||||
resolvePenetrationCoefficient,
|
resolvePenetrationCoefficient,
|
||||||
} from '@blitzkit/core';
|
} from "@blitzkit/core";
|
||||||
import { useThree } from '@react-three/fiber';
|
import { useThree } from "@react-three/fiber";
|
||||||
import { useCallback } from 'react';
|
import { useCallback } from "react";
|
||||||
import {
|
import {
|
||||||
type Intersection,
|
type Intersection,
|
||||||
MeshBasicMaterial,
|
MeshBasicMaterial,
|
||||||
@@ -14,21 +14,21 @@ import {
|
|||||||
Raycaster,
|
Raycaster,
|
||||||
Scene,
|
Scene,
|
||||||
Vector3,
|
Vector3,
|
||||||
} from 'three';
|
} from "three";
|
||||||
import { degToRad } from 'three/src/math/MathUtils.js';
|
import { degToRad } from "three/src/math/MathUtils.js";
|
||||||
import { hasEquipment } from '../../../../core/blitzkit/hasEquipment';
|
import { hasEquipment } from "../../../../core/blitzkit/hasEquipment";
|
||||||
import { jsxTree } from '../../../../core/blitzkit/jsxTree';
|
import { jsxTree } from "../../../../core/blitzkit/jsxTree";
|
||||||
import { discardClippingPlane } from '../../../../core/three/discardClippingPlane';
|
import { discardClippingPlane } from "../../../../core/three/discardClippingPlane";
|
||||||
import { Duel } from '../../../../stores/duel';
|
import { Duel } from "../../../../stores/duel";
|
||||||
import {
|
import {
|
||||||
type Shot,
|
type Shot,
|
||||||
type ShotLayerBase,
|
type ShotLayerBase,
|
||||||
type ShotLayerNonExternal,
|
type ShotLayerNonExternal,
|
||||||
TankopediaEphemeral,
|
Tankopedia,
|
||||||
} from '../../../../stores/tankopediaEphemeral';
|
} from "../../../../stores/tankopedia";
|
||||||
import { ArmorType } from '../SpacedArmorScene';
|
import { ArmorType } from "../SpacedArmorScene";
|
||||||
import { SpacedArmorSubExternal } from './components/SpacedArmorSubExternal';
|
import { SpacedArmorSubExternal } from "./components/SpacedArmorSubExternal";
|
||||||
import { SpacedArmorSubSpaced } from './components/SpacedArmorSubSpaced';
|
import { SpacedArmorSubSpaced } from "./components/SpacedArmorSubSpaced";
|
||||||
|
|
||||||
type SpacedArmorSceneComponentProps = {
|
type SpacedArmorSceneComponentProps = {
|
||||||
node: Object3D;
|
node: Object3D;
|
||||||
@@ -45,7 +45,7 @@ type SpacedArmorSceneComponentProps = {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
export type ExternalModuleVariant = 'gun' | 'track';
|
export type ExternalModuleVariant = "gun" | "track";
|
||||||
export type ArmorUserData = {
|
export type ArmorUserData = {
|
||||||
thickness: number;
|
thickness: number;
|
||||||
} & (
|
} & (
|
||||||
@@ -76,20 +76,17 @@ export function SpacedArmorSceneComponent({
|
|||||||
clip,
|
clip,
|
||||||
...props
|
...props
|
||||||
}: SpacedArmorSceneComponentProps) {
|
}: SpacedArmorSceneComponentProps) {
|
||||||
const tankopediaEphemeralStore = TankopediaEphemeral.useStore();
|
|
||||||
const duelStore = Duel.useStore();
|
|
||||||
const camera = useThree((state) => state.camera);
|
const camera = useThree((state) => state.camera);
|
||||||
|
|
||||||
const shoot = useCallback(
|
const shoot = useCallback(
|
||||||
async (
|
(
|
||||||
point: Vector3,
|
point: Vector3,
|
||||||
intersections: Intersection[],
|
intersections: Intersection[],
|
||||||
allowRicochet: boolean,
|
allowRicochet: boolean,
|
||||||
remainingPenetrationInput?: number,
|
remainingPenetrationInput?: number
|
||||||
) => {
|
) => {
|
||||||
const { antagonist, protagonist } = duelStore.getState();
|
const { customShell } = Tankopedia.state;
|
||||||
const { customShell } = tankopediaEphemeralStore.getState();
|
const shell = customShell ?? Duel.state.antagonist.shell;
|
||||||
const shell = customShell ?? antagonist.shell;
|
|
||||||
const cameraNormal = camera.position.clone().sub(point).normalize();
|
const cameraNormal = camera.position.clone().sub(point).normalize();
|
||||||
const shot: Shot = {
|
const shot: Shot = {
|
||||||
splashRadius:
|
splashRadius:
|
||||||
@@ -99,19 +96,19 @@ export function SpacedArmorSceneComponent({
|
|||||||
in: {
|
in: {
|
||||||
surfaceNormal: cameraNormal,
|
surfaceNormal: cameraNormal,
|
||||||
layers: [],
|
layers: [],
|
||||||
status: 'blocked',
|
status: "blocked",
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const hasCalibratedShells = await hasEquipment(
|
const hasCalibratedShells = hasEquipment(
|
||||||
103,
|
103,
|
||||||
antagonist.tank.equipment_preset,
|
Duel.state.antagonist.tank.equipment_preset,
|
||||||
antagonist.equipmentMatrix,
|
Duel.state.antagonist.equipmentMatrix
|
||||||
);
|
);
|
||||||
const hasEnhancedArmor = await hasEquipment(
|
const hasEnhancedArmor = hasEquipment(
|
||||||
110,
|
110,
|
||||||
protagonist.tank.equipment_preset,
|
Duel.state.protagonist.tank.equipment_preset,
|
||||||
protagonist.equipmentMatrix,
|
Duel.state.protagonist.equipmentMatrix
|
||||||
);
|
);
|
||||||
const penetration =
|
const penetration =
|
||||||
shell.penetration.near *
|
shell.penetration.near *
|
||||||
@@ -119,8 +116,8 @@ export function SpacedArmorSceneComponent({
|
|||||||
const thicknessCoefficient = hasEnhancedArmor ? 1.03 : 1;
|
const thicknessCoefficient = hasEnhancedArmor ? 1.03 : 1;
|
||||||
const filteredIntersections = intersections.filter(
|
const filteredIntersections = intersections.filter(
|
||||||
(intersection) =>
|
(intersection) =>
|
||||||
'type' in intersection.object.userData &&
|
"type" in intersection.object.userData &&
|
||||||
!discardClippingPlane(intersection.object, intersection.point),
|
!discardClippingPlane(intersection.object, intersection.point)
|
||||||
) as unknown as Intersection<Object3D & { userData: ArmorUserData }>[];
|
) as unknown as Intersection<Object3D & { userData: ArmorUserData }>[];
|
||||||
const encounteredExternalModuleVariants: ExternalModuleVariant[] = [];
|
const encounteredExternalModuleVariants: ExternalModuleVariant[] = [];
|
||||||
const noDuplicateIntersections: typeof filteredIntersections = [];
|
const noDuplicateIntersections: typeof filteredIntersections = [];
|
||||||
@@ -129,12 +126,12 @@ export function SpacedArmorSceneComponent({
|
|||||||
if (intersection.object.userData.type === ArmorType.External) {
|
if (intersection.object.userData.type === ArmorType.External) {
|
||||||
if (
|
if (
|
||||||
!encounteredExternalModuleVariants.includes(
|
!encounteredExternalModuleVariants.includes(
|
||||||
intersection.object.userData.variant,
|
intersection.object.userData.variant
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
noDuplicateIntersections.push(intersection);
|
noDuplicateIntersections.push(intersection);
|
||||||
encounteredExternalModuleVariants.push(
|
encounteredExternalModuleVariants.push(
|
||||||
intersection.object.userData.variant,
|
intersection.object.userData.variant
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -162,7 +159,7 @@ export function SpacedArmorSceneComponent({
|
|||||||
const surfaceNormal = intersection
|
const surfaceNormal = intersection
|
||||||
.normal!.clone()
|
.normal!.clone()
|
||||||
.applyQuaternion(
|
.applyQuaternion(
|
||||||
intersection.object.getWorldQuaternion(new Quaternion()),
|
intersection.object.getWorldQuaternion(new Quaternion())
|
||||||
);
|
);
|
||||||
|
|
||||||
if (shell.type === ShellType.HEAT && index > 0) {
|
if (shell.type === ShellType.HEAT && index > 0) {
|
||||||
@@ -174,7 +171,7 @@ export function SpacedArmorSceneComponent({
|
|||||||
shot.in.layers.push({
|
shot.in.layers.push({
|
||||||
type: null,
|
type: null,
|
||||||
distance,
|
distance,
|
||||||
status: blocked ? 'blocked' : 'penetration',
|
status: blocked ? "blocked" : "penetration",
|
||||||
});
|
});
|
||||||
|
|
||||||
if (blocked) break;
|
if (blocked) break;
|
||||||
@@ -194,16 +191,16 @@ export function SpacedArmorSceneComponent({
|
|||||||
surfaceNormal,
|
surfaceNormal,
|
||||||
status:
|
status:
|
||||||
shell.type === ShellType.HE
|
shell.type === ShellType.HE
|
||||||
? 'blocked'
|
? "blocked"
|
||||||
: blocked
|
: blocked
|
||||||
? 'blocked'
|
? "blocked"
|
||||||
: 'penetration',
|
: "penetration",
|
||||||
variant: layer.variant,
|
variant: layer.variant,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
const thickness = layer.thickness * thicknessCoefficient;
|
const thickness = layer.thickness * thicknessCoefficient;
|
||||||
const ricochet = degToRad(
|
const ricochet = degToRad(
|
||||||
isExplosive(shell.type) ? 90 : shell.ricochet!,
|
isExplosive(shell.type) ? 90 : shell.ricochet!
|
||||||
);
|
);
|
||||||
const angle = surfaceNormal.angleTo(cameraNormal);
|
const angle = surfaceNormal.angleTo(cameraNormal);
|
||||||
|
|
||||||
@@ -227,7 +224,7 @@ export function SpacedArmorSceneComponent({
|
|||||||
thicknessAngled: finalThickness,
|
thicknessAngled: finalThickness,
|
||||||
point: intersection.point,
|
point: intersection.point,
|
||||||
surfaceNormal,
|
surfaceNormal,
|
||||||
status: 'ricochet',
|
status: "ricochet",
|
||||||
angle,
|
angle,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -245,10 +242,10 @@ export function SpacedArmorSceneComponent({
|
|||||||
surfaceNormal: intersection.face!.normal,
|
surfaceNormal: intersection.face!.normal,
|
||||||
status:
|
status:
|
||||||
shell.type === ShellType.HE && layer.type !== ArmorType.Primary
|
shell.type === ShellType.HE && layer.type !== ArmorType.Primary
|
||||||
? 'blocked'
|
? "blocked"
|
||||||
: blocked
|
: blocked
|
||||||
? 'blocked'
|
? "blocked"
|
||||||
: 'penetration',
|
: "penetration",
|
||||||
angle,
|
angle,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -282,10 +279,10 @@ export function SpacedArmorSceneComponent({
|
|||||||
|
|
||||||
return acc + layer.thicknessAngled;
|
return acc + layer.thicknessAngled;
|
||||||
},
|
},
|
||||||
0,
|
0
|
||||||
);
|
);
|
||||||
const distanceFromSpacedArmor = firstLayer.point.distanceTo(
|
const distanceFromSpacedArmor = firstLayer.point.distanceTo(
|
||||||
lastLayer.point,
|
lastLayer.point
|
||||||
);
|
);
|
||||||
const finalDamage = Math.max(
|
const finalDamage = Math.max(
|
||||||
0,
|
0,
|
||||||
@@ -294,7 +291,7 @@ export function SpacedArmorSceneComponent({
|
|||||||
(1 - distanceFromSpacedArmor / shell.explosion_radius!) -
|
(1 - distanceFromSpacedArmor / shell.explosion_radius!) -
|
||||||
1.1 *
|
1.1 *
|
||||||
(lastLayer.thicknessAngled +
|
(lastLayer.thicknessAngled +
|
||||||
Math.min(penetration, totalSpacedArmorThickness)),
|
Math.min(penetration, totalSpacedArmorThickness))
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -308,19 +305,19 @@ export function SpacedArmorSceneComponent({
|
|||||||
* for parity's sake, I am capping the value here.
|
* for parity's sake, I am capping the value here.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (shot.in.layers.length > 1 || lastLayer.status === 'blocked') {
|
if (shot.in.layers.length > 1 || lastLayer.status === "blocked") {
|
||||||
shot.in.status = finalDamage > 0 ? 'splash' : 'blocked';
|
shot.in.status = finalDamage > 0 ? "splash" : "blocked";
|
||||||
shot.damage = finalDamage;
|
shot.damage = finalDamage;
|
||||||
} else {
|
} else {
|
||||||
shot.in.status = 'penetration';
|
shot.in.status = "penetration";
|
||||||
shot.damage = shell.armor_damage;
|
shot.damage = shell.armor_damage;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (lastLayer.status === 'blocked') {
|
if (lastLayer.status === "blocked") {
|
||||||
shot.in.status = 'blocked';
|
shot.in.status = "blocked";
|
||||||
shot.damage = 0;
|
shot.damage = 0;
|
||||||
} else if (lastLayer.status === 'penetration') {
|
} else if (lastLayer.status === "penetration") {
|
||||||
shot.in.status = 'penetration';
|
shot.in.status = "penetration";
|
||||||
shot.damage = shell.armor_damage;
|
shot.damage = shell.armor_damage;
|
||||||
} else {
|
} else {
|
||||||
const caster = new Raycaster();
|
const caster = new Raycaster();
|
||||||
@@ -331,29 +328,29 @@ export function SpacedArmorSceneComponent({
|
|||||||
.sub(
|
.sub(
|
||||||
lastLayer.surfaceNormal
|
lastLayer.surfaceNormal
|
||||||
.clone()
|
.clone()
|
||||||
.multiplyScalar(2 * shellNormal.dot(lastLayer.surfaceNormal)),
|
.multiplyScalar(2 * shellNormal.dot(lastLayer.surfaceNormal))
|
||||||
);
|
);
|
||||||
|
|
||||||
caster.set(lastLayer.point, ricochetNormal);
|
caster.set(lastLayer.point, ricochetNormal);
|
||||||
|
|
||||||
const ricochetIntersections = caster.intersectObjects(
|
const ricochetIntersections = caster.intersectObjects(
|
||||||
props.scene.children,
|
props.scene.children,
|
||||||
true,
|
true
|
||||||
);
|
);
|
||||||
const outShot = await shoot(
|
const outShot = shoot(
|
||||||
lastLayer.point,
|
lastLayer.point,
|
||||||
ricochetIntersections,
|
ricochetIntersections,
|
||||||
false,
|
false,
|
||||||
remainingPenetration,
|
remainingPenetration
|
||||||
);
|
);
|
||||||
|
|
||||||
shot.in.status = 'ricochet';
|
shot.in.status = "ricochet";
|
||||||
if (outShot === null) {
|
if (outShot === null) {
|
||||||
shot.damage = 0;
|
shot.damage = 0;
|
||||||
shot.out = {
|
shot.out = {
|
||||||
surfaceNormal: ricochetNormal,
|
surfaceNormal: ricochetNormal,
|
||||||
layers: [],
|
layers: [],
|
||||||
status: 'ricochet',
|
status: "ricochet",
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
shot.damage = outShot.damage;
|
shot.damage = outShot.damage;
|
||||||
@@ -366,7 +363,7 @@ export function SpacedArmorSceneComponent({
|
|||||||
|
|
||||||
return shot;
|
return shot;
|
||||||
},
|
},
|
||||||
[camera],
|
[camera]
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -386,14 +383,14 @@ export function SpacedArmorSceneComponent({
|
|||||||
thickness,
|
thickness,
|
||||||
} satisfies ArmorUserData
|
} satisfies ArmorUserData
|
||||||
}
|
}
|
||||||
onClick={async (event) => {
|
onClick={(event) => {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
const shot = (await shoot(
|
|
||||||
event.point,
|
const shot = shoot(event.point, event.intersections, true)!;
|
||||||
event.intersections,
|
|
||||||
true,
|
Tankopedia.mutate((draft) => {
|
||||||
))!;
|
draft.shot = shot;
|
||||||
tankopediaEphemeralStore.setState({ shot });
|
});
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,23 +1,22 @@
|
|||||||
import { normalizeAngleRad } from '@blitzkit/core';
|
import { useThree, type ThreeEvent } from "@react-three/fiber";
|
||||||
import { useThree, type ThreeEvent } from '@react-three/fiber';
|
import { memo, useRef } from "react";
|
||||||
import { memo, useRef } from 'react';
|
import { Group, Plane, Vector2, Vector3 } from "three";
|
||||||
import { Group, Plane, Vector2, Vector3 } from 'three';
|
import { applyPitchYawLimits } from "../../../core/blitz/applyPitchYawLimits";
|
||||||
import { applyPitchYawLimits } from '../../../core/blitz/applyPitchYawLimits';
|
import { correctZYTuple } from "../../../core/blitz/correctZYTuple";
|
||||||
import { correctZYTuple } from '../../../core/blitz/correctZYTuple';
|
import { hasEquipment } from "../../../core/blitzkit/hasEquipment";
|
||||||
import { hasEquipment } from '../../../core/blitzkit/hasEquipment';
|
import { modelTransformEvent } from "../../../core/blitzkit/modelTransform";
|
||||||
import { modelTransformEvent } from '../../../core/blitzkit/modelTransform';
|
import { nameToArmorId } from "../../../core/blitzkit/nameToArmorId";
|
||||||
import { nameToArmorId } from '../../../core/blitzkit/nameToArmorId';
|
import { resolveArmor } from "../../../core/blitzkit/resolveThickness";
|
||||||
import { resolveArmor } from '../../../core/blitzkit/resolveThickness';
|
import { useArmor } from "../../../hooks/useArmor";
|
||||||
import { useArmor } from '../../../hooks/useArmor';
|
import { useModel } from "../../../hooks/useModel";
|
||||||
import { useModel } from '../../../hooks/useModel';
|
import { useTankModelDefinition } from "../../../hooks/useTankModelDefinition";
|
||||||
import { useTankModelDefinition } from '../../../hooks/useTankModelDefinition';
|
import { useTankTransform } from "../../../hooks/useTankTransform";
|
||||||
import { useTankTransform } from '../../../hooks/useTankTransform';
|
import { Duel } from "../../../stores/duel";
|
||||||
import { Duel } from '../../../stores/duel';
|
import { Tankopedia } from "../../../stores/tankopedia";
|
||||||
import { TankopediaEphemeral } from '../../../stores/tankopediaEphemeral';
|
import { TankopediaPersistent } from "../../../stores/tankopediaPersistent";
|
||||||
import { TankopediaPersistent } from '../../../stores/tankopediaPersistent';
|
import { ModelTankWrapper } from "./ModelTankWrapper";
|
||||||
import { ModelTankWrapper } from './ModelTankWrapper';
|
import { ArmorType } from "./SpacedArmorScene";
|
||||||
import { ArmorType } from './SpacedArmorScene';
|
import { StaticArmorSceneComponent } from "./StaticArmorSceneComponent";
|
||||||
import { StaticArmorSceneComponent } from './StaticArmorSceneComponent';
|
|
||||||
|
|
||||||
interface ArmorSceneProps {
|
interface ArmorSceneProps {
|
||||||
thicknessRange: ThicknessRange;
|
thicknessRange: ThicknessRange;
|
||||||
@@ -31,7 +30,6 @@ export const StaticArmor = memo<ArmorSceneProps>(({ thicknessRange }) => {
|
|||||||
const wrapper = useRef<Group>(null);
|
const wrapper = useRef<Group>(null);
|
||||||
const turretContainer = useRef<Group>(null);
|
const turretContainer = useRef<Group>(null);
|
||||||
const gunContainer = useRef<Group>(null);
|
const gunContainer = useRef<Group>(null);
|
||||||
const protagonist = Duel.use((draft) => draft.protagonist);
|
|
||||||
const tank = Duel.use((state) => state.protagonist.tank);
|
const tank = Duel.use((state) => state.protagonist.tank);
|
||||||
const track = Duel.use((state) => state.protagonist.track);
|
const track = Duel.use((state) => state.protagonist.track);
|
||||||
const turret = Duel.use((state) => state.protagonist.turret);
|
const turret = Duel.use((state) => state.protagonist.turret);
|
||||||
@@ -43,30 +41,27 @@ export const StaticArmor = memo<ArmorSceneProps>(({ thicknessRange }) => {
|
|||||||
const tankModelDefinition = useTankModelDefinition();
|
const tankModelDefinition = useTankModelDefinition();
|
||||||
const trackModelDefinition = tankModelDefinition.tracks[track.id];
|
const trackModelDefinition = tankModelDefinition.tracks[track.id];
|
||||||
const turretModelDefinition = tankModelDefinition.turrets[turret.id];
|
const turretModelDefinition = tankModelDefinition.turrets[turret.id];
|
||||||
const gunModelDefinition =
|
const gunModelDefinition = turretModelDefinition.guns[gun.id];
|
||||||
turretModelDefinition.guns[gun.gun_type!.value.base.id];
|
|
||||||
const hullOrigin = correctZYTuple(trackModelDefinition.origin);
|
const hullOrigin = correctZYTuple(trackModelDefinition.origin);
|
||||||
const turretOrigin = correctZYTuple(tankModelDefinition.turret_origin);
|
const turretOrigin = correctZYTuple(tankModelDefinition.turret_origin);
|
||||||
const gunOrigin = correctZYTuple(turretModelDefinition.gun_origin);
|
const gunOrigin = correctZYTuple(turretModelDefinition.gun_origin);
|
||||||
const mutateDuel = Duel.useMutation();
|
|
||||||
const canvas = useThree((state) => state.gl.domElement);
|
const canvas = useThree((state) => state.gl.domElement);
|
||||||
const mutateTankopediaEphemeral = TankopediaEphemeral.useMutation();
|
|
||||||
const duelStore = Duel.useStore();
|
|
||||||
const maskOrigin =
|
const maskOrigin =
|
||||||
gunModelDefinition.mask === undefined
|
gunModelDefinition.mask === undefined
|
||||||
? undefined
|
? undefined
|
||||||
: gunModelDefinition.mask + hullOrigin.y + turretOrigin.y + gunOrigin.y;
|
: gunModelDefinition.mask + hullOrigin.y + turretOrigin.y + gunOrigin.y;
|
||||||
const showPrimaryArmor = TankopediaPersistent.use(
|
const showPrimaryArmor = TankopediaPersistent.use(
|
||||||
(state) => state.showPrimaryArmor,
|
(state) => state.showPrimaryArmor
|
||||||
);
|
);
|
||||||
const showSpacedArmor = TankopediaPersistent.use(
|
const showSpacedArmor = TankopediaPersistent.use(
|
||||||
(state) => state.showSpacedArmor,
|
(state) => state.showSpacedArmor
|
||||||
);
|
);
|
||||||
const showExternalModules = TankopediaPersistent.use(
|
const showExternalModules = TankopediaPersistent.use(
|
||||||
(state) => state.showExternalModules,
|
(state) => state.showExternalModules
|
||||||
);
|
);
|
||||||
const isDynamicArmorActive = Duel.use((state) =>
|
const isDynamicArmorActive = Duel.use((state) =>
|
||||||
state.protagonist.consumables.includes(73),
|
state.protagonist.consumables.includes(73)
|
||||||
);
|
);
|
||||||
|
|
||||||
useTankTransform(track, turret, turretContainer, gunContainer);
|
useTankTransform(track, turret, turretContainer, gunContainer);
|
||||||
@@ -75,12 +70,12 @@ export const StaticArmor = memo<ArmorSceneProps>(({ thicknessRange }) => {
|
|||||||
<ModelTankWrapper ref={wrapper}>
|
<ModelTankWrapper ref={wrapper}>
|
||||||
<group position={hullOrigin}>
|
<group position={hullOrigin}>
|
||||||
{armorNodes.map((node) => {
|
{armorNodes.map((node) => {
|
||||||
const isHull = node.name.startsWith('hull_');
|
const isHull = node.name.startsWith("hull_");
|
||||||
const isVisible = isHull;
|
const isVisible = isHull;
|
||||||
const armorId = nameToArmorId(node.name);
|
const armorId = nameToArmorId(node.name);
|
||||||
const { spaced, thickness } = resolveArmor(
|
const { spaced, thickness } = resolveArmor(
|
||||||
tankModelDefinition.armor,
|
tankModelDefinition.armor,
|
||||||
armorId,
|
armorId
|
||||||
);
|
);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
@@ -88,8 +83,8 @@ export const StaticArmor = memo<ArmorSceneProps>(({ thicknessRange }) => {
|
|||||||
thickness === undefined ||
|
thickness === undefined ||
|
||||||
(!showPrimaryArmor && !spaced) ||
|
(!showPrimaryArmor && !spaced) ||
|
||||||
(!showSpacedArmor && spaced) ||
|
(!showSpacedArmor && spaced) ||
|
||||||
(isDynamicArmorActive && node.name.includes('state_00')) ||
|
(isDynamicArmorActive && node.name.includes("state_00")) ||
|
||||||
(!isDynamicArmorActive && node.name.includes('state_01'))
|
(!isDynamicArmorActive && node.name.includes("state_01"))
|
||||||
)
|
)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
@@ -108,8 +103,8 @@ export const StaticArmor = memo<ArmorSceneProps>(({ thicknessRange }) => {
|
|||||||
</group>
|
</group>
|
||||||
|
|
||||||
{modelNodes.map((node) => {
|
{modelNodes.map((node) => {
|
||||||
const isWheel = node.name.startsWith('chassis_wheel_');
|
const isWheel = node.name.startsWith("chassis_wheel_");
|
||||||
const isTrack = node.name.startsWith('chassis_track_');
|
const isTrack = node.name.startsWith("chassis_track_");
|
||||||
const isVisible = isWheel || isTrack;
|
const isVisible = isWheel || isTrack;
|
||||||
|
|
||||||
if (!isVisible || !showExternalModules) return null;
|
if (!isVisible || !showExternalModules) return null;
|
||||||
@@ -131,13 +126,13 @@ export const StaticArmor = memo<ArmorSceneProps>(({ thicknessRange }) => {
|
|||||||
<group ref={turretContainer}>
|
<group ref={turretContainer}>
|
||||||
{armorNodes.map((node) => {
|
{armorNodes.map((node) => {
|
||||||
const isCurrentTurret = node.name.startsWith(
|
const isCurrentTurret = node.name.startsWith(
|
||||||
`turret_${turretModelDefinition.model_id.toString().padStart(2, '0')}`,
|
`turret_${turretModelDefinition.model_id.toString().padStart(2, "0")}`
|
||||||
);
|
);
|
||||||
const isVisible = isCurrentTurret;
|
const isVisible = isCurrentTurret;
|
||||||
const armorId = nameToArmorId(node.name);
|
const armorId = nameToArmorId(node.name);
|
||||||
const { spaced, thickness } = resolveArmor(
|
const { spaced, thickness } = resolveArmor(
|
||||||
turretModelDefinition.armor,
|
turretModelDefinition.armor,
|
||||||
armorId,
|
armorId
|
||||||
);
|
);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
@@ -145,71 +140,63 @@ export const StaticArmor = memo<ArmorSceneProps>(({ thicknessRange }) => {
|
|||||||
thickness === undefined ||
|
thickness === undefined ||
|
||||||
(!showPrimaryArmor && !spaced) ||
|
(!showPrimaryArmor && !spaced) ||
|
||||||
(!showSpacedArmor && spaced) ||
|
(!showSpacedArmor && spaced) ||
|
||||||
(isDynamicArmorActive && node.name.includes('state_00')) ||
|
(isDynamicArmorActive && node.name.includes("state_00")) ||
|
||||||
(!isDynamicArmorActive && node.name.includes('state_01'))
|
(!isDynamicArmorActive && node.name.includes("state_01"))
|
||||||
) {
|
) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const position = new Vector2();
|
const position = new Vector2();
|
||||||
const delta = new Vector2();
|
const delta = new Vector2();
|
||||||
let pitch = 0;
|
|
||||||
let yaw = 0;
|
|
||||||
|
|
||||||
function onPointerDown(event: ThreeEvent<PointerEvent>) {
|
function onPointerDown(event: ThreeEvent<PointerEvent>) {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
|
|
||||||
position.set(event.clientX, event.clientY);
|
position.set(event.clientX, event.clientY);
|
||||||
yaw = protagonist.yaw;
|
|
||||||
pitch = protagonist.pitch;
|
|
||||||
|
|
||||||
mutateTankopediaEphemeral((draft) => {
|
Tankopedia.mutate((draft) => {
|
||||||
draft.controlsEnabled = false;
|
draft.controlsEnabled = false;
|
||||||
});
|
});
|
||||||
mutateTankopediaEphemeral((draft) => {
|
Tankopedia.mutate((draft) => {
|
||||||
draft.shot = undefined;
|
draft.shot = undefined;
|
||||||
draft.highlightArmor = undefined;
|
draft.highlightArmor = undefined;
|
||||||
});
|
});
|
||||||
window.addEventListener('pointermove', handlePointerMove);
|
window.addEventListener("pointermove", handlePointerMove);
|
||||||
window.addEventListener('pointerup', handlePointerUp);
|
window.addEventListener("pointerup", handlePointerUp);
|
||||||
}
|
}
|
||||||
async function handlePointerMove(event: PointerEvent) {
|
function handlePointerMove(event: PointerEvent) {
|
||||||
const duel = duelStore.getState();
|
const hasImprovedVerticalStabilizer = hasEquipment(
|
||||||
const hasImprovedVerticalStabilizer = await hasEquipment(
|
|
||||||
122,
|
122,
|
||||||
duel.protagonist.tank.equipment_preset,
|
Duel.state.protagonist.tank.equipment_preset,
|
||||||
duel.protagonist.equipmentMatrix,
|
Duel.state.protagonist.equipmentMatrix
|
||||||
);
|
);
|
||||||
const hasDownImprovedVerticalStabilizer = await hasEquipment(
|
const hasDownImprovedVerticalStabilizer = hasEquipment(
|
||||||
124,
|
124,
|
||||||
duel.protagonist.tank.equipment_preset,
|
Duel.state.protagonist.tank.equipment_preset,
|
||||||
duel.protagonist.equipmentMatrix,
|
Duel.state.protagonist.equipmentMatrix
|
||||||
);
|
);
|
||||||
const boundingRect = canvas.getBoundingClientRect();
|
const boundingRect = canvas.getBoundingClientRect();
|
||||||
|
|
||||||
delta.set(event.clientX, event.clientY).sub(position);
|
delta.set(event.clientX, event.clientY).sub(position);
|
||||||
position.set(event.clientX, event.clientY);
|
position.set(event.clientX, event.clientY);
|
||||||
|
|
||||||
[pitch, yaw] = applyPitchYawLimits(
|
const [pitch, yaw] = applyPitchYawLimits(
|
||||||
pitch,
|
modelTransformEvent.last!.pitch,
|
||||||
yaw + delta.x * (Math.PI / boundingRect.width),
|
modelTransformEvent.last!.yaw +
|
||||||
|
delta.x * (Math.PI / boundingRect.width),
|
||||||
gunModelDefinition.pitch,
|
gunModelDefinition.pitch,
|
||||||
turretModelDefinition.yaw,
|
turretModelDefinition.yaw,
|
||||||
hasImprovedVerticalStabilizer,
|
hasImprovedVerticalStabilizer,
|
||||||
hasDownImprovedVerticalStabilizer,
|
hasDownImprovedVerticalStabilizer
|
||||||
);
|
);
|
||||||
modelTransformEvent.emit({ pitch, yaw });
|
modelTransformEvent.dispatch({ pitch, yaw });
|
||||||
}
|
}
|
||||||
function handlePointerUp() {
|
function handlePointerUp() {
|
||||||
mutateDuel((draft) => {
|
Tankopedia.mutate((draft) => {
|
||||||
draft.protagonist.pitch = normalizeAngleRad(pitch);
|
|
||||||
draft.protagonist.yaw = normalizeAngleRad(yaw);
|
|
||||||
});
|
|
||||||
mutateTankopediaEphemeral((draft) => {
|
|
||||||
draft.controlsEnabled = true;
|
draft.controlsEnabled = true;
|
||||||
});
|
});
|
||||||
window.removeEventListener('pointermove', handlePointerMove);
|
window.removeEventListener("pointermove", handlePointerMove);
|
||||||
window.removeEventListener('pointerup', handlePointerUp);
|
window.removeEventListener("pointerup", handlePointerUp);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -218,7 +205,6 @@ export const StaticArmor = memo<ArmorSceneProps>(({ thicknessRange }) => {
|
|||||||
<StaticArmorSceneComponent
|
<StaticArmorSceneComponent
|
||||||
name={node.name}
|
name={node.name}
|
||||||
thicknessRange={thicknessRange}
|
thicknessRange={thicknessRange}
|
||||||
key={node.uuid}
|
|
||||||
type={spaced ? ArmorType.Spaced : ArmorType.Primary}
|
type={spaced ? ArmorType.Spaced : ArmorType.Primary}
|
||||||
thickness={thickness}
|
thickness={thickness}
|
||||||
node={node}
|
node={node}
|
||||||
@@ -232,13 +218,13 @@ export const StaticArmor = memo<ArmorSceneProps>(({ thicknessRange }) => {
|
|||||||
<group ref={gunContainer}>
|
<group ref={gunContainer}>
|
||||||
{armorNodes.map((node) => {
|
{armorNodes.map((node) => {
|
||||||
const isCurrentGun = node.name.startsWith(
|
const isCurrentGun = node.name.startsWith(
|
||||||
`gun_${gunModelDefinition.model_id.toString().padStart(2, '0')}`,
|
`gun_${gunModelDefinition.model_id.toString().padStart(2, "0")}`
|
||||||
);
|
);
|
||||||
const isVisible = isCurrentGun;
|
const isVisible = isCurrentGun;
|
||||||
const armorId = nameToArmorId(node.name);
|
const armorId = nameToArmorId(node.name);
|
||||||
const { spaced, thickness } = resolveArmor(
|
const { spaced, thickness } = resolveArmor(
|
||||||
gunModelDefinition.armor,
|
gunModelDefinition.armor,
|
||||||
armorId,
|
armorId
|
||||||
);
|
);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
@@ -246,70 +232,63 @@ export const StaticArmor = memo<ArmorSceneProps>(({ thicknessRange }) => {
|
|||||||
thickness === undefined ||
|
thickness === undefined ||
|
||||||
(!showPrimaryArmor && !spaced) ||
|
(!showPrimaryArmor && !spaced) ||
|
||||||
(!showSpacedArmor && spaced) ||
|
(!showSpacedArmor && spaced) ||
|
||||||
(isDynamicArmorActive && node.name.includes('state_00')) ||
|
(isDynamicArmorActive && node.name.includes("state_00")) ||
|
||||||
(!isDynamicArmorActive && node.name.includes('state_01'))
|
(!isDynamicArmorActive && node.name.includes("state_01"))
|
||||||
)
|
)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
const position = new Vector2();
|
const position = new Vector2();
|
||||||
const delta = new Vector2();
|
const delta = new Vector2();
|
||||||
let pitch = 0;
|
|
||||||
let yaw = 0;
|
|
||||||
|
|
||||||
function onPointerDown(event: ThreeEvent<PointerEvent>) {
|
function onPointerDown(event: ThreeEvent<PointerEvent>) {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
|
|
||||||
mutateTankopediaEphemeral((draft) => {
|
Tankopedia.mutate((draft) => {
|
||||||
draft.controlsEnabled = false;
|
draft.controlsEnabled = false;
|
||||||
});
|
});
|
||||||
mutateTankopediaEphemeral((draft) => {
|
Tankopedia.mutate((draft) => {
|
||||||
draft.shot = undefined;
|
draft.shot = undefined;
|
||||||
draft.highlightArmor = undefined;
|
draft.highlightArmor = undefined;
|
||||||
});
|
});
|
||||||
|
|
||||||
position.set(event.clientX, event.clientY);
|
position.set(event.clientX, event.clientY);
|
||||||
pitch = protagonist.pitch;
|
|
||||||
yaw = protagonist.yaw;
|
|
||||||
|
|
||||||
window.addEventListener('pointermove', handlePointerMove);
|
window.addEventListener("pointermove", handlePointerMove);
|
||||||
window.addEventListener('pointerup', handlePointerUp);
|
window.addEventListener("pointerup", handlePointerUp);
|
||||||
}
|
}
|
||||||
async function handlePointerMove(event: PointerEvent) {
|
function handlePointerMove(event: PointerEvent) {
|
||||||
const duel = duelStore.getState();
|
const hasImprovedVerticalStabilizer = hasEquipment(
|
||||||
const hasImprovedVerticalStabilizer = await hasEquipment(
|
|
||||||
122,
|
122,
|
||||||
duel.protagonist.tank.equipment_preset,
|
Duel.state.protagonist.tank.equipment_preset,
|
||||||
duel.protagonist.equipmentMatrix,
|
Duel.state.protagonist.equipmentMatrix
|
||||||
);
|
);
|
||||||
const hasDownImprovedVerticalStabilizer = await hasEquipment(
|
const hasDownImprovedVerticalStabilizer = hasEquipment(
|
||||||
124,
|
124,
|
||||||
duel.protagonist.tank.equipment_preset,
|
Duel.state.protagonist.tank.equipment_preset,
|
||||||
duel.protagonist.equipmentMatrix,
|
Duel.state.protagonist.equipmentMatrix
|
||||||
);
|
);
|
||||||
const boundingRect = canvas.getBoundingClientRect();
|
const boundingRect = canvas.getBoundingClientRect();
|
||||||
delta.set(event.clientX, event.clientY).sub(position);
|
delta.set(event.clientX, event.clientY).sub(position);
|
||||||
position.set(event.clientX, event.clientY);
|
position.set(event.clientX, event.clientY);
|
||||||
|
|
||||||
[pitch, yaw] = applyPitchYawLimits(
|
const [pitch, yaw] = applyPitchYawLimits(
|
||||||
pitch - delta.y * (Math.PI / boundingRect.height),
|
modelTransformEvent.last!.pitch -
|
||||||
yaw + delta.x * (Math.PI / boundingRect.width),
|
delta.y * (Math.PI / boundingRect.height),
|
||||||
|
modelTransformEvent.last!.yaw +
|
||||||
|
delta.x * (Math.PI / boundingRect.width),
|
||||||
gunModelDefinition.pitch,
|
gunModelDefinition.pitch,
|
||||||
turretModelDefinition.yaw,
|
turretModelDefinition.yaw,
|
||||||
hasImprovedVerticalStabilizer,
|
hasImprovedVerticalStabilizer,
|
||||||
hasDownImprovedVerticalStabilizer,
|
hasDownImprovedVerticalStabilizer
|
||||||
);
|
);
|
||||||
modelTransformEvent.emit({ pitch, yaw });
|
modelTransformEvent.dispatch({ pitch, yaw });
|
||||||
}
|
}
|
||||||
function handlePointerUp() {
|
function handlePointerUp() {
|
||||||
mutateTankopediaEphemeral((draft) => {
|
Tankopedia.mutate((draft) => {
|
||||||
draft.controlsEnabled = true;
|
draft.controlsEnabled = true;
|
||||||
});
|
});
|
||||||
mutateDuel((draft) => {
|
window.removeEventListener("pointermove", handlePointerMove);
|
||||||
draft.protagonist.pitch = normalizeAngleRad(pitch);
|
window.removeEventListener("pointerup", handlePointerUp);
|
||||||
draft.protagonist.yaw = normalizeAngleRad(yaw);
|
|
||||||
});
|
|
||||||
window.removeEventListener('pointermove', handlePointerMove);
|
|
||||||
window.removeEventListener('pointerup', handlePointerUp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -331,7 +310,7 @@ export const StaticArmor = memo<ArmorSceneProps>(({ thicknessRange }) => {
|
|||||||
{modelNodes.map((node) => {
|
{modelNodes.map((node) => {
|
||||||
const gunString = `gun_${gunModelDefinition.model_id
|
const gunString = `gun_${gunModelDefinition.model_id
|
||||||
.toString()
|
.toString()
|
||||||
.padStart(2, '0')}`;
|
.padStart(2, "0")}`;
|
||||||
const isCurrentGun = gunModelDefinition.mask
|
const isCurrentGun = gunModelDefinition.mask
|
||||||
? node.name.startsWith(gunString)
|
? node.name.startsWith(gunString)
|
||||||
: node.name === gunString;
|
: node.name === gunString;
|
||||||
@@ -341,63 +320,56 @@ export const StaticArmor = memo<ArmorSceneProps>(({ thicknessRange }) => {
|
|||||||
|
|
||||||
const position = new Vector2();
|
const position = new Vector2();
|
||||||
const delta = new Vector2();
|
const delta = new Vector2();
|
||||||
let pitch = 0;
|
|
||||||
let yaw = 0;
|
|
||||||
|
|
||||||
function onPointerDown(event: ThreeEvent<PointerEvent>) {
|
function onPointerDown(event: ThreeEvent<PointerEvent>) {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
|
|
||||||
mutateTankopediaEphemeral((draft) => {
|
Tankopedia.mutate((draft) => {
|
||||||
draft.controlsEnabled = false;
|
draft.controlsEnabled = false;
|
||||||
});
|
});
|
||||||
mutateTankopediaEphemeral((draft) => {
|
Tankopedia.mutate((draft) => {
|
||||||
draft.shot = undefined;
|
draft.shot = undefined;
|
||||||
draft.highlightArmor = undefined;
|
draft.highlightArmor = undefined;
|
||||||
});
|
});
|
||||||
|
|
||||||
position.set(event.clientX, event.clientY);
|
position.set(event.clientX, event.clientY);
|
||||||
pitch = protagonist.pitch;
|
window.addEventListener("pointermove", handlePointerMove);
|
||||||
yaw = protagonist.yaw;
|
window.addEventListener("pointerup", handlePointerUp);
|
||||||
|
|
||||||
window.addEventListener('pointermove', handlePointerMove);
|
|
||||||
window.addEventListener('pointerup', handlePointerUp);
|
|
||||||
}
|
}
|
||||||
async function handlePointerMove(event: PointerEvent) {
|
function handlePointerMove(event: PointerEvent) {
|
||||||
const duel = duelStore.getState();
|
const hasImprovedVerticalStabilizer = hasEquipment(
|
||||||
const hasImprovedVerticalStabilizer = await hasEquipment(
|
|
||||||
122,
|
122,
|
||||||
duel.protagonist.tank.equipment_preset,
|
Duel.state.protagonist.tank.equipment_preset,
|
||||||
duel.protagonist.equipmentMatrix,
|
Duel.state.protagonist.equipmentMatrix
|
||||||
);
|
);
|
||||||
const hasDownImprovedVerticalStabilizer = await hasEquipment(
|
const hasDownImprovedVerticalStabilizer = hasEquipment(
|
||||||
124,
|
124,
|
||||||
duel.protagonist.tank.equipment_preset,
|
Duel.state.protagonist.tank.equipment_preset,
|
||||||
duel.protagonist.equipmentMatrix,
|
Duel.state.protagonist.equipmentMatrix
|
||||||
);
|
);
|
||||||
const boundingRect = canvas.getBoundingClientRect();
|
const boundingRect = canvas.getBoundingClientRect();
|
||||||
delta.set(event.clientX, event.clientY).sub(position);
|
delta.set(event.clientX, event.clientY).sub(position);
|
||||||
position.set(event.clientX, event.clientY);
|
position.set(event.clientX, event.clientY);
|
||||||
|
|
||||||
[pitch, yaw] = applyPitchYawLimits(
|
const [pitch, yaw] = applyPitchYawLimits(
|
||||||
pitch - delta.y * (Math.PI / boundingRect.height),
|
modelTransformEvent.last!.pitch -
|
||||||
yaw + delta.x * (Math.PI / boundingRect.width),
|
delta.y * (Math.PI / boundingRect.height),
|
||||||
|
modelTransformEvent.last!.yaw +
|
||||||
|
delta.x * (Math.PI / boundingRect.width),
|
||||||
gunModelDefinition.pitch,
|
gunModelDefinition.pitch,
|
||||||
turretModelDefinition.yaw,
|
turretModelDefinition.yaw,
|
||||||
hasImprovedVerticalStabilizer,
|
hasImprovedVerticalStabilizer,
|
||||||
hasDownImprovedVerticalStabilizer,
|
hasDownImprovedVerticalStabilizer
|
||||||
);
|
);
|
||||||
modelTransformEvent.emit({ pitch, yaw });
|
modelTransformEvent.dispatch({ pitch, yaw });
|
||||||
}
|
}
|
||||||
function handlePointerUp() {
|
function handlePointerUp() {
|
||||||
mutateTankopediaEphemeral((draft) => {
|
Tankopedia.mutate((draft) => {
|
||||||
draft.controlsEnabled = true;
|
draft.controlsEnabled = true;
|
||||||
});
|
});
|
||||||
mutateDuel((draft) => {
|
|
||||||
draft.protagonist.pitch = normalizeAngleRad(pitch);
|
window.removeEventListener("pointermove", handlePointerMove);
|
||||||
draft.protagonist.yaw = normalizeAngleRad(yaw);
|
window.removeEventListener("pointerup", handlePointerUp);
|
||||||
});
|
|
||||||
window.removeEventListener('pointermove', handlePointerMove);
|
|
||||||
window.removeEventListener('pointerup', handlePointerUp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
import { I_HAT, J_HAT } from '@blitzkit/core';
|
import { I_HAT, J_HAT } from "@blitzkit/core";
|
||||||
import { type MeshProps, useThree } from '@react-three/fiber';
|
import { type MeshProps, useThree } from "@react-three/fiber";
|
||||||
import { clamp } from 'lodash-es';
|
import { clamp } from "lodash-es";
|
||||||
import { useEffect, useMemo } from 'react';
|
import type { QuicklimeEvent } from "quicklime";
|
||||||
|
import { useEffect, useMemo } from "react";
|
||||||
import {
|
import {
|
||||||
Box3,
|
Box3,
|
||||||
Color,
|
Color,
|
||||||
@@ -9,33 +10,33 @@ import {
|
|||||||
FrontSide,
|
FrontSide,
|
||||||
LineBasicMaterial,
|
LineBasicMaterial,
|
||||||
Mesh,
|
Mesh,
|
||||||
MeshStandardMaterial,
|
MeshBasicMaterial,
|
||||||
Object3D,
|
Object3D,
|
||||||
Plane,
|
Plane,
|
||||||
Quaternion,
|
Quaternion,
|
||||||
Vector3,
|
Vector3,
|
||||||
} from 'three';
|
} from "three";
|
||||||
import { unrotateDavaVector } from '../../../core/blitz/unrotateDavaVector';
|
import { unrotateDavaVector } from "../../../core/blitz/unrotateDavaVector";
|
||||||
import { jsxTree } from '../../../core/blitzkit/jsxTree';
|
import { jsxTree } from "../../../core/blitzkit/jsxTree";
|
||||||
import {
|
import {
|
||||||
type ModelTransformEventData,
|
type ModelTransformEventData,
|
||||||
modelTransformEvent,
|
modelTransformEvent,
|
||||||
} from '../../../core/blitzkit/modelTransform';
|
} from "../../../core/blitzkit/modelTransform";
|
||||||
import { discardClippingPlane } from '../../../core/three/discardClippingPlane';
|
import { discardClippingPlane } from "../../../core/three/discardClippingPlane";
|
||||||
import { TankopediaEphemeral } from '../../../stores/tankopediaEphemeral';
|
import { Tankopedia } from "../../../stores/tankopedia";
|
||||||
import { ArmorType } from './SpacedArmorScene';
|
import { ArmorType } from "./SpacedArmorScene";
|
||||||
import type {
|
import type {
|
||||||
ArmorUserData,
|
ArmorUserData,
|
||||||
ExternalModuleVariant,
|
ExternalModuleVariant,
|
||||||
} from './SpacedArmorSceneComponent';
|
} from "./SpacedArmorSceneComponent";
|
||||||
import type { ThicknessRange } from './StaticArmor';
|
import type { ThicknessRange } from "./StaticArmor";
|
||||||
|
|
||||||
type StaticArmorSceneComponentProps = {
|
type StaticArmorSceneComponentProps = {
|
||||||
name: string;
|
name: string;
|
||||||
thickness: number;
|
thickness: number;
|
||||||
thicknessRange: ThicknessRange;
|
thicknessRange: ThicknessRange;
|
||||||
node: Object3D;
|
node: Object3D;
|
||||||
onPointerDown?: MeshProps['onPointerDown'];
|
onPointerDown?: MeshProps["onPointerDown"];
|
||||||
} & (
|
} & (
|
||||||
| {
|
| {
|
||||||
type: Exclude<ArmorType, ArmorType.External>;
|
type: Exclude<ArmorType, ArmorType.External>;
|
||||||
@@ -68,8 +69,6 @@ export function StaticArmorSceneComponent({
|
|||||||
onPointerDown,
|
onPointerDown,
|
||||||
...props
|
...props
|
||||||
}: StaticArmorSceneComponentProps) {
|
}: StaticArmorSceneComponentProps) {
|
||||||
const mutateTankopediaEphemeralStore = TankopediaEphemeral.useMutation();
|
|
||||||
const tankopediaEphemeralStore = TankopediaEphemeral.useStore();
|
|
||||||
const camera = useThree((state) => state.camera);
|
const camera = useThree((state) => state.camera);
|
||||||
const x = thickness / thicknessRange.value;
|
const x = thickness / thicknessRange.value;
|
||||||
const xClamped = clamp(x, 0, 1);
|
const xClamped = clamp(x, 0, 1);
|
||||||
@@ -91,7 +90,7 @@ export function StaticArmorSceneComponent({
|
|||||||
color = new Color(
|
color = new Color(
|
||||||
clamp(1 - (7 / 8) * xClamped, 0, 1),
|
clamp(1 - (7 / 8) * xClamped, 0, 1),
|
||||||
0,
|
0,
|
||||||
clamp(1 - (1 / 8) * xClamped, 0, 1),
|
clamp(1 - (1 / 8) * xClamped, 0, 1)
|
||||||
);
|
);
|
||||||
opacity = clamp(x + 1 / 2, 0, 1);
|
opacity = clamp(x + 1 / 2, 0, 1);
|
||||||
break;
|
break;
|
||||||
@@ -107,14 +106,14 @@ export function StaticArmorSceneComponent({
|
|||||||
|
|
||||||
const surfaceMaterial = useMemo(
|
const surfaceMaterial = useMemo(
|
||||||
() =>
|
() =>
|
||||||
new MeshStandardMaterial({
|
new MeshBasicMaterial({
|
||||||
color,
|
color,
|
||||||
opacity,
|
opacity,
|
||||||
transparent: opacity < 1,
|
transparent: opacity < 1,
|
||||||
depthWrite,
|
depthWrite,
|
||||||
...(props.clip ? { clippingPlanes: [props.clip] } : {}),
|
...(props.clip ? { clippingPlanes: [props.clip] } : {}),
|
||||||
}),
|
}),
|
||||||
[thickness],
|
[thickness]
|
||||||
);
|
);
|
||||||
const outlineMaterial = useMemo(
|
const outlineMaterial = useMemo(
|
||||||
() =>
|
() =>
|
||||||
@@ -123,7 +122,7 @@ export function StaticArmorSceneComponent({
|
|||||||
.clone()
|
.clone()
|
||||||
.multiplyScalar(props.type === ArmorType.Spaced ? 2 ** 2 : 2 ** -1),
|
.multiplyScalar(props.type === ArmorType.Spaced ? 2 ** 2 : 2 ** -1),
|
||||||
}),
|
}),
|
||||||
[thickness],
|
[thickness]
|
||||||
);
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -138,11 +137,11 @@ export function StaticArmorSceneComponent({
|
|||||||
outlineMaterial.visible = true;
|
outlineMaterial.visible = true;
|
||||||
} else if (
|
} else if (
|
||||||
selectedName === name ||
|
selectedName === name ||
|
||||||
(name.startsWith('chassis_') && selectedName.startsWith('chassis_')) ||
|
(name.startsWith("chassis_") && selectedName.startsWith("chassis_")) ||
|
||||||
(name.startsWith('gun_') &&
|
(name.startsWith("gun_") &&
|
||||||
selectedName.startsWith('gun_') &&
|
selectedName.startsWith("gun_") &&
|
||||||
!name.includes('_armor_') &&
|
!name.includes("_armor_") &&
|
||||||
!selectedName.includes('_armor_'))
|
!selectedName.includes("_armor_"))
|
||||||
) {
|
) {
|
||||||
// this selected, stand out!
|
// this selected, stand out!
|
||||||
surfaceMaterial.opacity = 1;
|
surfaceMaterial.opacity = 1;
|
||||||
@@ -165,9 +164,9 @@ export function StaticArmorSceneComponent({
|
|||||||
}
|
}
|
||||||
|
|
||||||
const unsubscribes = [
|
const unsubscribes = [
|
||||||
tankopediaEphemeralStore.subscribe(
|
Tankopedia.on(
|
||||||
(state) => state.highlightArmor?.name,
|
(state) => state.highlightArmor?.name,
|
||||||
handleHighlightArmor,
|
handleHighlightArmor
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -180,22 +179,24 @@ export function StaticArmorSceneComponent({
|
|||||||
const { clip } = props;
|
const { clip } = props;
|
||||||
const gunOrigin = unrotateDavaVector(props.gunOrigin.clone());
|
const gunOrigin = unrotateDavaVector(props.gunOrigin.clone());
|
||||||
const neckOrigin = unrotateDavaVector(props.hullOrigin.clone()).add(
|
const neckOrigin = unrotateDavaVector(props.hullOrigin.clone()).add(
|
||||||
unrotateDavaVector(props.turretOrigin.clone()),
|
unrotateDavaVector(props.turretOrigin.clone())
|
||||||
);
|
);
|
||||||
const barrelOrigin = neckOrigin.clone().add(gunOrigin);
|
const barrelOrigin = neckOrigin.clone().add(gunOrigin);
|
||||||
const distanceToBarrel = clip.distanceToPoint(barrelOrigin);
|
const distanceToBarrel = clip.distanceToPoint(barrelOrigin);
|
||||||
const point = new Vector3();
|
const point = new Vector3();
|
||||||
|
|
||||||
function handleModelTransform(data: ModelTransformEventData) {
|
function handleModelTransform(
|
||||||
|
event: QuicklimeEvent<ModelTransformEventData>
|
||||||
|
) {
|
||||||
clip.normal
|
clip.normal
|
||||||
.set(0, 0, -1)
|
.set(0, 0, -1)
|
||||||
.applyAxisAngle(I_HAT, data.pitch)
|
.applyAxisAngle(I_HAT, event.data.pitch)
|
||||||
.applyAxisAngle(J_HAT, data.yaw ?? 0);
|
.applyAxisAngle(J_HAT, event.data.yaw);
|
||||||
clip.constant = 0;
|
clip.constant = 0;
|
||||||
|
|
||||||
point
|
point
|
||||||
.copy(gunOrigin)
|
.copy(gunOrigin)
|
||||||
.applyAxisAngle(J_HAT, data.yaw ?? 0)
|
.applyAxisAngle(J_HAT, event.data.yaw)
|
||||||
.add(clip.normal.multiplyScalar(-distanceToBarrel))
|
.add(clip.normal.multiplyScalar(-distanceToBarrel))
|
||||||
.add(neckOrigin);
|
.add(neckOrigin);
|
||||||
clip.normal.normalize();
|
clip.normal.normalize();
|
||||||
@@ -226,7 +227,7 @@ export function StaticArmorSceneComponent({
|
|||||||
{
|
{
|
||||||
type: props.type,
|
type: props.type,
|
||||||
variant:
|
variant:
|
||||||
props.type === ArmorType.External ? props.variant : 'gun',
|
props.type === ArmorType.External ? props.variant : "gun",
|
||||||
thickness,
|
thickness,
|
||||||
} satisfies ArmorUserData
|
} satisfies ArmorUserData
|
||||||
}
|
}
|
||||||
@@ -235,7 +236,7 @@ export function StaticArmorSceneComponent({
|
|||||||
|
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
|
|
||||||
const { editStatic } = tankopediaEphemeralStore.getState();
|
const { editStatic } = Tankopedia.state;
|
||||||
|
|
||||||
const bounds = new Box3().setFromObject(event.object);
|
const bounds = new Box3().setFromObject(event.object);
|
||||||
const point = bounds.min
|
const point = bounds.min
|
||||||
@@ -250,13 +251,13 @@ export function StaticArmorSceneComponent({
|
|||||||
const surfaceNormal = event
|
const surfaceNormal = event
|
||||||
.normal!.clone()
|
.normal!.clone()
|
||||||
.applyQuaternion(
|
.applyQuaternion(
|
||||||
event.object.getWorldQuaternion(new Quaternion()),
|
event.object.getWorldQuaternion(new Quaternion())
|
||||||
);
|
);
|
||||||
const angle = surfaceNormal.angleTo(cameraNormal);
|
const angle = surfaceNormal.angleTo(cameraNormal);
|
||||||
const thicknessAngled =
|
const thicknessAngled =
|
||||||
thickness / Math.sin(Math.PI / 2 - angle);
|
thickness / Math.sin(Math.PI / 2 - angle);
|
||||||
|
|
||||||
mutateTankopediaEphemeralStore((draft) => {
|
Tankopedia.mutate((draft) => {
|
||||||
draft.highlightArmor = {
|
draft.highlightArmor = {
|
||||||
type: props.type,
|
type: props.type,
|
||||||
name,
|
name,
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
import { assertSecret, idToRegion } from '@blitzkit/core';
|
import { assertSecret, idToRegion } from "@blitzkit/core";
|
||||||
import { Button, Flex, Heading, Text } from '@radix-ui/themes';
|
import { Button, Flex, Heading, Text } from "@radix-ui/themes";
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from "react";
|
||||||
import {
|
import {
|
||||||
LocaleProvider,
|
LocaleProvider,
|
||||||
useLocale,
|
useLocale,
|
||||||
type LocaleAcceptorProps,
|
type LocaleAcceptorProps,
|
||||||
} from '../../hooks/useLocale';
|
} from "../../hooks/useLocale";
|
||||||
import { App } from '../../stores/app';
|
import { App } from "../../stores/app";
|
||||||
import { CURRENT_POLICIES_AGREEMENT_INDEX } from '../../stores/app/constants';
|
import { CURRENT_POLICIES_AGREEMENT_INDEX } from "../../stores/app/constants";
|
||||||
import { LinkI18n } from '../LinkI18n';
|
import { LinkI18n } from "../LinkI18n";
|
||||||
import './index.css';
|
import "./index.css";
|
||||||
|
|
||||||
type Extension =
|
type Extension =
|
||||||
| {
|
| {
|
||||||
status: 'ok';
|
status: "ok";
|
||||||
data: {
|
data: {
|
||||||
access_token: string;
|
access_token: string;
|
||||||
account_id: number;
|
account_id: number;
|
||||||
@@ -21,15 +21,13 @@ type Extension =
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
| {
|
| {
|
||||||
status: 'error';
|
status: "error";
|
||||||
};
|
};
|
||||||
|
|
||||||
export function Checks({ locale }: LocaleAcceptorProps) {
|
export function Checks({ locale }: LocaleAcceptorProps) {
|
||||||
return (
|
return (
|
||||||
<LocaleProvider locale={locale}>
|
<LocaleProvider locale={locale}>
|
||||||
<App.Provider>
|
<Content />
|
||||||
<Content />
|
|
||||||
</App.Provider>
|
|
||||||
</LocaleProvider>
|
</LocaleProvider>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -40,19 +38,17 @@ export function Checks({ locale }: LocaleAcceptorProps) {
|
|||||||
function Content() {
|
function Content() {
|
||||||
const { locale } = useLocale();
|
const { locale } = useLocale();
|
||||||
const logins = App.use((state) => state.logins);
|
const logins = App.use((state) => state.logins);
|
||||||
const mutateApp = App.useMutation();
|
|
||||||
const appStore = App.useStore();
|
|
||||||
const policiesAgreementIndex = App.use(
|
const policiesAgreementIndex = App.use(
|
||||||
(state) => state.policiesAgreementIndex,
|
(state) => state.policiesAgreementIndex
|
||||||
);
|
);
|
||||||
const isLegal = window.location.pathname.startsWith('/legal');
|
const isLegal = window.location.pathname.startsWith("/legal");
|
||||||
const [showPoliciesAgreement, setShowPoliciesAgreement] = useState(false);
|
const [showPoliciesAgreement, setShowPoliciesAgreement] = useState(false);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
function unsubscribe() {
|
function unsubscribe() {
|
||||||
window.removeEventListener('scroll', show);
|
window.removeEventListener("scroll", show);
|
||||||
window.removeEventListener('pointermove', show);
|
window.removeEventListener("pointermove", show);
|
||||||
window.removeEventListener('pointerdown', show);
|
window.removeEventListener("pointerdown", show);
|
||||||
}
|
}
|
||||||
|
|
||||||
function show() {
|
function show() {
|
||||||
@@ -64,9 +60,9 @@ function Content() {
|
|||||||
policiesAgreementIndex !== CURRENT_POLICIES_AGREEMENT_INDEX &&
|
policiesAgreementIndex !== CURRENT_POLICIES_AGREEMENT_INDEX &&
|
||||||
!isLegal
|
!isLegal
|
||||||
) {
|
) {
|
||||||
window.addEventListener('scroll', show);
|
window.addEventListener("scroll", show);
|
||||||
window.addEventListener('pointermove', show);
|
window.addEventListener("pointermove", show);
|
||||||
window.addEventListener('pointerdown', show);
|
window.addEventListener("pointerdown", show);
|
||||||
}
|
}
|
||||||
|
|
||||||
return unsubscribe;
|
return unsubscribe;
|
||||||
@@ -78,25 +74,25 @@ function Content() {
|
|||||||
const expiresInDays = expiresIn / 1000 / 60 / 60 / 24;
|
const expiresInDays = expiresIn / 1000 / 60 / 60 / 24;
|
||||||
|
|
||||||
if (expiresInDays < 0) {
|
if (expiresInDays < 0) {
|
||||||
mutateApp((draft) => {
|
App.mutate((draft) => {
|
||||||
draft.logins.wargaming = undefined;
|
draft.logins.wargaming = undefined;
|
||||||
});
|
});
|
||||||
} else if (expiresInDays < 7) {
|
} else if (expiresInDays < 7) {
|
||||||
const { wargaming } = appStore.getState().logins;
|
const { wargaming } = App.state.logins;
|
||||||
|
|
||||||
if (!wargaming) return;
|
if (!wargaming) return;
|
||||||
|
|
||||||
fetch(
|
fetch(
|
||||||
`https://api.worldoftanks.${idToRegion(
|
`https://api.worldoftanks.${idToRegion(
|
||||||
wargaming.id,
|
wargaming.id
|
||||||
)}/wot/auth/prolongate/?application_id=${assertSecret(
|
)}/wot/auth/prolongate/?application_id=${assertSecret(
|
||||||
import.meta.env.PUBLIC_WARGAMING_APPLICATION_ID,
|
import.meta.env.PUBLIC_WARGAMING_APPLICATION_ID
|
||||||
)}&access_token=${wargaming.token}`,
|
)}&access_token=${wargaming.token}`
|
||||||
)
|
)
|
||||||
.then((response) => response.json() as Promise<Extension>)
|
.then((response) => response.json() as Promise<Extension>)
|
||||||
.then((json) => {
|
.then((json) => {
|
||||||
mutateApp((draft) => {
|
App.mutate((draft) => {
|
||||||
if (json.status === 'error') {
|
if (json.status === "error") {
|
||||||
draft.logins.wargaming = undefined;
|
draft.logins.wargaming = undefined;
|
||||||
} else {
|
} else {
|
||||||
draft.logins.wargaming = {
|
draft.logins.wargaming = {
|
||||||
@@ -126,11 +122,11 @@ function Content() {
|
|||||||
|
|
||||||
<Text>
|
<Text>
|
||||||
This website utilizes cookies to perform analytics and personalize
|
This website utilizes cookies to perform analytics and personalize
|
||||||
your experience. You can learn more through{' '}
|
your experience. You can learn more through{" "}
|
||||||
<LinkI18n locale={locale} href="/docs/legal/privacy-policy">
|
<LinkI18n locale={locale} href="/docs/legal/privacy-policy">
|
||||||
our privacy policy
|
our privacy policy
|
||||||
</LinkI18n>
|
</LinkI18n>
|
||||||
. By using BlitzKit, you also agree to our{' '}
|
. By using BlitzKit, you also agree to our{" "}
|
||||||
<LinkI18n locale={locale} href="/docs/legal/terms-of-service">
|
<LinkI18n locale={locale} href="/docs/legal/terms-of-service">
|
||||||
terms of service
|
terms of service
|
||||||
</LinkI18n>
|
</LinkI18n>
|
||||||
@@ -141,8 +137,8 @@ function Content() {
|
|||||||
<Button
|
<Button
|
||||||
mt="2"
|
mt="2"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
appStore.setState({
|
App.mutate((draft) => {
|
||||||
policiesAgreementIndex: CURRENT_POLICIES_AGREEMENT_INDEX,
|
draft.policiesAgreementIndex = CURRENT_POLICIES_AGREEMENT_INDEX;
|
||||||
});
|
});
|
||||||
setShowPoliciesAgreement(false);
|
setShowPoliciesAgreement(false);
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import { asset } from '@blitzkit/core';
|
import { asset } from "@blitzkit/core";
|
||||||
import { Flex, Heading, IconButton, Table } from '@radix-ui/themes';
|
import { Flex, Heading, IconButton, Table } from "@radix-ui/themes";
|
||||||
import type { TankCharacteristics } from '../../core/blitzkit/tankCharacteristics';
|
import type { TankCharacteristics } from "../../core/blitzkit/tankCharacteristics";
|
||||||
import { useLocale } from '../../hooks/useLocale';
|
import { useLocale } from "../../hooks/useLocale";
|
||||||
import { CompareEphemeral } from '../../stores/compareEphemeral';
|
import { CompareEphemeral } from "../../stores/compareEphemeral";
|
||||||
import { StickyColumnHeaderCell } from '../StickyColumnHeaderCell';
|
import { StickyColumnHeaderCell } from "../StickyColumnHeaderCell";
|
||||||
import { CompareRow } from './CompareRow';
|
import { CompareRow } from "./CompareRow";
|
||||||
import { CompareSectionTitle } from './CompareSectionTitle';
|
import { CompareSectionTitle } from "./CompareSectionTitle";
|
||||||
|
|
||||||
interface BodyProps {
|
interface BodyProps {
|
||||||
stats: TankCharacteristics[];
|
stats: TankCharacteristics[];
|
||||||
@@ -14,10 +14,9 @@ interface BodyProps {
|
|||||||
export function Body({ stats }: BodyProps) {
|
export function Body({ stats }: BodyProps) {
|
||||||
const members = CompareEphemeral.use((state) => state.members);
|
const members = CompareEphemeral.use((state) => state.members);
|
||||||
const hasNonRegularGun = members.some(
|
const hasNonRegularGun = members.some(
|
||||||
({ gun }) => gun.gun_type!.$case !== 'regular',
|
({ gun }) => gun.gun_type!.$case !== "regular"
|
||||||
);
|
);
|
||||||
const { unwrap, strings } = useLocale();
|
const { unwrap, strings } = useLocale();
|
||||||
const mutateCompareEphemeral = CompareEphemeral.useMutation();
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -33,43 +32,35 @@ export function Body({ stats }: BodyProps) {
|
|||||||
<StickyColumnHeaderCell key={key} top={137}>
|
<StickyColumnHeaderCell key={key} top={137}>
|
||||||
<Flex justify="center">
|
<Flex justify="center">
|
||||||
<Flex>
|
<Flex>
|
||||||
{gun.gun_type!.value.base.shells.map(
|
{gun.shells.map((thisShell, shellIndex) => (
|
||||||
(thisShell, shellIndex) => (
|
<IconButton
|
||||||
<IconButton
|
color={thisShell.id === shell.id ? undefined : "gray"}
|
||||||
color={thisShell.id === shell.id ? undefined : 'gray'}
|
variant="soft"
|
||||||
variant="soft"
|
key={thisShell.id}
|
||||||
key={thisShell.id}
|
style={{
|
||||||
style={{
|
borderTopLeftRadius: shellIndex === 0 ? undefined : 0,
|
||||||
borderTopLeftRadius: shellIndex === 0 ? undefined : 0,
|
borderBottomLeftRadius:
|
||||||
borderBottomLeftRadius:
|
shellIndex === 0 ? undefined : 0,
|
||||||
shellIndex === 0 ? undefined : 0,
|
borderTopRightRadius:
|
||||||
borderTopRightRadius:
|
shellIndex === gun.shells.length - 1 ? undefined : 0,
|
||||||
shellIndex ===
|
borderBottomRightRadius:
|
||||||
gun.gun_type!.value.base.shells.length - 1
|
shellIndex === gun.shells.length - 1 ? undefined : 0,
|
||||||
? undefined
|
marginLeft: shellIndex === 0 ? 0 : -1,
|
||||||
: 0,
|
}}
|
||||||
borderBottomRightRadius:
|
onClick={() => {
|
||||||
shellIndex ===
|
CompareEphemeral.mutate((draft) => {
|
||||||
gun.gun_type!.value.base.shells.length - 1
|
draft.members[index].shell = thisShell;
|
||||||
? undefined
|
});
|
||||||
: 0,
|
}}
|
||||||
marginLeft: shellIndex === 0 ? 0 : -1,
|
>
|
||||||
}}
|
<img
|
||||||
onClick={() => {
|
alt={unwrap(thisShell.name)}
|
||||||
mutateCompareEphemeral((draft) => {
|
width={16}
|
||||||
draft.members[index].shell = thisShell;
|
height={16}
|
||||||
});
|
src={asset(`icons/shells/${thisShell.icon}.webp`)}
|
||||||
}}
|
/>
|
||||||
>
|
</IconButton>
|
||||||
<img
|
))}
|
||||||
alt={unwrap(thisShell.name)}
|
|
||||||
width={16}
|
|
||||||
height={16}
|
|
||||||
src={asset(`icons/shells/${thisShell.icon}.webp`)}
|
|
||||||
/>
|
|
||||||
</IconButton>
|
|
||||||
),
|
|
||||||
)}
|
|
||||||
</Flex>
|
</Flex>
|
||||||
</Flex>
|
</Flex>
|
||||||
</StickyColumnHeaderCell>
|
</StickyColumnHeaderCell>
|
||||||
@@ -79,6 +70,12 @@ export function Body({ stats }: BodyProps) {
|
|||||||
|
|
||||||
<Table.Body>
|
<Table.Body>
|
||||||
<CompareRow stats={stats} value="dpm" decimals={0} />
|
<CompareRow stats={stats} value="dpm" decimals={0} />
|
||||||
|
<CompareRow stats={stats} value="damage" decimals={0} />
|
||||||
|
{hasNonRegularGun && (
|
||||||
|
<CompareRow stats={stats} indent value="clipDamage" decimals={0} />
|
||||||
|
)}
|
||||||
|
<CompareRow stats={stats} value="moduleDamage" decimals={0} />
|
||||||
|
<CompareRow stats={stats} value="penetration" decimals={0} />
|
||||||
<CompareRow
|
<CompareRow
|
||||||
stats={stats}
|
stats={stats}
|
||||||
name={strings.website.tools.tankopedia.characteristics.values.reload}
|
name={strings.website.tools.tankopedia.characteristics.values.reload}
|
||||||
@@ -90,7 +87,7 @@ export function Body({ stats }: BodyProps) {
|
|||||||
}
|
}
|
||||||
display={(stats) =>
|
display={(stats) =>
|
||||||
stats.shellReload?.toFixed(2) ??
|
stats.shellReload?.toFixed(2) ??
|
||||||
stats.shellReloads!.map((reload) => reload.toFixed(2)).join(', ')
|
stats.shellReloads!.map((reload) => reload.toFixed(2)).join(", ")
|
||||||
}
|
}
|
||||||
deltaNominalDisplay={(delta) => delta.toFixed(2)}
|
deltaNominalDisplay={(delta) => delta.toFixed(2)}
|
||||||
/>
|
/>
|
||||||
@@ -105,12 +102,6 @@ export function Body({ stats }: BodyProps) {
|
|||||||
<CompareRow stats={stats} value="shells" decimals={0} />
|
<CompareRow stats={stats} value="shells" decimals={0} />
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
<CompareRow stats={stats} value="penetration" decimals={0} />
|
|
||||||
<CompareRow stats={stats} value="damage" decimals={0} />
|
|
||||||
{hasNonRegularGun && (
|
|
||||||
<CompareRow stats={stats} indent value="clipDamage" decimals={0} />
|
|
||||||
)}
|
|
||||||
<CompareRow stats={stats} value="moduleDamage" decimals={0} />
|
|
||||||
<CompareRow stats={stats} value="caliber" decimals={0} />
|
<CompareRow stats={stats} value="caliber" decimals={0} />
|
||||||
<CompareRow stats={stats} value="shellNormalization" decimals={0} />
|
<CompareRow stats={stats} value="shellNormalization" decimals={0} />
|
||||||
<CompareRow
|
<CompareRow
|
||||||
|
|||||||
@@ -2,21 +2,21 @@ import {
|
|||||||
CaretLeftIcon,
|
CaretLeftIcon,
|
||||||
CaretRightIcon,
|
CaretRightIcon,
|
||||||
CaretSortIcon,
|
CaretSortIcon,
|
||||||
} from '@radix-ui/react-icons';
|
} from "@radix-ui/react-icons";
|
||||||
import { Flex, IconButton, Table, Text } from '@radix-ui/themes';
|
import { Flex, IconButton, Table, Text } from "@radix-ui/themes";
|
||||||
import { useRef } from 'react';
|
import { useRef } from "react";
|
||||||
import type { TankCharacteristics } from '../../core/blitzkit/tankCharacteristics';
|
import type { TankCharacteristics } from "../../core/blitzkit/tankCharacteristics";
|
||||||
import { Var } from '../../core/radix/var';
|
import { Var } from "../../core/radix/var";
|
||||||
import { useLocale } from '../../hooks/useLocale';
|
import { useLocale } from "../../hooks/useLocale";
|
||||||
import { CompareEphemeral } from '../../stores/compareEphemeral';
|
import { CompareEphemeral } from "../../stores/compareEphemeral";
|
||||||
import { ComparePersistent } from '../../stores/comparePersistent';
|
import { ComparePersistent } from "../../stores/comparePersistent";
|
||||||
import { StickyRowHeaderCell } from '../StickyRowHeaderCell';
|
import { StickyRowHeaderCell } from "../StickyRowHeaderCell";
|
||||||
|
|
||||||
type CompareRowProps = {
|
type CompareRowProps = {
|
||||||
display?: (
|
display?: (
|
||||||
member: Awaited<TankCharacteristics>,
|
member: Awaited<TankCharacteristics>
|
||||||
) => number | string | undefined;
|
) => number | string | undefined;
|
||||||
deltaType?: 'higherIsBetter' | 'lowerIsBetter';
|
deltaType?: "higherIsBetter" | "lowerIsBetter";
|
||||||
decimals?: number;
|
decimals?: number;
|
||||||
deltaNominalDisplay?: (delta: number) => string | number;
|
deltaNominalDisplay?: (delta: number) => string | number;
|
||||||
indent?: boolean;
|
indent?: boolean;
|
||||||
@@ -33,7 +33,7 @@ type CompareRowProps = {
|
|||||||
|
|
||||||
export function CompareRow({
|
export function CompareRow({
|
||||||
display,
|
display,
|
||||||
deltaType = 'higherIsBetter',
|
deltaType = "higherIsBetter",
|
||||||
decimals,
|
decimals,
|
||||||
deltaNominalDisplay,
|
deltaNominalDisplay,
|
||||||
indent,
|
indent,
|
||||||
@@ -41,17 +41,16 @@ export function CompareRow({
|
|||||||
...props
|
...props
|
||||||
}: CompareRowProps) {
|
}: CompareRowProps) {
|
||||||
const { strings } = useLocale();
|
const { strings } = useLocale();
|
||||||
const mutateCompareEphemeral = CompareEphemeral.useMutation();
|
|
||||||
const sorting = CompareEphemeral.use((state) => state.sorting);
|
const sorting = CompareEphemeral.use((state) => state.sorting);
|
||||||
const deltaMode = ComparePersistent.use((state) => state.deltaMode);
|
const deltaMode = ComparePersistent.use((state) => state.deltaMode);
|
||||||
const values = stats.map((stat) =>
|
const values = stats.map((stat) =>
|
||||||
typeof props.value === 'function'
|
typeof props.value === "function"
|
||||||
? props.value(stat)!
|
? props.value(stat)!
|
||||||
: (stat[props.value] as number),
|
: (stat[props.value] as number)
|
||||||
);
|
);
|
||||||
const id = useRef(Math.random());
|
const id = useRef(Math.random());
|
||||||
const name =
|
const name =
|
||||||
typeof props.value === 'string'
|
typeof props.value === "string"
|
||||||
? strings.website.tools.tankopedia.characteristics.values[props.value]
|
? strings.website.tools.tankopedia.characteristics.values[props.value]
|
||||||
: props.name;
|
: props.name;
|
||||||
|
|
||||||
@@ -60,21 +59,21 @@ export function CompareRow({
|
|||||||
<StickyRowHeaderCell>
|
<StickyRowHeaderCell>
|
||||||
<Flex
|
<Flex
|
||||||
align="center"
|
align="center"
|
||||||
style={{ whiteSpace: 'nowrap' }}
|
style={{ whiteSpace: "nowrap" }}
|
||||||
gap={indent ? { initial: '4', sm: '6' } : { initial: '1', sm: '2' }}
|
gap={indent ? { initial: "4", sm: "6" } : { initial: "1", sm: "2" }}
|
||||||
>
|
>
|
||||||
<IconButton
|
<IconButton
|
||||||
color={sorting?.by === id.current ? undefined : 'gray'}
|
color={sorting?.by === id.current ? undefined : "gray"}
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
mutateCompareEphemeral((draft) => {
|
CompareEphemeral.mutate((draft) => {
|
||||||
draft.members.sort((memberA, memberB) => {
|
draft.members.sort((memberA, memberB) => {
|
||||||
const indexA = draft.members.indexOf(memberA);
|
const indexA = draft.members.indexOf(memberA);
|
||||||
const indexB = draft.members.indexOf(memberB);
|
const indexB = draft.members.indexOf(memberB);
|
||||||
const valueA = values[indexA];
|
const valueA = values[indexA];
|
||||||
const valueB = values[indexB];
|
const valueB = values[indexB];
|
||||||
|
|
||||||
return draft.sorting?.direction === 'ascending' &&
|
return draft.sorting?.direction === "ascending" &&
|
||||||
draft.sorting.by === id.current
|
draft.sorting.by === id.current
|
||||||
? valueA - valueB
|
? valueA - valueB
|
||||||
: valueB - valueA;
|
: valueB - valueA;
|
||||||
@@ -83,26 +82,26 @@ export function CompareRow({
|
|||||||
draft.sorting = {
|
draft.sorting = {
|
||||||
by: id.current,
|
by: id.current,
|
||||||
direction:
|
direction:
|
||||||
draft.sorting?.direction === 'ascending' &&
|
draft.sorting?.direction === "ascending" &&
|
||||||
draft.sorting.by === id.current
|
draft.sorting.by === id.current
|
||||||
? 'descending'
|
? "descending"
|
||||||
: 'ascending',
|
: "ascending",
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{(sorting === undefined || sorting.by !== id.current) && (
|
{(sorting === undefined || sorting.by !== id.current) && (
|
||||||
<CaretSortIcon style={{ transform: 'rotate(90deg)' }} />
|
<CaretSortIcon style={{ transform: "rotate(90deg)" }} />
|
||||||
)}
|
)}
|
||||||
{sorting?.by === id.current && (
|
{sorting?.by === id.current && (
|
||||||
<>
|
<>
|
||||||
{sorting.direction === 'ascending' && <CaretRightIcon />}
|
{sorting.direction === "ascending" && <CaretRightIcon />}
|
||||||
{sorting.direction === 'descending' && <CaretLeftIcon />}
|
{sorting.direction === "descending" && <CaretLeftIcon />}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</IconButton>
|
</IconButton>
|
||||||
|
|
||||||
<Text size={{ initial: '1', sm: '2' }}>{name}</Text>
|
<Text size={{ initial: "1", sm: "2" }}>{name}</Text>
|
||||||
</Flex>
|
</Flex>
|
||||||
</StickyRowHeaderCell>
|
</StickyRowHeaderCell>
|
||||||
|
|
||||||
@@ -110,7 +109,7 @@ export function CompareRow({
|
|||||||
const delta = value - values[0];
|
const delta = value - values[0];
|
||||||
const deltaPercentage = value / values[0] - 1;
|
const deltaPercentage = value / values[0] - 1;
|
||||||
const normalizedDeltaPercentage = Math.round(
|
const normalizedDeltaPercentage = Math.round(
|
||||||
Math.min(100, Math.abs(deltaPercentage) * 2 * 100 + 25),
|
Math.min(100, Math.abs(deltaPercentage) * 2 * 100 + 25)
|
||||||
);
|
);
|
||||||
const resolvedDisplayValue = display
|
const resolvedDisplayValue = display
|
||||||
? display(stats[index])
|
? display(stats[index])
|
||||||
@@ -129,12 +128,12 @@ export function CompareRow({
|
|||||||
value === values[0]
|
value === values[0]
|
||||||
? undefined
|
? undefined
|
||||||
: (
|
: (
|
||||||
deltaType === 'higherIsBetter'
|
deltaType === "higherIsBetter"
|
||||||
? value > values[0]
|
? value > values[0]
|
||||||
: value < values[0]
|
: value < values[0]
|
||||||
)
|
)
|
||||||
? `color-mix(in srgb, ${Var('green-7')} ${normalizedDeltaPercentage}%, ${Var('green-3')})`
|
? `color-mix(in srgb, ${Var("green-7")} ${normalizedDeltaPercentage}%, ${Var("green-3")})`
|
||||||
: `color-mix(in srgb, ${Var('red-7')} ${normalizedDeltaPercentage}%, ${Var('red-3')})`,
|
: `color-mix(in srgb, ${Var("red-7")} ${normalizedDeltaPercentage}%, ${Var("red-3")})`,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Flex
|
<Flex
|
||||||
@@ -142,11 +141,11 @@ export function CompareRow({
|
|||||||
justify="center"
|
justify="center"
|
||||||
gap="2"
|
gap="2"
|
||||||
style={{
|
style={{
|
||||||
width: '100%',
|
width: "100%",
|
||||||
height: '100%',
|
height: "100%",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Text style={{ textAlign: 'center' }} wrap="nowrap">
|
<Text style={{ textAlign: "center" }} wrap="nowrap">
|
||||||
{resolvedDisplayValue}
|
{resolvedDisplayValue}
|
||||||
</Text>
|
</Text>
|
||||||
|
|
||||||
@@ -154,10 +153,10 @@ export function CompareRow({
|
|||||||
resolvedDisplayValue !== undefined &&
|
resolvedDisplayValue !== undefined &&
|
||||||
values[0] !== undefined && (
|
values[0] !== undefined && (
|
||||||
<>
|
<>
|
||||||
{deltaMode === 'absolute' && (
|
{deltaMode === "absolute" && (
|
||||||
<Text color="gray">
|
<Text color="gray">
|
||||||
(
|
(
|
||||||
{`${delta > 0 ? '+' : ''}${
|
{`${delta > 0 ? "+" : ""}${
|
||||||
deltaNominalDisplay
|
deltaNominalDisplay
|
||||||
? deltaNominalDisplay(delta)
|
? deltaNominalDisplay(delta)
|
||||||
: decimals === undefined
|
: decimals === undefined
|
||||||
@@ -168,11 +167,11 @@ export function CompareRow({
|
|||||||
</Text>
|
</Text>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{deltaMode === 'percentage' && (
|
{deltaMode === "percentage" && (
|
||||||
<Text color="gray">
|
<Text color="gray">
|
||||||
(
|
(
|
||||||
{`${deltaPercentage > 0 ? '+' : ''}${Math.round(
|
{`${deltaPercentage > 0 ? "+" : ""}${Math.round(
|
||||||
deltaPercentage * 100,
|
deltaPercentage * 100
|
||||||
)}%`}
|
)}%`}
|
||||||
)
|
)
|
||||||
</Text>
|
</Text>
|
||||||
|
|||||||
@@ -1,28 +1,28 @@
|
|||||||
import { asset, availableProvisions, permanentSkills } from '@blitzkit/core';
|
import { asset, availableProvisions, permanentSkills } from "@blitzkit/core";
|
||||||
import { checkConsumableProvisionInclusivity } from '@blitzkit/core/src/blitzkit/checkConsumableProvisionInclusivity';
|
import { checkConsumableProvisionInclusivity } from "@blitzkit/core/src/blitzkit/checkConsumableProvisionInclusivity";
|
||||||
import { ComponentPlaceholderIcon } from '@radix-ui/react-icons';
|
import { ComponentPlaceholderIcon } from "@radix-ui/react-icons";
|
||||||
import { Button, Flex, IconButton, Popover, Table } from '@radix-ui/themes';
|
import { Button, Flex, IconButton, Popover, Table } from "@radix-ui/themes";
|
||||||
import { times } from 'lodash-es';
|
import { times } from "lodash-es";
|
||||||
import { awaitableConsumableDefinitions } from '../../core/awaitables/consumableDefinitions';
|
import { awaitableConsumableDefinitions } from "../../core/awaitables/consumableDefinitions";
|
||||||
import { awaitableEquipmentDefinitions } from '../../core/awaitables/equipmentDefinitions';
|
import { awaitableEquipmentDefinitions } from "../../core/awaitables/equipmentDefinitions";
|
||||||
import { awaitableProvisionDefinitions } from '../../core/awaitables/provisionDefinitions';
|
import { awaitableProvisionDefinitions } from "../../core/awaitables/provisionDefinitions";
|
||||||
import { awaitableSkillDefinitions } from '../../core/awaitables/skillDefinitions';
|
import { awaitableSkillDefinitions } from "../../core/awaitables/skillDefinitions";
|
||||||
import type { TankCharacteristics } from '../../core/blitzkit/tankCharacteristics';
|
import type { TankCharacteristics } from "../../core/blitzkit/tankCharacteristics";
|
||||||
import { Var } from '../../core/radix/var';
|
import { Var } from "../../core/radix/var";
|
||||||
import { useLocale } from '../../hooks/useLocale';
|
import { useLocale } from "../../hooks/useLocale";
|
||||||
import { CompareEphemeral } from '../../stores/compareEphemeral';
|
import { CompareEphemeral } from "../../stores/compareEphemeral";
|
||||||
import type { EquipmentMatrix } from '../../stores/duel';
|
import type { EquipmentMatrix } from "../../stores/duel";
|
||||||
import { BlitzkitButtonGrayIcon } from '../BlitzkitButtonGrayIcon';
|
import { BlitzkitButtonGrayIcon } from "../BlitzkitButtonGrayIcon";
|
||||||
import { ConsumablesManager } from '../ConsumablesManager';
|
import { ConsumablesManager } from "../ConsumablesManager";
|
||||||
import { CrewSkillManager } from '../CrewSkillManager';
|
import { CrewSkillManager } from "../CrewSkillManager";
|
||||||
import { EquipmentManager } from '../EquipmentManager';
|
import { EquipmentManager } from "../EquipmentManager";
|
||||||
import { ModuleManager } from '../ModuleManager';
|
import { ModuleManager } from "../ModuleManager";
|
||||||
import { ProvisionsManager } from '../ProvisionsManager';
|
import { ProvisionsManager } from "../ProvisionsManager";
|
||||||
import { StickyColumnHeaderCell } from '../StickyColumnHeaderCell';
|
import { StickyColumnHeaderCell } from "../StickyColumnHeaderCell";
|
||||||
import { StickyTableRoot } from '../StickyTableRoot';
|
import { StickyTableRoot } from "../StickyTableRoot";
|
||||||
import { Body } from './Body';
|
import { Body } from "./Body";
|
||||||
import { InsertionMarker } from './IntersectionMarker';
|
import { InsertionMarker } from "./IntersectionMarker";
|
||||||
import { TankCard } from './TankCard';
|
import { TankCard } from "./TankCard";
|
||||||
|
|
||||||
interface CompareTableProps {
|
interface CompareTableProps {
|
||||||
stats: TankCharacteristics[];
|
stats: TankCharacteristics[];
|
||||||
@@ -43,7 +43,6 @@ const [
|
|||||||
export function CompareTable({ stats }: CompareTableProps) {
|
export function CompareTable({ stats }: CompareTableProps) {
|
||||||
const crewSkills = CompareEphemeral.use((state) => state.crewSkills);
|
const crewSkills = CompareEphemeral.use((state) => state.crewSkills);
|
||||||
const members = CompareEphemeral.use((state) => state.members);
|
const members = CompareEphemeral.use((state) => state.members);
|
||||||
const mutateCompareEphemeral = CompareEphemeral.useMutation();
|
|
||||||
const { unwrap, strings } = useLocale();
|
const { unwrap, strings } = useLocale();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -51,20 +50,20 @@ export function CompareTable({ stats }: CompareTableProps) {
|
|||||||
size="1"
|
size="1"
|
||||||
variant="surface"
|
variant="surface"
|
||||||
style={{
|
style={{
|
||||||
position: 'absolute',
|
position: "absolute",
|
||||||
maxWidth: '100%',
|
maxWidth: "100%",
|
||||||
maxHeight: '100%',
|
maxHeight: "100%",
|
||||||
height: '100%',
|
height: "100%",
|
||||||
// height: 'calc(100vh - 128px)'
|
// height: 'calc(100vh - 128px)'
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Table.Header>
|
<Table.Header>
|
||||||
<Table.Row>
|
<Table.Row>
|
||||||
<StickyColumnHeaderCell width="0" style={{ height: '100%' }}>
|
<StickyColumnHeaderCell width="0" style={{ height: "100%" }}>
|
||||||
<Flex
|
<Flex
|
||||||
style={{
|
style={{
|
||||||
width: '100%',
|
width: "100%",
|
||||||
height: '100%',
|
height: "100%",
|
||||||
}}
|
}}
|
||||||
align="center"
|
align="center"
|
||||||
justify="center"
|
justify="center"
|
||||||
@@ -82,11 +81,11 @@ export function CompareTable({ stats }: CompareTableProps) {
|
|||||||
|
|
||||||
<Table.Body>
|
<Table.Body>
|
||||||
<Table.Row>
|
<Table.Row>
|
||||||
<Table.Cell style={{ height: '100%' }}>
|
<Table.Cell style={{ height: "100%" }}>
|
||||||
<Flex
|
<Flex
|
||||||
style={{
|
style={{
|
||||||
width: '100%',
|
width: "100%",
|
||||||
height: '100%',
|
height: "100%",
|
||||||
}}
|
}}
|
||||||
align="center"
|
align="center"
|
||||||
justify="center"
|
justify="center"
|
||||||
@@ -107,15 +106,15 @@ export function CompareTable({ stats }: CompareTableProps) {
|
|||||||
borderRadius: 2,
|
borderRadius: 2,
|
||||||
backgroundColor:
|
backgroundColor:
|
||||||
crewSkills[skill] === 0
|
crewSkills[skill] === 0
|
||||||
? Var('gray-11')
|
? Var("gray-11")
|
||||||
: permanentSkills.includes(skill)
|
: permanentSkills.includes(skill)
|
||||||
? Var('crimson-11')
|
? Var("crimson-11")
|
||||||
: Var('amber-11'),
|
: Var("amber-11"),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</Flex>
|
</Flex>
|
||||||
),
|
)
|
||||||
)}
|
)}
|
||||||
</Flex>
|
</Flex>
|
||||||
</Button>
|
</Button>
|
||||||
@@ -125,7 +124,7 @@ export function CompareTable({ stats }: CompareTableProps) {
|
|||||||
<CrewSkillManager
|
<CrewSkillManager
|
||||||
skillLevels={crewSkills}
|
skillLevels={crewSkills}
|
||||||
onChange={(skills) => {
|
onChange={(skills) => {
|
||||||
mutateCompareEphemeral((draft) => {
|
CompareEphemeral.mutate((draft) => {
|
||||||
draft.crewSkills = skills;
|
draft.crewSkills = skills;
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
@@ -135,7 +134,7 @@ export function CompareTable({ stats }: CompareTableProps) {
|
|||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
mutateCompareEphemeral((draft) => {
|
CompareEphemeral.mutate((draft) => {
|
||||||
Object.keys(draft.crewSkills).forEach((skill) => {
|
Object.keys(draft.crewSkills).forEach((skill) => {
|
||||||
draft.crewSkills[skill] = 0;
|
draft.crewSkills[skill] = 0;
|
||||||
});
|
});
|
||||||
@@ -147,7 +146,7 @@ export function CompareTable({ stats }: CompareTableProps) {
|
|||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
mutateCompareEphemeral((draft) => {
|
CompareEphemeral.mutate((draft) => {
|
||||||
Object.keys(draft.crewSkills).forEach((skill) => {
|
Object.keys(draft.crewSkills).forEach((skill) => {
|
||||||
draft.crewSkills[skill] = 7;
|
draft.crewSkills[skill] = 7;
|
||||||
});
|
});
|
||||||
@@ -177,19 +176,19 @@ export function CompareTable({ stats }: CompareTableProps) {
|
|||||||
consumables,
|
consumables,
|
||||||
camouflage,
|
camouflage,
|
||||||
},
|
},
|
||||||
index,
|
index
|
||||||
) => {
|
) => {
|
||||||
const equipmentPreset =
|
const equipmentPreset =
|
||||||
equipmentDefinitions.presets[tank.equipment_preset];
|
equipmentDefinitions.presets[tank.equipment_preset];
|
||||||
const provisionsList = availableProvisions(
|
const provisionsList = availableProvisions(
|
||||||
tank,
|
tank,
|
||||||
gun,
|
gun,
|
||||||
provisionDefinitions,
|
provisionDefinitions
|
||||||
);
|
);
|
||||||
const consumablesList = Object.values(
|
const consumablesList = Object.values(
|
||||||
consumableDefinitions.consumables,
|
consumableDefinitions.consumables
|
||||||
).filter((consumable) =>
|
).filter((consumable) =>
|
||||||
checkConsumableProvisionInclusivity(consumable, tank, gun),
|
checkConsumableProvisionInclusivity(consumable, tank, gun)
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -205,7 +204,7 @@ export function CompareTable({ stats }: CompareTableProps) {
|
|||||||
<Button variant="ghost">
|
<Button variant="ghost">
|
||||||
<Flex align="center">
|
<Flex align="center">
|
||||||
{(
|
{(
|
||||||
['turret', 'gun', 'engine', 'chassis'] as const
|
["turret", "gun", "engine", "chassis"] as const
|
||||||
).map((module, index) => (
|
).map((module, index) => (
|
||||||
<img
|
<img
|
||||||
key={module}
|
key={module}
|
||||||
@@ -215,7 +214,7 @@ export function CompareTable({ stats }: CompareTableProps) {
|
|||||||
src={asset(`icons/modules/${module}.webp`)}
|
src={asset(`icons/modules/${module}.webp`)}
|
||||||
style={{
|
style={{
|
||||||
marginLeft: index > 0 ? -8 : 0,
|
marginLeft: index > 0 ? -8 : 0,
|
||||||
objectFit: 'contain',
|
objectFit: "contain",
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
@@ -232,7 +231,7 @@ export function CompareTable({ stats }: CompareTableProps) {
|
|||||||
engine={engine}
|
engine={engine}
|
||||||
track={track}
|
track={track}
|
||||||
onChange={(modules) => {
|
onChange={(modules) => {
|
||||||
mutateCompareEphemeral((draft) => {
|
CompareEphemeral.mutate((draft) => {
|
||||||
draft.members[index] = {
|
draft.members[index] = {
|
||||||
...draft.members[index],
|
...draft.members[index],
|
||||||
...modules,
|
...modules,
|
||||||
@@ -245,13 +244,12 @@ export function CompareTable({ stats }: CompareTableProps) {
|
|||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
mutateCompareEphemeral((draft) => {
|
CompareEphemeral.mutate((draft) => {
|
||||||
const member = draft.members[index];
|
const member = draft.members[index];
|
||||||
|
|
||||||
member.turret = member.tank.turrets[0];
|
member.turret = member.tank.turrets[0];
|
||||||
member.gun = member.turret.guns[0];
|
member.gun = member.turret.guns[0];
|
||||||
member.shell =
|
member.shell = member.gun.shells[0];
|
||||||
member.gun.gun_type!.value.base.shells[0];
|
|
||||||
member.engine = member.tank.engines[0];
|
member.engine = member.tank.engines[0];
|
||||||
member.track = member.tank.tracks[0];
|
member.track = member.tank.tracks[0];
|
||||||
});
|
});
|
||||||
@@ -262,13 +260,12 @@ export function CompareTable({ stats }: CompareTableProps) {
|
|||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
mutateCompareEphemeral((draft) => {
|
CompareEphemeral.mutate((draft) => {
|
||||||
const member = draft.members[index];
|
const member = draft.members[index];
|
||||||
|
|
||||||
member.turret = member.tank.turrets.at(-1)!;
|
member.turret = member.tank.turrets.at(-1)!;
|
||||||
member.gun = member.turret.guns.at(-1)!;
|
member.gun = member.turret.guns.at(-1)!;
|
||||||
member.shell =
|
member.shell = member.gun.shells[0];
|
||||||
member.gun.gun_type!.value.base.shells[0];
|
|
||||||
member.engine = member.tank.engines.at(-1)!;
|
member.engine = member.tank.engines.at(-1)!;
|
||||||
member.track = member.tank.tracks.at(-1)!;
|
member.track = member.tank.tracks.at(-1)!;
|
||||||
});
|
});
|
||||||
@@ -290,9 +287,9 @@ export function CompareTable({ stats }: CompareTableProps) {
|
|||||||
variant="ghost"
|
variant="ghost"
|
||||||
radius="large"
|
radius="large"
|
||||||
style={{
|
style={{
|
||||||
height: '100%',
|
height: "100%",
|
||||||
width: 12,
|
width: 12,
|
||||||
position: 'relative',
|
position: "relative",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Flex direction="column" justify="center">
|
<Flex direction="column" justify="center">
|
||||||
@@ -300,14 +297,14 @@ export function CompareTable({ stats }: CompareTableProps) {
|
|||||||
<img
|
<img
|
||||||
alt={unwrap(
|
alt={unwrap(
|
||||||
provisionDefinitions.provisions[provision]
|
provisionDefinitions.provisions[provision]
|
||||||
.name,
|
.name
|
||||||
)}
|
)}
|
||||||
key={provision}
|
key={provision}
|
||||||
src={asset(
|
src={asset(
|
||||||
`/icons/provisions/${provision}.webp`,
|
`/icons/provisions/${provision}.webp`
|
||||||
)}
|
)}
|
||||||
style={{
|
style={{
|
||||||
left: '50%',
|
left: "50%",
|
||||||
/**
|
/**
|
||||||
* max = 100% - 16px - 4px
|
* max = 100% - 16px - 4px
|
||||||
* min = 4px
|
* min = 4px
|
||||||
@@ -322,11 +319,11 @@ export function CompareTable({ stats }: CompareTableProps) {
|
|||||||
? 0.5
|
? 0.5
|
||||||
: index / (provisions.length - 1)
|
: index / (provisions.length - 1)
|
||||||
} * (100% - 24px))`,
|
} * (100% - 24px))`,
|
||||||
transform: 'translateX(-50%)',
|
transform: "translateX(-50%)",
|
||||||
position: 'absolute',
|
position: "absolute",
|
||||||
width: 16,
|
width: 16,
|
||||||
height: 16,
|
height: 16,
|
||||||
objectFit: 'contain',
|
objectFit: "contain",
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
@@ -341,12 +338,12 @@ export function CompareTable({ stats }: CompareTableProps) {
|
|||||||
<Popover.Content>
|
<Popover.Content>
|
||||||
<ProvisionsManager
|
<ProvisionsManager
|
||||||
provisions={provisionsList.map(
|
provisions={provisionsList.map(
|
||||||
(provision) => provision.id,
|
(provision) => provision.id
|
||||||
)}
|
)}
|
||||||
selected={provisions}
|
selected={provisions}
|
||||||
disabled={tank.max_provisions === provisions.length}
|
disabled={tank.max_provisions === provisions.length}
|
||||||
onChange={(provisions) => {
|
onChange={(provisions) => {
|
||||||
mutateCompareEphemeral((draft) => {
|
CompareEphemeral.mutate((draft) => {
|
||||||
draft.members[index].provisions = provisions;
|
draft.members[index].provisions = provisions;
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
@@ -355,7 +352,7 @@ export function CompareTable({ stats }: CompareTableProps) {
|
|||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
mutateCompareEphemeral((draft) => {
|
CompareEphemeral.mutate((draft) => {
|
||||||
draft.members[index].provisions = [];
|
draft.members[index].provisions = [];
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
@@ -396,8 +393,8 @@ export function CompareTable({ stats }: CompareTableProps) {
|
|||||||
height: 8,
|
height: 8,
|
||||||
backgroundColor:
|
backgroundColor:
|
||||||
equipment === -1
|
equipment === -1
|
||||||
? Var('crimson-11')
|
? Var("crimson-11")
|
||||||
: Var('gray-11'),
|
: Var("gray-11"),
|
||||||
borderRadius: 2,
|
borderRadius: 2,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
@@ -407,8 +404,8 @@ export function CompareTable({ stats }: CompareTableProps) {
|
|||||||
height: 8,
|
height: 8,
|
||||||
backgroundColor:
|
backgroundColor:
|
||||||
equipment === 1
|
equipment === 1
|
||||||
? Var('crimson-11')
|
? Var("crimson-11")
|
||||||
: Var('gray-11'),
|
: Var("gray-11"),
|
||||||
borderRadius: 2,
|
borderRadius: 2,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
@@ -426,7 +423,7 @@ export function CompareTable({ stats }: CompareTableProps) {
|
|||||||
matrix={equipmentMatrix}
|
matrix={equipmentMatrix}
|
||||||
preset={equipmentPreset}
|
preset={equipmentPreset}
|
||||||
onChange={(matrix) => {
|
onChange={(matrix) => {
|
||||||
mutateCompareEphemeral((draft) => {
|
CompareEphemeral.mutate((draft) => {
|
||||||
draft.members[index].equipmentMatrix = matrix;
|
draft.members[index].equipmentMatrix = matrix;
|
||||||
draft.sorting = undefined;
|
draft.sorting = undefined;
|
||||||
});
|
});
|
||||||
@@ -438,10 +435,10 @@ export function CompareTable({ stats }: CompareTableProps) {
|
|||||||
variant="ghost"
|
variant="ghost"
|
||||||
color="red"
|
color="red"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
mutateCompareEphemeral((draft) => {
|
CompareEphemeral.mutate((draft) => {
|
||||||
draft.members[index].equipmentMatrix = times(
|
draft.members[index].equipmentMatrix = times(
|
||||||
3,
|
3,
|
||||||
() => times(3, () => 0),
|
() => times(3, () => 0)
|
||||||
) as EquipmentMatrix;
|
) as EquipmentMatrix;
|
||||||
draft.sorting = undefined;
|
draft.sorting = undefined;
|
||||||
});
|
});
|
||||||
@@ -455,7 +452,7 @@ export function CompareTable({ stats }: CompareTableProps) {
|
|||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
mutateCompareEphemeral((draft) => {
|
CompareEphemeral.mutate((draft) => {
|
||||||
draft.members.forEach((member) => {
|
draft.members.forEach((member) => {
|
||||||
member.equipmentMatrix =
|
member.equipmentMatrix =
|
||||||
draft.members[index].equipmentMatrix;
|
draft.members[index].equipmentMatrix;
|
||||||
@@ -479,9 +476,9 @@ export function CompareTable({ stats }: CompareTableProps) {
|
|||||||
variant="ghost"
|
variant="ghost"
|
||||||
radius="large"
|
radius="large"
|
||||||
style={{
|
style={{
|
||||||
height: '100%',
|
height: "100%",
|
||||||
width: 12,
|
width: 12,
|
||||||
position: 'relative',
|
position: "relative",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Flex direction="column" justify="center">
|
<Flex direction="column" justify="center">
|
||||||
@@ -490,14 +487,14 @@ export function CompareTable({ stats }: CompareTableProps) {
|
|||||||
alt={unwrap(
|
alt={unwrap(
|
||||||
consumableDefinitions.consumables[
|
consumableDefinitions.consumables[
|
||||||
consumable
|
consumable
|
||||||
].name,
|
].name
|
||||||
)}
|
)}
|
||||||
key={consumable}
|
key={consumable}
|
||||||
src={asset(
|
src={asset(
|
||||||
`/icons/consumables/${consumable}.webp`,
|
`/icons/consumables/${consumable}.webp`
|
||||||
)}
|
)}
|
||||||
style={{
|
style={{
|
||||||
left: '50%',
|
left: "50%",
|
||||||
/**
|
/**
|
||||||
* max = 100% - 16px - 4px
|
* max = 100% - 16px - 4px
|
||||||
* min = 4px
|
* min = 4px
|
||||||
@@ -512,11 +509,11 @@ export function CompareTable({ stats }: CompareTableProps) {
|
|||||||
? 0.5
|
? 0.5
|
||||||
: index / (consumables.length - 1)
|
: index / (consumables.length - 1)
|
||||||
} * (100% - 24px))`,
|
} * (100% - 24px))`,
|
||||||
transform: 'translateX(-50%)',
|
transform: "translateX(-50%)",
|
||||||
position: 'absolute',
|
position: "absolute",
|
||||||
width: 16,
|
width: 16,
|
||||||
height: 16,
|
height: 16,
|
||||||
objectFit: 'contain',
|
objectFit: "contain",
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
@@ -533,7 +530,7 @@ export function CompareTable({ stats }: CompareTableProps) {
|
|||||||
consumables={consumablesList}
|
consumables={consumablesList}
|
||||||
selected={consumables}
|
selected={consumables}
|
||||||
onConsumablesChange={(consumables) => {
|
onConsumablesChange={(consumables) => {
|
||||||
mutateCompareEphemeral((draft) => {
|
CompareEphemeral.mutate((draft) => {
|
||||||
draft.members[index].consumables = consumables;
|
draft.members[index].consumables = consumables;
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
@@ -546,7 +543,7 @@ export function CompareTable({ stats }: CompareTableProps) {
|
|||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
mutateCompareEphemeral((draft) => {
|
CompareEphemeral.mutate((draft) => {
|
||||||
draft.members[index].consumables = [];
|
draft.members[index].consumables = [];
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
@@ -564,18 +561,18 @@ export function CompareTable({ stats }: CompareTableProps) {
|
|||||||
{!tank.fixed_camouflage && (
|
{!tank.fixed_camouflage && (
|
||||||
<IconButton
|
<IconButton
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
mutateCompareEphemeral((draft) => {
|
CompareEphemeral.mutate((draft) => {
|
||||||
draft.members[index].camouflage = !camouflage;
|
draft.members[index].camouflage = !camouflage;
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
variant={camouflage ? 'solid' : 'outline'}
|
variant={camouflage ? "solid" : "outline"}
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
src={asset('icons/camo.webp')}
|
src={asset("icons/camo.webp")}
|
||||||
style={{
|
style={{
|
||||||
width: '1em',
|
width: "1em",
|
||||||
height: '1em',
|
height: "1em",
|
||||||
transform: 'scale(2) translate(15%, 15%)',
|
transform: "scale(2) translate(15%, 15%)",
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
@@ -583,7 +580,7 @@ export function CompareTable({ stats }: CompareTableProps) {
|
|||||||
</Flex>
|
</Flex>
|
||||||
</Table.Cell>
|
</Table.Cell>
|
||||||
);
|
);
|
||||||
},
|
}
|
||||||
)}
|
)}
|
||||||
</Table.Row>
|
</Table.Row>
|
||||||
</Table.Body>
|
</Table.Body>
|
||||||
|
|||||||
@@ -1,33 +1,27 @@
|
|||||||
import { PlusIcon, TrashIcon } from '@radix-ui/react-icons';
|
import { PlusIcon, TrashIcon } from "@radix-ui/react-icons";
|
||||||
import { Button, Dialog, Flex, SegmentedControl } from '@radix-ui/themes';
|
import { Button, Dialog, Flex, SegmentedControl } from "@radix-ui/themes";
|
||||||
import { awaitableModelDefinitions } from '../../core/awaitables/modelDefinitions';
|
import { awaitableProvisionDefinitions } from "../../core/awaitables/provisionDefinitions";
|
||||||
import { awaitableProvisionDefinitions } from '../../core/awaitables/provisionDefinitions';
|
import { tankToCompareMember } from "../../core/blitzkit/tankToCompareMember";
|
||||||
import { tankToCompareMember } from '../../core/blitzkit/tankToCompareMember';
|
import { useLocale } from "../../hooks/useLocale";
|
||||||
import { useLocale } from '../../hooks/useLocale';
|
import { CompareEphemeral } from "../../stores/compareEphemeral";
|
||||||
import { CompareEphemeral } from '../../stores/compareEphemeral';
|
|
||||||
import {
|
import {
|
||||||
ComparePersistent,
|
ComparePersistent,
|
||||||
type DeltaMode,
|
type DeltaMode,
|
||||||
} from '../../stores/comparePersistent';
|
} from "../../stores/comparePersistent";
|
||||||
import { TankSearch } from '../TankSearch';
|
import { TankSearch } from "../TankSearch";
|
||||||
|
|
||||||
interface ControlsProps {
|
interface ControlsProps {
|
||||||
addTankDialogOpen: boolean;
|
addTankDialogOpen: boolean;
|
||||||
onAddTankDialogOpenChange: (open: boolean) => void;
|
onAddTankDialogOpenChange: (open: boolean) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const [provisionDefinitions, modelDefinitions] = await Promise.all([
|
const provisionDefinitions = await awaitableProvisionDefinitions;
|
||||||
awaitableProvisionDefinitions,
|
|
||||||
awaitableModelDefinitions,
|
|
||||||
]);
|
|
||||||
|
|
||||||
export function Controls({
|
export function Controls({
|
||||||
addTankDialogOpen,
|
addTankDialogOpen,
|
||||||
onAddTankDialogOpenChange,
|
onAddTankDialogOpenChange,
|
||||||
}: ControlsProps) {
|
}: ControlsProps) {
|
||||||
const deltaMode = ComparePersistent.use((state) => state.deltaMode);
|
const deltaMode = ComparePersistent.use((state) => state.deltaMode);
|
||||||
const mutateCompareEphemeral = CompareEphemeral.useMutation();
|
|
||||||
const mutateComparePersistent = ComparePersistent.useMutation();
|
|
||||||
const { strings } = useLocale();
|
const { strings } = useLocale();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -60,28 +54,20 @@ export function Controls({
|
|||||||
<TankSearch
|
<TankSearch
|
||||||
compact
|
compact
|
||||||
onSelect={(tank) => {
|
onSelect={(tank) => {
|
||||||
const model = modelDefinitions.models[tank.id];
|
CompareEphemeral.mutate((draft) => {
|
||||||
|
|
||||||
mutateCompareEphemeral((draft) => {
|
|
||||||
draft.members.push(
|
draft.members.push(
|
||||||
tankToCompareMember(tank, model, provisionDefinitions),
|
tankToCompareMember(tank, provisionDefinitions)
|
||||||
);
|
);
|
||||||
draft.sorting = undefined;
|
draft.sorting = undefined;
|
||||||
});
|
});
|
||||||
onAddTankDialogOpenChange(false);
|
onAddTankDialogOpenChange(false);
|
||||||
}}
|
}}
|
||||||
onSelectAll={(tanks) => {
|
onSelectAll={(tanks) => {
|
||||||
mutateCompareEphemeral((draft) => {
|
CompareEphemeral.mutate((draft) => {
|
||||||
draft.members.push(
|
draft.members.push(
|
||||||
...tanks.map((tank) => {
|
...tanks.map((tank) => {
|
||||||
const model = modelDefinitions.models[tank.id];
|
return tankToCompareMember(tank, provisionDefinitions);
|
||||||
|
})
|
||||||
return tankToCompareMember(
|
|
||||||
tank,
|
|
||||||
model,
|
|
||||||
provisionDefinitions,
|
|
||||||
);
|
|
||||||
}),
|
|
||||||
);
|
);
|
||||||
draft.sorting = undefined;
|
draft.sorting = undefined;
|
||||||
});
|
});
|
||||||
@@ -97,7 +83,7 @@ export function Controls({
|
|||||||
variant="soft"
|
variant="soft"
|
||||||
color="red"
|
color="red"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
mutateCompareEphemeral((draft) => {
|
CompareEphemeral.mutate((draft) => {
|
||||||
draft.members = [];
|
draft.members = [];
|
||||||
draft.sorting = undefined;
|
draft.sorting = undefined;
|
||||||
});
|
});
|
||||||
@@ -110,18 +96,18 @@ export function Controls({
|
|||||||
variant="classic"
|
variant="classic"
|
||||||
value={deltaMode}
|
value={deltaMode}
|
||||||
onValueChange={(value) => {
|
onValueChange={(value) => {
|
||||||
mutateComparePersistent((draft) => {
|
ComparePersistent.mutate((draft) => {
|
||||||
draft.deltaMode = value as DeltaMode;
|
draft.deltaMode = value as DeltaMode;
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<SegmentedControl.Item value={'none' satisfies DeltaMode}>
|
<SegmentedControl.Item value={"none" satisfies DeltaMode}>
|
||||||
{strings.website.tools.compare.actions.deltas.none}
|
{strings.website.tools.compare.actions.deltas.none}
|
||||||
</SegmentedControl.Item>
|
</SegmentedControl.Item>
|
||||||
<SegmentedControl.Item value={'percentage' satisfies DeltaMode}>
|
<SegmentedControl.Item value={"percentage" satisfies DeltaMode}>
|
||||||
{strings.website.tools.compare.actions.deltas.percentage}
|
{strings.website.tools.compare.actions.deltas.percentage}
|
||||||
</SegmentedControl.Item>
|
</SegmentedControl.Item>
|
||||||
<SegmentedControl.Item value={'absolute' satisfies DeltaMode}>
|
<SegmentedControl.Item value={"absolute" satisfies DeltaMode}>
|
||||||
{strings.website.tools.compare.actions.deltas.absolute}
|
{strings.website.tools.compare.actions.deltas.absolute}
|
||||||
</SegmentedControl.Item>
|
</SegmentedControl.Item>
|
||||||
</SegmentedControl.Root>
|
</SegmentedControl.Root>
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
import { type TankDefinition, tankIcon } from '@blitzkit/core';
|
import { type TankDefinition, tankIcon } from "@blitzkit/core";
|
||||||
import { Flex, Text } from '@radix-ui/themes';
|
import { Flex, Text } from "@radix-ui/themes";
|
||||||
import { useEffect, useRef } from 'react';
|
import { useEffect, useRef } from "react";
|
||||||
import { Vector2 } from 'three';
|
import { Vector2 } from "three";
|
||||||
import { useLocale } from '../../hooks/useLocale';
|
import { useLocale } from "../../hooks/useLocale";
|
||||||
import { CompareEphemeral } from '../../stores/compareEphemeral';
|
import { CompareEphemeral } from "../../stores/compareEphemeral";
|
||||||
import { StickyColumnHeaderCell } from '../StickyColumnHeaderCell';
|
import { StickyColumnHeaderCell } from "../StickyColumnHeaderCell";
|
||||||
import { InsertionMarker } from './IntersectionMarker';
|
import { InsertionMarker } from "./IntersectionMarker";
|
||||||
import { insertionMarkers } from './IntersectionMarker/constants';
|
import { insertionMarkers } from "./IntersectionMarker/constants";
|
||||||
import { TankControl } from './TankControl';
|
import { TankControl } from "./TankControl";
|
||||||
|
|
||||||
interface TankCardProps {
|
interface TankCardProps {
|
||||||
index: number;
|
index: number;
|
||||||
@@ -16,7 +16,6 @@ interface TankCardProps {
|
|||||||
|
|
||||||
export function TankCard({ index, tank }: TankCardProps) {
|
export function TankCard({ index, tank }: TankCardProps) {
|
||||||
const draggable = useRef<HTMLDivElement>(null);
|
const draggable = useRef<HTMLDivElement>(null);
|
||||||
const mutateCompareEphemeral = CompareEphemeral.useMutation();
|
|
||||||
const { unwrap } = useLocale();
|
const { unwrap } = useLocale();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -34,8 +33,8 @@ export function TankCard({ index, tank }: TankCardProps) {
|
|||||||
|
|
||||||
delta.set(0, 0);
|
delta.set(0, 0);
|
||||||
current.copy(initial.set(event.clientX, event.clientY));
|
current.copy(initial.set(event.clientX, event.clientY));
|
||||||
window.addEventListener('pointermove', handlePointerMove);
|
window.addEventListener("pointermove", handlePointerMove);
|
||||||
window.addEventListener('pointerup', handlePointerUp);
|
window.addEventListener("pointerup", handlePointerUp);
|
||||||
}
|
}
|
||||||
function handlePointerMove(event: PointerEvent) {
|
function handlePointerMove(event: PointerEvent) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
@@ -43,7 +42,7 @@ export function TankCard({ index, tank }: TankCardProps) {
|
|||||||
current.set(event.clientX, event.clientY);
|
current.set(event.clientX, event.clientY);
|
||||||
delta.copy(current).sub(initial);
|
delta.copy(current).sub(initial);
|
||||||
insertionMarkers.forEach(({ element }) => {
|
insertionMarkers.forEach(({ element }) => {
|
||||||
element.style.opacity = '0';
|
element.style.opacity = "0";
|
||||||
});
|
});
|
||||||
|
|
||||||
const distances = insertionMarkers.map((insertionMarker) => {
|
const distances = insertionMarkers.map((insertionMarker) => {
|
||||||
@@ -56,34 +55,34 @@ export function TankCard({ index, tank }: TankCardProps) {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
const closest = distances.reduce((a, b) =>
|
const closest = distances.reduce((a, b) =>
|
||||||
a.distance < b.distance ? a : b,
|
a.distance < b.distance ? a : b
|
||||||
);
|
);
|
||||||
|
|
||||||
dropIndex = closest.index;
|
dropIndex = closest.index;
|
||||||
closest.element.style.opacity = '1';
|
closest.element.style.opacity = "1";
|
||||||
draggable.current!.style.position = 'fixed';
|
draggable.current!.style.position = "fixed";
|
||||||
draggable.current!.style.cursor = 'grabbing';
|
draggable.current!.style.cursor = "grabbing";
|
||||||
draggable.current!.style.zIndex = '1';
|
draggable.current!.style.zIndex = "1";
|
||||||
draggable.current!.style.left = `${initialRect.left + delta.x}px`;
|
draggable.current!.style.left = `${initialRect.left + delta.x}px`;
|
||||||
draggable.current!.style.top = `${initialRect.top + delta.y}px`;
|
draggable.current!.style.top = `${initialRect.top + delta.y}px`;
|
||||||
}
|
}
|
||||||
function handlePointerUp(event: PointerEvent) {
|
function handlePointerUp(event: PointerEvent) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
draggable.current!.style.position = 'static';
|
draggable.current!.style.position = "static";
|
||||||
draggable.current!.style.zIndex = 'unset';
|
draggable.current!.style.zIndex = "unset";
|
||||||
draggable.current!.style.cursor = 'grab';
|
draggable.current!.style.cursor = "grab";
|
||||||
|
|
||||||
insertionMarkers.forEach(({ element }) => {
|
insertionMarkers.forEach(({ element }) => {
|
||||||
element.style.opacity = '0';
|
element.style.opacity = "0";
|
||||||
});
|
});
|
||||||
|
|
||||||
window.removeEventListener('pointermove', handlePointerMove);
|
window.removeEventListener("pointermove", handlePointerMove);
|
||||||
window.removeEventListener('pointerup', handlePointerUp);
|
window.removeEventListener("pointerup", handlePointerUp);
|
||||||
|
|
||||||
if (dropIndex === -1) return;
|
if (dropIndex === -1) return;
|
||||||
|
|
||||||
mutateCompareEphemeral((draft) => {
|
CompareEphemeral.mutate((draft) => {
|
||||||
const fromIndex = index;
|
const fromIndex = index;
|
||||||
const toIndex = dropIndex > index ? dropIndex - 1 : dropIndex;
|
const toIndex = dropIndex > index ? dropIndex - 1 : dropIndex;
|
||||||
|
|
||||||
@@ -95,10 +94,10 @@ export function TankCard({ index, tank }: TankCardProps) {
|
|||||||
dropIndex = -1;
|
dropIndex = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
draggable.current?.addEventListener('pointerdown', handlePointerDown);
|
draggable.current?.addEventListener("pointerdown", handlePointerDown);
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
draggable.current?.removeEventListener('pointerdown', handlePointerDown);
|
draggable.current?.removeEventListener("pointerdown", handlePointerDown);
|
||||||
};
|
};
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
@@ -114,9 +113,9 @@ export function TankCard({ index, tank }: TankCardProps) {
|
|||||||
justify="between"
|
justify="between"
|
||||||
gap="2"
|
gap="2"
|
||||||
style={{
|
style={{
|
||||||
userSelect: 'none',
|
userSelect: "none",
|
||||||
touchAction: 'none',
|
touchAction: "none",
|
||||||
cursor: 'grab',
|
cursor: "grab",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
@@ -126,16 +125,16 @@ export function TankCard({ index, tank }: TankCardProps) {
|
|||||||
height={64}
|
height={64}
|
||||||
draggable={false}
|
draggable={false}
|
||||||
style={{
|
style={{
|
||||||
objectFit: 'contain',
|
objectFit: "contain",
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Text
|
<Text
|
||||||
style={{
|
style={{
|
||||||
whiteSpace: 'nowrap',
|
whiteSpace: "nowrap",
|
||||||
maxWidth: 128,
|
maxWidth: 128,
|
||||||
overflow: 'hidden',
|
overflow: "hidden",
|
||||||
textOverflow: 'ellipsis',
|
textOverflow: "ellipsis",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{unwrap(tank.name)}
|
{unwrap(tank.name)}
|
||||||
|
|||||||
@@ -1,35 +1,30 @@
|
|||||||
import { ExternalLinkIcon, LoopIcon, TrashIcon } from '@radix-ui/react-icons';
|
import { ExternalLinkIcon, LoopIcon, TrashIcon } from "@radix-ui/react-icons";
|
||||||
import { Dialog, Flex, IconButton } from '@radix-ui/themes';
|
import { Dialog, Flex, IconButton } from "@radix-ui/themes";
|
||||||
import { useState } from 'react';
|
import { useState } from "react";
|
||||||
import { awaitableModelDefinitions } from '../../core/awaitables/modelDefinitions';
|
import { awaitableProvisionDefinitions } from "../../core/awaitables/provisionDefinitions";
|
||||||
import { awaitableProvisionDefinitions } from '../../core/awaitables/provisionDefinitions';
|
import { tankToCompareMember } from "../../core/blitzkit/tankToCompareMember";
|
||||||
import { tankToCompareMember } from '../../core/blitzkit/tankToCompareMember';
|
import { useLocale } from "../../hooks/useLocale";
|
||||||
import { useLocale } from '../../hooks/useLocale';
|
import { CompareEphemeral } from "../../stores/compareEphemeral";
|
||||||
import { CompareEphemeral } from '../../stores/compareEphemeral';
|
import { LinkI18n } from "../LinkI18n";
|
||||||
import { LinkI18n } from '../LinkI18n';
|
import { TankSearch } from "../TankSearch";
|
||||||
import { TankSearch } from '../TankSearch';
|
|
||||||
|
|
||||||
interface TankControlProps {
|
interface TankControlProps {
|
||||||
index: number;
|
index: number;
|
||||||
slug: string;
|
slug: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const [provisionDefinitions, modelDefinitions] = await Promise.all([
|
const provisionDefinitions = await awaitableProvisionDefinitions;
|
||||||
awaitableProvisionDefinitions,
|
|
||||||
awaitableModelDefinitions,
|
|
||||||
]);
|
|
||||||
|
|
||||||
export function TankControl({ index, slug }: TankControlProps) {
|
export function TankControl({ index, slug }: TankControlProps) {
|
||||||
const { locale } = useLocale();
|
const { locale } = useLocale();
|
||||||
const [switchTankDialogOpen, setSwitchTankDialogOpen] = useState(false);
|
const [switchTankDialogOpen, setSwitchTankDialogOpen] = useState(false);
|
||||||
const mutateCompareEphemeral = CompareEphemeral.useMutation();
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Flex gap="3" justify="center" style={{ width: '100%' }}>
|
<Flex gap="3" justify="center" style={{ width: "100%" }}>
|
||||||
<IconButton
|
<IconButton
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
mutateCompareEphemeral((draft) => {
|
CompareEphemeral.mutate((draft) => {
|
||||||
draft.members.splice(index, 1);
|
draft.members.splice(index, 1);
|
||||||
draft.sorting = undefined;
|
draft.sorting = undefined;
|
||||||
});
|
});
|
||||||
@@ -61,13 +56,10 @@ export function TankControl({ index, slug }: TankControlProps) {
|
|||||||
<TankSearch
|
<TankSearch
|
||||||
compact
|
compact
|
||||||
onSelect={(tank) => {
|
onSelect={(tank) => {
|
||||||
const model = modelDefinitions.models[tank.id];
|
CompareEphemeral.mutate((draft) => {
|
||||||
|
|
||||||
mutateCompareEphemeral((draft) => {
|
|
||||||
draft.members[index] = tankToCompareMember(
|
draft.members[index] = tankToCompareMember(
|
||||||
tank,
|
tank,
|
||||||
model,
|
provisionDefinitions
|
||||||
provisionDefinitions,
|
|
||||||
);
|
);
|
||||||
draft.sorting = undefined;
|
draft.sorting = undefined;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,16 +1,14 @@
|
|||||||
import { Switch } from '@radix-ui/themes';
|
import { Switch } from "@radix-ui/themes";
|
||||||
import type { EmbedPreviewControllerProps } from '../../pages/[...locale]/embed/[embed]/_index';
|
import type { EmbedPreviewControllerProps } from "../../pages/[...locale]/embed/[embed]/_index";
|
||||||
import { EmbedState } from '../../stores/embedState';
|
import { EmbedState } from "../../stores/embedState";
|
||||||
|
|
||||||
export function Boolean({ configKey }: EmbedPreviewControllerProps) {
|
export function Boolean({ configKey }: EmbedPreviewControllerProps) {
|
||||||
const mutateEmbedState = EmbedState.useMutation();
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Switch
|
<Switch
|
||||||
variant="classic"
|
variant="classic"
|
||||||
checked={EmbedState.use((state) => state[configKey] as boolean)}
|
checked={EmbedState.use((state) => state[configKey] as boolean)}
|
||||||
onCheckedChange={() => {
|
onCheckedChange={() => {
|
||||||
mutateEmbedState((draft) => {
|
EmbedState.mutate((draft) => {
|
||||||
draft[configKey] = !draft[configKey];
|
draft[configKey] = !draft[configKey];
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
|
|||||||
Loaded 100 of 268 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user