mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-16 06:06:11 +01:00
Compare commits
70
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bbe53deb98 | ||
|
|
1f07c2be74 | ||
|
|
ea744b673a | ||
|
|
d8a6cac52f | ||
|
|
1524b9a35d | ||
|
|
36738f57a9 | ||
|
|
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:
|
||||||
|
|||||||
@@ -34,7 +34,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,8 @@ 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 }}
|
||||||
|
|
||||||
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
|
||||||
Vendored
+2
@@ -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",
|
||||||
|
|||||||
@@ -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
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "blitzkit",
|
"name": "blitzkit",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "1.27.11",
|
"version": "1.27.13",
|
||||||
"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",
|
||||||
|
|||||||
@@ -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,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';
|
||||||
@@ -157,6 +157,17 @@ message GunDefinitionBase {
|
|||||||
required float dispersion_damaged = 13;
|
required float dispersion_damaged = 13;
|
||||||
repeated Unlock unlocks = 14;
|
repeated Unlock unlocks = 14;
|
||||||
required uint32 shell_capacity = 15;
|
required uint32 shell_capacity = 15;
|
||||||
|
optional AssaultRanges assault_ranges = 16;
|
||||||
|
}
|
||||||
|
|
||||||
|
message AssaultRanges {
|
||||||
|
repeated AssaultRange ranges = 1;
|
||||||
|
repeated ShellType types = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message AssaultRange {
|
||||||
|
required float distance = 1;
|
||||||
|
required float factor = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
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",
|
||||||
@@ -886,6 +887,10 @@
|
|||||||
"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",
|
||||||
@@ -1078,7 +1083,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",
|
||||||
@@ -1092,6 +1096,7 @@
|
|||||||
"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",
|
||||||
|
|||||||
@@ -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",
|
||||||
|
|||||||
@@ -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",
|
||||||
|
|||||||
@@ -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": "弾速",
|
||||||
|
|||||||
@@ -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",
|
||||||
|
|||||||
@@ -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",
|
||||||
|
|||||||
@@ -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": "скорость снаряда",
|
||||||
@@ -790,8 +791,8 @@
|
|||||||
"hull": "Корпус",
|
"hull": "Корпус",
|
||||||
"turret": "Башня",
|
"turret": "Башня",
|
||||||
"hard": "Твёрдые",
|
"hard": "Твёрдые",
|
||||||
"medium": "Средний танк",
|
"medium": "Средние",
|
||||||
"soft": "На мягком грунте",
|
"soft": "Мягкие",
|
||||||
"effective": "Эффективно"
|
"effective": "Эффективно"
|
||||||
},
|
},
|
||||||
"ricochet": {
|
"ricochet": {
|
||||||
|
|||||||
@@ -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": {
|
||||||
@@ -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": "швидкість польоту снаряда",
|
||||||
|
|||||||
+678
-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,
|
||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
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, writeFile } 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';
|
||||||
@@ -32,7 +32,6 @@ export async function tankModels() {
|
|||||||
if (tankKey.includes('tutorial_bot')) continue;
|
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`,
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -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,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;
|
||||||
|
|||||||
@@ -1,12 +1,15 @@
|
|||||||
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 { DATA_COMPRESSED } from '../../../buildAssets/constants';
|
||||||
import { readDVPLFile } from '../readDVPLFile';
|
import { readDVPLFile } from '../readDVPLFile';
|
||||||
import { TextureMutation } from './constants';
|
import { TextureMutation } from './constants';
|
||||||
|
|
||||||
export async function readTexture(path: string, mutation?: TextureMutation) {
|
export async function readTexture(path: string, mutation?: TextureMutation) {
|
||||||
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');
|
||||||
@@ -75,5 +78,4 @@ export async function readTexture(path: string, mutation?: TextureMutation) {
|
|||||||
default:
|
default:
|
||||||
return await sharp(raw.data, { raw }).jpeg().toBuffer();
|
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',
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
@@ -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,7 +10,6 @@
|
|||||||
"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:*",
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
dh=ecd11a058908f58ccea092ed17aa43ace59 4b9a5
|
||||||
+2
@@ -1,3 +1,5 @@
|
|||||||
|
precision mediump float;
|
||||||
|
|
||||||
#define USE_FOG
|
#define USE_FOG
|
||||||
|
|
||||||
#include <fog_pars_fragment>
|
#include <fog_pars_fragment>
|
||||||
|
|||||||
+2
@@ -1,3 +1,5 @@
|
|||||||
|
precision mediump float;
|
||||||
|
|
||||||
#define USE_FOG
|
#define USE_FOG
|
||||||
|
|
||||||
#include <fog_pars_vertex>
|
#include <fog_pars_vertex>
|
||||||
|
|||||||
+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() {
|
||||||
|
|||||||
+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;
|
||||||
|
|
||||||
|
|||||||
@@ -79,6 +79,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}
|
||||||
@@ -105,12 +111,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
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import { LinkI18n } from './LinkI18n';
|
|||||||
import { LocaleSwitcherThemeWrapper } from './LocaleSwitcher';
|
import { LocaleSwitcherThemeWrapper } from './LocaleSwitcher';
|
||||||
|
|
||||||
const gameDefinitions = await fetchGameDefinitions();
|
const gameDefinitions = await fetchGameDefinitions();
|
||||||
const PUBLIC_ASSET_BRANCH = assertSecret(import.meta.env.PUBLIC_ASSET_BRANCH);
|
const PUBLIC_ASSET_BRANCH = assertSecret(import.meta.env.PUBLIC_BRANCH);
|
||||||
const locale = Astro.params.locale ?? DEFAULT_LOCALE;
|
const locale = Astro.params.locale ?? DEFAULT_LOCALE;
|
||||||
const strings = getStrings(locale);
|
const strings = getStrings(locale);
|
||||||
---
|
---
|
||||||
@@ -127,8 +127,8 @@ const strings = getStrings(locale);
|
|||||||
</Flex>
|
</Flex>
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|
||||||
<Flex gap="5" display={{ initial: 'flex', sm: 'none' }}>
|
<Flex gap="5" display={{ initial: 'flex', sm: 'none' }} width="100%">
|
||||||
<Flex direction="column" justify="between" align="end">
|
<Flex direction="column" gap="1" flexGrow="1" flexBasis="0" align="end">
|
||||||
<Text size="2" color="gray">BlitzKit</Text>
|
<Text size="2" color="gray">BlitzKit</Text>
|
||||||
{
|
{
|
||||||
PUBLIC_ASSET_BRANCH !== 'preview' && (
|
PUBLIC_ASSET_BRANCH !== 'preview' && (
|
||||||
@@ -140,7 +140,7 @@ const strings = getStrings(locale);
|
|||||||
<Text size="2" color="gray">CDN</Text>
|
<Text size="2" color="gray">CDN</Text>
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|
||||||
<Flex direction="column" justify="between" align="start">
|
<Flex direction="column" gap="1" flexGrow="1" flexBasis="0" align="start">
|
||||||
<Code size="2" color="gray">
|
<Code size="2" color="gray">
|
||||||
{packageJson.version}
|
{packageJson.version}
|
||||||
</Code>
|
</Code>
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ export interface Props {
|
|||||||
integrated?: boolean;
|
integrated?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const { integrated } = Astro.props;
|
const { integrated = false } = Astro.props;
|
||||||
const toolsFiltered = TOOLS.filter((tool) => !('href' in tool));
|
const toolsFiltered = TOOLS.filter((tool) => !('href' in tool));
|
||||||
const { locale } = Astro.params;
|
const { locale } = Astro.params;
|
||||||
const branchName = resolveBranchName(locale);
|
const branchName = resolveBranchName(locale);
|
||||||
@@ -47,7 +47,7 @@ const strings = getStrings(locale);
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.navbar[data-expanded='false'] .content {
|
.navbar[data-expanded='false'][data-integrated='false'] .content {
|
||||||
background-color: var(--black-a8);
|
background-color: var(--black-a8);
|
||||||
backdrop-filter: blur(4rem);
|
backdrop-filter: blur(4rem);
|
||||||
box-shadow: var(--shadow-3);
|
box-shadow: var(--shadow-3);
|
||||||
@@ -87,6 +87,7 @@ const strings = getStrings(locale);
|
|||||||
direction="column"
|
direction="column"
|
||||||
align="center"
|
align="center"
|
||||||
data-expanded="false"
|
data-expanded="false"
|
||||||
|
data-integrated={`${integrated}`}
|
||||||
className="navbar"
|
className="navbar"
|
||||||
width="100%"
|
width="100%"
|
||||||
top="0"
|
top="0"
|
||||||
@@ -139,7 +140,7 @@ const strings = getStrings(locale);
|
|||||||
toolsFiltered.map((tool) => {
|
toolsFiltered.map((tool) => {
|
||||||
const unavailableOnBranch = tool.branches?.every(
|
const unavailableOnBranch = tool.branches?.every(
|
||||||
(branch) =>
|
(branch) =>
|
||||||
branch !== assertSecret(import.meta.env.PUBLIC_ASSET_BRANCH),
|
branch !== assertSecret(import.meta.env.PUBLIC_BRANCH),
|
||||||
);
|
);
|
||||||
const selected = Astro.url.pathname.includes(`/${tool.id}`);
|
const selected = Astro.url.pathname.includes(`/${tool.id}`);
|
||||||
const toolStrings =
|
const toolStrings =
|
||||||
@@ -211,7 +212,7 @@ const strings = getStrings(locale);
|
|||||||
toolsFiltered.map((tool) => {
|
toolsFiltered.map((tool) => {
|
||||||
const unavailableOnBranch = tool.branches?.every(
|
const unavailableOnBranch = tool.branches?.every(
|
||||||
(branch) =>
|
(branch) =>
|
||||||
branch !== assertSecret(import.meta.env.PUBLIC_ASSET_BRANCH),
|
branch !== assertSecret(import.meta.env.PUBLIC_BRANCH),
|
||||||
);
|
);
|
||||||
|
|
||||||
if (unavailableOnBranch) return null;
|
if (unavailableOnBranch) return null;
|
||||||
@@ -232,7 +233,7 @@ const strings = getStrings(locale);
|
|||||||
<Box
|
<Box
|
||||||
style={{
|
style={{
|
||||||
borderRadius: Var('radius-2'),
|
borderRadius: Var('radius-2'),
|
||||||
backgroundImage: `url(/assets/images/${tool.id}.webp)`,
|
backgroundImage: `url(/assets/images/tools/${tool.id}.webp)`,
|
||||||
backgroundSize: '200%',
|
backgroundSize: '200%',
|
||||||
backgroundPosition: 'right center',
|
backgroundPosition: 'right center',
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -6,42 +6,20 @@ const PUBLIC_GOOGLE_TAG_MANAGER_ID = assertSecret(
|
|||||||
);
|
);
|
||||||
---
|
---
|
||||||
|
|
||||||
{/* google analytics */}
|
|
||||||
<script
|
<script
|
||||||
is:inline
|
is:inline
|
||||||
async
|
async
|
||||||
type="text/partytown"
|
|
||||||
src={`https://www.googletagmanager.com/gtag/js?id=${PUBLIC_GOOGLE_TAG_MANAGER_ID}`}
|
src={`https://www.googletagmanager.com/gtag/js?id=${PUBLIC_GOOGLE_TAG_MANAGER_ID}`}
|
||||||
></script>
|
></script>
|
||||||
<script
|
|
||||||
is:inline
|
<script is:inline define:vars={{ PUBLIC_GOOGLE_TAG_MANAGER_ID }}>
|
||||||
define:vars={{ PUBLIC_GOOGLE_TAG_MANAGER_ID }}
|
|
||||||
type="text/partytown"
|
|
||||||
>
|
|
||||||
window.dataLayer = window.dataLayer || [];
|
window.dataLayer = window.dataLayer || [];
|
||||||
|
|
||||||
function gtag() {
|
function gtag() {
|
||||||
dataLayer.push(arguments);
|
dataLayer.push(arguments);
|
||||||
}
|
}
|
||||||
|
|
||||||
gtag('js', new Date());
|
gtag('js', new Date());
|
||||||
|
|
||||||
gtag('config', PUBLIC_GOOGLE_TAG_MANAGER_ID);
|
gtag('config', PUBLIC_GOOGLE_TAG_MANAGER_ID);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{/* nitro ads */}
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
<script is:inline data-cfasync="false">
|
|
||||||
window.nitroAds = window.nitroAds || {
|
|
||||||
createAd: function () {
|
|
||||||
return new Promise((e) => {
|
|
||||||
window.nitroAds.queue.push(['createAd', arguments, e]);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
addUserToken: function () {
|
|
||||||
window.nitroAds.queue.push(['addUserToken', arguments]);
|
|
||||||
},
|
|
||||||
queue: [],
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
@@ -14,7 +14,7 @@ export function Plugs() {
|
|||||||
function Content() {
|
function Content() {
|
||||||
const promoteOpentest =
|
const promoteOpentest =
|
||||||
assertSecret(import.meta.env.PUBLIC_PROMOTE_OPENTEST) === 'true' &&
|
assertSecret(import.meta.env.PUBLIC_PROMOTE_OPENTEST) === 'true' &&
|
||||||
assertSecret(import.meta.env.PUBLIC_ASSET_BRANCH) !== 'opentest';
|
assertSecret(import.meta.env.PUBLIC_BRANCH) !== 'opentest';
|
||||||
const promotions = [promoteOpentest];
|
const promotions = [promoteOpentest];
|
||||||
|
|
||||||
if (promotions.every((promotion) => !promotion)) return null;
|
if (promotions.every((promotion) => !promotion)) return null;
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ export const TankCard = forwardRef<HTMLSpanElement, TankCardProps>(
|
|||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
alt={unwrap(tank.name)}
|
alt={unwrap(tank.name)}
|
||||||
src={asset(`icons/tanks/blitzkit/${tank.id}.webp`)}
|
src={asset(`icons/tanks/big/${tank.id}.webp`)}
|
||||||
className="image"
|
className="image"
|
||||||
draggable={false}
|
draggable={false}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ export function TankSearchCard({ tank, onSelect }: TankSearchCardProps) {
|
|||||||
const gun = turret.guns.at(-1)!;
|
const gun = turret.guns.at(-1)!;
|
||||||
const shell0 = gun.gun_type!.value.base.shells[0];
|
const shell0 = gun.gun_type!.value.base.shells[0];
|
||||||
const shell1 = gun.gun_type!.value.base.shells[1];
|
const shell1 = gun.gun_type!.value.base.shells[1];
|
||||||
|
const shell2 = gun.gun_type!.value.base.shells[2];
|
||||||
const tracks = tank.tracks.at(-1)!;
|
const tracks = tank.tracks.at(-1)!;
|
||||||
const engine = tank.engines.at(-1)!;
|
const engine = tank.engines.at(-1)!;
|
||||||
const tankModelDefinition = modelDefinitions.models[tank.id];
|
const tankModelDefinition = modelDefinitions.models[tank.id];
|
||||||
@@ -57,6 +58,8 @@ export function TankSearchCard({ tank, onSelect }: TankSearchCardProps) {
|
|||||||
return shell0.penetration.near.toFixed(0);
|
return shell0.penetration.near.toFixed(0);
|
||||||
case 'fire.premiumPenetration':
|
case 'fire.premiumPenetration':
|
||||||
return shell1 ? shell1.penetration.near.toFixed(0) : '--';
|
return shell1 ? shell1.penetration.near.toFixed(0) : '--';
|
||||||
|
case 'fire.tertiaryPenetration':
|
||||||
|
return shell1 ? shell2.penetration.near.toFixed(0) : '--';
|
||||||
case 'fire.shellVelocity':
|
case 'fire.shellVelocity':
|
||||||
return shell0.velocity.toFixed(0);
|
return shell0.velocity.toFixed(0);
|
||||||
case 'fire.shellCapacity':
|
case 'fire.shellCapacity':
|
||||||
|
|||||||
@@ -21,27 +21,17 @@ export function SearchBar({ topResult, skeleton, onSelect }: SearchBarProps) {
|
|||||||
const input = useRef<HTMLInputElement>(null);
|
const input = useRef<HTMLInputElement>(null);
|
||||||
const performSearch = useCallback(
|
const performSearch = useCallback(
|
||||||
debounce(() => {
|
debounce(() => {
|
||||||
// tankFiltersStore.setState({ searching: false });
|
|
||||||
$tankFilters.setKey('searching', false);
|
$tankFilters.setKey('searching', false);
|
||||||
|
|
||||||
if (!input.current) return;
|
if (!input.current) return;
|
||||||
|
|
||||||
const sanitized = input.current.value.trim();
|
const sanitized = input.current.value.trim();
|
||||||
|
|
||||||
// tankFiltersStore.setState({
|
$tankFilters.setKey('search', sanitized.length === 0 ? null : sanitized);
|
||||||
// search: sanitized.length === 0 ? undefined : sanitized,
|
|
||||||
// });
|
|
||||||
$tankFilters.setKey(
|
|
||||||
'search',
|
|
||||||
sanitized.length === 0 ? undefined : sanitized,
|
|
||||||
);
|
|
||||||
}, 500),
|
}, 500),
|
||||||
[],
|
[],
|
||||||
);
|
);
|
||||||
const handleChange = useCallback(() => {
|
const handleChange = useCallback(() => {
|
||||||
// if (!tankFiltersStore.getState().searching) {
|
|
||||||
// tankFiltersStore.setState({ searching: true });
|
|
||||||
// }
|
|
||||||
if (!tankFilters.searching) {
|
if (!tankFilters.searching) {
|
||||||
$tankFilters.setKey('searching', true);
|
$tankFilters.setKey('searching', true);
|
||||||
}
|
}
|
||||||
@@ -69,7 +59,7 @@ export function SearchBar({ topResult, skeleton, onSelect }: SearchBarProps) {
|
|||||||
<TextField.Root
|
<TextField.Root
|
||||||
variant="classic"
|
variant="classic"
|
||||||
disabled={skeleton}
|
disabled={skeleton}
|
||||||
defaultValue={tankFilters.search}
|
defaultValue={tankFilters.search ?? undefined}
|
||||||
style={{ flex: 1 }}
|
style={{ flex: 1 }}
|
||||||
ref={input}
|
ref={input}
|
||||||
placeholder={strings.website.common.tank_search.search_bar_hint}
|
placeholder={strings.website.common.tank_search.search_bar_hint}
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ export function Sort() {
|
|||||||
<Item by="fire.caliber" />
|
<Item by="fire.caliber" />
|
||||||
<Item by="fire.standardPenetration" />
|
<Item by="fire.standardPenetration" />
|
||||||
<Item by="fire.premiumPenetration" />
|
<Item by="fire.premiumPenetration" />
|
||||||
|
<Item by="fire.tertiaryPenetration" />
|
||||||
<Item by="fire.damage" />
|
<Item by="fire.damage" />
|
||||||
<Item by="fire.moduleDamage" />
|
<Item by="fire.moduleDamage" />
|
||||||
<Item by="fire.shellVelocity" />
|
<Item by="fire.shellVelocity" />
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ export const TankSearch = memo<TankSearchProps>(
|
|||||||
const tankFilters = useStore($tankFilters);
|
const tankFilters = useStore($tankFilters);
|
||||||
const tankopediaSort = useStore($tankopediaSort);
|
const tankopediaSort = useStore($tankopediaSort);
|
||||||
const tanksFiltered = useMemo(() => {
|
const tanksFiltered = useMemo(() => {
|
||||||
if (tankFilters.search === undefined) {
|
if (tankFilters.search === null) {
|
||||||
const filtered = awaitedTanksDefinitionsArray.filter((tank) =>
|
const filtered = awaitedTanksDefinitionsArray.filter((tank) =>
|
||||||
filterTank(tankFilters, tank),
|
filterTank(tankFilters, tank),
|
||||||
);
|
);
|
||||||
@@ -238,6 +238,16 @@ export const TankSearch = memo<TankSearchProps>(
|
|||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'fire.tertiaryPenetration':
|
||||||
|
sorted = filtered.sort(
|
||||||
|
(a, b) =>
|
||||||
|
(a.turrets.at(-1)!.guns.at(-1)!.gun_type!.value.base.shells[2]
|
||||||
|
?.penetration.near ?? 0) -
|
||||||
|
(b.turrets.at(-1)!.guns.at(-1)!.gun_type!.value.base.shells[2]
|
||||||
|
?.penetration.near ?? 0),
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
|
||||||
case 'fire.damage':
|
case 'fire.damage':
|
||||||
sorted = filtered.sort(
|
sorted = filtered.sort(
|
||||||
(a, b) =>
|
(a, b) =>
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ export function CalloutsSection() {
|
|||||||
const tank = Duel.use((state) => state.protagonist.tank);
|
const tank = Duel.use((state) => state.protagonist.tank);
|
||||||
const mutateTankopediaPersistent = TankopediaPersistent.useMutation();
|
const mutateTankopediaPersistent = TankopediaPersistent.useMutation();
|
||||||
const promoteAeson =
|
const promoteAeson =
|
||||||
assertSecret(import.meta.env.PUBLIC_ASSET_BRANCH) === 'preview';
|
assertSecret(import.meta.env.PUBLIC_BRANCH) === 'preview';
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
mutateTankopediaPersistent((draft) => {
|
mutateTankopediaPersistent((draft) => {
|
||||||
|
|||||||
+7
@@ -0,0 +1,7 @@
|
|||||||
|
#assault-cursor {
|
||||||
|
cursor: grab;
|
||||||
|
}
|
||||||
|
|
||||||
|
#assault-cursor:active {
|
||||||
|
cursor: grabbing;
|
||||||
|
}
|
||||||
+113
@@ -0,0 +1,113 @@
|
|||||||
|
import { DragHandleDots2Icon } from '@radix-ui/react-icons';
|
||||||
|
import { Box, Flex, Text } from '@radix-ui/themes';
|
||||||
|
import { useEffect, useRef, useState } from 'react';
|
||||||
|
import { clamp } from 'three/src/math/MathUtils.js';
|
||||||
|
import {
|
||||||
|
fakeLog,
|
||||||
|
fakeLogInverse,
|
||||||
|
} from '../../../../../../../../../core/blitzkit/fakeLog';
|
||||||
|
import { Var } from '../../../../../../../../../core/radix/var';
|
||||||
|
import { Duel } from '../../../../../../../../../stores/duel';
|
||||||
|
import './index.css';
|
||||||
|
|
||||||
|
interface Props {
|
||||||
|
maxDistance: number;
|
||||||
|
maxFakeDistance: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function AssaultCursor({ maxDistance, maxFakeDistance }: Props) {
|
||||||
|
const assaultDistance = Duel.use(
|
||||||
|
(state) => state.protagonist.assaultDistance,
|
||||||
|
);
|
||||||
|
const [x, setX] = useState(fakeLog(assaultDistance / maxDistance, 2));
|
||||||
|
const cursor = useRef<HTMLDivElement>(null);
|
||||||
|
const mutateDuel = Duel.useMutation();
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
let localX = x;
|
||||||
|
|
||||||
|
function handlePointerDown(event: PointerEvent) {
|
||||||
|
event.preventDefault();
|
||||||
|
|
||||||
|
window.addEventListener('pointermove', handlePointerMove);
|
||||||
|
window.addEventListener('pointerup', handlePointerUp);
|
||||||
|
}
|
||||||
|
|
||||||
|
function handlePointerMove(event: PointerEvent) {
|
||||||
|
const parent = cursor.current?.parentElement;
|
||||||
|
|
||||||
|
if (!parent) return;
|
||||||
|
|
||||||
|
const width = parent.clientWidth;
|
||||||
|
|
||||||
|
setX((state) => {
|
||||||
|
localX = clamp(state + event.movementX / width, 0, 1);
|
||||||
|
return localX;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function handlePointerUp() {
|
||||||
|
mutateDuel((draft) => {
|
||||||
|
draft.protagonist.assaultDistance =
|
||||||
|
fakeLogInverse(localX * maxFakeDistance, 2) * maxDistance;
|
||||||
|
});
|
||||||
|
|
||||||
|
window.removeEventListener('pointermove', handlePointerMove);
|
||||||
|
window.removeEventListener('pointerup', handlePointerUp);
|
||||||
|
}
|
||||||
|
|
||||||
|
cursor.current?.addEventListener('pointerdown', handlePointerDown);
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
cursor.current?.removeEventListener('pointerdown', handlePointerDown);
|
||||||
|
};
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Box
|
||||||
|
ref={cursor}
|
||||||
|
position="absolute"
|
||||||
|
top="0"
|
||||||
|
left={`${x * 100}%`}
|
||||||
|
height="100%"
|
||||||
|
width="2pt"
|
||||||
|
id="assault-cursor"
|
||||||
|
style={{
|
||||||
|
transform: 'translateX(-50%)',
|
||||||
|
backgroundColor: Var('accent-11'),
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Flex
|
||||||
|
align="center"
|
||||||
|
direction="column"
|
||||||
|
position="absolute"
|
||||||
|
left="50%"
|
||||||
|
bottom="100%"
|
||||||
|
style={{ transform: 'translateX(-50%)' }}
|
||||||
|
>
|
||||||
|
<Flex
|
||||||
|
align="center"
|
||||||
|
justify="center"
|
||||||
|
style={{
|
||||||
|
width: '1.5rem',
|
||||||
|
height: '1.5rem',
|
||||||
|
backgroundColor: Var('accent-9'),
|
||||||
|
borderRadius: `50% 50% ${Var('radius-1')} ${Var('radius-1')}`,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text style={{ display: 'flex' }} highContrast color="purple">
|
||||||
|
<DragHandleDots2Icon />
|
||||||
|
</Text>
|
||||||
|
</Flex>
|
||||||
|
|
||||||
|
<Box
|
||||||
|
height="0.5rem"
|
||||||
|
width="2pt"
|
||||||
|
style={{
|
||||||
|
backgroundColor: Var('accent-11'),
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Flex>
|
||||||
|
</Box>
|
||||||
|
);
|
||||||
|
}
|
||||||
+152
@@ -0,0 +1,152 @@
|
|||||||
|
import type { AssaultRanges } from '@blitzkit/core';
|
||||||
|
import { literals } from '@blitzkit/i18n';
|
||||||
|
import { Box, Card, Flex, Text } from '@radix-ui/themes';
|
||||||
|
import { clamp } from 'three/src/math/MathUtils.js';
|
||||||
|
import { fakeLog } from '../../../../../../../core/blitzkit/fakeLog';
|
||||||
|
import type { TankCharacteristics } from '../../../../../../../core/blitzkit/tankCharacteristics';
|
||||||
|
import { Var } from '../../../../../../../core/radix/var';
|
||||||
|
import { useLocale } from '../../../../../../../hooks/useLocale';
|
||||||
|
import { AssaultCursor } from './components/Cursor';
|
||||||
|
|
||||||
|
interface Props {
|
||||||
|
ranges: AssaultRanges;
|
||||||
|
stats: TankCharacteristics;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function AssaultRangesVisualizer({ ranges: _ranges, stats }: Props) {
|
||||||
|
const maxDistance = _ranges.ranges.at(-1)!.distance;
|
||||||
|
const ranges = _ranges.ranges.map((range) => ({
|
||||||
|
factor: range.factor,
|
||||||
|
distance: range.distance,
|
||||||
|
fakeDistance: fakeLog(range.distance / maxDistance, 2),
|
||||||
|
}));
|
||||||
|
const maxFakeDistance = ranges.at(-1)!.fakeDistance;
|
||||||
|
|
||||||
|
const { strings } = useLocale();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Card mb="6" variant="classic" style={{ aspectRatio: '1 / 1' }}>
|
||||||
|
<Flex
|
||||||
|
position="absolute"
|
||||||
|
top="0"
|
||||||
|
left="0"
|
||||||
|
width="100%"
|
||||||
|
height="100%"
|
||||||
|
direction="column"
|
||||||
|
>
|
||||||
|
<Text m="3" size="2" color="gray">
|
||||||
|
{strings.website.tools.tankopedia.visualizers.assault.title}
|
||||||
|
</Text>
|
||||||
|
|
||||||
|
<Flex
|
||||||
|
direction="column"
|
||||||
|
p="3"
|
||||||
|
pt="8"
|
||||||
|
pr="5"
|
||||||
|
style={{ backgroundColor: Var('gray-1') }}
|
||||||
|
flexGrow="1"
|
||||||
|
>
|
||||||
|
<Flex flexGrow="1">
|
||||||
|
<Box position="relative" width={Var('space-8')}>
|
||||||
|
{ranges.map((range, index) => (
|
||||||
|
<Text
|
||||||
|
key={index}
|
||||||
|
style={{
|
||||||
|
position: 'absolute',
|
||||||
|
left: 0,
|
||||||
|
top: `${(1 - range.factor) * 100}%`,
|
||||||
|
transform: 'translateY(-50%)',
|
||||||
|
}}
|
||||||
|
color="gray"
|
||||||
|
size="1"
|
||||||
|
wrap="nowrap"
|
||||||
|
>
|
||||||
|
{literals(strings.common.units.hp, [
|
||||||
|
`${Math.round(stats.damageWithoutAssault * range.factor)}`,
|
||||||
|
])}
|
||||||
|
</Text>
|
||||||
|
))}
|
||||||
|
</Box>
|
||||||
|
|
||||||
|
<Flex flexGrow="1" align="end" position="relative">
|
||||||
|
{ranges.map((range, index) => {
|
||||||
|
const mix = clamp(1.5 * (range.factor - 1) + 1, 0, 1) * 100;
|
||||||
|
const color0 = `color-mix(in hsl, ${Var('tomato-9')}, ${Var('jade-9')} ${mix}%)`;
|
||||||
|
const color1 = `color-mix(in hsl, ${Var('tomato-7')}, ${Var('jade-7')} ${mix}%)`;
|
||||||
|
const last = ranges[index - 1];
|
||||||
|
const lastFakeDistance = last?.fakeDistance ?? 0;
|
||||||
|
const fakeWidth = range.fakeDistance - lastFakeDistance;
|
||||||
|
const fraction = fakeWidth / ranges.at(-1)!.fakeDistance;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Box
|
||||||
|
width={`${fraction * 100}%`}
|
||||||
|
height={`${range.factor * 100}%`}
|
||||||
|
style={{
|
||||||
|
background: `linear-gradient(45deg, ${color1}, ${color0})`,
|
||||||
|
}}
|
||||||
|
key={index}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
|
||||||
|
{ranges.map((range, index) => (
|
||||||
|
<Box
|
||||||
|
key={index}
|
||||||
|
position="absolute"
|
||||||
|
left="0"
|
||||||
|
bottom={`${range.factor * 100}%`}
|
||||||
|
width="100%"
|
||||||
|
height="1pt"
|
||||||
|
style={{
|
||||||
|
transform: 'translateY(50%)',
|
||||||
|
backgroundColor: Var('gray-11'),
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
|
||||||
|
<AssaultCursor
|
||||||
|
maxDistance={maxDistance}
|
||||||
|
maxFakeDistance={maxFakeDistance}
|
||||||
|
/>
|
||||||
|
</Flex>
|
||||||
|
</Flex>
|
||||||
|
|
||||||
|
<Flex ml="8" height={Var('space-7')}>
|
||||||
|
{ranges.map((range, index) => {
|
||||||
|
const last = ranges[index - 1];
|
||||||
|
const lastFakeDistance = last?.fakeDistance ?? 0;
|
||||||
|
const fakeWidth = range.fakeDistance - lastFakeDistance;
|
||||||
|
const fraction = fakeWidth / ranges.at(-1)!.fakeDistance;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Box
|
||||||
|
position="relative"
|
||||||
|
key={index}
|
||||||
|
width={`${fraction * 100}%`}
|
||||||
|
height="100%"
|
||||||
|
>
|
||||||
|
<Text
|
||||||
|
size="1"
|
||||||
|
color="gray"
|
||||||
|
mt="2"
|
||||||
|
style={{
|
||||||
|
position: 'absolute',
|
||||||
|
right: 0,
|
||||||
|
transform: 'translateX(50%)',
|
||||||
|
writingMode: 'vertical-rl',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{literals(strings.common.units.m, [
|
||||||
|
`${Math.round(range.distance)}`,
|
||||||
|
])}
|
||||||
|
</Text>
|
||||||
|
</Box>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</Flex>
|
||||||
|
</Flex>
|
||||||
|
</Flex>
|
||||||
|
</Card>
|
||||||
|
);
|
||||||
|
}
|
||||||
+15
-6
@@ -21,6 +21,7 @@ import { useEquipment } from '../../../../../../hooks/useEquipment';
|
|||||||
import { useLocale } from '../../../../../../hooks/useLocale';
|
import { useLocale } from '../../../../../../hooks/useLocale';
|
||||||
import { useTankModelDefinition } from '../../../../../../hooks/useTankModelDefinition';
|
import { useTankModelDefinition } from '../../../../../../hooks/useTankModelDefinition';
|
||||||
import { Duel } from '../../../../../../stores/duel';
|
import { Duel } from '../../../../../../stores/duel';
|
||||||
|
import { AssaultRangesVisualizer } from './AssaultRangesVisualizer';
|
||||||
import { Info } from './Info';
|
import { Info } from './Info';
|
||||||
import { InfoWithDelta } from './InfoWithDelta';
|
import { InfoWithDelta } from './InfoWithDelta';
|
||||||
import { RicochetVisualizer } from './RicochetVisualizer';
|
import { RicochetVisualizer } from './RicochetVisualizer';
|
||||||
@@ -112,6 +113,20 @@ export function Firepower({ stats }: StatsAcceptorProps) {
|
|||||||
{strings.common.gun_types[gun.gun_type!.$case]}
|
{strings.common.gun_types[gun.gun_type!.$case]}
|
||||||
</Info>
|
</Info>
|
||||||
<InfoWithDelta stats={stats} decimals={0} value="dpm" />
|
<InfoWithDelta stats={stats} decimals={0} value="dpm" />
|
||||||
|
<InfoWithDelta stats={stats} decimals={0} value="damage" />
|
||||||
|
{gun.gun_type!.$case !== 'regular' && (
|
||||||
|
<InfoWithDelta stats={stats} indent decimals={0} value="clipDamage" />
|
||||||
|
)}
|
||||||
|
<InfoWithDelta stats={stats} decimals={0} value="moduleDamage" />
|
||||||
|
<InfoWithDelta stats={stats} decimals={0} value="penetration" />
|
||||||
|
|
||||||
|
{gun.gun_type!.value.base.assault_ranges?.types.includes(shell.type) && (
|
||||||
|
<AssaultRangesVisualizer
|
||||||
|
stats={stats}
|
||||||
|
ranges={gun.gun_type!.value.base.assault_ranges}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
{gun.gun_type!.$case === 'auto_reloader' && (
|
{gun.gun_type!.$case === 'auto_reloader' && (
|
||||||
<InfoWithDelta stats={stats} decimals={0} indent value="dpmEffective" />
|
<InfoWithDelta stats={stats} decimals={0} indent value="dpmEffective" />
|
||||||
)}
|
)}
|
||||||
@@ -172,7 +187,6 @@ export function Firepower({ stats }: StatsAcceptorProps) {
|
|||||||
)}
|
)}
|
||||||
{/* <ReloadVisualizer stats={stats} /> */}
|
{/* <ReloadVisualizer stats={stats} /> */}
|
||||||
|
|
||||||
<InfoWithDelta stats={stats} decimals={0} value="penetration" />
|
|
||||||
{typeof shell.penetration !== 'number' && (
|
{typeof shell.penetration !== 'number' && (
|
||||||
<>
|
<>
|
||||||
<InfoWithDelta
|
<InfoWithDelta
|
||||||
@@ -240,11 +254,6 @@ export function Firepower({ stats }: StatsAcceptorProps) {
|
|||||||
</Flex>
|
</Flex>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
<InfoWithDelta stats={stats} decimals={0} value="damage" />
|
|
||||||
{gun.gun_type!.$case !== 'regular' && (
|
|
||||||
<InfoWithDelta stats={stats} indent decimals={0} value="clipDamage" />
|
|
||||||
)}
|
|
||||||
<InfoWithDelta stats={stats} decimals={0} value="moduleDamage" />
|
|
||||||
{isExplosive(shell.type) && (
|
{isExplosive(shell.type) && (
|
||||||
<InfoWithDelta
|
<InfoWithDelta
|
||||||
stats={stats}
|
stats={stats}
|
||||||
|
|||||||
+19
-4
@@ -65,6 +65,14 @@ export function InfoWithDelta({
|
|||||||
: (stats[props.value] as number);
|
: (stats[props.value] as number);
|
||||||
const delta = useDelta(uhWhatDoICallThisVariable);
|
const delta = useDelta(uhWhatDoICallThisVariable);
|
||||||
const protagonistTank = Duel.use((state) => state.protagonist.tank);
|
const protagonistTank = Duel.use((state) => state.protagonist.tank);
|
||||||
|
const shellIndex = Duel.use((state) =>
|
||||||
|
state.protagonist.gun.gun_type!.value.base.shells.indexOf(
|
||||||
|
state.protagonist.shell,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
const equipmentMatrix = Duel.use(
|
||||||
|
(state) => state.protagonist.equipmentMatrix,
|
||||||
|
);
|
||||||
const others = useMemo(() => {
|
const others = useMemo(() => {
|
||||||
const defaultSkills = createDefaultSkills(skillDefinitions);
|
const defaultSkills = createDefaultSkills(skillDefinitions);
|
||||||
|
|
||||||
@@ -86,6 +94,10 @@ export function InfoWithDelta({
|
|||||||
provisionDefinitions,
|
provisionDefinitions,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (member.gun.gun_type!.value.base.shells[shellIndex] === undefined) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
return tankCharacteristics(
|
return tankCharacteristics(
|
||||||
{
|
{
|
||||||
applyDynamicArmor: false,
|
applyDynamicArmor: false,
|
||||||
@@ -97,8 +109,8 @@ export function InfoWithDelta({
|
|||||||
provisions: member.provisions,
|
provisions: member.provisions,
|
||||||
engine: member.engine,
|
engine: member.engine,
|
||||||
gun: member.gun,
|
gun: member.gun,
|
||||||
equipmentMatrix: member.equipmentMatrix,
|
equipmentMatrix: equipmentMatrix,
|
||||||
shell: member.shell,
|
shell: member.gun.gun_type!.value.base.shells[shellIndex],
|
||||||
stockEngine: tank.engines[0],
|
stockEngine: tank.engines[0],
|
||||||
stockGun: tank.turrets[0].guns[0],
|
stockGun: tank.turrets[0].guns[0],
|
||||||
stockTrack: tank.tracks[0],
|
stockTrack: tank.tracks[0],
|
||||||
@@ -106,6 +118,7 @@ export function InfoWithDelta({
|
|||||||
tank,
|
tank,
|
||||||
track: member.track,
|
track: member.track,
|
||||||
turret: member.turret,
|
turret: member.turret,
|
||||||
|
assaultDistance: member.assaultDistance,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
equipmentDefinitions,
|
equipmentDefinitions,
|
||||||
@@ -115,14 +128,16 @@ export function InfoWithDelta({
|
|||||||
);
|
);
|
||||||
})
|
})
|
||||||
.filter((tank) => {
|
.filter((tank) => {
|
||||||
|
if (tank === undefined) return false;
|
||||||
|
|
||||||
const othersValue =
|
const othersValue =
|
||||||
typeof props.value === 'function'
|
typeof props.value === 'function'
|
||||||
? props.value(tank)!
|
? props.value(tank)!
|
||||||
: (tank[props.value] as number);
|
: (tank[props.value] as number);
|
||||||
|
|
||||||
return othersValue !== undefined;
|
return othersValue !== undefined;
|
||||||
});
|
}) as TankCharacteristics[];
|
||||||
}, [relativeAgainst]);
|
}, [relativeAgainst, shellIndex, equipmentMatrix]);
|
||||||
const betterTanks = others.filter((tank) => {
|
const betterTanks = others.filter((tank) => {
|
||||||
const othersValue =
|
const othersValue =
|
||||||
typeof props.value === 'function'
|
typeof props.value === 'function'
|
||||||
|
|||||||
+4
@@ -24,6 +24,9 @@ export function Characteristics() {
|
|||||||
const provisions = Duel.use((state) => state.protagonist.provisions);
|
const provisions = Duel.use((state) => state.protagonist.provisions);
|
||||||
const consumables = Duel.use((state) => state.protagonist.consumables);
|
const consumables = Duel.use((state) => state.protagonist.consumables);
|
||||||
const camouflage = Duel.use((state) => state.protagonist.camouflage);
|
const camouflage = Duel.use((state) => state.protagonist.camouflage);
|
||||||
|
const assaultDistance = Duel.use(
|
||||||
|
(state) => state.protagonist.assaultDistance,
|
||||||
|
);
|
||||||
const equipmentMatrix = Duel.use(
|
const equipmentMatrix = Duel.use(
|
||||||
(state) => state.protagonist.equipmentMatrix,
|
(state) => state.protagonist.equipmentMatrix,
|
||||||
);
|
);
|
||||||
@@ -58,6 +61,7 @@ export function Characteristics() {
|
|||||||
applyReactiveArmor: false,
|
applyReactiveArmor: false,
|
||||||
applyDynamicArmor: false,
|
applyDynamicArmor: false,
|
||||||
applySpallLiner: false,
|
applySpallLiner: false,
|
||||||
|
assaultDistance,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
tankModelDefinition,
|
tankModelDefinition,
|
||||||
|
|||||||
+25
@@ -0,0 +1,25 @@
|
|||||||
|
import { Box, Progress } from '@radix-ui/themes';
|
||||||
|
import { useProgress } from '@react-three/drei';
|
||||||
|
|
||||||
|
interface Props {
|
||||||
|
fontSize?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function Tracker({ fontSize }: Props) {
|
||||||
|
const { loaded, total } = useProgress();
|
||||||
|
const progress = total === 0 ? 0 : (loaded / total) * 100;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Box
|
||||||
|
position="absolute"
|
||||||
|
left="50%"
|
||||||
|
bottom="0"
|
||||||
|
width="min(100%, 16rem)"
|
||||||
|
style={{
|
||||||
|
transform: `translate(-50%, calc(${fontSize} / 2))`,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Progress color="gray" value={progress} />
|
||||||
|
</Box>
|
||||||
|
);
|
||||||
|
}
|
||||||
+18
-17
@@ -1,13 +1,14 @@
|
|||||||
import { TankType } from '@blitzkit/core';
|
import { TankType } from '@blitzkit/core';
|
||||||
import { Box, Heading } from '@radix-ui/themes';
|
import { Box, Heading } from '@radix-ui/themes';
|
||||||
import { Var } from '../../../../../core/radix/var';
|
import { Var } from '../../../../../../core/radix/var';
|
||||||
import { useLocale } from '../../../../../hooks/useLocale';
|
import { useLocale } from '../../../../../../hooks/useLocale';
|
||||||
import { Duel } from '../../../../../stores/duel';
|
import { Duel } from '../../../../../../stores/duel';
|
||||||
import type { RadixColor } from '../../../../../stores/embedState';
|
import type { RadixColor } from '../../../../../../stores/embedState';
|
||||||
import { TankopediaEphemeral } from '../../../../../stores/tankopediaEphemeral';
|
import { TankopediaEphemeral } from '../../../../../../stores/tankopediaEphemeral';
|
||||||
|
import { Tracker } from './components/Tracker';
|
||||||
|
|
||||||
interface TitleProps {
|
interface TitleProps {
|
||||||
outline?: boolean;
|
foreground?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const NATION_COLORS: Record<
|
export const NATION_COLORS: Record<
|
||||||
@@ -65,7 +66,7 @@ export const NATION_COLORS: Record<
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export function Title({ outline }: TitleProps) {
|
export function Title({ foreground }: TitleProps) {
|
||||||
const { unwrap } = useLocale();
|
const { unwrap } = useLocale();
|
||||||
const protagonist = Duel.use((state) => state.protagonist.tank);
|
const protagonist = Duel.use((state) => state.protagonist.tank);
|
||||||
const disturbed = TankopediaEphemeral.use((state) => state.disturbed);
|
const disturbed = TankopediaEphemeral.use((state) => state.disturbed);
|
||||||
@@ -81,6 +82,11 @@ export function Title({ outline }: TitleProps) {
|
|||||||
: `${nationColors.text}-12`,
|
: `${nationColors.text}-12`,
|
||||||
);
|
);
|
||||||
const name = unwrap(protagonist.name);
|
const name = unwrap(protagonist.name);
|
||||||
|
const fontSize = revealed
|
||||||
|
? disturbed
|
||||||
|
? '2rem'
|
||||||
|
: `min(65vh, ${125 / name.length}vw)`
|
||||||
|
: `min(48vh, ${75 / name.length}vw)`;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
@@ -97,17 +103,10 @@ export function Title({ outline }: TitleProps) {
|
|||||||
fontWeight: 900,
|
fontWeight: 900,
|
||||||
userSelect: 'none',
|
userSelect: 'none',
|
||||||
pointerEvents: 'none',
|
pointerEvents: 'none',
|
||||||
fontSize: revealed
|
fontSize,
|
||||||
? disturbed
|
|
||||||
? '2rem'
|
|
||||||
: `min(65vh, ${125 / name.length}vw)`
|
|
||||||
: `min(48vh, ${75 / name.length}vw)`,
|
|
||||||
whiteSpace: 'nowrap',
|
whiteSpace: 'nowrap',
|
||||||
color: outline ? Var(`${nationColors.tint}-a2`) : color,
|
color: foreground ? Var('gray-a10') : color,
|
||||||
opacity: outline && disturbed ? 0 : 1,
|
opacity: foreground && disturbed ? 0 : 1,
|
||||||
WebkitTextStroke: outline
|
|
||||||
? `${revealed ? (disturbed ? '1px' : 'min(2px, 0.2vw)') : 0} ${color}`
|
|
||||||
: undefined,
|
|
||||||
letterSpacing: disturbed || !revealed ? 0 : '-0.03em',
|
letterSpacing: disturbed || !revealed ? 0 : '-0.03em',
|
||||||
transition: `
|
transition: `
|
||||||
letter-spacing 1.5s ${disturbed ? '' : 'cubic-bezier(.81,-2,.68,1)'},
|
letter-spacing 1.5s ${disturbed ? '' : 'cubic-bezier(.81,-2,.68,1)'},
|
||||||
@@ -120,6 +119,8 @@ export function Title({ outline }: TitleProps) {
|
|||||||
>
|
>
|
||||||
{name}
|
{name}
|
||||||
</Heading>
|
</Heading>
|
||||||
|
|
||||||
|
{!revealed && <Tracker fontSize={fontSize} />}
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
+4
@@ -73,6 +73,9 @@ export function SceneProps() {
|
|||||||
const crewSkills = TankopediaEphemeral.use((state) => state.skills);
|
const crewSkills = TankopediaEphemeral.use((state) => state.skills);
|
||||||
const consumables = Duel.use((state) => state.protagonist.consumables);
|
const consumables = Duel.use((state) => state.protagonist.consumables);
|
||||||
const provisions = Duel.use((state) => state.protagonist.provisions);
|
const provisions = Duel.use((state) => state.protagonist.provisions);
|
||||||
|
const assaultDistance = Duel.use(
|
||||||
|
(state) => state.protagonist.assaultDistance,
|
||||||
|
);
|
||||||
const equipmentMatrix = Duel.use(
|
const equipmentMatrix = Duel.use(
|
||||||
(state) => state.protagonist.equipmentMatrix,
|
(state) => state.protagonist.equipmentMatrix,
|
||||||
);
|
);
|
||||||
@@ -96,6 +99,7 @@ export function SceneProps() {
|
|||||||
stockTurret: tank.turrets[0],
|
stockTurret: tank.turrets[0],
|
||||||
stockTrack: tank.tracks[0],
|
stockTrack: tank.tracks[0],
|
||||||
track,
|
track,
|
||||||
|
assaultDistance,
|
||||||
},
|
},
|
||||||
{ equipmentDefinitions, provisionDefinitions, tankModelDefinition },
|
{ equipmentDefinitions, provisionDefinitions, tankModelDefinition },
|
||||||
);
|
);
|
||||||
|
|||||||
+2
@@ -1,3 +1,5 @@
|
|||||||
|
precision mediump float;
|
||||||
|
|
||||||
#define USE_FOG
|
#define USE_FOG
|
||||||
|
|
||||||
#include <fog_pars_fragment>
|
#include <fog_pars_fragment>
|
||||||
|
|||||||
+2
@@ -1,3 +1,5 @@
|
|||||||
|
precision mediump float;
|
||||||
|
|
||||||
#define USE_FOG
|
#define USE_FOG
|
||||||
|
|
||||||
#include <fog_pars_vertex>
|
#include <fog_pars_vertex>
|
||||||
|
|||||||
+4
-4
@@ -39,11 +39,11 @@ interface TankSandboxProps {
|
|||||||
naked?: boolean;
|
naked?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const forNear0 = 20;
|
export const forNear0 = 30;
|
||||||
export const fogFar0 = 25;
|
export const fogFar0 = 50;
|
||||||
export const forNear1 = 0;
|
export const forNear1 = 0;
|
||||||
export const fogFar1 = 0;
|
export const fogFar1 = 0;
|
||||||
export const fogAnimationTime = 1.5;
|
export const fogAnimationTime = 2.5;
|
||||||
|
|
||||||
export const TankSandbox = forwardRef<HTMLCanvasElement, TankSandboxProps>(
|
export const TankSandbox = forwardRef<HTMLCanvasElement, TankSandboxProps>(
|
||||||
({ thicknessRange, naked }, ref) => {
|
({ thicknessRange, naked }, ref) => {
|
||||||
@@ -74,7 +74,7 @@ export const TankSandbox = forwardRef<HTMLCanvasElement, TankSandboxProps>(
|
|||||||
const interval = setInterval(() => {
|
const interval = setInterval(() => {
|
||||||
const t = (Date.now() - t0) / 1000;
|
const t = (Date.now() - t0) / 1000;
|
||||||
const x = t / fogAnimationTime;
|
const x = t / fogAnimationTime;
|
||||||
const y = Math.cbrt(-2 * Math.abs(x - 0.5)) + 1;
|
const y = Math.sin(Math.PI * x);
|
||||||
|
|
||||||
const near = forNear0 + (forNear1 - forNear0) * y;
|
const near = forNear0 + (forNear1 - forNear0) * y;
|
||||||
const far = fogFar0 + (fogFar1 - fogFar0) * y;
|
const far = fogFar0 + (fogFar1 - fogFar0) * y;
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ export function HeroSection({ skeleton }: MaybeSkeletonComponentProps) {
|
|||||||
transitionDuration: '1s',
|
transitionDuration: '1s',
|
||||||
background: isFullScreen ? 'black' : undefined,
|
background: isFullScreen ? 'black' : undefined,
|
||||||
}}
|
}}
|
||||||
height={disturbed && !isFullScreen ? 'calc(100svh - 6rem)' : '100vh'}
|
height={!isFullScreen ? 'calc(100svh - 6rem)' : '100vh'}
|
||||||
maxHeight={isFullScreen ? undefined : '60rem'}
|
maxHeight={isFullScreen ? undefined : '60rem'}
|
||||||
maxWidth={isFullScreen ? undefined : '120rem'}
|
maxWidth={isFullScreen ? undefined : '120rem'}
|
||||||
flexGrow="1"
|
flexGrow="1"
|
||||||
@@ -136,7 +136,7 @@ export function HeroSection({ skeleton }: MaybeSkeletonComponentProps) {
|
|||||||
height: '100%',
|
height: '100%',
|
||||||
transitionDuration: '2s',
|
transitionDuration: '2s',
|
||||||
opacity: revealed ? 1 : 0,
|
opacity: revealed ? 1 : 0,
|
||||||
filter: disturbed ? undefined : `drop-shadow(0 0 2rem black)`,
|
filter: disturbed ? undefined : `drop-shadow(0 0 1rem black)`,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Suspense>
|
<Suspense>
|
||||||
@@ -153,7 +153,7 @@ export function HeroSection({ skeleton }: MaybeSkeletonComponentProps) {
|
|||||||
</Box>
|
</Box>
|
||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
<Title outline />
|
<Title foreground />
|
||||||
</Flex>
|
</Flex>
|
||||||
</Flex>
|
</Flex>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ interface Props {
|
|||||||
|
|
||||||
const { tool } = Astro.props;
|
const { tool } = Astro.props;
|
||||||
const disabled = tool.branches?.every(
|
const disabled = tool.branches?.every(
|
||||||
(branch) => branch !== assertSecret(import.meta.env.PUBLIC_ASSET_BRANCH),
|
(branch) => branch !== assertSecret(import.meta.env.PUBLIC_BRANCH),
|
||||||
);
|
);
|
||||||
const { locale } = Astro.params;
|
const { locale } = Astro.params;
|
||||||
const strings = getStrings(locale);
|
const strings = getStrings(locale);
|
||||||
@@ -108,7 +108,7 @@ const toolStrings =
|
|||||||
disabled ? (
|
disabled ? (
|
||||||
<>
|
<>
|
||||||
Unavailable on{' '}
|
Unavailable on{' '}
|
||||||
<Code>{assertSecret(import.meta.env.PUBLIC_ASSET_BRANCH)}</Code>
|
<Code>{assertSecret(import.meta.env.PUBLIC_BRANCH)}</Code>
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
toolStrings.description
|
toolStrings.description
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ export function resolveBranchName(locale: string = DEFAULT_LOCALE) {
|
|||||||
if (!(locale in STRINGS)) throw new Error(`Unsupported locale: ${locale}`);
|
if (!(locale in STRINGS)) throw new Error(`Unsupported locale: ${locale}`);
|
||||||
|
|
||||||
const strings = STRINGS[locale as SupportedLocale];
|
const strings = STRINGS[locale as SupportedLocale];
|
||||||
const secret = assertSecret(import.meta.env.PUBLIC_ASSET_BRANCH);
|
const secret = assertSecret(import.meta.env.PUBLIC_BRANCH);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
assertSecret(import.meta.env.MODE) === 'development' &&
|
assertSecret(import.meta.env.MODE) === 'development' &&
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
const GAMMA = 1.2;
|
||||||
|
|
||||||
|
export function fakeLog(x: number, a = 1) {
|
||||||
|
return Math.sin((Math.PI / 2) * x) ** (1 / GAMMA);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function fakeLogInverse(y: number, a = 1) {
|
||||||
|
return (2 / Math.PI) * Math.asin(y ** GAMMA);
|
||||||
|
}
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
import { fetchEquipmentDefinitions } from '@blitzkit/core';
|
|
||||||
import type { EquipmentMatrix } from '../../stores/duel';
|
import type { EquipmentMatrix } from '../../stores/duel';
|
||||||
|
import { awaitableEquipmentDefinitions } from '../awaitables/equipmentDefinitions';
|
||||||
|
|
||||||
export async function hasEquipment(
|
export async function hasEquipment(
|
||||||
id: number,
|
id: number,
|
||||||
equipmentPreset: string,
|
equipmentPreset: string,
|
||||||
equipmentMatrix: EquipmentMatrix,
|
equipmentMatrix: EquipmentMatrix,
|
||||||
) {
|
) {
|
||||||
const equipmentDefinitions = await fetchEquipmentDefinitions();
|
const equipmentDefinitions = await awaitableEquipmentDefinitions;
|
||||||
const preset = equipmentDefinitions.presets[equipmentPreset];
|
const preset = equipmentDefinitions.presets[equipmentPreset];
|
||||||
return preset.slots.some((slot, index) => {
|
return preset.slots.some((slot, index) => {
|
||||||
const row = Math.floor(index / 3);
|
const row = Math.floor(index / 3);
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ export function tankCharacteristics(
|
|||||||
applyReactiveArmor,
|
applyReactiveArmor,
|
||||||
applyDynamicArmor,
|
applyDynamicArmor,
|
||||||
applySpallLiner,
|
applySpallLiner,
|
||||||
|
assaultDistance,
|
||||||
}: {
|
}: {
|
||||||
tank: TankDefinition;
|
tank: TankDefinition;
|
||||||
turret: TurretDefinition;
|
turret: TurretDefinition;
|
||||||
@@ -65,6 +66,7 @@ export function tankCharacteristics(
|
|||||||
applyReactiveArmor: boolean;
|
applyReactiveArmor: boolean;
|
||||||
applyDynamicArmor: boolean;
|
applyDynamicArmor: boolean;
|
||||||
applySpallLiner: boolean;
|
applySpallLiner: boolean;
|
||||||
|
assaultDistance: number;
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
tankModelDefinition,
|
tankModelDefinition,
|
||||||
@@ -157,7 +159,15 @@ export function tankCharacteristics(
|
|||||||
[applyDynamicArmor, -0.1],
|
[applyDynamicArmor, -0.1],
|
||||||
[applySpallLiner && shell.type === ShellType.HE, -0.2],
|
[applySpallLiner && shell.type === ShellType.HE, -0.2],
|
||||||
);
|
);
|
||||||
const moduleDamageCoefficient = coefficient([hasTungsten, 0.15]);
|
const assaultDamageCoefficient =
|
||||||
|
gun.gun_type!.value.base.assault_ranges &&
|
||||||
|
gun.gun_type!.value.base.assault_ranges.types.includes(shell.type)
|
||||||
|
? (gun.gun_type!.value.base.assault_ranges.ranges.find(
|
||||||
|
({ distance }) => distance >= assaultDistance,
|
||||||
|
)?.factor ?? 0)
|
||||||
|
: 1;
|
||||||
|
const moduleDamageCoefficient =
|
||||||
|
coefficient([hasTungsten, 0.15]) * assaultDamageCoefficient;
|
||||||
const reloadCoefficient =
|
const reloadCoefficient =
|
||||||
(coefficient([hasGunRammer, -0.05]) *
|
(coefficient([hasGunRammer, -0.05]) *
|
||||||
coefficient([true, degressiveStat(loaderMastery)])) /
|
coefficient([true, degressiveStat(loaderMastery)])) /
|
||||||
@@ -326,10 +336,13 @@ export function tankCharacteristics(
|
|||||||
stockTurret.weight +
|
stockTurret.weight +
|
||||||
stockGun.gun_type!.value.base.weight;
|
stockGun.gun_type!.value.base.weight;
|
||||||
const resolvedEnginePower = engine.power * enginePowerCoefficient;
|
const resolvedEnginePower = engine.power * enginePowerCoefficient;
|
||||||
|
const damageCoefficientWithoutAssault = armorDamageCoefficient;
|
||||||
|
const damageCoefficient =
|
||||||
|
damageCoefficientWithoutAssault * assaultDamageCoefficient;
|
||||||
const dpm = resolveDpm(
|
const dpm = resolveDpm(
|
||||||
gun,
|
gun,
|
||||||
shell,
|
shell,
|
||||||
armorDamageCoefficient,
|
damageCoefficient,
|
||||||
reloadCoefficient,
|
reloadCoefficient,
|
||||||
intraClipCoefficient,
|
intraClipCoefficient,
|
||||||
);
|
);
|
||||||
@@ -352,7 +365,9 @@ export function tankCharacteristics(
|
|||||||
return current;
|
return current;
|
||||||
}, null)!.index
|
}, null)!.index
|
||||||
: undefined;
|
: undefined;
|
||||||
const damage = shell.armor_damage * armorDamageCoefficient;
|
const damageWithoutAssault =
|
||||||
|
shell.armor_damage * damageCoefficientWithoutAssault;
|
||||||
|
const damage = shell.armor_damage * damageCoefficient;
|
||||||
const dpmEffective =
|
const dpmEffective =
|
||||||
gun.gun_type!.$case === 'auto_reloader'
|
gun.gun_type!.$case === 'auto_reloader'
|
||||||
? gun.gun_type!.value.extension.shell_reloads[0] >
|
? gun.gun_type!.value.extension.shell_reloads[0] >
|
||||||
@@ -533,6 +548,7 @@ export function tankCharacteristics(
|
|||||||
caliber,
|
caliber,
|
||||||
penetration,
|
penetration,
|
||||||
damage,
|
damage,
|
||||||
|
damageWithoutAssault,
|
||||||
clipDamage,
|
clipDamage,
|
||||||
moduleDamage,
|
moduleDamage,
|
||||||
explosionRadius,
|
explosionRadius,
|
||||||
|
|||||||
@@ -40,5 +40,7 @@ export function tankToDuelMember(
|
|||||||
yaw,
|
yaw,
|
||||||
pitch,
|
pitch,
|
||||||
turret,
|
turret,
|
||||||
|
assaultDistance:
|
||||||
|
(gun.gun_type!.value.base.assault_ranges?.ranges[0].distance ?? 0) / 2,
|
||||||
} satisfies DuelMember;
|
} satisfies DuelMember;
|
||||||
}
|
}
|
||||||
@@ -85,6 +85,7 @@ function Content() {
|
|||||||
member.key !== thisMember.key &&
|
member.key !== thisMember.key &&
|
||||||
member.provisions.includes(101),
|
member.provisions.includes(101),
|
||||||
),
|
),
|
||||||
|
assaultDistance: thisMember.assaultDistance,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
equipmentDefinitions: equipmentDefinitions,
|
equipmentDefinitions: equipmentDefinitions,
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import {
|
|||||||
import { getStrings } from '../../core/i18n/getStrings';
|
import { getStrings } from '../../core/i18n/getStrings';
|
||||||
import BaseLayout from '../../layouts/BaseLayout.astro';
|
import BaseLayout from '../../layouts/BaseLayout.astro';
|
||||||
|
|
||||||
const PUBLIC_ASSET_BRANCH = assertSecret(import.meta.env.PUBLIC_ASSET_BRANCH);
|
const PUBLIC_ASSET_BRANCH = assertSecret(import.meta.env.PUBLIC_BRANCH);
|
||||||
const MODE = assertSecret(import.meta.env.MODE);
|
const MODE = assertSecret(import.meta.env.MODE);
|
||||||
const locale = Astro.params.locale ?? DEFAULT_LOCALE;
|
const locale = Astro.params.locale ?? DEFAULT_LOCALE;
|
||||||
const strings = getStrings(Astro.params.locale);
|
const strings = getStrings(Astro.params.locale);
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ const url = import.meta.env.SITE + Astro.url.pathname;
|
|||||||
const icon = asset(`icons/tanks/big/${id}.webp`);
|
const icon = asset(`icons/tanks/big/${id}.webp`);
|
||||||
const turret = tank.turrets.at(-1)!;
|
const turret = tank.turrets.at(-1)!;
|
||||||
const gun = turret.guns.at(-1)!;
|
const gun = turret.guns.at(-1)!;
|
||||||
|
const shell = gun.gun_type!.value.base.shells[0];
|
||||||
const characteristics = tankCharacteristics(
|
const characteristics = tankCharacteristics(
|
||||||
{
|
{
|
||||||
tank,
|
tank,
|
||||||
@@ -74,12 +75,13 @@ const characteristics = tankCharacteristics(
|
|||||||
turret,
|
turret,
|
||||||
gun,
|
gun,
|
||||||
provisions: createDefaultProvisions(tank, gun, provisionDefinitions),
|
provisions: createDefaultProvisions(tank, gun, provisionDefinitions),
|
||||||
shell: gun.gun_type!.value.base.shells[0],
|
shell,
|
||||||
stockEngine: tank.engines[0],
|
stockEngine: tank.engines[0],
|
||||||
stockGun: tank.turrets[0].guns[0],
|
stockGun: tank.turrets[0].guns[0],
|
||||||
stockTurret: tank.turrets[0],
|
stockTurret: tank.turrets[0],
|
||||||
stockTrack: tank.tracks[0],
|
stockTrack: tank.tracks[0],
|
||||||
track: tank.tracks.at(-1)!,
|
track: tank.tracks.at(-1)!,
|
||||||
|
assaultDistance: 0,
|
||||||
},
|
},
|
||||||
{ equipmentDefinitions, provisionDefinitions, tankModelDefinition },
|
{ equipmentDefinitions, provisionDefinitions, tankModelDefinition },
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
import type { APIContext } from 'astro';
|
import type { APIContext } from 'astro';
|
||||||
|
|
||||||
|
const ALLOW_ROBOTS = import.meta.env.ALLOW_ROBOTS === 'true';
|
||||||
|
|
||||||
export async function GET({ request }: APIContext) {
|
export async function GET({ request }: APIContext) {
|
||||||
const flags: Record<string, string | null> = {
|
const flags: Record<string, string | null> = {
|
||||||
'User-agent': '*',
|
'User-agent': '*',
|
||||||
Allow: '/',
|
Allow: ALLOW_ROBOTS ? '/' : null,
|
||||||
|
Disallow: ALLOW_ROBOTS ? null : '/',
|
||||||
|
|
||||||
space: null,
|
space: null,
|
||||||
Sitemap: `${new URL(request.url).origin}/sitemap-index.xml`,
|
Sitemap: `${new URL(request.url).origin}/sitemap-index.xml`,
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ export interface DuelMember {
|
|||||||
provisions: number[];
|
provisions: number[];
|
||||||
camouflage: boolean;
|
camouflage: boolean;
|
||||||
cooldownBooster: number;
|
cooldownBooster: number;
|
||||||
|
assaultDistance: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DuelStore {
|
export interface DuelStore {
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ export interface TankFilters {
|
|||||||
classes: TankClass[];
|
classes: TankClass[];
|
||||||
types: TankType[];
|
types: TankType[];
|
||||||
testing: 'include' | 'exclude' | 'only';
|
testing: 'include' | 'exclude' | 'only';
|
||||||
search?: string;
|
search: string | null;
|
||||||
searching: boolean;
|
searching: boolean;
|
||||||
gunType: CaseType<GunDefinition>[];
|
gunType: CaseType<GunDefinition>[];
|
||||||
shells: [ShellType | null, ShellType | null, ShellType | null];
|
shells: [ShellType | null, ShellType | null, ShellType | null];
|
||||||
@@ -30,7 +30,7 @@ export const initialTankFilters: TankFilters = {
|
|||||||
classes: [],
|
classes: [],
|
||||||
types: [],
|
types: [],
|
||||||
testing: 'include',
|
testing: 'include',
|
||||||
search: undefined,
|
search: null,
|
||||||
searching: false,
|
searching: false,
|
||||||
gunType: [],
|
gunType: [],
|
||||||
shells: [null, null, null],
|
shells: [null, null, null],
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ export const SORT_UNITS: Record<TankopediaSortBy, string | undefined> = {
|
|||||||
'fire.gunDepression': '°',
|
'fire.gunDepression': '°',
|
||||||
'fire.gunElevation': '°',
|
'fire.gunElevation': '°',
|
||||||
'fire.premiumPenetration': 'mm',
|
'fire.premiumPenetration': 'mm',
|
||||||
|
'fire.tertiaryPenetration': 'mm',
|
||||||
'fire.reload': 's',
|
'fire.reload': 's',
|
||||||
'fire.shellVelocity': 'm/s',
|
'fire.shellVelocity': 'm/s',
|
||||||
'fire.shellRange': 'm',
|
'fire.shellRange': 'm',
|
||||||
|
|||||||
Submodule submodules/blitzkit-closed updated: 31937a9f1e...89dc337d27.
Submodule
+1
Submodule submodules/blitzkit-internal added at 14adb2e456.
Reference in new issue
Block a user