From 9e388154756d1ad3206a1b42b970137762950df6 Mon Sep 17 00:00:00 2001 From: Mark Greene Date: Tue, 14 Jul 2026 10:31:14 +1200 Subject: [PATCH 01/43] Add Spall Liner toggle to Tankopedia model viewer --- packages/i18n/strings/en.json | 4 + .../SpacedArmorSceneComponent/index.tsx | 11 ++ .../Options/components/SpallLinerSwitcher.tsx | 103 ++++++++++++++++++ .../HeroSection/components/Options/index.tsx | 3 + .../website/src/core/blitzkit/spallLiner.ts | 8 ++ .../src/core/blitzkit/tankCharacteristics.ts | 6 +- 6 files changed, 134 insertions(+), 1 deletion(-) create mode 100644 packages/website/src/components/Tankopedia/HeroSection/components/Options/components/SpallLinerSwitcher.tsx create mode 100644 packages/website/src/core/blitzkit/spallLiner.ts diff --git a/packages/i18n/strings/en.json b/packages/i18n/strings/en.json index 534e2fa8d..9ac4145ee 100644 --- a/packages/i18n/strings/en.json +++ b/packages/i18n/strings/en.json @@ -527,6 +527,10 @@ "label": "Edit", "reset": "Reset" } + }, + + "spall_liner": { + "swap_prompt": "Spall Liner will replace one of your active provisions. Choose which one to remove:" } }, diff --git a/packages/website/src/components/Armor/components/SpacedArmorSceneComponent/index.tsx b/packages/website/src/components/Armor/components/SpacedArmorSceneComponent/index.tsx index f2c770593..784836464 100644 --- a/packages/website/src/components/Armor/components/SpacedArmorSceneComponent/index.tsx +++ b/packages/website/src/components/Armor/components/SpacedArmorSceneComponent/index.tsx @@ -18,6 +18,10 @@ import { import { degToRad } from "three/src/math/MathUtils.js"; import { hasEquipment } from "../../../../core/blitzkit/hasEquipment"; import { jsxTree } from "../../../../core/blitzkit/jsxTree"; +import { + SPALL_LINER_HE_DAMAGE_DELTA, + SPALL_LINER_PROVISION_ID, +} from "../../../../core/blitzkit/spallLiner"; import { defaultEqualizer } from "../../../../core/blitzkit/tankToDuelMember"; import { discardClippingPlane } from "../../../../core/three/discardClippingPlane"; import { Duel } from "../../../../stores/duel"; @@ -384,6 +388,13 @@ export function SpacedArmorSceneComponent({ shot.damage *= antagonistEqualizer.damage; + const hasSpallLiner = Duel.state.protagonist.provisions.includes( + SPALL_LINER_PROVISION_ID, + ); + if (hasSpallLiner && shell.type === ShellType.SHELL_TYPE_HE) { + shot.damage *= 1 + SPALL_LINER_HE_DAMAGE_DELTA; + } + return shot; }, [camera], diff --git a/packages/website/src/components/Tankopedia/HeroSection/components/Options/components/SpallLinerSwitcher.tsx b/packages/website/src/components/Tankopedia/HeroSection/components/Options/components/SpallLinerSwitcher.tsx new file mode 100644 index 000000000..3b66d75dc --- /dev/null +++ b/packages/website/src/components/Tankopedia/HeroSection/components/Options/components/SpallLinerSwitcher.tsx @@ -0,0 +1,103 @@ +import { alias, availableProvisions } from "@blitzkit/core"; +import { Flex, IconButton, Popover, Text } from "@radix-ui/themes"; +import { api } from "../../../../../../core/blitzkit/api"; +import { SPALL_LINER_PROVISION_ID } from "../../../../../../core/blitzkit/spallLiner"; +import { useLocale } from "../../../../../../hooks/useLocale"; +import { Duel } from "../../../../../../stores/duel"; +import { Tankopedia } from "../../../../../../stores/tankopedia"; +import { ProvisionButton } from "../../../../../ModuleButtons/ProvisionButton"; + +const provisionDefinitions = await api.provisionDefinitions(); + +export function SpallLinerSwitcher() { + const { tank, gun, provisions } = Duel.use((state) => state.protagonist); + const { strings, unwrap } = useLocale(); + const isSpallLinerActive = provisions.includes(SPALL_LINER_PROVISION_ID); + const hasSlotAvailable = provisions.length < tank.max_provisions; + + const canEquipSpallLiner = availableProvisions( + tank, + gun, + provisionDefinitions, + ).some((provision) => provision.id === SPALL_LINER_PROVISION_ID); + + if (!canEquipSpallLiner) return null; + + function equip(replacing?: number) { + Duel.mutate((draft) => { + if (replacing !== undefined) { + const provisions = draft.protagonist.provisions; + provisions[provisions.indexOf(replacing)] = SPALL_LINER_PROVISION_ID; + } else { + draft.protagonist.provisions.push(SPALL_LINER_PROVISION_ID); + } + }); + Tankopedia.mutate((draft) => { + draft.shot = undefined; + }); + } + + function unequip() { + Duel.mutate((draft) => { + draft.protagonist.provisions = draft.protagonist.provisions.filter( + (id) => id !== SPALL_LINER_PROVISION_ID, + ); + }); + Tankopedia.mutate((draft) => { + draft.shot = undefined; + }); + } + + const button = ( + { + if (isSpallLinerActive) { + unequip(); + } else if (hasSlotAvailable) { + equip(); + } + }} + > + {unwrap(provisionDefinitions.provisions[SPALL_LINER_PROVISION_ID].name!)} + + ); + + if (isSpallLinerActive || hasSlotAvailable) return button; + + return ( + + {button} + + + + + {strings.website.tools.tankopedia.sandbox.spall_liner.swap_prompt} + + + + {provisions.map((id) => ( + + equip(id)} + /> + + ))} + + + + + ); +} diff --git a/packages/website/src/components/Tankopedia/HeroSection/components/Options/index.tsx b/packages/website/src/components/Tankopedia/HeroSection/components/Options/index.tsx index 05fc67d92..5856c66d0 100644 --- a/packages/website/src/components/Tankopedia/HeroSection/components/Options/index.tsx +++ b/packages/website/src/components/Tankopedia/HeroSection/components/Options/index.tsx @@ -46,6 +46,7 @@ import { TankSearch } from "../../../../TankSearch"; import { CustomShellButton } from "./components/CustomShellButton"; import { DynamicArmorSwitcher } from "./components/DynamicArmorSwitcher"; import { QuickInputs } from "./components/QuickInputs"; +import { SpallLinerSwitcher } from "./components/SpallLinerSwitcher"; import { Thicknesses } from "./components/Thicknesses"; type OptionsProps = MaybeSkeletonComponentProps & { @@ -278,6 +279,8 @@ export function Options({ thicknessRange, canvas, skeleton }: OptionsProps) { }} /> + + {!skeleton && ( diff --git a/packages/website/src/core/blitzkit/spallLiner.ts b/packages/website/src/core/blitzkit/spallLiner.ts new file mode 100644 index 000000000..80598d5c1 --- /dev/null +++ b/packages/website/src/core/blitzkit/spallLiner.ts @@ -0,0 +1,8 @@ +export const SPALL_LINER_PROVISION_ID = 101; + +/** + * Matches the in-game reduction Spall Liner grants against HE splash + * damage. Shared between the characteristics panel and the Dynamic + * Armor 3D viewer's damage readout so the figure isn't duplicated. + */ +export const SPALL_LINER_HE_DAMAGE_DELTA = -0.2; diff --git a/packages/website/src/core/blitzkit/tankCharacteristics.ts b/packages/website/src/core/blitzkit/tankCharacteristics.ts index d9d041098..f03bbf3e7 100644 --- a/packages/website/src/core/blitzkit/tankCharacteristics.ts +++ b/packages/website/src/core/blitzkit/tankCharacteristics.ts @@ -22,6 +22,7 @@ import { } from "@blitzkit/core"; import { coefficient } from "@blitzkit/core/src/blitzkit/coefficient"; import type { EquipmentMatrix } from "../../stores/duel"; +import { SPALL_LINER_HE_DAMAGE_DELTA } from "./spallLiner"; import { defaultEqualizer } from "./tankToDuelMember"; export type TankCharacteristics = ReturnType; @@ -170,7 +171,10 @@ export function tankCharacteristics( coefficient( [applyReactiveArmor && shell.type !== ShellType.SHELL_TYPE_HE, -0.27], [applyDynamicArmor, -0.1], - [applySpallLiner && shell.type === ShellType.SHELL_TYPE_HE, -0.2], + [ + applySpallLiner && shell.type === ShellType.SHELL_TYPE_HE, + SPALL_LINER_HE_DAMAGE_DELTA, + ], ); const assaultDamageCoefficient = gun.assault_ranges && gun.assault_ranges.types.includes(shell.type) From 85b8c7057d040de7fa72d786c8fb83af3e76c1ef Mon Sep 17 00:00:00 2001 From: Mark Greene Date: Sat, 26 Sep 2026 19:45:17 +1200 Subject: [PATCH 02/43] Redesign Spall Liner swap popover with icons Replace wordy swap prompt with compact icon row (spall liner icon, swap icon, current provisions) and drop unused ProvisionButton tooltip that flashed on popover open. --- packages/i18n/strings/en.json | 4 -- .../Options/components/SpallLinerSwitcher.tsx | 49 ++++++++++++++----- 2 files changed, 37 insertions(+), 16 deletions(-) diff --git a/packages/i18n/strings/en.json b/packages/i18n/strings/en.json index 9ac4145ee..534e2fa8d 100644 --- a/packages/i18n/strings/en.json +++ b/packages/i18n/strings/en.json @@ -527,10 +527,6 @@ "label": "Edit", "reset": "Reset" } - }, - - "spall_liner": { - "swap_prompt": "Spall Liner will replace one of your active provisions. Choose which one to remove:" } }, diff --git a/packages/website/src/components/Tankopedia/HeroSection/components/Options/components/SpallLinerSwitcher.tsx b/packages/website/src/components/Tankopedia/HeroSection/components/Options/components/SpallLinerSwitcher.tsx index 3b66d75dc..34ecffe18 100644 --- a/packages/website/src/components/Tankopedia/HeroSection/components/Options/components/SpallLinerSwitcher.tsx +++ b/packages/website/src/components/Tankopedia/HeroSection/components/Options/components/SpallLinerSwitcher.tsx @@ -1,17 +1,17 @@ import { alias, availableProvisions } from "@blitzkit/core"; -import { Flex, IconButton, Popover, Text } from "@radix-ui/themes"; +import { ShuffleIcon } from "@radix-ui/react-icons"; +import { Flex, IconButton, Popover } from "@radix-ui/themes"; import { api } from "../../../../../../core/blitzkit/api"; import { SPALL_LINER_PROVISION_ID } from "../../../../../../core/blitzkit/spallLiner"; import { useLocale } from "../../../../../../hooks/useLocale"; import { Duel } from "../../../../../../stores/duel"; import { Tankopedia } from "../../../../../../stores/tankopedia"; -import { ProvisionButton } from "../../../../../ModuleButtons/ProvisionButton"; const provisionDefinitions = await api.provisionDefinitions(); export function SpallLinerSwitcher() { const { tank, gun, provisions } = Duel.use((state) => state.protagonist); - const { strings, unwrap } = useLocale(); + const { unwrap } = useLocale(); const isSpallLinerActive = provisions.includes(SPALL_LINER_PROVISION_ID); const hasSlotAvailable = provisions.length < tank.max_provisions; @@ -80,19 +80,44 @@ export function SpallLinerSwitcher() { {button} - - - {strings.website.tools.tankopedia.sandbox.spall_liner.swap_prompt} - + + + {unwrap( + - + + + {provisions.map((id) => ( - equip(id)} - /> + > + {unwrap(provisionDefinitions.provisions[id].name!)} + ))} From 0bdb66742b261941465f9e6ff81b52ab6e8e6295 Mon Sep 17 00:00:00 2001 From: Mark Greene Date: Sun, 4 Oct 2026 13:27:34 +1300 Subject: [PATCH 03/43] Feature: Add Spall Liner toggle to Tankopedia model viewer ## Summary - Add a Spall Liner toggle button to the Tankopedia model viewer, placed alongside the existing Calibrated Shells / Enhanced Armor buttons. It's only shown for tanks that can actually equip Spall Liner. - The toggle reads/writes the same `Duel.protagonist.provisions` array as the Provisions tab, so both stay in sync automatically. - If a provision slot is free, clicking equips Spall Liner immediately. If all slots are full, a popover shows icons with a shuffle arrow so you can pick which active provision to swap out in one step. - Buttons use the same medium rounding as the consumable buttons on the tank page. - When Spall Liner is equipped, the Dynamic Armor 3D viewer's click-damage tooltip now applies the same 20% HE damage reduction Spall Liner grants in-game. - Refactored the hardcoded `-0.2` HE damage coefficient in `tankCharacteristics.ts` into a shared constant so the Compare tool and the 3D viewer use a single source of truth. ## Scope This only affects the single-tank Tankopedia page. The Firepower stats table (the viewed tank's own outgoing gun damage) is intentionally untouched, since a defensive damage reduction would be semantically backwards there. The Dynamic Armor viewer's click tooltip is the only place a "damage taken by this tank" number exists, so that's where the reduction is wired in. --- .../SpacedArmorSceneComponent/index.tsx | 11 ++ .../Options/components/SpallLinerSwitcher.tsx | 128 ++++++++++++++++++ .../HeroSection/components/Options/index.tsx | 3 + .../website/src/core/blitzkit/spallLiner.ts | 8 ++ .../src/core/blitzkit/tankCharacteristics.ts | 6 +- 5 files changed, 155 insertions(+), 1 deletion(-) create mode 100644 packages/website/src/components/Tankopedia/HeroSection/components/Options/components/SpallLinerSwitcher.tsx create mode 100644 packages/website/src/core/blitzkit/spallLiner.ts diff --git a/packages/website/src/components/Armor/components/SpacedArmorSceneComponent/index.tsx b/packages/website/src/components/Armor/components/SpacedArmorSceneComponent/index.tsx index f2c770593..784836464 100644 --- a/packages/website/src/components/Armor/components/SpacedArmorSceneComponent/index.tsx +++ b/packages/website/src/components/Armor/components/SpacedArmorSceneComponent/index.tsx @@ -18,6 +18,10 @@ import { import { degToRad } from "three/src/math/MathUtils.js"; import { hasEquipment } from "../../../../core/blitzkit/hasEquipment"; import { jsxTree } from "../../../../core/blitzkit/jsxTree"; +import { + SPALL_LINER_HE_DAMAGE_DELTA, + SPALL_LINER_PROVISION_ID, +} from "../../../../core/blitzkit/spallLiner"; import { defaultEqualizer } from "../../../../core/blitzkit/tankToDuelMember"; import { discardClippingPlane } from "../../../../core/three/discardClippingPlane"; import { Duel } from "../../../../stores/duel"; @@ -384,6 +388,13 @@ export function SpacedArmorSceneComponent({ shot.damage *= antagonistEqualizer.damage; + const hasSpallLiner = Duel.state.protagonist.provisions.includes( + SPALL_LINER_PROVISION_ID, + ); + if (hasSpallLiner && shell.type === ShellType.SHELL_TYPE_HE) { + shot.damage *= 1 + SPALL_LINER_HE_DAMAGE_DELTA; + } + return shot; }, [camera], diff --git a/packages/website/src/components/Tankopedia/HeroSection/components/Options/components/SpallLinerSwitcher.tsx b/packages/website/src/components/Tankopedia/HeroSection/components/Options/components/SpallLinerSwitcher.tsx new file mode 100644 index 000000000..021f5cacf --- /dev/null +++ b/packages/website/src/components/Tankopedia/HeroSection/components/Options/components/SpallLinerSwitcher.tsx @@ -0,0 +1,128 @@ +import { alias, availableProvisions } from "@blitzkit/core"; +import { ShuffleIcon } from "@radix-ui/react-icons"; +import { Flex, IconButton, Popover } from "@radix-ui/themes"; +import { api } from "../../../../../../core/blitzkit/api"; +import { SPALL_LINER_PROVISION_ID } from "../../../../../../core/blitzkit/spallLiner"; +import { useLocale } from "../../../../../../hooks/useLocale"; +import { Duel } from "../../../../../../stores/duel"; +import { Tankopedia } from "../../../../../../stores/tankopedia"; + +const provisionDefinitions = await api.provisionDefinitions(); + +export function SpallLinerSwitcher() { + const { tank, gun, provisions } = Duel.use((state) => state.protagonist); + const { unwrap } = useLocale(); + const isSpallLinerActive = provisions.includes(SPALL_LINER_PROVISION_ID); + const hasSlotAvailable = provisions.length < tank.max_provisions; + + const canEquipSpallLiner = availableProvisions( + tank, + gun, + provisionDefinitions, + ).some((provision) => provision.id === SPALL_LINER_PROVISION_ID); + + if (!canEquipSpallLiner) return null; + + function equip(replacing?: number) { + Duel.mutate((draft) => { + if (replacing !== undefined) { + const provisions = draft.protagonist.provisions; + provisions[provisions.indexOf(replacing)] = SPALL_LINER_PROVISION_ID; + } else { + draft.protagonist.provisions.push(SPALL_LINER_PROVISION_ID); + } + }); + Tankopedia.mutate((draft) => { + draft.shot = undefined; + }); + } + + function unequip() { + Duel.mutate((draft) => { + draft.protagonist.provisions = draft.protagonist.provisions.filter( + (id) => id !== SPALL_LINER_PROVISION_ID, + ); + }); + Tankopedia.mutate((draft) => { + draft.shot = undefined; + }); + } + + const button = ( + { + if (isSpallLinerActive) { + unequip(); + } else if (hasSlotAvailable) { + equip(); + } + }} + > + {unwrap(provisionDefinitions.provisions[SPALL_LINER_PROVISION_ID].name!)} + + ); + + if (isSpallLinerActive || hasSlotAvailable) return button; + + return ( + + {button} + + + + + {unwrap( + + + + + + {provisions.map((id) => ( + + equip(id)} + > + {unwrap(provisionDefinitions.provisions[id].name!)} + + + ))} + + + + + ); +} diff --git a/packages/website/src/components/Tankopedia/HeroSection/components/Options/index.tsx b/packages/website/src/components/Tankopedia/HeroSection/components/Options/index.tsx index 05fc67d92..5856c66d0 100644 --- a/packages/website/src/components/Tankopedia/HeroSection/components/Options/index.tsx +++ b/packages/website/src/components/Tankopedia/HeroSection/components/Options/index.tsx @@ -46,6 +46,7 @@ import { TankSearch } from "../../../../TankSearch"; import { CustomShellButton } from "./components/CustomShellButton"; import { DynamicArmorSwitcher } from "./components/DynamicArmorSwitcher"; import { QuickInputs } from "./components/QuickInputs"; +import { SpallLinerSwitcher } from "./components/SpallLinerSwitcher"; import { Thicknesses } from "./components/Thicknesses"; type OptionsProps = MaybeSkeletonComponentProps & { @@ -278,6 +279,8 @@ export function Options({ thicknessRange, canvas, skeleton }: OptionsProps) { }} /> + + {!skeleton && ( diff --git a/packages/website/src/core/blitzkit/spallLiner.ts b/packages/website/src/core/blitzkit/spallLiner.ts new file mode 100644 index 000000000..80598d5c1 --- /dev/null +++ b/packages/website/src/core/blitzkit/spallLiner.ts @@ -0,0 +1,8 @@ +export const SPALL_LINER_PROVISION_ID = 101; + +/** + * Matches the in-game reduction Spall Liner grants against HE splash + * damage. Shared between the characteristics panel and the Dynamic + * Armor 3D viewer's damage readout so the figure isn't duplicated. + */ +export const SPALL_LINER_HE_DAMAGE_DELTA = -0.2; diff --git a/packages/website/src/core/blitzkit/tankCharacteristics.ts b/packages/website/src/core/blitzkit/tankCharacteristics.ts index 0cc72302e..51301190a 100644 --- a/packages/website/src/core/blitzkit/tankCharacteristics.ts +++ b/packages/website/src/core/blitzkit/tankCharacteristics.ts @@ -22,6 +22,7 @@ import { } from "@blitzkit/core"; import { coefficient } from "@blitzkit/core/src/blitzkit/coefficient"; import type { EquipmentMatrix } from "../../stores/duel"; +import { SPALL_LINER_HE_DAMAGE_DELTA } from "./spallLiner"; import { defaultEqualizer } from "./tankToDuelMember"; export type TankCharacteristics = ReturnType; @@ -170,7 +171,10 @@ export function tankCharacteristics( coefficient( [applyReactiveArmor && shell.type !== ShellType.SHELL_TYPE_HE, -0.27], [applyDynamicArmor, -0.1], - [applySpallLiner && shell.type === ShellType.SHELL_TYPE_HE, -0.2], + [ + applySpallLiner && shell.type === ShellType.SHELL_TYPE_HE, + SPALL_LINER_HE_DAMAGE_DELTA, + ], ); const assaultDamageCoefficient = gun.assault_ranges && gun.assault_ranges.types.includes(shell.type) From 98b555fa7ee1b74219d33ebec53046a0bb21becb Mon Sep 17 00:00:00 2001 From: Mark Greene Date: Sun, 4 Oct 2026 13:38:20 +1300 Subject: [PATCH 04/43] Fix: gun depression visualizer ignoring turret mount tilt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The gun flexibility visualizer at the bottom of the Tankopedia Firepower section computed depression/elevation purely from the raw gun `pitch.min`/`pitch.max` values, ignoring `initial_turret_rotation.pitch` (the tank's baked-in turret mount tilt). Every other place that reports gun depression/elevation already accounts for this offset; the visualizer was the outlier. On tanks with a level turret mount the offset is zero, so it was invisible almost everywhere. Minotauro's turret sits pitched 3° forward, which made the visualizer's min/max/pitch stats and wedge shape disagree with the Firepower stats directly above it (e.g. 7°/-18° instead of 10°/15°). **Changes:** - `GunFlexibilityVisualizer/index.tsx`: fold the turret's initial pitch offset into `minPitch`, `maxPitch` and the displayed `pitch` stat, and into the drawn limit shape, the pitch dot and the pointer mapping, so the dashed neutrality circle sits at the displayed 0°. - `GunFlexibilityVisualizer/components/CanvasContent.tsx`: nest the gun mesh inside a turret group carrying the same static tilt as its base rotation, so the mini 3D preview's live drag-pitch composes on top of it, mirroring `useTankTransform.ts`. --- .../components/CanvasContent.tsx | 27 +++++++++++-- .../GunFlexibilityVisualizer/index.tsx | 40 +++++++++++++------ 2 files changed, 51 insertions(+), 16 deletions(-) diff --git a/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Characteristics/components/GunFlexibilityVisualizer/components/CanvasContent.tsx b/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Characteristics/components/GunFlexibilityVisualizer/components/CanvasContent.tsx index 2f1d7342c..1fdc38bb1 100644 --- a/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Characteristics/components/GunFlexibilityVisualizer/components/CanvasContent.tsx +++ b/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Characteristics/components/GunFlexibilityVisualizer/components/CanvasContent.tsx @@ -1,6 +1,7 @@ import type { QuicklimeEvent } from "quicklime"; import { useEffect, useRef } from "react"; import type { Group } from "three"; +import { degToRad } from "three/src/math/MathUtils.js"; import { api } from "../../../../../../../../core/blitzkit/api"; import { modelTransformEvent, @@ -21,6 +22,13 @@ export function CanvasContent() { const tankModel = modelDefinitions.models[tank.id]; const turretModel = tankModel.turrets[turret.id]; + // baked-in turret mount tilt (e.g. Minotauro sits pitched 3deg forward); + // applied as a static base rotation so the live gun pitch composes on top + // of it, mirroring useTankTransform.ts's turretContainer/gunContainer nesting + const initialTurretPitch = -degToRad( + tankModel.initial_turret_rotation?.pitch ?? 0, + ); + useEffect(() => { function handleModelTransformEvent( event: QuicklimeEvent, @@ -45,10 +53,23 @@ export function CanvasContent() { - + + + - - + + + + ); diff --git a/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Characteristics/components/GunFlexibilityVisualizer/index.tsx b/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Characteristics/components/GunFlexibilityVisualizer/index.tsx index 171c1a73d..93d7a5e1a 100644 --- a/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Characteristics/components/GunFlexibilityVisualizer/index.tsx +++ b/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Characteristics/components/GunFlexibilityVisualizer/index.tsx @@ -48,13 +48,27 @@ export function GunFlexibilityVisualizer({ const turretModel = tankModel.turrets[turret.id]; const gunModel = turretModel.guns[gun.id]; + // turret's own baked-in mount tilt (e.g. Minotauro's turret sits pitched + // 3deg forward on the hull); must be folded into displayed pitch values + // the same way tankCharacteristics.ts and QuickInputs do + const initialTurretPitch = degToRad( + tankModel.initial_turret_rotation?.pitch ?? 0, + ); + + // radial map is in the tilt-compensated frame so the neutrality circle sits + // at the displayed 0deg + const tiltDeg = radToDeg(initialTurretPitch); + const magTilted = (deg: number) => mag(deg + tiltDeg); + const [yaw, setYaw] = useState(0); const [pitch, setPitch] = useState(0); const [minPitch, setMinPitch] = useState( - -degToRad(gunModel.pitch!.front?.max ?? gunModel.pitch!.max), + -degToRad(gunModel.pitch!.front?.max ?? gunModel.pitch!.max) - + initialTurretPitch, ); const [maxPitch, setMaxPitch] = useState( - -degToRad(gunModel.pitch!.front?.min ?? gunModel.pitch!.min), + -degToRad(gunModel.pitch!.front?.min ?? gunModel.pitch!.min) - + initialTurretPitch, ); const container = useRef(null); @@ -70,7 +84,7 @@ export function GunFlexibilityVisualizer({ let d = ""; // right - const mo = mag(p.max); + const mo = magTilted(p.max); if (y) { d += `M 0 0`; d += `L ${c(90 - y.max, mo)}`; @@ -87,7 +101,7 @@ export function GunFlexibilityVisualizer({ // front if (f) { - const m = mag(f.max); + const m = magTilted(f.max); d += `L ${c(90 - f.range / 2, m)}`; d += `A ${m} ${m} 0 0 0 ${c(90 + f.range / 2, m)}`; } @@ -108,7 +122,7 @@ export function GunFlexibilityVisualizer({ // back if (!y && b) { - const m = mag(b.max); + const m = magTilted(b.max); d += `L ${c(-90 - b.range / 2, m)}`; d += `A ${m} ${m} 0 0 0 ${c(-90 + b.range / 2, m)}`; } @@ -116,7 +130,7 @@ export function GunFlexibilityVisualizer({ d += `Z`; // right - const mi = mag(p.min); + const mi = magTilted(p.min); if (y) { d += `M 0 0`; d += `L ${c(90 - y.max, mi)}`; @@ -133,7 +147,7 @@ export function GunFlexibilityVisualizer({ // front if (f) { - const m = mag(f.min); + const m = magTilted(f.min); d += `L ${c(90 - f.range / 2, m)}`; d += `A ${m} ${m} 0 0 0 ${c(90 + f.range / 2, m)}`; } @@ -154,14 +168,14 @@ export function GunFlexibilityVisualizer({ // back if (!y && b) { - const m = mag(b.min); + const m = magTilted(b.min); d += `L ${c(-90 - b.range / 2, m)}`; d += `A ${m} ${m} 0 0 0 ${c(-90 + b.range / 2, m)}`; } d += `Z`; - const r = mag(radToDeg(-pitch)); + const r = mag(radToDeg(-(pitch - initialTurretPitch))); const dotX = r * Math.sin(yaw); const dotY = r * Math.cos(yaw); @@ -251,13 +265,13 @@ export function GunFlexibilityVisualizer({ yaw = min[1]; let t = 2 * Math.sqrt((u / rect.width) ** 2 + (v / rect.height) ** 2); t = clamp(t, 0, 1); - let pitch = degToRad(magInverse(-t)); + let pitch = degToRad(magInverse(-t)) + initialTurretPitch; pitch = clamp(pitch, min[0], max[0]); setPitch(pitch); setYaw(yaw); - setMinPitch(min[0]); - setMaxPitch(max[0]); + setMinPitch(min[0] - initialTurretPitch); + setMaxPitch(max[0] - initialTurretPitch); modelTransformEvent.dispatch({ pitch, yaw }); }} @@ -376,7 +390,7 @@ export function GunFlexibilityVisualizer({ From 90006dfd2a182ad7e8368178b2932352624fea83 Mon Sep 17 00:00:00 2001 From: Mark Greene Date: Sun, 4 Oct 2026 14:14:57 +1300 Subject: [PATCH 05/43] Fix: loading bar too close to tank title The hero loading bar was offset below the title by half the font size plus a fixed 16px. The title is centered as a line box, so its descenders and heavy caps reach lower than half the font size, and the fixed gap didn't grow with the title. Offset the bar by 0.75 of the font size instead, so the gap scales with the title. --- .../components/TankSandbox/Title/components/Tracker.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/Title/components/Tracker.tsx b/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/Title/components/Tracker.tsx index 2b6d7071d..1f1e340fa 100644 --- a/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/Title/components/Tracker.tsx +++ b/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/Title/components/Tracker.tsx @@ -15,7 +15,7 @@ export function Tracker({ fontSize }: Props) { top="50%" width="min(100%, 16rem)" style={{ - transform: `translate(-50%, calc(${fontSize} / 2 + var(--space-4)))`, + transform: `translate(-50%, calc(${fontSize} * 0.75 + var(--space-4)))`, }} > From 6153beced6fa8d0754b9d48c3e65cfc418f7319a Mon Sep 17 00:00:00 2001 From: Mark Greene Date: Sun, 4 Oct 2026 14:24:02 +1300 Subject: [PATCH 06/43] Fix: search redirecting early and missing full tank names **Enter key** - Enter redirected to the previous results' first tank while a search was still buffering, because the key handler captured a stale `searching` value. - Enter on an empty field redirected to the first tank of the unfiltered list (Sheridan). - The handler now reads live filter state and only acts when there is a settled search, matching the quick-link button. **Full names in search** - Search only knew short tank names, so queries like "super pershing" found nothing when the game stores a short form. - Add an optional `name_full` to `TankDefinition`, filled from the game's full name when a short name exists, and index it (plus an accent-stripped copy) in `fetchTankNames` / `SEARCH_KEYS`. - Displayed names are unchanged. Full names become searchable once the definitions are regenerated on the next build. --- .../blitzkit/api/server/1_tankDefinitions.ts | 3 +++ packages/core/src/blitzkit/tankNames.ts | 13 ++++++++++++ .../core/src/protos/tank_definitions.proto | 1 + packages/core/src/protos/tank_definitions.ts | 20 +++++++++++++++++++ .../TankSearch/components/SearchBar.tsx | 3 ++- 5 files changed, 39 insertions(+), 1 deletion(-) diff --git a/packages/core/src/blitzkit/api/server/1_tankDefinitions.ts b/packages/core/src/blitzkit/api/server/1_tankDefinitions.ts index ee3f69a58..b7ff54c8d 100644 --- a/packages/core/src/blitzkit/api/server/1_tankDefinitions.ts +++ b/packages/core/src/blitzkit/api/server/1_tankDefinitions.ts @@ -371,6 +371,9 @@ export abstract class ServerBlitzKitAPI1 extends ServerBlitzKitAPI0 { (tank.shortUserString ? this.getString(tank.shortUserString) : undefined) ?? this.getString(tank.userString), + name_full: tank.shortUserString + ? this.getString(tank.userString) + : undefined, slug, nation, type: tankTags.includes("collectible") diff --git a/packages/core/src/blitzkit/tankNames.ts b/packages/core/src/blitzkit/tankNames.ts index bb19c9597..15462add5 100644 --- a/packages/core/src/blitzkit/tankNames.ts +++ b/packages/core/src/blitzkit/tankNames.ts @@ -18,11 +18,22 @@ export async function fetchTankNames(api: BlitzKitAPI) { searchableNameDeburr.locales[key] = deburr(value); }); + const searchableNameFull: I18nString = { + locales: { ...tank.name_full?.locales }, + }; + const searchableNameFullDeburr: I18nString = { locales: {} }; + + Object.entries(searchableNameFull.locales).forEach(([key, value]) => { + searchableNameFullDeburr.locales[key] = deburr(value); + }); + return { id: tank.id, name: tank.name, searchableName: tank.name, searchableNameDeburr, + searchableNameFull, + searchableNameFullDeburr, camouflages: tank.camouflages ?.map((id) => locales.supported.map( @@ -45,6 +56,8 @@ export const SEARCH_KEYS = [ .map(({ locale }) => [ `searchableName.locales.${locale}`, `searchableNameDeburr.locales.${locale}`, + `searchableNameFull.locales.${locale}`, + `searchableNameFullDeburr.locales.${locale}`, ]) .flat(), "camouflages", diff --git a/packages/core/src/protos/tank_definitions.proto b/packages/core/src/protos/tank_definitions.proto index 0c15d59f1..6c9cb1078 100644 --- a/packages/core/src/protos/tank_definitions.proto +++ b/packages/core/src/protos/tank_definitions.proto @@ -41,6 +41,7 @@ message TankDefinition { required uint32 weight = 31; required string dev_name = 32; optional Equalizer equalizer = 33; + optional I18nString name_full = 34; } message Equalizer { diff --git a/packages/core/src/protos/tank_definitions.ts b/packages/core/src/protos/tank_definitions.ts index 302424353..be6e2a1f0 100644 --- a/packages/core/src/protos/tank_definitions.ts +++ b/packages/core/src/protos/tank_definitions.ts @@ -292,6 +292,7 @@ export interface TankDefinition { weight: number; dev_name: string; equalizer?: Equalizer | undefined; + name_full?: I18nString | undefined; } export interface TankDefinition_RolesEntry { @@ -651,6 +652,7 @@ function createBaseTankDefinition(): TankDefinition { weight: 0, dev_name: "", equalizer: undefined, + name_full: undefined, }; } @@ -752,6 +754,9 @@ export const TankDefinition: MessageFns = { if (message.equalizer !== undefined) { Equalizer.encode(message.equalizer, writer.uint32(266).fork()).join(); } + if (message.name_full !== undefined) { + I18nString.encode(message.name_full, writer.uint32(274).fork()).join(); + } return writer; }, @@ -1051,6 +1056,14 @@ export const TankDefinition: MessageFns = { message.equalizer = Equalizer.decode(reader, reader.uint32()); continue; } + case 34: { + if (tag !== 274) { + break; + } + + message.name_full = I18nString.decode(reader, reader.uint32()); + continue; + } } if ((tag & 7) === 4 || tag === 0) { break; @@ -1111,6 +1124,7 @@ export const TankDefinition: MessageFns = { weight: isSet(object.weight) ? globalThis.Number(object.weight) : 0, dev_name: isSet(object.dev_name) ? globalThis.String(object.dev_name) : "", equalizer: isSet(object.equalizer) ? Equalizer.fromJSON(object.equalizer) : undefined, + name_full: isSet(object.name_full) ? I18nString.fromJSON(object.name_full) : undefined, }; }, @@ -1218,6 +1232,9 @@ export const TankDefinition: MessageFns = { if (message.equalizer !== undefined) { obj.equalizer = Equalizer.toJSON(message.equalizer); } + if (message.name_full !== undefined) { + obj.name_full = I18nString.toJSON(message.name_full); + } return obj; }, @@ -1271,6 +1288,9 @@ export const TankDefinition: MessageFns = { message.equalizer = (object.equalizer !== undefined && object.equalizer !== null) ? Equalizer.fromPartial(object.equalizer) : undefined; + message.name_full = (object.name_full !== undefined && object.name_full !== null) + ? I18nString.fromPartial(object.name_full) + : undefined; return message; }, }; diff --git a/packages/website/src/components/TankSearch/components/SearchBar.tsx b/packages/website/src/components/TankSearch/components/SearchBar.tsx index 32eba599f..1a97aa3d2 100644 --- a/packages/website/src/components/TankSearch/components/SearchBar.tsx +++ b/packages/website/src/components/TankSearch/components/SearchBar.tsx @@ -46,7 +46,8 @@ export function SearchBar({ topResult, skeleton, onSelect }: SearchBarProps) { }, [searching]); const handleKeyDown = useCallback( (event) => { - if (event.key !== "Enter" || !topResult || searching) return; + if (event.key !== "Enter" || !topResult) return; + if (!TankFilters.state.search || TankFilters.state.searching) return; event.preventDefault(); From 2e46ba79cf9a51a8f7363aede16f7229d0f0d4bc Mon Sep 17 00:00:00 2001 From: Mark Greene Date: Sun, 4 Oct 2026 14:33:24 +1300 Subject: [PATCH 07/43] Fix: reload times show one decimal from a shared constant The reload visualizer and the Firepower reload rows showed two decimals. Add an exported `RELOAD_PRECISION` (1) in the reload visualizer and use it for the visualizer's times and placeholders and for the Firepower reload rows (per-shell reloads, reload and intra-clip). --- .../Characteristics/components/Firepower.tsx | 8 ++++---- .../components/ReloadVisualizer/index.tsx | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Characteristics/components/Firepower.tsx b/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Characteristics/components/Firepower.tsx index c1efdc8b4..6311aa782 100644 --- a/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Characteristics/components/Firepower.tsx +++ b/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Characteristics/components/Firepower.tsx @@ -17,7 +17,7 @@ import { AssaultRangesVisualizer } from "./AssaultRangesVisualizer"; import { GunFlexibilityVisualizer } from "./GunFlexibilityVisualizer"; import { Info } from "./Info"; import { InfoWithDelta } from "./InfoWithDelta"; -import { ReloadVisualizer } from "./ReloadVisualizer"; +import { RELOAD_PRECISION, ReloadVisualizer } from "./ReloadVisualizer"; import { RicochetVisualizer } from "./RicochetVisualizer"; import { StatsTableWrapper } from "./StatsTableWrapper"; import type { StatsAcceptorProps } from "./TraverseVisualizer"; @@ -163,7 +163,7 @@ export function Firepower({ .shell_index, { index: index + 1 }, )} - decimals={2} + decimals={RELOAD_PRECISION} deltaType="lowerIsBetter" noRanking value={() => reload} @@ -173,7 +173,7 @@ export function Firepower({ ) : ( @@ -183,7 +183,7 @@ export function Firepower({ diff --git a/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Characteristics/components/ReloadVisualizer/index.tsx b/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Characteristics/components/ReloadVisualizer/index.tsx index 1ce46ab09..f2f7c8f46 100644 --- a/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Characteristics/components/ReloadVisualizer/index.tsx +++ b/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Characteristics/components/ReloadVisualizer/index.tsx @@ -11,7 +11,7 @@ import { Shell } from './components/Shell'; import { Target } from './components/Target'; import './index.css'; -const PRECISION = 2; +export const RELOAD_PRECISION = 1; export interface ReloadUpdateData { reload: number; @@ -82,9 +82,9 @@ export function ReloadVisualizer({ stats }: StatsAcceptorProps) { ); } - totalTime.current.innerHTML = shellReload.toFixed(PRECISION); + totalTime.current.innerHTML = shellReload.toFixed(RELOAD_PRECISION); progressTime.current.innerHTML = ((1 - reload) * shellReload).toFixed( - PRECISION, + RELOAD_PRECISION, ); if (state.current >= reloadThreshold) shoot(); @@ -117,9 +117,9 @@ export function ReloadVisualizer({ stats }: StatsAcceptorProps) { shells = times(stats.shells, (index) => index > state.current - 1); } - totalTime.current.innerHTML = interval.toFixed(PRECISION); + totalTime.current.innerHTML = interval.toFixed(RELOAD_PRECISION); progressTime.current.innerHTML = ((1 - reload) * interval).toFixed( - PRECISION, + RELOAD_PRECISION, ); if (lastState % 1 > state.current % 1) shoot(); @@ -262,7 +262,7 @@ export function ReloadVisualizer({ stats }: StatsAcceptorProps) { transform: 'translate(50%, -50%)', }} > - 0.00 + {(0).toFixed(RELOAD_PRECISION)} - 0.00 + {(0).toFixed(RELOAD_PRECISION)} {stats.shells > 1 && From 6fb14d5544fffc5cdff670491937f20e59719c0c Mon Sep 17 00:00:00 2001 From: Mark Greene Date: Sun, 4 Oct 2026 14:36:18 +1300 Subject: [PATCH 08/43] Fix: footer game version and CDN label The footer showed the game's full version with its build number and labelled the environment as "CDN". Show only the part of the game version before the underscore (e.g. 11.20), and rename the "CDN" label to "Branch" since it shows the environment/branch the site was built from. --- packages/website/src/components/Footer.astro | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/website/src/components/Footer.astro b/packages/website/src/components/Footer.astro index 3bcd19c6c..ff2f490d3 100644 --- a/packages/website/src/components/Footer.astro +++ b/packages/website/src/components/Footer.astro @@ -12,6 +12,7 @@ export interface Props { } const gameDefinitions = await api.gameDefinitions(); +const gameVersion = gameDefinitions.version.split("_")[0]; const environment = assertSecret(import.meta.env.PUBLIC_ENVIRONMENT); const { locale } = Astro.props; const strings = getStrings(locale); @@ -141,7 +142,7 @@ const strings = getStrings(locale); ) } - CDN + Branch @@ -151,7 +152,7 @@ const strings = getStrings(locale); { environment !== "preview" && ( - {gameDefinitions.version} + {gameVersion} ) } @@ -174,13 +175,13 @@ const strings = getStrings(locale); WoTB - {gameDefinitions.version} + {gameVersion} ) } - CDN + Branch {environment} From cef393473f8ed5de75ff3a94a109960dc7cea4be Mon Sep 17 00:00:00 2001 From: Mark Greene Date: Sun, 4 Oct 2026 14:39:30 +1300 Subject: [PATCH 09/43] Fix: testing and unlocked filters off by default and exclusive Both buttons in the testing and unlocked filter pairs started on, so showing only one kind meant turning the other kind off. Start all four filters off, treat a pair with neither button on as showing everything, and make the buttons in each pair mutually exclusive: turning one on turns its partner off, and clicking an active one turns it off. The playlist page now sets the unlocked filter on (and locked off) explicitly, since the old default no longer provides that. --- .../components/TankSearch/components/FilterControl.tsx | 4 ++++ packages/website/src/core/blitzkit/filterTank.ts | 6 ++++-- .../[...chunk_default]/[...locale]/playlist/_index.tsx | 5 ++++- packages/website/src/stores/tankFilters.ts | 8 ++++---- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/packages/website/src/components/TankSearch/components/FilterControl.tsx b/packages/website/src/components/TankSearch/components/FilterControl.tsx index ac7bde3b8..41400d365 100644 --- a/packages/website/src/components/TankSearch/components/FilterControl.tsx +++ b/packages/website/src/components/TankSearch/components/FilterControl.tsx @@ -789,6 +789,7 @@ function OwnershipFilterInternal(props: FlexProps) { onClick={() => { TankFilters.mutate((draft) => { draft.showOwned = !draft.showOwned; + if (draft.showOwned) draft.showUnowned = false; }); }} > @@ -808,6 +809,7 @@ function OwnershipFilterInternal(props: FlexProps) { onClick={() => { TankFilters.mutate((draft) => { draft.showUnowned = !draft.showUnowned; + if (draft.showUnowned) draft.showOwned = false; }); }} > @@ -834,6 +836,7 @@ function TestFilter() { onClick={() => { TankFilters.mutate((draft) => { draft.showNonTesting = !draft.showNonTesting; + if (draft.showNonTesting) draft.showTesting = false; }); }} > @@ -854,6 +857,7 @@ function TestFilter() { onClick={() => { TankFilters.mutate((draft) => { draft.showTesting = !draft.showTesting; + if (draft.showTesting) draft.showNonTesting = false; }); }} > diff --git a/packages/website/src/core/blitzkit/filterTank.ts b/packages/website/src/core/blitzkit/filterTank.ts index 91c808b56..48fc41a34 100644 --- a/packages/website/src/core/blitzkit/filterTank.ts +++ b/packages/website/src/core/blitzkit/filterTank.ts @@ -16,13 +16,15 @@ export async function filterTank( owned: number[] = [], ) { return ( - ((filters.showOwned && owned.includes(tank.id)) || + ((!filters.showOwned && !filters.showUnowned) || + (filters.showOwned && owned.includes(tank.id)) || (filters.showUnowned && !owned.includes(tank.id))) && (filters.tiers.length === 0 || filters.tiers.includes(tank.tier)) && (filters.nations.length === 0 || filters.nations.includes(tank.nation)) && (filters.classes.length === 0 || filters.classes.includes(tank.class)) && (filters.types.length === 0 || filters.types.includes(tank.type)) && - ((filters.showTesting && tank.testing) || + ((!filters.showTesting && !filters.showNonTesting) || + (filters.showTesting && tank.testing) || (filters.showNonTesting && !tank.testing)) && (filters.gunType.length === 0 || (filters.gunType.includes("regular") && diff --git a/packages/website/src/pages/[...chunk_default]/[...locale]/playlist/_index.tsx b/packages/website/src/pages/[...chunk_default]/[...locale]/playlist/_index.tsx index 04e090b26..9d6d906db 100644 --- a/packages/website/src/pages/[...chunk_default]/[...locale]/playlist/_index.tsx +++ b/packages/website/src/pages/[...chunk_default]/[...locale]/playlist/_index.tsx @@ -17,7 +17,10 @@ export function Page({ }: Props & MaybeSkeletonComponentProps) { const generated = Playlist.use((state) => state.list !== undefined); - if (App.state.logins.wargaming) TankFilters.state.showUnowned = false; + if (App.state.logins.wargaming) { + TankFilters.state.showOwned = true; + TankFilters.state.showUnowned = false; + } return ( diff --git a/packages/website/src/stores/tankFilters.ts b/packages/website/src/stores/tankFilters.ts index 7d1c1dcdb..438d327ae 100644 --- a/packages/website/src/stores/tankFilters.ts +++ b/packages/website/src/stores/tankFilters.ts @@ -46,8 +46,8 @@ export const TankFilters = new Varuna({ abilities: [], powers: [], - showTesting: true, - showNonTesting: true, - showOwned: true, - showUnowned: true, + showTesting: false, + showNonTesting: false, + showOwned: false, + showUnowned: false, }); From b4770c1497b394c56079ba1d9121adad7d7b86f9 Mon Sep 17 00:00:00 2001 From: Mark Greene Date: Sun, 4 Oct 2026 14:44:39 +1300 Subject: [PATCH 10/43] Fix: uneven margin around the help translate link The "Help translate BlitzKit" link on the home page had only a bottom margin, so it sat flush against the hero above while the tool grid below added extra space. Add a top margin so the space above matches the space below, leaving the bottom margin unchanged. --- .../src/pages/[...chunk_default]/[...locale]/index.astro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/website/src/pages/[...chunk_default]/[...locale]/index.astro b/packages/website/src/pages/[...chunk_default]/[...locale]/index.astro index 1f43e7990..e00f7bc5a 100644 --- a/packages/website/src/pages/[...chunk_default]/[...locale]/index.astro +++ b/packages/website/src/pages/[...chunk_default]/[...locale]/index.astro @@ -67,7 +67,7 @@ export const getStaticPaths = mixStaticPaths(_getStaticPaths, () => { { locale !== locales.default && ( - + Date: Sun, 4 Oct 2026 19:47:20 +1300 Subject: [PATCH 11/43] Fix: restore redirect to the user's preferred locale Users were no longer sent to their preferred locale. `LocaleRedirector` was emptied in `115fa5aca` after its previous versions caused repeated redirects, and nothing replaced it. **Cause** - The earlier logic compared the best locale (a string) against the current locale entry (an object), so the check was always true on non-default locale pages - That made the redirect fire repeatedly, which led to the logic being removed entirely **Changes** - Derive the current locale from the URL, treating the default locale as unprefixed to match how pages are generated - Redirect only when the best locale differs from the current locale, so it stops after one hop - Redirect users with a saved `preferred-locale` from any page - Redirect users without a saved preference from default-locale URLs only, using their browser language, so shared locale links are respected - Preserve the rest of the path when swapping the locale prefix - Skip `/api` paths --- .../src/components/LocaleRedirector.astro | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/packages/website/src/components/LocaleRedirector.astro b/packages/website/src/components/LocaleRedirector.astro index e4ed25333..80c0afeaa 100644 --- a/packages/website/src/components/LocaleRedirector.astro +++ b/packages/website/src/components/LocaleRedirector.astro @@ -1,3 +1,30 @@ From c2c586c2e7e46f47e2481fb8d313d642c0027343 Mon Sep 17 00:00:00 2001 From: Mark Greene Date: Sun, 4 Oct 2026 20:00:51 +1300 Subject: [PATCH 12/43] Fix: scroll track textures at the same rate Dragging a tank's track scrolled its roughness/metalness texture at twice the speed of the base color and normal textures, so highlights drifted off the track links. **Cause** - `translateTexture` added the scroll offset to `roughnessMap` and `metalnessMap` separately - glTF has a single metallic-roughness texture, and the loader assigns that same texture object to both slots, so it received the offset twice **Changes** - Collect the track's maps in a `Set` before scrolling so a texture shared between slots is offset exactly once --- .../TankSandbox/components/TankModel.tsx | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/components/TankModel.tsx b/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/components/TankModel.tsx index ded24bba1..c74722bff 100644 --- a/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/components/TankModel.tsx +++ b/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/components/TankModel.tsx @@ -51,11 +51,17 @@ export function TankModel() { invalidate(); - if (material.map) material.map.offset.y += offset; - if (material.aoMap) material.aoMap.offset.y += offset; - if (material.normalMap) material.normalMap.offset.y += offset; - if (material.roughnessMap) material.roughnessMap.offset.y += offset; - if (material.metalnessMap) material.metalnessMap.offset.y += offset; + const textures = new Set([ + material.map, + material.aoMap, + material.normalMap, + material.roughnessMap, + material.metalnessMap, + ]); + + for (const texture of textures) { + if (texture) texture.offset.y += offset; + } } function onPointerDown(event: ThreeEvent) { From 86e7ace3f0be232646598b18ff5344f975c58946 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tr=C3=A8sAbhi?= <43380238+tresabhi@users.noreply.github.com> Date: Sun, 4 Oct 2026 12:22:36 -0500 Subject: [PATCH 13/43] Remove misleading text Removed contribution note regarding sensitive submodules. --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index cc7f8f283..620b2af73 100644 --- a/README.md +++ b/README.md @@ -3,5 +3,3 @@ Tools for everything and anything, World of Tanks Blitz. This GitHub repository contains the code for BlitzKit and all its services. If you are here, looking to use BlitzKit, go to https://blitzkit.app/. - -If you intend to contribute to the code, note that you may need to check out sensitive, closed-source submodules to locally develop certain aspects of BlitzKit. Communicate with `@tresabhi` on Discord to get started or discuss sensitive content, such as environment variables or submodules. From d9f29cd0c9c90e03c740c733eff8002dd34ad145 Mon Sep 17 00:00:00 2001 From: tresabhi <43380238+tresabhi@users.noreply.github.com> Date: Sun, 4 Oct 2026 13:11:36 -0500 Subject: [PATCH 14/43] start of docs --- README.md | 28 ++++++++++++++++++++++++++-- packages/scripts/src/protos.ts | 2 ++ 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 620b2af73..658c47e5e 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,29 @@ # BlitzKit -Tools for everything and anything, World of Tanks Blitz. +Your Blitz experience, elevated. https://blitzkit.app/. -This GitHub repository contains the code for BlitzKit and all its services. If you are here, looking to use BlitzKit, go to https://blitzkit.app/. +## Developing + +### Prerequisites + +#### Bun + +[Bun](https://bun.sh/) is the package manager and runtime that BlitzKit uses. + +Ideally, you should also uninstall Node.js if you have it installed to avoid any cases where Node.js is used to run code instead of Bun which happens in some cases. But, this is not required and is unlikely to cause issues. + +#### Linux (Optional) + +All work on BlitzKit is done on Linux and macOS. It is theoretically possible to work on Windows; please feel free to try and share your discoveries with us! + +### Setting Up + +Start by cloning the repository and changing directories. + +```bash +git clone https://github.com/blitzkit/blitzkit.git +cd blitzkit +``` + +> [!INFO] +> There is a closed source submodule under `packages/closed` that you can safely ignore. This sole purpose of this submodule is to provide `dvp.ts`, a proprietary Wargaming game asset tree compression tool. You will not need this at any point. diff --git a/packages/scripts/src/protos.ts b/packages/scripts/src/protos.ts index 28789d95a..6972d3bd2 100644 --- a/packages/scripts/src/protos.ts +++ b/packages/scripts/src/protos.ts @@ -6,7 +6,9 @@ import { promisify } from "util"; const MAX_COMMAND_LENGTH = 2 ** 11; const TS_PROTO_EXECUTABLE_LOCATIONS = [ "./node_modules/.bin/protoc-gen-ts_proto", + "./node_modules/.bin/protoc-gen-ts_proto.exe", "../../node_modules/.bin/protoc-gen-ts_proto", + "../../node_modules/.bin/protoc-gen-ts_proto.exe", ]; const roots = [ From 8b03784be5d2b8a497ebb120b3d4287d623122ed Mon Sep 17 00:00:00 2001 From: tresabhi <43380238+tresabhi@users.noreply.github.com> Date: Sun, 4 Oct 2026 13:21:21 -0500 Subject: [PATCH 15/43] clis --- README.md | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 658c47e5e..4dc57a641 100644 --- a/README.md +++ b/README.md @@ -2,21 +2,33 @@ Your Blitz experience, elevated. https://blitzkit.app/. -## Developing +## Developing: Prerequisites -### Prerequisites +There's a few things you'll need to get started. If this is your first time working with BlitzKit, it's completely safe to ignore all optional prerequisites below to get things running as quickly as possible. -#### Bun +### Bun [Bun](https://bun.sh/) is the package manager and runtime that BlitzKit uses. Ideally, you should also uninstall Node.js if you have it installed to avoid any cases where Node.js is used to run code instead of Bun which happens in some cases. But, this is not required and is unlikely to cause issues. -#### Linux (Optional) +### Protocol Buffer + +BlitzKit uses [Protocol Buffer's protoc CLI](https://protobuf.dev/installation/) to generate efficiently packed data structures to serve data to clients in place of JSON. + +### aria2 (Optional) + +If you plan to use BlitzKit's client-management CLI for BlitzKit Previews, you will need to [get aria2](https://aria2.github.io/) to speed up your downloads. + +### libarchive (Optional) + +If you plan to use BlitzKit's client-management CLI for BlitzKit OpenTests, you will need to [get libarchive](https://www.libarchive.org/) to keep your downloads completely in-memory. + +### Linux (Optional) All work on BlitzKit is done on Linux and macOS. It is theoretically possible to work on Windows; please feel free to try and share your discoveries with us! -### Setting Up +## Developing: Setting Up Start by cloning the repository and changing directories. @@ -27,3 +39,5 @@ cd blitzkit > [!INFO] > There is a closed source submodule under `packages/closed` that you can safely ignore. This sole purpose of this submodule is to provide `dvp.ts`, a proprietary Wargaming game asset tree compression tool. You will not need this at any point. + +## Developing: Running From 784c3e58c162ef9f4f9797df9028a17f4b0bbb82 Mon Sep 17 00:00:00 2001 From: tresabhi <43380238+tresabhi@users.noreply.github.com> Date: Sun, 4 Oct 2026 13:27:46 -0500 Subject: [PATCH 16/43] protos --- README.md | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4dc57a641..0f9e9b155 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,10 @@ Ideally, you should also uninstall Node.js if you have it installed to avoid any BlitzKit uses [Protocol Buffer's protoc CLI](https://protobuf.dev/installation/) to generate efficiently packed data structures to serve data to clients in place of JSON. +### World of Tanks Blitz + +You will need a local installation of [World of Tanks Blitz](https://wotblitz.com/) for BlitzKit to build off. + ### aria2 (Optional) If you plan to use BlitzKit's client-management CLI for BlitzKit Previews, you will need to [get aria2](https://aria2.github.io/) to speed up your downloads. @@ -37,7 +41,23 @@ git clone https://github.com/blitzkit/blitzkit.git cd blitzkit ``` -> [!INFO] +> [!NOTE] > There is a closed source submodule under `packages/closed` that you can safely ignore. This sole purpose of this submodule is to provide `dvp.ts`, a proprietary Wargaming game asset tree compression tool. You will not need this at any point. +Then, download the dependencies with Bun. + +```bash +bun install +``` + +Finally, compile the proto files into TypeScript. + +```bash +build build-protos +``` + ## Developing: Running + +```bash +bun dev +``` From 6be4ff97f3b0707c22356b04126f84acd2f30dd2 Mon Sep 17 00:00:00 2001 From: tresabhi <43380238+tresabhi@users.noreply.github.com> Date: Sun, 4 Oct 2026 13:36:33 -0500 Subject: [PATCH 17/43] env --- README.md | 4 ++++ packages/website/template.env | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 packages/website/template.env diff --git a/README.md b/README.md index 0f9e9b155..e2a50f4ef 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,10 @@ Finally, compile the proto files into TypeScript. build build-protos ``` +## Developing: Environment + +Go through the different packages in the `packages` directory and clone their respective `template.env`'s to `.env` files. Follow the instructions in the `.env` files to fill them out as much as you can. + ## Developing: Running ```bash diff --git a/packages/website/template.env b/packages/website/template.env new file mode 100644 index 000000000..e2f4d103f --- /dev/null +++ b/packages/website/template.env @@ -0,0 +1,35 @@ +# Point this to your local installation of the game (make sure you see the Data +# folder within the directory you're putting here); don't forget to use +# double quotation marks if your path has spaces +CLIENT_DIR= + +# Should be set to * for local development to build all chunks at once +CHUNK=* + +# Should always be development when using CHUNKS=* +PUBLIC_ENVIRONMENT=development + +# GuidesBlitz is the official textual partner of BlitzKit, but, really any +# website that supports BlitzKit tank slugs like example.com/tank-slug works +# too +PUBLIC_GUIDE_WEBSITE=https://guidesblitz.com + +# The tag manager doesn't do anything in localhost, but here's what BlitzKit +# uses for completeness sake +PUBLIC_GOOGLE_TAG_MANAGER_ID=G-GL2JVHCGPQ + +# A very rare, but required variable, enabling the advertising of BlitzKit +# OpenTest; TODO: make this a string field to allow for cross-advertising for +# any branch of BlitzKit +PUBLIC_PROMOTE_OPENTEST=false + +# Legacy variable; this will be removed soon +PUBLIC_STATIC_ASSET_BASE=https://assets.blitzkit.app + +# Proprietary Wargaming fields; you shouldn't need these for 99% of the tasks +WOTB_GLOSSARY= +WOTB_GLOSSARY_DOMAIN= +WOTB_GLOSSARY_PATH= + +# Generate your own application id: https://developers.wargaming.net +PUBLIC_WARGAMING_APPLICATION_ID= \ No newline at end of file From dd11efd48165e79ffe7ac3cc8a6ed7793aa8f864 Mon Sep 17 00:00:00 2001 From: tresabhi <43380238+tresabhi@users.noreply.github.com> Date: Sun, 4 Oct 2026 13:37:21 -0500 Subject: [PATCH 18/43] running --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index e2a50f4ef..1568ac800 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,14 @@ Go through the different packages in the `packages` directory and clone their re ## Developing: Running +Launching the website is as easy as running the `dev` script. + ```bash bun dev ``` + +If you ever make a change to any proto file, make sure to rebuild them. + +```bash +build build-protos +``` From 9a659845f54030c0ae90a8c53200c17e0bccf1c6 Mon Sep 17 00:00:00 2001 From: tresabhi <43380238+tresabhi@users.noreply.github.com> Date: Sun, 4 Oct 2026 13:51:53 -0500 Subject: [PATCH 19/43] make spall icon not a button --- .../Options/components/SpallLinerSwitcher.tsx | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/packages/website/src/components/Tankopedia/HeroSection/components/Options/components/SpallLinerSwitcher.tsx b/packages/website/src/components/Tankopedia/HeroSection/components/Options/components/SpallLinerSwitcher.tsx index 021f5cacf..77653a3c9 100644 --- a/packages/website/src/components/Tankopedia/HeroSection/components/Options/components/SpallLinerSwitcher.tsx +++ b/packages/website/src/components/Tankopedia/HeroSection/components/Options/components/SpallLinerSwitcher.tsx @@ -63,7 +63,9 @@ export function SpallLinerSwitcher() { }} > {unwrap(provisionDefinitions.provisions[SPALL_LINER_PROVISION_ID].name!)} - - {unwrap( - + {unwrap( From f3a8f2faab21c0423d8c229b3e3ed1b2f165678f Mon Sep 17 00:00:00 2001 From: tresabhi <43380238+tresabhi@users.noreply.github.com> Date: Sun, 4 Oct 2026 14:03:32 -0500 Subject: [PATCH 20/43] only supply full name if it's different --- .../blitzkit/api/server/1_tankDefinitions.ts | 18 +++++++++++------- .../TankSearch/components/SearchBar.tsx | 14 ++++++++++---- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/packages/core/src/blitzkit/api/server/1_tankDefinitions.ts b/packages/core/src/blitzkit/api/server/1_tankDefinitions.ts index b7ff54c8d..e7192e140 100644 --- a/packages/core/src/blitzkit/api/server/1_tankDefinitions.ts +++ b/packages/core/src/blitzkit/api/server/1_tankDefinitions.ts @@ -350,6 +350,15 @@ export abstract class ServerBlitzKitAPI1 extends ServerBlitzKitAPI0 { const tankClass = this.blitzTankClassToBlitzkit[blitzTankClass as BlitzTankClass]; + const canonicalFullName = this.getString(tank.userString); + const name = + (tank.shortUserString + ? this.getString(tank.shortUserString) + : undefined) ?? canonicalFullName; + // only supply full name if it's different from the displayed short name to save some bytes + const name_full = + name === canonicalFullName ? undefined : canonicalFullName; + tankDefinitions.tanks[tankId] = { ancestors: [], successors: [], @@ -367,13 +376,8 @@ export abstract class ServerBlitzKitAPI1 extends ServerBlitzKitAPI0 { typeof equipment === "string" ? equipment : equipment.at(-1)!, max_consumables: tankDefinition.root.consumableSlots, max_provisions: tankDefinition.root.provisionSlots, - name: - (tank.shortUserString - ? this.getString(tank.shortUserString) - : undefined) ?? this.getString(tank.userString), - name_full: tank.shortUserString - ? this.getString(tank.userString) - : undefined, + name, + name_full, slug, nation, type: tankTags.includes("collectible") diff --git a/packages/website/src/components/TankSearch/components/SearchBar.tsx b/packages/website/src/components/TankSearch/components/SearchBar.tsx index 1a97aa3d2..034a2e458 100644 --- a/packages/website/src/components/TankSearch/components/SearchBar.tsx +++ b/packages/website/src/components/TankSearch/components/SearchBar.tsx @@ -33,7 +33,7 @@ export function SearchBar({ topResult, skeleton, onSelect }: SearchBarProps) { draft.search = sanitized.length === 0 ? null : sanitized; }); }, 500), - [] + [], ); const handleChange = useCallback(() => { if (!searching) { @@ -46,8 +46,14 @@ export function SearchBar({ topResult, skeleton, onSelect }: SearchBarProps) { }, [searching]); const handleKeyDown = useCallback( (event) => { - if (event.key !== "Enter" || !topResult) return; - if (!TankFilters.state.search || TankFilters.state.searching) return; + if ( + event.key !== "Enter" || + !topResult || + !TankFilters.state.search || + TankFilters.state.searching + ) { + return; + } event.preventDefault(); @@ -57,7 +63,7 @@ export function SearchBar({ topResult, skeleton, onSelect }: SearchBarProps) { window.location.href = `/tanks/${topResult.slug}`; } }, - [topResult] + [topResult], ); return ( From 60a92fbfdf9b2bcb37fc03f0d4428e69230b84f6 Mon Sep 17 00:00:00 2001 From: tresabhi <43380238+tresabhi@users.noreply.github.com> Date: Sun, 4 Oct 2026 14:13:55 -0500 Subject: [PATCH 21/43] pixel perfect fix --- .../src/pages/[...chunk_default]/[...locale]/index.astro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/website/src/pages/[...chunk_default]/[...locale]/index.astro b/packages/website/src/pages/[...chunk_default]/[...locale]/index.astro index e00f7bc5a..21a5a0d8f 100644 --- a/packages/website/src/pages/[...chunk_default]/[...locale]/index.astro +++ b/packages/website/src/pages/[...chunk_default]/[...locale]/index.astro @@ -67,7 +67,7 @@ export const getStaticPaths = mixStaticPaths(_getStaticPaths, () => { { locale !== locales.default && ( - + Date: Sun, 4 Oct 2026 14:22:04 -0500 Subject: [PATCH 22/43] logs --- docs/changelogs/1.31.4.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/changelogs/1.31.4.md b/docs/changelogs/1.31.4.md index e4035ebb7..ecf232845 100644 --- a/docs/changelogs/1.31.4.md +++ b/docs/changelogs/1.31.4.md @@ -6,6 +6,8 @@ Thank you to [Mark Greene](https://github.com/Hitjack007) for your contributions - [Mark Greene] Added Peekaboo DPM - Your Peekaboo DPM is lower than your normal DPM if your reload is faster than 10s as you'll have to wait for the remaining 10s for you to get unspotted before you can poke and shoot +- [Mark Greene] The test and owned tank filters are now more intuitive as clicking on them now turns the clicked option on instead of off +- [Mark Greene] Added a spall liner button to the Tankopedia beside the other equipment ## Fixes @@ -15,6 +17,20 @@ Thank you to [Mark Greene](https://github.com/Hitjack007) for your contributions - [Mark Greene] The armor no longer disappears when you turn on Dynamic Armor System - [Mark Greene] Camouflage values in Tankopedia are now more descriptive when shooting - [Mark Greene] The contact shadows on the ground no longer grow & darken when switching between tabs +- The "Help Translate BlitzKit" text on the home page is now properly centered vertically +- [Mark Greene] The footer now says "Branch" instead of "CDN" +- [Mark Greene] The game version in the footer now displays a shorthand version instead of the entire version number +- [Mark Greene] The reload visualizer now displays just 1 decimal place +- [Mark Greene] The search bar no longer redirects to a seemingly random tank when clicking enter when searching +- [Mark Greene] Tank search now properly handles the full names of tanks like the Super Pershing +- [Mark Greene] The loading bar below the name of the tanks in Tankopedia is now sufficiently spaced below +- [Mark Greene] The gun depression visualizer now properly handles the inherent tilt of tanks like the Minotauro + +## Technical Features + +- Added documentation to the README on setting up and developing BlitzKit locally +- Added bug report and feature request forms to GitHub +- Switched to the GNU AGPLv3 license ## Technical Fixes From a5eac5572e768c11bc499609cef315ceeec21061 Mon Sep 17 00:00:00 2001 From: Mark Greene Date: Mon, 5 Oct 2026 17:20:52 +1300 Subject: [PATCH 23/43] Fix: remove background sliver under equalizer toggle gradient On some browsers a thin sliver of the Insanity banner showed through along the rounded edges of the equalizer toggle, most visibly on the right where the gradient is opaque. The banner and the gradient were painted on two separately clipped elements, so their anti-aliased edges didn't line up. - Moved the gradient onto the outer box as the top layer of its `backgroundImage`, above the banner - Removed the separate gradient layer from the inner flex Fixes #297 --- .../components/Equalizer.tsx | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Equalizer.tsx b/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Equalizer.tsx index d06240059..f9c29e521 100644 --- a/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Equalizer.tsx +++ b/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Equalizer.tsx @@ -29,22 +29,16 @@ export function Equalizer() { style={{ cursor: "pointer", borderRadius: "var(--radius-3)", - backgroundImage: `url(${alias("api", `/gamemodes/Insanity/banner.webp`)})`, + backgroundImage: ` + linear-gradient(90deg, var(--black-a3), var(--gray-1)), + url(${alias("api", `/gamemodes/Insanity/banner.webp`)}) + `, backgroundSize: "cover", backgroundPosition: "50% 25%", overflow: "hidden", }} > - + Date: Mon, 5 Oct 2026 17:28:01 +1300 Subject: [PATCH 24/43] Fix: keep contact shadows visible at low camera angles Contact shadows under the tank disappeared when the camera orbited low enough to look up at it. The shadow plane and the ground disc are both transparent and centred on the origin, so three.js sorts them by camera depth. Looking upward flips that order, and because the shadow doesn't write depth, the ground disc was drawn over it. - Gave `ContactShadows` a `renderOrder` of 1 so it always renders after the ground disc Fixes #299 --- .../HeroSection/components/TankSandbox/components/Lighting.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/components/Lighting.tsx b/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/components/Lighting.tsx index 26abe418b..d2cfd9804 100644 --- a/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/components/Lighting.tsx +++ b/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/components/Lighting.tsx @@ -82,6 +82,7 @@ export function Lighting({ hasPbr }: Props) { blur={2 ** 1} resolution={2 ** 9} depthWrite={false} + renderOrder={1} /> {animate && ( From 3aefe7d985d690bfe748669633429c66f9657445 Mon Sep 17 00:00:00 2001 From: Mark Greene Date: Mon, 5 Oct 2026 17:33:01 +1300 Subject: [PATCH 25/43] Fix: await the ID discovery loop so it runs to completion The ID discovery script exited about a second after starting. Since the switch to `atMaxRate`, neither the discovery loop nor the request loop was awaited, and `atMaxRate` didn't await its callback, so the script went straight to `save()`, committed and exited while overlapping duplicate requests failed in the background. - Awaited both `atMaxRate` loops and the callback inside `atMaxRate` - Moved the ID range exhaustion check out of the retry loop so retries can't remove extra regions - Treated network and JSON errors as failed API calls so a long run retries instead of crashing without saving Fixes #306 --- packages/scripts/src/discoverIds/index.ts | 23 ++++++++++++----------- packages/scripts/src/discoverIds/time.ts | 6 ++++-- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/packages/scripts/src/discoverIds/index.ts b/packages/scripts/src/discoverIds/index.ts index 1d18a25d7..fb8c307cd 100644 --- a/packages/scripts/src/discoverIds/index.ts +++ b/packages/scripts/src/discoverIds/index.ts @@ -135,7 +135,7 @@ let regionI = 0; console.log("Starting discovery loop..."); -atMaxRate(async ({ _break: break1 }) => { +await atMaxRate(async ({ _break: break1 }) => { if (regions.length === 0) { console.log("All regions exhausted, exiting discovery loop..."); return break1(); @@ -166,18 +166,19 @@ atMaxRate(async ({ _break: break1 }) => { fields }&account_id=${accountIds}`; - atMaxRate(async ({ _break: break2 }) => { - if (idRange.length < MAX_IDS_PER_CALL) { - console.log( - `Removing region ${region.domain} removed due to ID range exhaustion...`, - ); - regions.splice(regionI, 1); - } + if (idRange.length < MAX_IDS_PER_CALL) { + console.log( + `Removing region ${region.domain} removed due to ID range exhaustion...`, + ); + regions.splice(regionI, 1); + } - const response = await fetch(url); - const data = (await response.json()) as QuickInfo; + await atMaxRate(async ({ _break: break2 }) => { + const data = await fetch(url) + .then((response) => response.json() as Promise) + .catch(() => null); - if (data.status !== "ok") { + if (data === null || data.status !== "ok") { console.warn("Failed API call; trying again..."); return; } diff --git a/packages/scripts/src/discoverIds/time.ts b/packages/scripts/src/discoverIds/time.ts index d8750ae24..09c476e18 100644 --- a/packages/scripts/src/discoverIds/time.ts +++ b/packages/scripts/src/discoverIds/time.ts @@ -20,7 +20,9 @@ interface MethodContext { let lastT = 0; const maxDelta = 1000 / API_RATE; const DELTA_BUFFER = 0; -export async function atMaxRate(method: (context: MethodContext) => void) { +export async function atMaxRate( + method: (context: MethodContext) => void | Promise, +) { let isBroken = false; const context: MethodContext = { @@ -39,7 +41,7 @@ export async function atMaxRate(method: (context: MethodContext) => void) { await sleep(maxDelta - delta + DELTA_BUFFER); } - method(context); + await method(context); lastT = t; } } From 273881c460a44c7e344d17e6a6a09fba7b3dd6a9 Mon Sep 17 00:00:00 2001 From: Mark Greene Date: Mon, 5 Oct 2026 18:00:43 +1300 Subject: [PATCH 26/43] Fix: keep tank order stable on select Tanks sharing the same tier, nation, class and type were shown in an arbitrary order that changed after selecting a tank. The meta sort had no tiebreaker, and the filtered list was sorted and reversed in place, so each re-sort started from the previous reversed order and flipped tied tanks around. - Added tank ID as the first sort key in `metaSortTank` so tied tanks always come out in the same order - Sorted a copy of the tank search results, pre-sorted by ID, instead of the cached list - Added an `exclude` option to tank search and used it in Compare so tanks already being compared can't be added again, including through select all or by swapping another slot Fixes #313 --- packages/core/src/blitzkit/metaSortTank.ts | 1 + .../website/src/components/Compare/Controls.tsx | 7 +++++++ .../website/src/components/Compare/TankControl.tsx | 11 ++++++++++- .../website/src/components/TankSearch/index.tsx | 13 ++++++++++--- 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/packages/core/src/blitzkit/metaSortTank.ts b/packages/core/src/blitzkit/metaSortTank.ts index f146915b1..db1137359 100644 --- a/packages/core/src/blitzkit/metaSortTank.ts +++ b/packages/core/src/blitzkit/metaSortTank.ts @@ -12,6 +12,7 @@ export function metaSortTank( gameDefinitions: GameDefinitions, ) { return tanks + .sort((a, b) => a.id - b.id) .sort((a, b) => b.tier - a.tier) .sort( (a, b) => treeTypeOrder.indexOf(b.type) - treeTypeOrder.indexOf(a.type), diff --git a/packages/website/src/components/Compare/Controls.tsx b/packages/website/src/components/Compare/Controls.tsx index 1bb45c6cb..8614c2c31 100644 --- a/packages/website/src/components/Compare/Controls.tsx +++ b/packages/website/src/components/Compare/Controls.tsx @@ -1,5 +1,6 @@ import { PlusIcon, TrashIcon } from "@radix-ui/react-icons"; import { Button, Dialog, Flex, SegmentedControl } from "@radix-ui/themes"; +import { useMemo } from "react"; import { api } from "../../core/blitzkit/api"; import { tankToCompareMember } from "../../core/blitzkit/tankToCompareMember"; import { useLocale } from "../../hooks/useLocale"; @@ -22,6 +23,11 @@ export function Controls({ onAddTankDialogOpenChange, }: ControlsProps) { const deltaMode = ComparePersistent.use((state) => state.deltaMode); + const members = CompareEphemeral.use((state) => state.members); + const memberIds = useMemo( + () => members.map((member) => member.tank.id), + [members], + ); const { strings } = useLocale(); return ( @@ -53,6 +59,7 @@ export function Controls({ > { CompareEphemeral.mutate((draft) => { draft.members.push( diff --git a/packages/website/src/components/Compare/TankControl.tsx b/packages/website/src/components/Compare/TankControl.tsx index 28ab0e129..bf2e6e227 100644 --- a/packages/website/src/components/Compare/TankControl.tsx +++ b/packages/website/src/components/Compare/TankControl.tsx @@ -1,6 +1,6 @@ import { ExternalLinkIcon, LoopIcon, TrashIcon } from "@radix-ui/react-icons"; import { Dialog, Flex, IconButton } from "@radix-ui/themes"; -import { useState } from "react"; +import { useMemo, useState } from "react"; import { api } from "../../core/blitzkit/api"; import { tankToCompareMember } from "../../core/blitzkit/tankToCompareMember"; import { useLocale } from "../../hooks/useLocale"; @@ -18,6 +18,14 @@ const provisionDefinitions = await api.provisionDefinitions(); export function TankControl({ index, slug }: TankControlProps) { const { locale, strings } = useLocale(); const [switchTankDialogOpen, setSwitchTankDialogOpen] = useState(false); + const members = CompareEphemeral.use((state) => state.members); + const otherMemberIds = useMemo( + () => + members + .filter((_, memberIndex) => memberIndex !== index) + .map((member) => member.tank.id), + [members, index], + ); return ( @@ -57,6 +65,7 @@ export function TankControl({ index, slug }: TankControlProps) { > { CompareEphemeral.mutate((draft) => { draft.members[index] = tankToCompareMember( diff --git a/packages/website/src/components/TankSearch/index.tsx b/packages/website/src/components/TankSearch/index.tsx index 35321dc2c..fcc976aed 100644 --- a/packages/website/src/components/TankSearch/index.tsx +++ b/packages/website/src/components/TankSearch/index.tsx @@ -38,6 +38,7 @@ export type TankSearchProps = MaybeSkeletonComponentProps & compact?: boolean; onSelect?: (tank: TankDefinition) => void; onSelectAll?: (tanks: TankDefinition[]) => void; + exclude?: number[]; }; const PREVIEW_COUNT = 20; @@ -52,14 +53,14 @@ const [gameDefinitions, modelDefinitions, tankDefinitions, tankNames] = ]); export const TankSearch = memo( - ({ compact, onSelect, onSelectAll, skeleton, ...props }) => { + ({ compact, onSelect, onSelectAll, exclude, skeleton, ...props }) => { const { strings, locale } = useLocale(); const wargaming = App.use((state) => state.logins.wargaming); const awaitedTanksDefinitionsArray = Object.values(tankDefinitions.tanks); const tankopediaSort = TankSort.use(); const tankFilters = TankFilters.use(); - const filtered = usePromise( + const allFiltered = usePromise( () => { if (tankFilters.search === null) { return filterTanks( @@ -81,9 +82,15 @@ export const TankSearch = memo( [tankFilters] as any, ); const sorted = useMemo(() => { + const filtered = allFiltered.filter( + (tank) => !exclude?.includes(tank.id), + ); + if (tankFilters.search === null) { let sorted: TankDefinition[]; + filtered.sort((a, b) => a.id - b.id); + switch (tankopediaSort.by) { case "meta.none": sorted = metaSortTank(filtered, gameDefinitions); @@ -417,7 +424,7 @@ export const TankSearch = memo( } else { return filtered; } - }, [tankFilters, tankopediaSort]); + }, [tankFilters, tankopediaSort, exclude]); const [loadedCards, setLoadedCards] = useState(DEFAULT_LOADED_CARDS); const tanks = sorted.slice(0, loadedCards); From e4e92d76b4c1fb65da2e03a42a7b93f1a7db5f1a Mon Sep 17 00:00:00 2001 From: Mark Greene Date: Mon, 5 Oct 2026 18:18:19 +1300 Subject: [PATCH 27/43] Feature: tier XI compatibility Prepares BlitzKit for tier XI tanks ahead of their release. Tier X was hardcoded as the maximum in the tank search filters, the guesser and the tech tree, and had no roman numeral beyond X. - Added `XI` to `TIER_ROMAN_NUMERALS` - Added an awaitable tier list derived from the highest tier in the tank definitions, so nothing changes until tier XI tanks exist - Used it for the tank search tier filters and the guesser tier picker and defaults - Made the tech tree check for successors instead of assuming tier X is the last tier Fixes #302 --- .../core/src/blitzkit/tankDefinitions/constants.ts | 1 + packages/website/src/components/Guesser.tsx | 9 +++++---- .../components/TankSearch/components/FilterControl.tsx | 4 ++-- .../components/TankSearch/components/TierFilter.tsx | 7 ++++--- .../Tankopedia/TechTreeSection/components/Node.tsx | 2 +- .../components/Tankopedia/TechTreeSection/index.tsx | 2 +- packages/website/src/core/awaitables/tiers.ts | 10 ++++++++++ packages/website/src/stores/guess.ts | 6 ++++-- 8 files changed, 28 insertions(+), 13 deletions(-) create mode 100644 packages/website/src/core/awaitables/tiers.ts diff --git a/packages/core/src/blitzkit/tankDefinitions/constants.ts b/packages/core/src/blitzkit/tankDefinitions/constants.ts index 5224cdae7..9671b938a 100644 --- a/packages/core/src/blitzkit/tankDefinitions/constants.ts +++ b/packages/core/src/blitzkit/tankDefinitions/constants.ts @@ -54,6 +54,7 @@ export const TIER_ROMAN_NUMERALS: Record = { 8: "VIII", 9: "IX", 10: "X", + 11: "XI", }; export const flags: Record = { diff --git a/packages/website/src/components/Guesser.tsx b/packages/website/src/components/Guesser.tsx index 09c1a3cd0..a468d900b 100644 --- a/packages/website/src/components/Guesser.tsx +++ b/packages/website/src/components/Guesser.tsx @@ -27,9 +27,10 @@ import { TextField, } from "@radix-ui/themes"; import fuzzysort from "fuzzysort"; -import { debounce, times } from "lodash-es"; +import { debounce } from "lodash-es"; import { useCallback, useEffect, useRef, useState } from "react"; import { awaitableTankNames } from "../core/awaitables/tankNames"; +import { awaitableTiers } from "../core/awaitables/tiers"; import { api } from "../core/blitzkit/api"; import { useLocale } from "../hooks/useLocale"; import { Guess, GuessState } from "../stores/guess"; @@ -38,9 +39,10 @@ import { SearchResults } from "./SearchResults"; const { go } = fuzzysort; -const [tankNames, tankDefinitions] = await Promise.all([ +const [tankNames, tankDefinitions, TIERS] = await Promise.all([ awaitableTankNames, api.tankDefinitions(), + awaitableTiers, ]); const ids = Object.keys(tankDefinitions.tanks); @@ -193,8 +195,7 @@ export function Guesser() { - {times(10, (index) => { - const tier = 10 - index; + {TIERS.map((tier) => { const isSelected = tiers.includes(tier); return ( diff --git a/packages/website/src/components/TankSearch/components/FilterControl.tsx b/packages/website/src/components/TankSearch/components/FilterControl.tsx index 41400d365..5892aacd1 100644 --- a/packages/website/src/components/TankSearch/components/FilterControl.tsx +++ b/packages/website/src/components/TankSearch/components/FilterControl.tsx @@ -25,8 +25,8 @@ import { Tooltip, type FlexProps, } from "@radix-ui/themes"; -import { times } from "lodash-es"; import { Fragment, type ComponentProps, type ReactNode } from "react"; +import { awaitableTiers } from "../../../core/awaitables/tiers"; import { api } from "../../../core/blitzkit/api"; import { useLocale } from "../../../hooks/useLocale"; import { App } from "../../../stores/app"; @@ -171,7 +171,7 @@ const GUN_TYPES = Object.keys( const MAX_ICONS = 4; -const TIERS = times(10, (i) => 10 - i); +const TIERS = await awaitableTiers; export function FilterControl() { return ( diff --git a/packages/website/src/components/TankSearch/components/TierFilter.tsx b/packages/website/src/components/TankSearch/components/TierFilter.tsx index 735399ea9..7129ac418 100644 --- a/packages/website/src/components/TankSearch/components/TierFilter.tsx +++ b/packages/website/src/components/TankSearch/components/TierFilter.tsx @@ -1,10 +1,12 @@ import { TIER_ROMAN_NUMERALS } from "@blitzkit/core"; import { Flex, IconButton, Text } from "@radix-ui/themes"; -import { times } from "lodash-es"; import { memo } from "react"; +import { awaitableTiers } from "../../../core/awaitables/tiers"; import { TankFilters } from "../../../stores/tankFilters"; import { TankSort } from "../../../stores/tankopediaSort"; +const TIERS = await awaitableTiers; + export const TierFilter = memo(() => { const by = TankSort.use((state) => state.by); const search = TankFilters.use((state) => state.search); @@ -19,8 +21,7 @@ export const TierFilter = memo(() => { overflow="hidden" style={{ borderRadius: "var(--radius-full)" }} > - {times(10, (index) => { - const tier = 10 - index; + {TIERS.map((tier) => { const selected = tiers.includes(tier); return ( diff --git a/packages/website/src/components/Tankopedia/TechTreeSection/components/Node.tsx b/packages/website/src/components/Tankopedia/TechTreeSection/components/Node.tsx index 5a710564e..6f575a078 100644 --- a/packages/website/src/components/Tankopedia/TechTreeSection/components/Node.tsx +++ b/packages/website/src/components/Tankopedia/TechTreeSection/components/Node.tsx @@ -127,7 +127,7 @@ export function Node({ id, highlight, nextIds, skeleton }: NodeProps) { - {averages && nextTanks && tank.tier !== 10 && ( + {averages && nextTanks && nextTanks.length > 0 && ( {skeleton && } {!skeleton && diff --git a/packages/website/src/components/Tankopedia/TechTreeSection/index.tsx b/packages/website/src/components/Tankopedia/TechTreeSection/index.tsx index ab6119b1c..1b099c735 100644 --- a/packages/website/src/components/Tankopedia/TechTreeSection/index.tsx +++ b/packages/website/src/components/Tankopedia/TechTreeSection/index.tsx @@ -191,7 +191,7 @@ export function TechTreeSection({ skeleton }: MaybeSkeletonComponentProps) { ); })} - {master.tier < 10 && ( + {master.successors.length > 0 && ( <> {master.successors!.map((id, index) => ( diff --git a/packages/website/src/core/awaitables/tiers.ts b/packages/website/src/core/awaitables/tiers.ts new file mode 100644 index 000000000..a83389b73 --- /dev/null +++ b/packages/website/src/core/awaitables/tiers.ts @@ -0,0 +1,10 @@ +import { times } from "lodash-es"; +import { api } from "../blitzkit/api"; + +export const awaitableTiers = api.tankDefinitions().then((tankDefinitions) => { + const maxTier = Math.max( + ...Object.values(tankDefinitions.tanks).map((tank) => tank.tier), + ); + + return times(maxTier, (index) => maxTier - index); +}); diff --git a/packages/website/src/stores/guess.ts b/packages/website/src/stores/guess.ts index 0a3e94f49..76a6f7c8c 100644 --- a/packages/website/src/stores/guess.ts +++ b/packages/website/src/stores/guess.ts @@ -1,6 +1,8 @@ import type { TankDefinition } from "@blitzkit/core"; -import { times } from "lodash-es"; import { Varuna } from "varuna"; +import { awaitableTiers } from "../core/awaitables/tiers"; + +const tiers = await awaitableTiers; export enum GuessState { Correct, @@ -25,5 +27,5 @@ export const Guess = new Varuna((tank) => ({ correctGuesses: 0, streak: 0, helpingReveal: false, - tiers: times(10, (index) => index + 1), + tiers, })); From 541da65bfc910bfa1e80a33cdeb9699fb812894a Mon Sep 17 00:00:00 2001 From: Mark Greene Date: Mon, 5 Oct 2026 19:52:46 +1300 Subject: [PATCH 28/43] Feature: option to turn off automatic tank model loading Lets people on limited data stop the Tankopedia from downloading 3D models automatically. - Added an Automatically load 3D models switch to the settings page, on by default - When off, the tank page hero shows a Load 3D model button where the loading bar sits - Held back every model download on the tank page until requested, including the dynamic armor switcher and the gun flexibility visualizer - Wrapped the tank sandbox in its own suspense boundary so the loading bar shows real progress instead of the whole page waiting on the model - Measured loading progress from when each loading bar appears so it always starts empty - Added the English strings; other languages fall back until translated Fixes #311 --- packages/i18n/strings/en.json | 3 ++ .../GunFlexibilityVisualizer/index.tsx | 4 +- .../HeroSection/components/Options/index.tsx | 3 +- .../components/TankSandbox/Title/index.tsx | 43 +++++++++++++++++-- .../Tankopedia/HeroSection/index.tsx | 11 +++-- .../website/src/hooks/useStableProgress.ts | 4 +- .../[...locale]/settings/_index.tsx | 17 ++++++++ packages/website/src/stores/app/index.ts | 2 + packages/website/src/stores/tankopedia.ts | 3 ++ 9 files changed, 79 insertions(+), 11 deletions(-) diff --git a/packages/i18n/strings/en.json b/packages/i18n/strings/en.json index fe4ed47b1..c610ad57e 100644 --- a/packages/i18n/strings/en.json +++ b/packages/i18n/strings/en.json @@ -215,6 +215,7 @@ "title": "Settings", "description": "Change BlitzKit settings", "dev_mode": "Development mode", + "auto_load_models": "Automatically load 3D models", "language": "Language" }, @@ -458,6 +459,8 @@ }, "sandbox": { + "load_model": "Load 3D model", + "poses": { "hull_down": "Hull down", "face_hug": "Face hug", diff --git a/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Characteristics/components/GunFlexibilityVisualizer/index.tsx b/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Characteristics/components/GunFlexibilityVisualizer/index.tsx index 93d7a5e1a..f28050abc 100644 --- a/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Characteristics/components/GunFlexibilityVisualizer/index.tsx +++ b/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Characteristics/components/GunFlexibilityVisualizer/index.tsx @@ -13,6 +13,7 @@ import { modelTransformEvent } from "../../../../../../../core/blitzkit/modelTra import { Var } from "../../../../../../../core/radix/var"; import { useLocale } from "../../../../../../../hooks/useLocale"; import { Duel } from "../../../../../../../stores/duel"; +import { Tankopedia } from "../../../../../../../stores/tankopedia"; import type { MaybeSkeletonComponentProps } from "../../../../../../../types/maybeSkeletonComponentProps"; import { VisualizerCard } from "../VisualizerCard"; import { VisualizerCornerStat } from "../VisualizerCornerStat"; @@ -43,6 +44,7 @@ export function GunFlexibilityVisualizer({ const tank = Duel.use((state) => state.protagonist.tank); const turret = Duel.use((state) => state.protagonist.turret); const gun = Duel.use((state) => state.protagonist.gun); + const modelRequested = Tankopedia.use((state) => state.modelRequested); const tankModel = modelDefinition.models[tank.id]; const turretModel = tankModel.turrets[turret.id]; @@ -193,7 +195,7 @@ export function GunFlexibilityVisualizer({ top="0" left="0" > - {!skeleton && } + {!skeleton && modelRequested && } state.revealed); const disturbed = Tankopedia.use((state) => state.disturbed); const highGraphics = TankopediaPersistent.use((state) => state.highGraphics); + const modelRequested = Tankopedia.use((state) => state.modelRequested); const equalize = Duel.use((state) => state.equalize); const equalizer = Duel.use((state) => state.antagonist.tank.equalizer); @@ -283,7 +284,7 @@ export function Options({ thicknessRange, canvas, skeleton }: OptionsProps) { - {!skeleton && ( + {!skeleton && modelRequested && ( diff --git a/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/Title/index.tsx b/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/Title/index.tsx index 694d24f12..b3dab3aaf 100644 --- a/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/Title/index.tsx +++ b/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/Title/index.tsx @@ -1,11 +1,14 @@ -import { Flex, Heading } from "@radix-ui/themes"; +import { DownloadIcon } from "@radix-ui/react-icons"; +import { Button, Flex, Heading } from "@radix-ui/themes"; import { useLocale } from "../../../../../../hooks/useLocale"; import { Duel } from "../../../../../../stores/duel"; import { Tankopedia } from "../../../../../../stores/tankopedia"; +import type { MaybeSkeletonComponentProps } from "../../../../../../types/maybeSkeletonComponentProps"; import { Tracker } from "./components/Tracker"; -export function Title() { - const { unwrap } = useLocale(); +export function Title({ skeleton }: MaybeSkeletonComponentProps) { + const { unwrap, strings } = useLocale(); + const modelRequested = Tankopedia.use((state) => state.modelRequested); const protagonist = Duel.use((state) => state.protagonist.tank); const revealed = Tankopedia.use((state) => state.revealed); const disturbed = Tankopedia.use((state) => state.disturbed); @@ -21,6 +24,8 @@ export function Title() { onPointerDown={(event) => { event.preventDefault(); + if (!modelRequested) return; + Tankopedia.mutate((draft) => { draft.revealed = true; }); @@ -60,7 +65,37 @@ export function Title() { {name} - {!revealed && } + {!skeleton && !revealed && modelRequested && ( + + )} + + {!skeleton && !modelRequested && ( + + + + )} ); } diff --git a/packages/website/src/components/Tankopedia/HeroSection/index.tsx b/packages/website/src/components/Tankopedia/HeroSection/index.tsx index 11f13d58e..51205fb49 100644 --- a/packages/website/src/components/Tankopedia/HeroSection/index.tsx +++ b/packages/website/src/components/Tankopedia/HeroSection/index.tsx @@ -1,6 +1,6 @@ import { Box, Flex } from "@radix-ui/themes"; import { times } from "lodash-es"; -import { useEffect, useMemo, useRef } from "react"; +import { Suspense, useEffect, useMemo, useRef } from "react"; import { api } from "../../../core/blitzkit/api"; import { defaultEqualizer } from "../../../core/blitzkit/tankToDuelMember"; import { useFullScreen } from "../../../hooks/useFullScreen"; @@ -20,6 +20,7 @@ export function HeroSection({ skeleton }: MaybeSkeletonComponentProps) { const canvas = useRef(null!); const isFullScreen = useFullScreen(); const protagonist = Duel.use((state) => state.protagonist.tank); + const modelRequested = Tankopedia.use((state) => state.modelRequested); const thicknessRange = useMemo(() => { const entries = Object.values(tankDefinitions.tanks); const filtered = entries.filter( @@ -131,13 +132,15 @@ export function HeroSection({ skeleton }: MaybeSkeletonComponentProps) { top="0" left="0" > - {!skeleton && ( - + {!skeleton && modelRequested && ( + + + )} - + <Title skeleton={skeleton} /> <Options skeleton={skeleton} diff --git a/packages/website/src/hooks/useStableProgress.ts b/packages/website/src/hooks/useStableProgress.ts index 332ded1d0..396136e51 100644 --- a/packages/website/src/hooks/useStableProgress.ts +++ b/packages/website/src/hooks/useStableProgress.ts @@ -3,11 +3,13 @@ import { useRef } from "react"; export function useStableProgress() { const { loaded, total } = useProgress(); + const baseline = useRef(loaded); const progress = useRef(0); + const pending = total - baseline.current; progress.current = Math.max( progress.current, - total === 0 ? 0 : (loaded / total) * 100 + pending <= 0 ? 0 : ((loaded - baseline.current) / pending) * 100 ); return progress.current; diff --git a/packages/website/src/pages/[...chunk_default]/[...locale]/settings/_index.tsx b/packages/website/src/pages/[...chunk_default]/[...locale]/settings/_index.tsx index c5054b676..374d24198 100644 --- a/packages/website/src/pages/[...chunk_default]/[...locale]/settings/_index.tsx +++ b/packages/website/src/pages/[...chunk_default]/[...locale]/settings/_index.tsx @@ -18,6 +18,10 @@ export function Page({ locale }: LocaleAcceptorProps) { function Content({ locale }: LocaleAcceptorProps) { const developerMode = App.useDeferred((state) => state.developerMode, false); + const autoLoadModels = App.useDeferred( + (state) => state.autoLoadModels, + true, + ); const { strings } = useLocale(); return ( @@ -36,6 +40,19 @@ function Content({ locale }: LocaleAcceptorProps) { /> </Flex> + <Flex align="center" gap="2" justify="between"> + <Text>{strings.website.settings.auto_load_models}</Text> + <Switch + variant="classic" + checked={autoLoadModels} + onCheckedChange={(checked) => + App.mutate((draft) => { + draft.autoLoadModels = checked; + }) + } + /> + </Flex> + <Flex align="center" gap="2" justify="between"> <Text>{strings.website.settings.language}</Text> <LocaleSwitcher locale={locale} /> diff --git a/packages/website/src/stores/app/index.ts b/packages/website/src/stores/app/index.ts index 6b15394f2..ba975056c 100644 --- a/packages/website/src/stores/app/index.ts +++ b/packages/website/src/stores/app/index.ts @@ -8,6 +8,7 @@ export interface WargamingLogin { export interface App { developerMode: boolean; + autoLoadModels: boolean; policiesAgreementIndex: number; logins: { wargaming?: WargamingLogin; @@ -17,6 +18,7 @@ export interface App { export const App = new Varuna<App>( { developerMode: false, + autoLoadModels: true, policiesAgreementIndex: -1, logins: {}, }, diff --git a/packages/website/src/stores/tankopedia.ts b/packages/website/src/stores/tankopedia.ts index d2eb8a066..023ab0e87 100644 --- a/packages/website/src/stores/tankopedia.ts +++ b/packages/website/src/stores/tankopedia.ts @@ -9,6 +9,7 @@ import type { ArmorType } from "../components/Armor/components/SpacedArmorScene" import type { ExternalModuleVariant } from "../components/Armor/components/SpacedArmorSceneComponent"; import type { XP_MULTIPLIERS } from "../components/Tankopedia/TechTreeSection"; import { api } from "../core/blitzkit/api"; +import { App } from "./app"; import { TankopediaDisplay } from "./tankopediaPersistent/constants"; export interface ShotLayerBase { @@ -79,6 +80,7 @@ export enum TankopediaRelativeAgainst { interface Tankopedia { disturbed: boolean; revealed: boolean; + modelRequested: boolean; shot?: Shot; skills: Record<string, number>; relativeAgainst: TankopediaRelativeAgainst; @@ -110,6 +112,7 @@ const skillDefinitions = await api.skillDefinitions(); export const Tankopedia = new Varuna<Tankopedia, ModelDefinition>((model) => ({ disturbed: false, revealed: false, + modelRequested: App.state.autoLoadModels, relativeAgainst: TankopediaRelativeAgainst.Class, editStatic: false, skills: createDefaultSkills(skillDefinitions), From d79e0ddb5d289c157f95f3157c2fc2a3cfa8bb7c Mon Sep 17 00:00:00 2001 From: tresabhi <43380238+tresabhi@users.noreply.github.com> Date: Mon, 5 Oct 2026 11:24:01 -0500 Subject: [PATCH 29/43] caching for strings --- .../core/src/blitzkit/api/server/0_base.ts | 41 +++++++++++-------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/packages/core/src/blitzkit/api/server/0_base.ts b/packages/core/src/blitzkit/api/server/0_base.ts index a41ec123d..d67af5898 100644 --- a/packages/core/src/blitzkit/api/server/0_base.ts +++ b/packages/core/src/blitzkit/api/server/0_base.ts @@ -25,8 +25,8 @@ import { VehicleDefinitionList, } from "@blitzkit/core"; import { AbstractVFS } from "@blitzkit/core/src/blitzkit/vfs/abstract"; -import { SUPPORTED_LOCALE_BLITZ_MAP } from "@blitzkit/i18n"; import locales from "@blitzkit/i18n/locales.json"; +import { SUPPORTED_LOCALE_BLITZ_MAP } from "@blitzkit/i18n/src/strings"; import { parse as parseYaml } from "yaml"; import { BlitzKitAPI } from "../base"; @@ -113,6 +113,9 @@ export abstract class ServerBlitzKitAPI0 extends BlitzKitAPI { } async init() { + const { existsSync } = await import("fs"); + const { readFile, writeFile, mkdir } = await import("fs/promises"); + console.log("Initializing virtual file system..."); await this.vfs.init(); @@ -155,31 +158,37 @@ export abstract class ServerBlitzKitAPI0 extends BlitzKitAPI { console.log("Fetching game localizations..."); - if (import.meta.env.DEV) { - locales.supported = [locales.supported[0]]; - } - - let fetchedLocalizations = 0; await Promise.all( locales.supported.map(async ({ locale }) => { + const root = "../../temp/strings"; + const cachePath = `${root}/${locale}.json`; + + if (existsSync(cachePath)) { + console.log(` Cache hit for ${locale}`); + + const content = await readFile(cachePath, "utf-8"); + this.stringsI18n[locale] = JSON.parse(content) as BlitzStrings; + + return; + } + + console.log(` Cache miss for ${locale} (this will take a while...)`); + const blitzLocale = SUPPORTED_LOCALE_BLITZ_MAP[locale]; - const cache = await fetch( + const networkStrings = (await fetch( `https://stufficons.wgcdn.co/localizations/${blitzLocale}.yaml`, ) .then((response) => response.text()) - .then((string) => parseYaml(string) as BlitzStrings); - const preInstalled = await this.vfs.yaml<BlitzStrings>( + .then(parseYaml)) as BlitzStrings; + const localStrings = await this.vfs.yaml<BlitzStrings>( `Data/Strings/${blitzLocale}.yaml`, ); + const combined = { ...networkStrings, ...localStrings }; - this.stringsI18n[locale] = { - ...cache, - ...preInstalled, - }; + await mkdir(root, { recursive: true }); + await writeFile(cachePath, JSON.stringify(combined)); - console.log( - `Fetched localizations for ${locale} (${++fetchedLocalizations}/${locales.supported.length})`, - ); + this.stringsI18n[locale] = combined; }), ); From c70fae81622c6e55593d425bc387b159fb41d387 Mon Sep 17 00:00:00 2001 From: tresabhi <43380238+tresabhi@users.noreply.github.com> Date: Mon, 5 Oct 2026 11:24:29 -0500 Subject: [PATCH 30/43] game strings --- packages/core/src/blitzkit/api/server/0_base.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/blitzkit/api/server/0_base.ts b/packages/core/src/blitzkit/api/server/0_base.ts index d67af5898..2efff35ec 100644 --- a/packages/core/src/blitzkit/api/server/0_base.ts +++ b/packages/core/src/blitzkit/api/server/0_base.ts @@ -160,7 +160,7 @@ export abstract class ServerBlitzKitAPI0 extends BlitzKitAPI { await Promise.all( locales.supported.map(async ({ locale }) => { - const root = "../../temp/strings"; + const root = "../../temp/game-strings"; const cachePath = `${root}/${locale}.json`; if (existsSync(cachePath)) { From 5ce927be4e8748861fa7b5c41a27963c7085501f Mon Sep 17 00:00:00 2001 From: tresabhi <43380238+tresabhi@users.noreply.github.com> Date: Wed, 7 Oct 2026 10:14:44 -0500 Subject: [PATCH 31/43] force bun even with node installed --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 979a37799..3b4791010 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "license": "BlitzKit License", "private": true, "scripts": { - "dev": "cd packages/website && bun run dev", + "dev": "cd packages/website && bun --bun run dev", "build": "cd packages/website && bun run build", "discover-ids": "cd packages/scripts && bun run discover-ids", "build-protos": "cd packages/scripts && bun run build-protos", From 00149a3d9d8a0d9aad1ebbbfb372d703ff4885bc Mon Sep 17 00:00:00 2001 From: tresabhi <43380238+tresabhi@users.noreply.github.com> Date: Wed, 7 Oct 2026 16:03:41 -0500 Subject: [PATCH 32/43] simplify strings --- packages/i18n/strings/en.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/i18n/strings/en.json b/packages/i18n/strings/en.json index c610ad57e..04125f138 100644 --- a/packages/i18n/strings/en.json +++ b/packages/i18n/strings/en.json @@ -215,7 +215,7 @@ "title": "Settings", "description": "Change BlitzKit settings", "dev_mode": "Development mode", - "auto_load_models": "Automatically load 3D models", + "auto_load_models": "Auto-load models", "language": "Language" }, @@ -459,7 +459,7 @@ }, "sandbox": { - "load_model": "Load 3D model", + "load_model": "Load model", "poses": { "hull_down": "Hull down", From e1b079ca02c233de57ddbb5047f5e763bd68dc67 Mon Sep 17 00:00:00 2001 From: tresabhi <43380238+tresabhi@users.noreply.github.com> Date: Wed, 7 Oct 2026 16:06:52 -0500 Subject: [PATCH 33/43] high contrast button --- .../HeroSection/components/TankSandbox/Title/index.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/Title/index.tsx b/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/Title/index.tsx index b3dab3aaf..69f7a0193 100644 --- a/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/Title/index.tsx +++ b/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/Title/index.tsx @@ -81,8 +81,7 @@ export function Title({ skeleton }: MaybeSkeletonComponentProps) { }} > <Button - variant="surface" - color="gray" + variant="solid" highContrast onPointerDown={(event) => event.stopPropagation()} onClick={() => { From 16be5faae6516e4ba1a5bf8adc68b1ff4a5ef615 Mon Sep 17 00:00:00 2001 From: tresabhi <43380238+tresabhi@users.noreply.github.com> Date: Wed, 7 Oct 2026 16:08:56 -0500 Subject: [PATCH 34/43] use UpdateIcon --- .../HeroSection/components/TankSandbox/Title/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/Title/index.tsx b/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/Title/index.tsx index 69f7a0193..d31db7a1f 100644 --- a/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/Title/index.tsx +++ b/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/Title/index.tsx @@ -1,4 +1,4 @@ -import { DownloadIcon } from "@radix-ui/react-icons"; +import { UpdateIcon } from "@radix-ui/react-icons"; import { Button, Flex, Heading } from "@radix-ui/themes"; import { useLocale } from "../../../../../../hooks/useLocale"; import { Duel } from "../../../../../../stores/duel"; @@ -90,7 +90,7 @@ export function Title({ skeleton }: MaybeSkeletonComponentProps) { }); }} > - <DownloadIcon /> + <UpdateIcon /> {strings.website.tools.tankopedia.sandbox.load_model} </Button> </Flex> From d4e649804e1a35d740fbd791f675c8ba430b387a Mon Sep 17 00:00:00 2001 From: tresabhi <43380238+tresabhi@users.noreply.github.com> Date: Wed, 7 Oct 2026 16:15:07 -0500 Subject: [PATCH 35/43] add astro cleaning script --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 3b4791010..d9bc165ba 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,8 @@ "discover-ids": "cd packages/scripts && bun run discover-ids", "build-protos": "cd packages/scripts && bun run build-protos", "record-performance": "cd packages/scripts && bun run record-performance", - "download-client": "cd packages/scripts && bun run download-client" + "download-client": "cd packages/scripts && bun run download-client", + "clean-astro": "rm -rf packages/website/.astro packages/website/node_modules/.astro packages/website/node_modules/.vite" }, "type": "module", "workspaces": [ From 3397e7f67bc30260f291f197fc4bce4eea31d45e Mon Sep 17 00:00:00 2001 From: tresabhi <43380238+tresabhi@users.noreply.github.com> Date: Wed, 7 Oct 2026 16:25:34 -0500 Subject: [PATCH 36/43] truthy array --- .../components/Tankopedia/TechTreeSection/components/Node.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/website/src/components/Tankopedia/TechTreeSection/components/Node.tsx b/packages/website/src/components/Tankopedia/TechTreeSection/components/Node.tsx index 6f575a078..7b743aeaa 100644 --- a/packages/website/src/components/Tankopedia/TechTreeSection/components/Node.tsx +++ b/packages/website/src/components/Tankopedia/TechTreeSection/components/Node.tsx @@ -127,7 +127,7 @@ export function Node({ id, highlight, nextIds, skeleton }: NodeProps) { </Text> </Flex> - {averages && nextTanks && nextTanks.length > 0 && ( + {averages && nextTanks && ( <Text color="gray" size="1" mt="2"> {skeleton && <Skeleton height="1em" width="4em" />} {!skeleton && From 0e119b6ba858db629e9c649670a32e9add880aa2 Mon Sep 17 00:00:00 2001 From: tresabhi <43380238+tresabhi@users.noreply.github.com> Date: Wed, 7 Oct 2026 16:27:38 -0500 Subject: [PATCH 37/43] optimize awaitable tiers --- packages/website/src/core/awaitables/tiers.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/website/src/core/awaitables/tiers.ts b/packages/website/src/core/awaitables/tiers.ts index a83389b73..0729a3d45 100644 --- a/packages/website/src/core/awaitables/tiers.ts +++ b/packages/website/src/core/awaitables/tiers.ts @@ -2,9 +2,11 @@ import { times } from "lodash-es"; import { api } from "../blitzkit/api"; export const awaitableTiers = api.tankDefinitions().then((tankDefinitions) => { - const maxTier = Math.max( - ...Object.values(tankDefinitions.tanks).map((tank) => tank.tier), - ); + let max = 0; - return times(maxTier, (index) => maxTier - index); + for (const tank of Object.values(tankDefinitions.tanks)) { + if (tank.tier > max) max = tank.tier; + } + + return times(max, (index) => max - index); }); From e19d0d5895192f54e538a3e8de9ae559aec3bcfd Mon Sep 17 00:00:00 2001 From: tresabhi <43380238+tresabhi@users.noreply.github.com> Date: Wed, 7 Oct 2026 16:32:48 -0500 Subject: [PATCH 38/43] revert tank exclusion --- .../website/src/components/Compare/Controls.tsx | 7 ------- .../website/src/components/Compare/TankControl.tsx | 11 +---------- .../website/src/components/TankSearch/index.tsx | 13 +++---------- 3 files changed, 4 insertions(+), 27 deletions(-) diff --git a/packages/website/src/components/Compare/Controls.tsx b/packages/website/src/components/Compare/Controls.tsx index 8614c2c31..1bb45c6cb 100644 --- a/packages/website/src/components/Compare/Controls.tsx +++ b/packages/website/src/components/Compare/Controls.tsx @@ -1,6 +1,5 @@ import { PlusIcon, TrashIcon } from "@radix-ui/react-icons"; import { Button, Dialog, Flex, SegmentedControl } from "@radix-ui/themes"; -import { useMemo } from "react"; import { api } from "../../core/blitzkit/api"; import { tankToCompareMember } from "../../core/blitzkit/tankToCompareMember"; import { useLocale } from "../../hooks/useLocale"; @@ -23,11 +22,6 @@ export function Controls({ onAddTankDialogOpenChange, }: ControlsProps) { const deltaMode = ComparePersistent.use((state) => state.deltaMode); - const members = CompareEphemeral.use((state) => state.members); - const memberIds = useMemo( - () => members.map((member) => member.tank.id), - [members], - ); const { strings } = useLocale(); return ( @@ -59,7 +53,6 @@ export function Controls({ > <TankSearch compact - exclude={memberIds} onSelect={(tank) => { CompareEphemeral.mutate((draft) => { draft.members.push( diff --git a/packages/website/src/components/Compare/TankControl.tsx b/packages/website/src/components/Compare/TankControl.tsx index bf2e6e227..28ab0e129 100644 --- a/packages/website/src/components/Compare/TankControl.tsx +++ b/packages/website/src/components/Compare/TankControl.tsx @@ -1,6 +1,6 @@ import { ExternalLinkIcon, LoopIcon, TrashIcon } from "@radix-ui/react-icons"; import { Dialog, Flex, IconButton } from "@radix-ui/themes"; -import { useMemo, useState } from "react"; +import { useState } from "react"; import { api } from "../../core/blitzkit/api"; import { tankToCompareMember } from "../../core/blitzkit/tankToCompareMember"; import { useLocale } from "../../hooks/useLocale"; @@ -18,14 +18,6 @@ const provisionDefinitions = await api.provisionDefinitions(); export function TankControl({ index, slug }: TankControlProps) { const { locale, strings } = useLocale(); const [switchTankDialogOpen, setSwitchTankDialogOpen] = useState(false); - const members = CompareEphemeral.use((state) => state.members); - const otherMemberIds = useMemo( - () => - members - .filter((_, memberIndex) => memberIndex !== index) - .map((member) => member.tank.id), - [members, index], - ); return ( <Flex gap="3" justify="center" style={{ width: "100%" }}> @@ -65,7 +57,6 @@ export function TankControl({ index, slug }: TankControlProps) { > <TankSearch compact - exclude={otherMemberIds} onSelect={(tank) => { CompareEphemeral.mutate((draft) => { draft.members[index] = tankToCompareMember( diff --git a/packages/website/src/components/TankSearch/index.tsx b/packages/website/src/components/TankSearch/index.tsx index fcc976aed..35321dc2c 100644 --- a/packages/website/src/components/TankSearch/index.tsx +++ b/packages/website/src/components/TankSearch/index.tsx @@ -38,7 +38,6 @@ export type TankSearchProps = MaybeSkeletonComponentProps & compact?: boolean; onSelect?: (tank: TankDefinition) => void; onSelectAll?: (tanks: TankDefinition[]) => void; - exclude?: number[]; }; const PREVIEW_COUNT = 20; @@ -53,14 +52,14 @@ const [gameDefinitions, modelDefinitions, tankDefinitions, tankNames] = ]); export const TankSearch = memo<TankSearchProps>( - ({ compact, onSelect, onSelectAll, exclude, skeleton, ...props }) => { + ({ compact, onSelect, onSelectAll, skeleton, ...props }) => { const { strings, locale } = useLocale(); const wargaming = App.use((state) => state.logins.wargaming); const awaitedTanksDefinitionsArray = Object.values(tankDefinitions.tanks); const tankopediaSort = TankSort.use(); const tankFilters = TankFilters.use(); - const allFiltered = usePromise( + const filtered = usePromise( () => { if (tankFilters.search === null) { return filterTanks( @@ -82,15 +81,9 @@ export const TankSearch = memo<TankSearchProps>( [tankFilters] as any, ); const sorted = useMemo(() => { - const filtered = allFiltered.filter( - (tank) => !exclude?.includes(tank.id), - ); - if (tankFilters.search === null) { let sorted: TankDefinition[]; - filtered.sort((a, b) => a.id - b.id); - switch (tankopediaSort.by) { case "meta.none": sorted = metaSortTank(filtered, gameDefinitions); @@ -424,7 +417,7 @@ export const TankSearch = memo<TankSearchProps>( } else { return filtered; } - }, [tankFilters, tankopediaSort, exclude]); + }, [tankFilters, tankopediaSort]); const [loadedCards, setLoadedCards] = useState(DEFAULT_LOADED_CARDS); const tanks = sorted.slice(0, loadedCards); From 904d50f4c30f84ef611ad09511fc6a296186d9a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tr=C3=A8sAbhi?= <43380238+tresabhi@users.noreply.github.com> Date: Wed, 7 Oct 2026 16:35:15 -0500 Subject: [PATCH 39/43] New Crowdin updates (#379) --- packages/i18n/strings/es.json | 2 ++ packages/i18n/strings/fr.json | 2 ++ packages/i18n/strings/ja.json | 2 ++ packages/i18n/strings/pl.json | 2 ++ packages/i18n/strings/pt.json | 2 ++ packages/i18n/strings/ru.json | 2 ++ packages/i18n/strings/uk.json | 2 ++ packages/i18n/strings/zh.json | 2 ++ 8 files changed, 16 insertions(+) diff --git a/packages/i18n/strings/es.json b/packages/i18n/strings/es.json index 8df0c4a90..e877464d5 100644 --- a/packages/i18n/strings/es.json +++ b/packages/i18n/strings/es.json @@ -194,6 +194,7 @@ "title": "Settings", "description": "Change BlitzKit settings", "dev_mode": "Modo de desarrollador", + "auto_load_models": "Auto-load models", "language": "Idioma" }, "common": { @@ -412,6 +413,7 @@ } }, "sandbox": { + "load_model": "Load model", "poses": { "hull_down": "Hull down", "face_hug": "Cara a cara", diff --git a/packages/i18n/strings/fr.json b/packages/i18n/strings/fr.json index 7e5d2a7c3..ba01e0146 100644 --- a/packages/i18n/strings/fr.json +++ b/packages/i18n/strings/fr.json @@ -194,6 +194,7 @@ "title": "Paramètres", "description": "Modifier les paramètres de BlitzKit", "dev_mode": "Mode développement", + "auto_load_models": "Auto-load models", "language": "Langue" }, "common": { @@ -412,6 +413,7 @@ } }, "sandbox": { + "load_model": "Load model", "poses": { "hull_down": "Hull down", "face_hug": "Face hug", diff --git a/packages/i18n/strings/ja.json b/packages/i18n/strings/ja.json index 18ae1e3f4..f56d1986f 100644 --- a/packages/i18n/strings/ja.json +++ b/packages/i18n/strings/ja.json @@ -194,6 +194,7 @@ "title": "Settings", "description": "Change BlitzKit settings", "dev_mode": "開発者モード", + "auto_load_models": "Auto-load models", "language": "言語 / Language" }, "common": { @@ -412,6 +413,7 @@ } }, "sandbox": { + "load_model": "Load model", "poses": { "hull_down": "ハルダウン", "face_hug": "密着", diff --git a/packages/i18n/strings/pl.json b/packages/i18n/strings/pl.json index cb209b4be..447d389b3 100644 --- a/packages/i18n/strings/pl.json +++ b/packages/i18n/strings/pl.json @@ -194,6 +194,7 @@ "title": "Settings", "description": "Change BlitzKit settings", "dev_mode": "Development mode", + "auto_load_models": "Auto-load models", "language": "Language" }, "common": { @@ -412,6 +413,7 @@ } }, "sandbox": { + "load_model": "Load model", "poses": { "hull_down": "Hull down", "face_hug": "Face hug", diff --git a/packages/i18n/strings/pt.json b/packages/i18n/strings/pt.json index c0591e83c..757530039 100644 --- a/packages/i18n/strings/pt.json +++ b/packages/i18n/strings/pt.json @@ -194,6 +194,7 @@ "title": "Settings", "description": "Change BlitzKit settings", "dev_mode": "Modo de desenvolvimento", + "auto_load_models": "Auto-load models", "language": "Idioma" }, "common": { @@ -412,6 +413,7 @@ } }, "sandbox": { + "load_model": "Load model", "poses": { "hull_down": "Casco para baixo", "face_hug": "Abraço facial", diff --git a/packages/i18n/strings/ru.json b/packages/i18n/strings/ru.json index 3f34d00d4..c887147c7 100644 --- a/packages/i18n/strings/ru.json +++ b/packages/i18n/strings/ru.json @@ -194,6 +194,7 @@ "title": "Настройки", "description": "Изменить настройки BlitzKit", "dev_mode": "Режим разработчика", + "auto_load_models": "Auto-load models", "language": "Язык" }, "common": { @@ -412,6 +413,7 @@ } }, "sandbox": { + "load_model": "Load model", "poses": { "hull_down": "За холмом", "face_hug": "В упор", diff --git a/packages/i18n/strings/uk.json b/packages/i18n/strings/uk.json index 945d41188..1cf6305fe 100644 --- a/packages/i18n/strings/uk.json +++ b/packages/i18n/strings/uk.json @@ -194,6 +194,7 @@ "title": "Налаштування", "description": "Змінити налаштування BlitzKit ", "dev_mode": "Режим розробника", + "auto_load_models": "Auto-load models", "language": "Мова" }, "common": { @@ -412,6 +413,7 @@ } }, "sandbox": { + "load_model": "Load model", "poses": { "hull_down": "Від башти", "face_hug": "Клінч", diff --git a/packages/i18n/strings/zh.json b/packages/i18n/strings/zh.json index eeb75358e..3ab253b45 100644 --- a/packages/i18n/strings/zh.json +++ b/packages/i18n/strings/zh.json @@ -194,6 +194,7 @@ "title": "设置", "description": "更改 BlitzKit 设置", "dev_mode": "开发者模式", + "auto_load_models": "Auto-load models", "language": "语言" }, "common": { @@ -412,6 +413,7 @@ } }, "sandbox": { + "load_model": "Load model", "poses": { "hull_down": "俯角视角", "face_hug": "顶牛视角", From 0e7b020d60baaf4e2d500caff8600474515dba85 Mon Sep 17 00:00:00 2001 From: tresabhi <43380238+tresabhi@users.noreply.github.com> Date: Wed, 7 Oct 2026 16:48:08 -0500 Subject: [PATCH 40/43] fix sliver --- .../CharacteristicsSection/components/Equalizer.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Equalizer.tsx b/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Equalizer.tsx index f9c29e521..8c5b2771b 100644 --- a/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Equalizer.tsx +++ b/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Equalizer.tsx @@ -28,17 +28,17 @@ export function Equalizer() { width="100%" style={{ cursor: "pointer", - borderRadius: "var(--radius-3)", + borderRadius: "var(--radius-3) 0 0 var(--radius-3)", backgroundImage: ` linear-gradient(90deg, var(--black-a3), var(--gray-1)), url(${alias("api", `/gamemodes/Insanity/banner.webp`)}) `, - backgroundSize: "cover", + backgroundSize: "auto, fit", backgroundPosition: "50% 25%", overflow: "hidden", }} > - <Flex align="center" width="100%" justify="between" p="4"> + <Flex align="center" width="100%" justify="between" p="4" style={{}}> <Text style={{ textShadow: "0 0 var(--space-1) var(--black-a12)", From 92c8b90bb3084447eae534da60b6c20676ba4a23 Mon Sep 17 00:00:00 2001 From: tresabhi <43380238+tresabhi@users.noreply.github.com> Date: Wed, 7 Oct 2026 16:56:40 -0500 Subject: [PATCH 41/43] remove api check --- packages/website/src/components/LocaleRedirector.astro | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/website/src/components/LocaleRedirector.astro b/packages/website/src/components/LocaleRedirector.astro index 80c0afeaa..50cd05acb 100644 --- a/packages/website/src/components/LocaleRedirector.astro +++ b/packages/website/src/components/LocaleRedirector.astro @@ -3,7 +3,6 @@ import { getBestLocale } from "../core/i18n/getBestLocale"; const pathname = window.location.pathname; - const isAPI = pathname.startsWith("/api"); const hasPreference = localStorage.getItem("preferred-locale") !== null; const bestLocale = getBestLocale(); const currentLocale = @@ -14,7 +13,6 @@ )?.locale ?? locales.default; if ( - !isAPI && bestLocale !== currentLocale && (hasPreference || currentLocale === locales.default) ) { From 02f5cc0686dd55ca6076e08d890312d0c17fffea Mon Sep 17 00:00:00 2001 From: tresabhi <43380238+tresabhi@users.noreply.github.com> Date: Wed, 7 Oct 2026 17:00:47 -0500 Subject: [PATCH 42/43] remove redundant logic --- packages/website/src/components/LocaleRedirector.astro | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/website/src/components/LocaleRedirector.astro b/packages/website/src/components/LocaleRedirector.astro index 50cd05acb..3805c19cc 100644 --- a/packages/website/src/components/LocaleRedirector.astro +++ b/packages/website/src/components/LocaleRedirector.astro @@ -8,8 +8,7 @@ const currentLocale = locales.supported.find( ({ locale }) => - locale !== locales.default && - (pathname === `/${locale}` || pathname.startsWith(`/${locale}/`)), + pathname === `/${locale}` || pathname.startsWith(`/${locale}/`), )?.locale ?? locales.default; if ( From 7234c39ad81db68ba6e06349f0fe27331baeb7e9 Mon Sep 17 00:00:00 2001 From: tresabhi <43380238+tresabhi@users.noreply.github.com> Date: Wed, 7 Oct 2026 21:32:38 -0500 Subject: [PATCH 43/43] move credits back --- docs/changelogs/1.29.10.md | 4 ++-- docs/changelogs/1.29.16.md | 2 +- docs/changelogs/1.29.8.md | 2 +- docs/changelogs/1.29.9.md | 4 ++-- docs/changelogs/1.30.0.md | 10 +++++----- docs/changelogs/1.30.1.md | 2 +- docs/changelogs/1.30.2.md | 6 +++--- docs/changelogs/1.30.3.md | 10 +++++----- docs/changelogs/1.30.7.md | 8 ++++---- docs/changelogs/1.31.4.md | 30 +++++++++++++++--------------- 10 files changed, 39 insertions(+), 39 deletions(-) diff --git a/docs/changelogs/1.29.10.md b/docs/changelogs/1.29.10.md index c293c1b4f..d96d78fd8 100644 --- a/docs/changelogs/1.29.10.md +++ b/docs/changelogs/1.29.10.md @@ -5,10 +5,10 @@ Thank you to [Mark Greene](https://github.com/Hitjack007) for your contributions ## Features - Combined game mode passive and active abilities into a single dropdown -- [Mark Greene] Added tier filters to the Guess game +- Added tier filters to the Guess game [Mark Greene] - Changing tiers will break your streak ## Fixes -- [Mark Greene] module damage is now properly shown when sorting with it in the tank search +- module damage is now properly shown when sorting with it in the tank search [Mark Greene] - Duplicate abilities in the tank filters are now removed diff --git a/docs/changelogs/1.29.16.md b/docs/changelogs/1.29.16.md index c111d385d..9a110001b 100644 --- a/docs/changelogs/1.29.16.md +++ b/docs/changelogs/1.29.16.md @@ -4,7 +4,7 @@ Thank you to [GonnaHetzMe](https://github.com/karelpak1) for your contributions ## Fixes -- [GonnaHetzMe] The turret for Centurion I is no longer offset from the body +- The turret for Centurion I is no longer offset from the body [GonnaHetzMe] - Please allow up to 24 hours for the model to update - Vertical Stabilizers now give the correct 12% buff instead of 15% - Re-ordering tanks in Compare now works once again diff --git a/docs/changelogs/1.29.8.md b/docs/changelogs/1.29.8.md index fa010e23f..a32e7d558 100644 --- a/docs/changelogs/1.29.8.md +++ b/docs/changelogs/1.29.8.md @@ -15,5 +15,5 @@ Thank you to [Mark Greene](https://github.com/Hitjack007) for your contributions ## Fixes - The Tankopedia now smoothly resizes when enlarging on interaction -- [Mark Greene] Stock turrets now correctly mount the corresponding stock gun +- Stock turrets now correctly mount the corresponding stock gun [Mark Greene] - The consumable and provision buttons in Compare are no longer tiny diff --git a/docs/changelogs/1.29.9.md b/docs/changelogs/1.29.9.md index 5f8d4a78e..c426194e1 100644 --- a/docs/changelogs/1.29.9.md +++ b/docs/changelogs/1.29.9.md @@ -5,10 +5,10 @@ Thank you to [Mark Greene](https://github.com/Hitjack007) for your contributions ## Features - Reworked tank search filters to be far more compact to make way for new filters -- [Mark Greene] Added the ability to filter tanks by consumables +- Added the ability to filter tanks by consumables [Mark Greene] - Added the ability to filter tanks by provisions and game-mode abilities and powers ## Fixes - Consumable and provision icons in Compare are now properly sized -- [Mark Greene] Provisions now properly affect terrain resistances +- Provisions now properly affect terrain resistances [Mark Greene] diff --git a/docs/changelogs/1.30.0.md b/docs/changelogs/1.30.0.md index cedbf5607..fd009b569 100644 --- a/docs/changelogs/1.30.0.md +++ b/docs/changelogs/1.30.0.md @@ -13,11 +13,11 @@ Thank you to [GonnaHetzMe](https://github.com/karelpak1) for your contributions ## Technical Features -- [GonnaHetzMe] Enabling dev mode now displays the tank's non-numerical id -- [GonnaHetzMe] The dev id and the new dev name are now copyable on click +- Enabling dev mode now displays the tank's non-numerical id [GonnaHetzMe] +- The dev id and the new dev name are now copyable on click [GonnaHetzMe] ## Fixes -- [GonnaHetzMe] Tech trees that start at tiers higher than tier 1 like the Blitz Nation ones now properly render their trees in Tankopedia -- [GonnaHetzMe] The tank pitch/yaw inputs in the Tank Sandbox now initialize with the correct values instead of 0 -- [GonnaHetzMe] Large Repair Kits once again use the correct modern icon +- Tech trees that start at tiers higher than tier 1 like the Blitz Nation ones now properly render their trees in Tankopedia [GonnaHetzMe] +- The tank pitch/yaw inputs in the Tank Sandbox now initialize with the correct values instead of 0 [GonnaHetzMe] +- Large Repair Kits once again use the correct modern icon [GonnaHetzMe] diff --git a/docs/changelogs/1.30.1.md b/docs/changelogs/1.30.1.md index 9491bc53a..8f2fd5c8c 100644 --- a/docs/changelogs/1.30.1.md +++ b/docs/changelogs/1.30.1.md @@ -4,5 +4,5 @@ Thank you to [GonnaHetzMe](https://github.com/karelpak1) for your contributions ## Fixes -- [GonnaHetzMe] Tank hit points in Equalizer mode is now accurate to the game +- Tank hit points in Equalizer mode is now accurate to the game [GonnaHetzMe] - Armor highlighting now reflects the actual thicknesses of tanks in Equalizer mode diff --git a/docs/changelogs/1.30.2.md b/docs/changelogs/1.30.2.md index e6437cad0..db259e391 100644 --- a/docs/changelogs/1.30.2.md +++ b/docs/changelogs/1.30.2.md @@ -4,9 +4,9 @@ Thank you to [GonnaHetzMe](https://github.com/karelpak1) for your contributions ## Fixes -- [GonnaHetzMe] Tungsten shells are now properly cropped +- Tungsten shells are now properly cropped [GonnaHetzMe] - Equalizer no longer gives insanely high penetration values - The tank reveal animation no longer repeats when you scroll away and back to the tank sandbox -- [GonnaHetzMe] The RHM. Pzw.'s turret no longer has the floating plate +- The RHM. Pzw.'s turret no longer has the floating plate [GonnaHetzMe] - Please give BlitzKit up to 1 hour to update the model -- [GonnaHetzMe] Tanks with inclined turret rings like the Minotauro now display the correct pitch in the tank sandbox inputs +- Tanks with inclined turret rings like the Minotauro now display the correct pitch in the tank sandbox inputs [GonnaHetzMe] diff --git a/docs/changelogs/1.30.3.md b/docs/changelogs/1.30.3.md index 69137dcac..74924659b 100644 --- a/docs/changelogs/1.30.3.md +++ b/docs/changelogs/1.30.3.md @@ -4,7 +4,7 @@ Thank you to [GonnaHetzMe](https://github.com/karelpak1) for your contributions ## Features -- [GonnaHetzMe] Added tooltips to the module selector in Tankopedia +- Added tooltips to the module selector in Tankopedia [GonnaHetzMe] ## Fixes @@ -12,7 +12,7 @@ Thank you to [GonnaHetzMe](https://github.com/karelpak1) for your contributions - Removed tank visual and collision model caching - Guesser once again breaks streaks if not all tiers are selected - BlitzKit now properly unloads tank models from memory when visually hidden in Guesser -- [GonnaHetzMe] Tanks with complex transparency like the Herdbreaker once again handle opacity correctly -- [GonnaHetzMe] Pieces of tank models that have transparency now handle culling properly (they're visible from both sides) -- [GonnaHetzMe] Tanks with "cardboard" textures have been fixed, thanks to better PVR file parsing -- [GonnaHetzMe] Tank icons are now scaled correctly so small tanks are now properly zoomed out in contrast to bigger ones +- Tanks with complex transparency like the Herdbreaker once again handle opacity correctly [GonnaHetzMe] +- Pieces of tank models that have transparency now handle culling properly (they're visible from both sides) [GonnaHetzMe] +- Tanks with "cardboard" textures have been fixed, thanks to better PVR file parsing [GonnaHetzMe] +- Tank icons are now scaled correctly so small tanks are now properly zoomed out in contrast to bigger ones [GonnaHetzMe] diff --git a/docs/changelogs/1.30.7.md b/docs/changelogs/1.30.7.md index 2545b4b20..c42589bff 100644 --- a/docs/changelogs/1.30.7.md +++ b/docs/changelogs/1.30.7.md @@ -8,13 +8,13 @@ Thank you to [Mark Greene](https://github.com/Hitjack007) for your contributions ## Fixes -- [Mark Greene] Clicking on the armor multiple times with HE no longer crashes BlitzKit -- [Mark Greene] Ricochets that later intersect with external modules no longer falsely claim a successful damaging penetration +- Clicking on the armor multiple times with HE no longer crashes BlitzKit [Mark Greene] +- Ricochets that later intersect with external modules no longer falsely claim a successful damaging penetration [Mark Greene] - The lighting animation no longer stops prematurely when BlitzKit is unfocused - The spot light angle has been increased to more evenly light up larger tanks - BlitzKit once again uses soft shadows, reducing the pixelated shadows - Fixed the weird patterns that formed on the tracks of tanks under self-shadows - Increased the floor size and light decay to create the illusion that the floor is infinite -- [Mark Greene] Safari no longer crashes when unloading textures for unloaded tanks +- Safari no longer crashes when unloading textures for unloaded tanks [Mark Greene] - The gun depression transition between two constraints (like often behind tanks) now uses a gentler zoned and can never be 0 -- [Mark Greene] Armor plate names in Static Armor are now properly capitalized in English and translated to other languages +- Armor plate names in Static Armor are now properly capitalized in English and translated to other languages [Mark Greene] diff --git a/docs/changelogs/1.31.4.md b/docs/changelogs/1.31.4.md index ecf232845..462d732f7 100644 --- a/docs/changelogs/1.31.4.md +++ b/docs/changelogs/1.31.4.md @@ -4,27 +4,27 @@ Thank you to [Mark Greene](https://github.com/Hitjack007) for your contributions ## Features -- [Mark Greene] Added Peekaboo DPM +- Added Peekaboo DPM [Mark Greene] - Your Peekaboo DPM is lower than your normal DPM if your reload is faster than 10s as you'll have to wait for the remaining 10s for you to get unspotted before you can poke and shoot -- [Mark Greene] The test and owned tank filters are now more intuitive as clicking on them now turns the clicked option on instead of off -- [Mark Greene] Added a spall liner button to the Tankopedia beside the other equipment +- The test and owned tank filters are now more intuitive as clicking on them now turns the clicked option on instead of off [Mark Greene] +- Added a spall liner button to the Tankopedia beside the other equipment [Mark Greene] ## Fixes -- [Mark Greene] BlitzKit Session now properly handles tanks removed from the game -- [Mark Greene] Removed the Beta badge from the Equalizer button +- BlitzKit Session now properly handles tanks removed from the game [Mark Greene] +- Removed the Beta badge from the Equalizer button [Mark Greene] - Updated the background image for the Equalizer button to the actual banner of the new game mode -- [Mark Greene] The armor no longer disappears when you turn on Dynamic Armor System -- [Mark Greene] Camouflage values in Tankopedia are now more descriptive when shooting -- [Mark Greene] The contact shadows on the ground no longer grow & darken when switching between tabs +- The armor no longer disappears when you turn on Dynamic Armor System [Mark Greene] +- Camouflage values in Tankopedia are now more descriptive when shooting [Mark Greene] +- The contact shadows on the ground no longer grow & darken when switching between tabs [Mark Greene] - The "Help Translate BlitzKit" text on the home page is now properly centered vertically -- [Mark Greene] The footer now says "Branch" instead of "CDN" -- [Mark Greene] The game version in the footer now displays a shorthand version instead of the entire version number -- [Mark Greene] The reload visualizer now displays just 1 decimal place -- [Mark Greene] The search bar no longer redirects to a seemingly random tank when clicking enter when searching -- [Mark Greene] Tank search now properly handles the full names of tanks like the Super Pershing -- [Mark Greene] The loading bar below the name of the tanks in Tankopedia is now sufficiently spaced below -- [Mark Greene] The gun depression visualizer now properly handles the inherent tilt of tanks like the Minotauro +- The footer now says "Branch" instead of "CDN" [Mark Greene] +- The game version in the footer now displays a shorthand version instead of the entire version number [Mark Greene] +- The reload visualizer now displays just 1 decimal place [Mark Greene] +- The search bar no longer redirects to a seemingly random tank when clicking enter when searching [Mark Greene] +- Tank search now properly handles the full names of tanks like the Super Pershing [Mark Greene] +- The loading bar below the name of the tanks in Tankopedia is now sufficiently spaced below [Mark Greene] +- The gun depression visualizer now properly handles the inherent tilt of tanks like the Minotauro [Mark Greene] ## Technical Features