mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-22 03:07:04 +02:00
feat: migration 2
This commit is contained in:
1 parent
e1c8194beb
commit
6285f33989
305 files changed
+414
-414
No files matched your search
@@ -38,7 +38,6 @@
|
||||
"@resvg/resvg-js": "^2.6.2",
|
||||
"@types/three": "^0.160.0",
|
||||
"@vanilla-extract/css": "^1.15.5",
|
||||
"adm-zip": "^0.5.16",
|
||||
"bepaint": "^0.1.0-beta.3",
|
||||
"csv-parse": "^5.5.6",
|
||||
"decompress": "^4.2.1",
|
||||
@@ -53,10 +52,8 @@
|
||||
"markdown-escape": "^2.0.0",
|
||||
"markdown-to-jsx": "^7.5.0",
|
||||
"parse-dds": "^1.2.1",
|
||||
"pickleparser": "^0.2.1",
|
||||
"postprocessing": "^6.36.0",
|
||||
"progress": "^2.0.3",
|
||||
"protobufjs": "^7.4.0",
|
||||
"satori": "^0.10.14",
|
||||
"sharp": "^0.33.5",
|
||||
"three-stdlib": "^2.32.2",
|
||||
@@ -65,7 +62,6 @@
|
||||
},
|
||||
"_devDependencies": {
|
||||
"@total-typescript/ts-reset": "^0.5.1",
|
||||
"@types/adm-zip": "^0.5.5",
|
||||
"@types/bun": "latest",
|
||||
"@types/decompress": "^4.2.7",
|
||||
"@types/escape-html": "^1.0.4",
|
||||
|
||||
+5
-3
@@ -1,10 +1,10 @@
|
||||
import { Locale } from 'discord.js';
|
||||
import { Region } from '../../../constants/regions';
|
||||
import { Region } from '../../../../../src/constants/regions';
|
||||
import getTankHistories, {
|
||||
TankHistories,
|
||||
TankHistoryRaw,
|
||||
} from '../../blitzkit/getTankHistories';
|
||||
import { BlitzStats } from '../../statistics/compositeStats/constants';
|
||||
} from '../../../../../src/core/blitzkit/getTankHistories';
|
||||
import { BlitzStats } from '../../../../../src/core/statistics/compositeStats/constants';
|
||||
import { emptyAllStats } from './constants';
|
||||
|
||||
const emptyTankHistoryNode: TankHistoryRaw = {
|
||||
@@ -106,3 +106,5 @@ export default async function getStatsInPeriod(
|
||||
|
||||
return { diff, order } satisfies DiffedTankStats;
|
||||
}
|
||||
|
||||
export * from './constants';
|
||||
@@ -0,0 +1 @@
|
||||
export * from './getStatsInPeriod';
|
||||
@@ -2,7 +2,7 @@ import AdmZip from 'adm-zip';
|
||||
import { readFile, writeFile } from 'fs/promises';
|
||||
import { Parser } from 'pickleparser';
|
||||
import protobuf from 'protobufjs';
|
||||
import { ReadStream } from './buffer';
|
||||
import { ReadStream } from '../../../../core/src/streams/buffer';
|
||||
|
||||
interface WotbReplayMetaJson {
|
||||
version: string;
|
||||
@@ -8,9 +8,13 @@
|
||||
"lodash": "^4.17.21",
|
||||
"@prisma/client": "^5.19.1",
|
||||
"@octokit/plugin-throttling": "^8.2.0",
|
||||
"lz4js": "^0.2.0"
|
||||
"protobufjs": "^7.4.0",
|
||||
"lz4js": "^0.2.0",
|
||||
"pickleparser": "^0.2.1",
|
||||
"adm-zip": "^0.5.16"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/adm-zip": "^0.5.5",
|
||||
"@types/lodash": "^4.17.7",
|
||||
"@types/lz4js": "^0.2.1"
|
||||
}
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -6,3 +6,23 @@ export const TANK_CLASSES = [
|
||||
'heavyTank',
|
||||
'AT-SPG',
|
||||
] as const;
|
||||
|
||||
export const emptyAllStats: BlitzStats = {
|
||||
battles: 0,
|
||||
capture_points: 0,
|
||||
damage_dealt: 0,
|
||||
damage_received: 0,
|
||||
dropped_capture_points: 0,
|
||||
frags: 0,
|
||||
frags8p: 0,
|
||||
hits: 0,
|
||||
losses: 0,
|
||||
max_frags: 0,
|
||||
max_xp: 0,
|
||||
shots: 0,
|
||||
spotted: 0,
|
||||
survived_battles: 0,
|
||||
xp: 0,
|
||||
win_and_survived: 0,
|
||||
wins: 0,
|
||||
};
|
||||
@@ -1,3 +1,4 @@
|
||||
export * from './constants';
|
||||
export * from './idToRegion';
|
||||
export * from './permanentSkills';
|
||||
export * from './resolveNearPenetration';
|
||||
File renamed without changes.
+1
-1
@@ -1,5 +1,5 @@
|
||||
import { ProvisionDefinitions } from '@blitzkit/core/src/blitzkit/provisionDefinitions';
|
||||
import { checkConsumableProvisionInclusivity } from './checkConsumableProvisionInclusivity';
|
||||
import { ProvisionDefinitions } from './provisionDefinitions';
|
||||
import { GunDefinition, TankDefinition } from './tankDefinitions';
|
||||
|
||||
export function availableProvisions(
|
||||
+1
-2
@@ -1,6 +1,5 @@
|
||||
import { Samples } from '.';
|
||||
import { emptyAllStats } from '../../blitzstars/getStatsInPeriod/constants';
|
||||
import { BlitzkitStats } from '../../statistics/compositeStats/constants';
|
||||
import { emptyAllStats } from '../../blitz/constants';
|
||||
|
||||
export const emptyAverageDefinitionsAllStats: BlitzkitStats = {
|
||||
...emptyAllStats,
|
||||
+6
-4
@@ -1,5 +1,5 @@
|
||||
import { decode } from '../../protobuf/decode';
|
||||
import { BlitzkitStats } from '../../statistics/compositeStats/constants';
|
||||
import { BlitzkitStats } from '../../../../../src/core/statistics/compositeStats/constants';
|
||||
import { decodeProtobuf } from '../../protobuf/decodeProtobuf';
|
||||
import { asset } from '../asset';
|
||||
|
||||
export interface AverageDefinitionsEntry {
|
||||
@@ -51,7 +51,7 @@ export const averageDefinitions = fetch(asset('averages/manifest.json'), {
|
||||
.then((manifest) => fetch(asset(`averages/${manifest.latest}.pb`)))
|
||||
.then((response) => response.arrayBuffer())
|
||||
.then((buffer) =>
|
||||
decode<AverageDefinitions>(
|
||||
decodeProtobuf<AverageDefinitions>(
|
||||
'average_definitions',
|
||||
'blitzkit.AverageDefinitions',
|
||||
new Uint8Array(buffer),
|
||||
@@ -65,7 +65,9 @@ export const averageDefinitionsArray = averageDefinitions.then((data) =>
|
||||
({
|
||||
id: Number(key),
|
||||
...(value as AverageDefinitionsEntry),
|
||||
}) satisfies AverageDefinitionsEntryWithId,
|
||||
} satisfies AverageDefinitionsEntryWithId),
|
||||
)
|
||||
.filter((tank) => tank.mu.battles > 0),
|
||||
);
|
||||
|
||||
export * from './constants';
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
import { ConsumableEntry } from './consumableDefinitions';
|
||||
import { ProvisionEntry } from './provisionDefinitions';
|
||||
import { ConsumableEntry } from '@blitzkit/core/src/blitzkit/consumableDefinitions';
|
||||
import { ProvisionEntry } from '@blitzkit/core/src/blitzkit/provisionDefinitions';
|
||||
import { GunDefinition, TankDefinition } from './tankDefinitions';
|
||||
|
||||
export function checkConsumableProvisionInclusivity(
|
||||
File renamed without changes.
File renamed without changes.
+2
-2
@@ -1,5 +1,5 @@
|
||||
import { permanentSkills } from '../../app/tools/tankopedia/[id]/components/Characteristics/components/Skills/constants';
|
||||
import { SkillDefinitions } from './skillDefinitions';
|
||||
import { SkillDefinitions } from '@blitzkit/core/src/blitzkit/skillDefinitions';
|
||||
import { permanentSkills } from '../blitz/permanentSkills';
|
||||
|
||||
export function createDefaultSkills(skillDefinitions: SkillDefinitions) {
|
||||
const skills: Record<string, number> = {};
|
||||
File renamed without changes.
File renamed without changes.
@@ -1,12 +1,30 @@
|
||||
export * from './assertSecret';
|
||||
export * from './asset';
|
||||
export * from './availableProvisions';
|
||||
export * from './averageDefinitions';
|
||||
export * from './camouflageDefinitions';
|
||||
export * from './checkConsumableProvisionInclusivity';
|
||||
export * from './coefficient';
|
||||
export * from './consumableDefinitions';
|
||||
export * from './createDefaultSkills';
|
||||
export * from './equipmentDefinitions';
|
||||
export * from './eventManager';
|
||||
export * from './fetchCdonLz4';
|
||||
export * from './filterTank';
|
||||
export * from './gameDefinitions';
|
||||
export * from './isExplosive';
|
||||
export * from './modelDefinitions';
|
||||
export * from './pose';
|
||||
export * from './provisionDefinitions';
|
||||
export * from './resolvePenetrationCoefficient';
|
||||
export * from './reviews';
|
||||
export * from './skillDefinitions';
|
||||
export * from './sum';
|
||||
export * from './superCompress';
|
||||
export * from './superDecompress';
|
||||
export * from './tankCharacteristics';
|
||||
export * from './tankDefinitions';
|
||||
export * from './tankIcon';
|
||||
export * from './tankNames';
|
||||
export * from './uniqueGuns';
|
||||
export * from './youtubers';
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ShellDefinition, ShellType } from '../blitzkit/tankDefinitions';
|
||||
import { ShellDefinition, ShellType } from '@blitzkit/core';
|
||||
|
||||
export function isExplosive(
|
||||
type: ShellDefinition['type'],
|
||||
File renamed without changes.
+1
-1
@@ -1,5 +1,5 @@
|
||||
import { TankFilterDefinition } from '@blitzkit/core/src/blitzkit/consumableDefinitions';
|
||||
import { asset } from './asset';
|
||||
import { TankFilterDefinition } from './consumableDefinitions';
|
||||
import { fetchCdonLz4 } from './fetchCdonLz4';
|
||||
|
||||
export type ProvisionEntry = {
|
||||
File renamed without changes.
@@ -1,5 +1,5 @@
|
||||
import { decode } from '../protobuf/decode';
|
||||
import { asset } from '@blitzkit/core/src/blitzkit/asset';
|
||||
import { decodeProtobuf } from '../protobuf';
|
||||
|
||||
export interface Reviews {
|
||||
reviews: Record<number, Review>;
|
||||
@@ -18,5 +18,9 @@ export interface Video {
|
||||
export const reviews = fetch(asset('definitions/reviews.pb'))
|
||||
.then((response) => response.arrayBuffer())
|
||||
.then((buffer) =>
|
||||
decode<Reviews>('reviews', 'blitzkit.Reviews', new Uint8Array(buffer)),
|
||||
decodeProtobuf<Reviews>(
|
||||
'reviews',
|
||||
'blitzkit.Reviews',
|
||||
new Uint8Array(buffer),
|
||||
),
|
||||
);
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
import { TankClass } from '../../components/Tanks';
|
||||
import { asset } from '@blitzkit/core/src/blitzkit/asset';
|
||||
import { fetchCdonLz4 } from '@blitzkit/core/src/blitzkit/fetchCdonLz4';
|
||||
import { TankClass } from '../../../../src/components/Tanks';
|
||||
|
||||
export interface SkillDefinitions {
|
||||
classes: Record<TankClass, string[]>;
|
||||
File renamed without changes.
@@ -1,5 +1,5 @@
|
||||
import { compress } from 'lz4js';
|
||||
import { CdonWriteStream } from '../../../../src/core/streams/cdon';
|
||||
import { CdonWriteStream } from '../streams';
|
||||
|
||||
export function superCompress(object: any) {
|
||||
const write = new CdonWriteStream().cdon(object);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { decompress } from 'lz4js';
|
||||
import { CdonReadStream } from '../../../../src/core/streams/cdon';
|
||||
import { CdonReadStream } from '../streams';
|
||||
|
||||
export function superDecompress<Type>(buffer: ArrayBuffer) {
|
||||
const decompressed = decompress(new Uint8Array(buffer)).buffer as ArrayBuffer;
|
||||
|
||||
+6
-11
@@ -1,15 +1,11 @@
|
||||
import { EquipmentDefinitions } from '@blitzkit/core/src/blitzkit/equipmentDefinitions';
|
||||
import { ModelDefinition } from '@blitzkit/core/src/blitzkit/modelDefinitions';
|
||||
import { resolveNearPenetration } from '@blitzkit/core/src/blitzkit/resolveNearPenetration';
|
||||
import { EquipmentMatrix } from '../../../packages/website/src/stores/duel';
|
||||
import { isExplosive } from '../blitz/isExplosive';
|
||||
import { resolvePenetrationCoefficient } from '../blitz/resolvePenetrationCoefficient';
|
||||
import { ProvisionDefinitions } from '@blitzkit/core/src/blitzkit/provisionDefinitions';
|
||||
import { EquipmentMatrix } from '../../../website/src/stores/duel';
|
||||
import { resolveNearPenetration } from '../blitz/resolveNearPenetration';
|
||||
import { coefficient } from './coefficient';
|
||||
import { degressiveStat } from './degressiveStat';
|
||||
import { EquipmentDefinitions } from './equipmentDefinitions';
|
||||
import { normalizeBoundingBox } from './normalizeBoundingBox';
|
||||
import { progressiveStat } from './progressiveStat';
|
||||
import { ProvisionDefinitions } from './provisionDefinitions';
|
||||
import { resolveDpm } from './resolveDpm';
|
||||
import { isExplosive } from './isExplosive';
|
||||
import { resolvePenetrationCoefficient } from './resolvePenetrationCoefficient';
|
||||
import { sum } from './sum';
|
||||
import {
|
||||
EngineDefinition,
|
||||
@@ -19,7 +15,6 @@ import {
|
||||
TrackDefinition,
|
||||
TurretDefinition,
|
||||
} from './tankDefinitions';
|
||||
import { unionBoundingBox } from './unionBoundingBox';
|
||||
|
||||
export type TankCharacteristics = ReturnType<typeof tankCharacteristics>;
|
||||
|
||||
File renamed without changes.
File renamed without changes.
@@ -1,5 +1,10 @@
|
||||
export * from './blitz';
|
||||
export * from './blitzkit';
|
||||
export * from './imgur';
|
||||
export * from './math';
|
||||
export * from './patreon';
|
||||
export * from './protobuf';
|
||||
export * from './radix';
|
||||
export * from './statistics';
|
||||
export * from './streams';
|
||||
export * from './zustand';
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,7 @@
|
||||
export * from './axis';
|
||||
export * from './formatCompact';
|
||||
export * from './isNumber';
|
||||
export * from './NaNFallback';
|
||||
export * from './normalizeAngleRad';
|
||||
export * from './normalToEuler';
|
||||
export * from './numberToRomanNumeral';
|
||||
File renamed without changes.
@@ -1,5 +1,5 @@
|
||||
import { Euler, Quaternion, Vector3 } from 'three';
|
||||
import { J_HAT } from '../../constants/axis';
|
||||
import { J_HAT } from './axis';
|
||||
|
||||
const quaternion = new Quaternion();
|
||||
const axis = new Vector3();
|
||||
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,9 @@
|
||||
import { lookupProtobufType, ProtoSource } from './lookupProtobufType';
|
||||
|
||||
export function decodeProtobuf<Type>(
|
||||
source: ProtoSource,
|
||||
type: string,
|
||||
data: Uint8Array,
|
||||
) {
|
||||
return lookupProtobufType(source, type).decode(data).toJSON() as Type;
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
import { lookup, ProtoSource } from './lookup';
|
||||
import { lookupProtobufType, ProtoSource } from './lookupProtobufType';
|
||||
|
||||
export function encode(
|
||||
export function encodeProtobuf(
|
||||
source: ProtoSource,
|
||||
type: string,
|
||||
data: Record<string, any>,
|
||||
) {
|
||||
const message = lookup(source, type);
|
||||
const message = lookupProtobufType(source, type);
|
||||
const verification = message.verify(data);
|
||||
|
||||
if (verification !== null) throw new Error(verification);
|
||||
@@ -0,0 +1,11 @@
|
||||
import { encodeProtobuf } from './encodeProtobuf';
|
||||
import { ProtoSource } from './lookupProtobufType';
|
||||
|
||||
export async function encodeProtobufToBase64(
|
||||
source: ProtoSource,
|
||||
type: string,
|
||||
data: any,
|
||||
) {
|
||||
const array = encodeProtobuf(source, type, data);
|
||||
return Buffer.from(array).toString('base64');
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
export * from './decodeProtobuf';
|
||||
export * from './encodeProtobuf';
|
||||
export * from './encodeProtobufToBase64';
|
||||
export * from './lookupProtobufType';
|
||||
@@ -0,0 +1,11 @@
|
||||
import { parse } from 'protobufjs';
|
||||
import average_definitions from '../../protos/average_definitions.proto';
|
||||
import reviews from '../../protos/reviews.proto';
|
||||
|
||||
export type ProtoSource = keyof typeof protos;
|
||||
|
||||
const protos = { reviews, average_definitions };
|
||||
|
||||
export function lookupProtobufType(source: ProtoSource, type: string) {
|
||||
return parse(protos[source]).root.lookupType(type);
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export * from './var';
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
+7
-1
@@ -52,10 +52,16 @@ export function compositeStats(stats: BlitzkitStats, average: BlitzkitStats) {
|
||||
export function formatCompositeStat(value: number, key: CompositeStatsKey) {
|
||||
const formatting = compositeStatsFormatting[key];
|
||||
const resolvedValue = (formatting.coefficient ?? 1) * value;
|
||||
return `${formatting.localeFormat ? resolvedValue.toLocaleString() : resolvedValue.toFixed(formatting.fixed)}${formatting.unit ?? ''}`;
|
||||
return `${
|
||||
formatting.localeFormat
|
||||
? resolvedValue.toLocaleString()
|
||||
: resolvedValue.toFixed(formatting.fixed)
|
||||
}${formatting.unit ?? ''}`;
|
||||
}
|
||||
|
||||
export function previewCompositeStat(key: CompositeStatsKey) {
|
||||
const { preview } = compositeStatsFormatting[key];
|
||||
return formatCompositeStat(preview, key);
|
||||
}
|
||||
|
||||
export * from './constants';
|
||||
File renamed without changes.
@@ -1,8 +1,3 @@
|
||||
import {
|
||||
emptyIndividualTankStats,
|
||||
IndividualTankStats,
|
||||
} from '../../types/tanksStats';
|
||||
|
||||
export function deltaTankStats(
|
||||
tanksA: IndividualTankStats[],
|
||||
tanksB: IndividualTankStats[],
|
||||
@@ -1,8 +1,4 @@
|
||||
import { TreeType } from '../../components/Tanks';
|
||||
import { SupplementaryStats } from '../blitz/getAccountInfo';
|
||||
import { tankDefinitions } from '../blitzkit/tankDefinitions';
|
||||
import { DiffedTankStats } from '../blitzstars/getStatsInPeriod';
|
||||
import { tankAverages } from '../blitzstars/tankAverages';
|
||||
import calculateWN8 from './calculateWN8';
|
||||
import sumStats from './sumStats';
|
||||
|
||||
File renamed without changes.
File renamed without changes.
+1
-1
@@ -1,4 +1,4 @@
|
||||
import { Percentile } from '../../constants/percentiles';
|
||||
import { Percentile } from './percentiles';
|
||||
|
||||
const WN8_PERCENTILES: [number, Percentile][] = [
|
||||
[0, Percentile.VeryBad],
|
||||
@@ -0,0 +1,10 @@
|
||||
export * from './calculateWN8';
|
||||
export * from './compositeStats';
|
||||
export * from './deltaBkrlBlitzStats';
|
||||
export * from './deltaTankStats';
|
||||
export * from './filterStats';
|
||||
export * from './getBkniPercentile';
|
||||
export * from './getTierWeights';
|
||||
export * from './getWN8Percentile';
|
||||
export * from './percentiles';
|
||||
export * from './sumStats';
|
||||
File renamed without changes.
@@ -1,4 +1,3 @@
|
||||
import { emptyAllStats } from '../blitzstars/getStatsInPeriod/constants';
|
||||
import { BlitzStats } from './compositeStats/constants';
|
||||
|
||||
export default function sumStats(allStatsCollection: BlitzStats[]) {
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,11 @@
|
||||
export * from './bkrl';
|
||||
export * from './buffer';
|
||||
export * from './cdon';
|
||||
export * from './dds';
|
||||
export * from './dids';
|
||||
export * from './pvr';
|
||||
export * from './rts';
|
||||
export * from './sc2';
|
||||
export * from './scg';
|
||||
export * from './scpg';
|
||||
export * from './windows';
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,3 +1,6 @@
|
||||
// MIGRATION TODO: i added this use client, it makes stuff work again?
|
||||
'use client';
|
||||
|
||||
import { Draft, produce } from 'immer';
|
||||
import {
|
||||
createContext,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { permanentSkills } from '@blitzkit/core/src/blitz/permanentSkills';
|
||||
import { ComponentPlaceholderIcon } from '@radix-ui/react-icons';
|
||||
import { Button, Flex, Popover, Slider, Table, Text } from '@radix-ui/themes';
|
||||
import { debounce, times } from 'lodash';
|
||||
@@ -21,7 +22,6 @@ import { BlitzkitButtonGray } from '../../../../icons/BlitzkitButtonGray';
|
||||
import { theme } from '../../../../stitches.config';
|
||||
import * as CompareEphemeral from '../../../../stores/compareEphemeral';
|
||||
import { EquipmentMatrix } from '../../../../stores/duel';
|
||||
import { permanentSkills } from '../../tankopedia/[id]/components/Characteristics/components/Skills/constants';
|
||||
import { Body } from './Body';
|
||||
import { InsertionMarker } from './IntersectionMarker';
|
||||
import { TankCard } from './TankCard';
|
||||
@@ -101,8 +101,8 @@ export function CompareTable({ stats }: CompareTableProps) {
|
||||
crewSkills[skill] === 0
|
||||
? theme.colors.textLowContrast
|
||||
: permanentSkills.includes(skill)
|
||||
? theme.colors.textLowContrast_crimson
|
||||
: theme.colors.textLowContrast_amber,
|
||||
? theme.colors.textLowContrast_crimson
|
||||
: theme.colors.textLowContrast_amber,
|
||||
}}
|
||||
/>
|
||||
))}
|
||||
|
||||
+4
-2
@@ -1,3 +1,7 @@
|
||||
import {
|
||||
checkConsumableProvisionInclusivity,
|
||||
consumableDefinitions,
|
||||
} from '@blitzkit/core';
|
||||
import { InfoCircledIcon } from '@radix-ui/react-icons';
|
||||
import {
|
||||
Button,
|
||||
@@ -9,8 +13,6 @@ import {
|
||||
} from '@radix-ui/themes';
|
||||
import { use } from 'react';
|
||||
import { ConsumablesManager } from '../../../../../../../components/ConsumablesManager';
|
||||
import { checkConsumableProvisionInclusivity } from '../../../../../../../core/blitzkit/checkConsumableProvisionInclusivity';
|
||||
import { consumableDefinitions } from '../../../../../../../core/blitzkit/consumableDefinitions';
|
||||
import { useEquipment } from '../../../../../../../hooks/useEquipment';
|
||||
import * as Duel from '../../../../../../../stores/duel';
|
||||
import { ConfigurationChildWrapper } from './ConfigurationChildWrapper';
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
import { equipmentDefinitions } from '@blitzkit/core';
|
||||
import { Button, Flex, Heading } from '@radix-ui/themes';
|
||||
import { use } from 'react';
|
||||
import { EquipmentManager } from '../../../../../../../components/EquipmentManager';
|
||||
import { equipmentDefinitions } from '../../../../../../../core/blitzkit/equipmentDefinitions';
|
||||
import * as Duel from '../../../../../../../stores/duel';
|
||||
import { ConfigurationChildWrapper } from './ConfigurationChildWrapper';
|
||||
|
||||
|
||||
+3
-8
@@ -1,14 +1,12 @@
|
||||
import { CaretDownIcon, CaretUpIcon } from '@radix-ui/react-icons';
|
||||
import { Flex, Text } from '@radix-ui/themes';
|
||||
import { ReactNode } from 'react';
|
||||
import { theme } from '../../../../../../../stitches.config';
|
||||
|
||||
export interface InfoProps {
|
||||
name: ReactNode;
|
||||
children?: ReactNode;
|
||||
unit?: string;
|
||||
indent?: boolean;
|
||||
highlight?: boolean;
|
||||
delta?: number;
|
||||
decimals?: number;
|
||||
prefix?: string;
|
||||
@@ -20,7 +18,6 @@ export function Info({
|
||||
children,
|
||||
unit,
|
||||
indent = false,
|
||||
highlight,
|
||||
delta,
|
||||
decimals,
|
||||
prefix,
|
||||
@@ -32,7 +29,7 @@ export function Info({
|
||||
style={{ width: '100%', paddingLeft: indent ? 24 : 0 }}
|
||||
gap="4"
|
||||
>
|
||||
<Text color={highlight ? 'amber' : 'gray'}>
|
||||
<Text color="gray">
|
||||
{name}
|
||||
{unit != undefined && (
|
||||
<>
|
||||
@@ -49,9 +46,7 @@ export function Info({
|
||||
style={{
|
||||
flex: 1,
|
||||
height: 1,
|
||||
backgroundColor: highlight
|
||||
? theme.colors.componentCallToActionInteractive_amberAlpha
|
||||
: theme.colors.componentCallToActionInteractive_alpha,
|
||||
backgroundColor: 'red',
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
@@ -82,7 +77,7 @@ export function Info({
|
||||
</Text>
|
||||
</>
|
||||
)}
|
||||
<Text color={highlight ? 'amber' : undefined}>
|
||||
<Text>
|
||||
{prefix}
|
||||
{decimals !== undefined && typeof children === 'number'
|
||||
? children.toFixed(decimals)
|
||||
|
||||
+5
-5
@@ -1,8 +1,8 @@
|
||||
import { asset } from '@blitzkit/core';
|
||||
import { Flex, Heading, Slider, TextField } from '@radix-ui/themes';
|
||||
import { clamp, debounce } from 'lodash';
|
||||
import { useEffect, useMemo, useRef, useState } from 'react';
|
||||
import { GenericTankComponentButton } from '../../../../../../../components/ModuleButtons/GenericTankComponentButton';
|
||||
import { asset } from '../../../../../../../core/blitzkit/asset';
|
||||
import * as Duel from '../../../../../../../stores/duel';
|
||||
import { ConfigurationChildWrapper } from './ConfigurationChildWrapper';
|
||||
|
||||
@@ -61,10 +61,10 @@ export function Miscellaneous() {
|
||||
cooldownBooster === 0
|
||||
? undefined
|
||||
: cooldownBooster === 1
|
||||
? '#afb0abc0'
|
||||
: cooldownBooster === 2
|
||||
? '#5f72cbc0'
|
||||
: '#9b3cc0c0'
|
||||
? '#afb0abc0'
|
||||
: cooldownBooster === 2
|
||||
? '#5f72cbc0'
|
||||
: '#9b3cc0c0'
|
||||
}
|
||||
iconStyles={{
|
||||
transform: 'translate(-50%, -50%) scale(0.8)',
|
||||
|
||||
+22
-25
@@ -1,3 +1,10 @@
|
||||
import {
|
||||
asset,
|
||||
formatCompact,
|
||||
tankDefinitions,
|
||||
tankIcon,
|
||||
TIER_ROMAN_NUMERALS,
|
||||
} from '@blitzkit/core';
|
||||
import {
|
||||
Button,
|
||||
ChevronDownIcon,
|
||||
@@ -8,18 +15,6 @@ import {
|
||||
Text,
|
||||
} from '@radix-ui/themes';
|
||||
import { use } from 'react';
|
||||
import { asset } from '../../../../../../../core/blitzkit/asset';
|
||||
import {
|
||||
ModuleDefinition,
|
||||
ModuleType,
|
||||
TankDefinition,
|
||||
tankDefinitions,
|
||||
Tier,
|
||||
Unlock,
|
||||
} from '../../../../../../../core/blitzkit/tankDefinitions';
|
||||
import { TIER_ROMAN_NUMERALS } from '../../../../../../../core/blitzkit/tankDefinitions/constants';
|
||||
import { tankIcon } from '../../../../../../../core/blitzkit/tankIcon';
|
||||
import { formatCompact } from '../../../../../../../core/math/formatCompact';
|
||||
import * as Duel from '../../../../../../../stores/duel';
|
||||
import { ConfigurationChildWrapper } from './ConfigurationChildWrapper';
|
||||
|
||||
@@ -222,7 +217,9 @@ export function Modules() {
|
||||
<div
|
||||
style={{
|
||||
backgroundColor: 'currentcolor',
|
||||
width: `calc(${central ? 100 : 50}% + ${central ? 8 : 4}px)`,
|
||||
width: `calc(${central ? 100 : 50}% + ${
|
||||
central ? 8 : 4
|
||||
}px)`,
|
||||
height: 1,
|
||||
position: 'absolute',
|
||||
right: first ? 0 : undefined,
|
||||
@@ -262,23 +259,23 @@ export function Modules() {
|
||||
(unlock.type === 'turret'
|
||||
? turret.id
|
||||
: unlock.type === 'gun'
|
||||
? gun.id
|
||||
: unlock.type === 'engine'
|
||||
? engine.id
|
||||
: unlock.type === 'chassis'
|
||||
? track.id
|
||||
: -1) === unlock.id
|
||||
? gun.id
|
||||
: unlock.type === 'engine'
|
||||
? engine.id
|
||||
: unlock.type === 'chassis'
|
||||
? track.id
|
||||
: -1) === unlock.id
|
||||
}
|
||||
top={
|
||||
unlock.type === 'turret'
|
||||
? module.id == topTurret.id
|
||||
: unlock.type === 'gun'
|
||||
? module.id === topGun.id
|
||||
: unlock.type === 'engine'
|
||||
? module.id === topEngine.id
|
||||
: unlock.type === 'chassis'
|
||||
? module.id === topTrack.id
|
||||
: false
|
||||
? module.id === topGun.id
|
||||
: unlock.type === 'engine'
|
||||
? module.id === topEngine.id
|
||||
: unlock.type === 'chassis'
|
||||
? module.id === topTrack.id
|
||||
: false
|
||||
}
|
||||
onClick={() => setByUnlock(unlock)}
|
||||
/>
|
||||
|
||||
+1
-2
@@ -1,8 +1,7 @@
|
||||
import { availableProvisions, provisionDefinitions } from '@blitzkit/core';
|
||||
import { Button, Flex, Heading } from '@radix-ui/themes';
|
||||
import { use } from 'react';
|
||||
import { ProvisionsManager } from '../../../../../../../components/ProvisionsManager';
|
||||
import { availableProvisions } from '../../../../../../../core/blitzkit/availableProvisions';
|
||||
import { provisionDefinitions } from '../../../../../../../core/blitzkit/provisionDefinitions';
|
||||
import * as Duel from '../../../../../../../stores/duel';
|
||||
import { ConfigurationChildWrapper } from './ConfigurationChildWrapper';
|
||||
|
||||
|
||||
+1
-2
@@ -1,3 +1,4 @@
|
||||
import { createDefaultSkills, skillDefinitions } from '@blitzkit/core';
|
||||
import { InfoCircledIcon } from '@radix-ui/react-icons';
|
||||
import {
|
||||
Button,
|
||||
@@ -10,8 +11,6 @@ import {
|
||||
} from '@radix-ui/themes';
|
||||
import { use } from 'react';
|
||||
import { CrewSkillManager } from '../../../../../../../../components/CrewSkillManager';
|
||||
import { createDefaultSkills } from '../../../../../../../../core/blitzkit/createDefaultSkills';
|
||||
import { skillDefinitions } from '../../../../../../../../core/blitzkit/skillDefinitions';
|
||||
import * as TankopediaEphemeral from '../../../../../../../../stores/tankopediaEphemeral';
|
||||
import { ConfigurationChildWrapper } from '../ConfigurationChildWrapper';
|
||||
|
||||
|
||||
+14
-13
@@ -1,3 +1,14 @@
|
||||
import {
|
||||
asset,
|
||||
coefficient,
|
||||
CREW_MEMBER_NAMES,
|
||||
equipmentDefinitions,
|
||||
GUN_TYPE_NAMES,
|
||||
isExplosive,
|
||||
provisionDefinitions,
|
||||
resolvePenetrationCoefficient,
|
||||
tankCharacteristics,
|
||||
} from '@blitzkit/core';
|
||||
import { AccessibilityIcon, InfoCircledIcon } from '@radix-ui/react-icons';
|
||||
import {
|
||||
Flex,
|
||||
@@ -13,18 +24,6 @@ import { debounce } from 'lodash';
|
||||
import { Fragment, use, useEffect, useRef, useState } from 'react';
|
||||
import { lerp } from 'three/src/math/MathUtils';
|
||||
import { Ad, AdType } from '../../../../../../components/Ad';
|
||||
import { applyPitchYawLimits } from '../../../../../../core/blitz/applyPitchYawLimits';
|
||||
import { isExplosive } from '../../../../../../core/blitz/isExplosive';
|
||||
import { resolvePenetrationCoefficient } from '../../../../../../core/blitz/resolvePenetrationCoefficient';
|
||||
import { asset } from '../../../../../../core/blitzkit/asset';
|
||||
import { coefficient } from '../../../../../../core/blitzkit/coefficient';
|
||||
import { equipmentDefinitions } from '../../../../../../core/blitzkit/equipmentDefinitions';
|
||||
import { provisionDefinitions } from '../../../../../../core/blitzkit/provisionDefinitions';
|
||||
import { tankCharacteristics } from '../../../../../../core/blitzkit/tankCharacteristics';
|
||||
import {
|
||||
CREW_MEMBER_NAMES,
|
||||
GUN_TYPE_NAMES,
|
||||
} from '../../../../../../core/blitzkit/tankDefinitions/constants';
|
||||
import { useAdExempt } from '../../../../../../hooks/useAdExempt';
|
||||
import { useEquipment } from '../../../../../../hooks/useEquipment';
|
||||
import { useTankModelDefinition } from '../../../../../../hooks/useTankModelDefinition';
|
||||
@@ -463,7 +462,9 @@ export function Characteristics() {
|
||||
<Fragment key={member.type}>
|
||||
<InfoWithDelta
|
||||
key={`${member.type}-root`}
|
||||
name={`${CREW_MEMBER_NAMES[member.type]}${count > 1 ? ` x ${count}` : ''}`}
|
||||
name={`${CREW_MEMBER_NAMES[member.type]}${
|
||||
count > 1 ? ` x ${count}` : ''
|
||||
}`}
|
||||
unit="%"
|
||||
decimals={0}
|
||||
>
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
import { Pose } from '@blitzkit/core';
|
||||
import { OrbitControls } from '@react-three/drei';
|
||||
import { useThree } from '@react-three/fiber';
|
||||
import { useEffect, useRef, useState } from 'react';
|
||||
import { Vector3 } from 'three';
|
||||
import { OrbitControls as OrbitControlsClass } from 'three-stdlib';
|
||||
import { applyPitchYawLimits } from '../../../../../core/blitz/applyPitchYawLimits';
|
||||
import { hasEquipment } from '../../../../../core/blitzkit/hasEquipment';
|
||||
import { modelDefinitions } from '../../../../../core/blitzkit/modelDefinitions';
|
||||
import { Pose, poseEvent } from '../../../../../core/blitzkit/pose';
|
||||
import { useAwait } from '../../../../../hooks/useAwait';
|
||||
import * as Duel from '../../../../../stores/duel';
|
||||
import * as TankopediaEphemeral from '../../../../../stores/tankopediaEphemeral';
|
||||
|
||||
+12
-6
@@ -1,9 +1,11 @@
|
||||
import {
|
||||
asset,
|
||||
consumableDefinitions,
|
||||
gameDefinitions,
|
||||
provisionDefinitions,
|
||||
} from '@blitzkit/core';
|
||||
import { Box, Flex, Heading, Text } from '@radix-ui/themes';
|
||||
import { use } from 'react';
|
||||
import { asset } from '../../../../../../core/blitzkit/asset';
|
||||
import { consumableDefinitions } from '../../../../../../core/blitzkit/consumableDefinitions';
|
||||
import { gameDefinitions } from '../../../../../../core/blitzkit/gameDefinitions';
|
||||
import { provisionDefinitions } from '../../../../../../core/blitzkit/provisionDefinitions';
|
||||
import * as Duel from '../../../../../../stores/duel';
|
||||
|
||||
export function GameModeSection() {
|
||||
@@ -33,7 +35,9 @@ export function GameModeSection() {
|
||||
direction="column"
|
||||
style={{
|
||||
borderRadius: 'var(--radius-3)',
|
||||
background: `url(${asset(`icons/game_mode_banners/${id}.webp`)})`,
|
||||
background: `url(${asset(
|
||||
`icons/game_mode_banners/${id}.webp`,
|
||||
)})`,
|
||||
backgroundSize: 'cover',
|
||||
backgroundPosition: 'center',
|
||||
}}
|
||||
@@ -41,7 +45,9 @@ export function GameModeSection() {
|
||||
<Box
|
||||
flexGrow="1"
|
||||
style={{
|
||||
background: `url(${asset(`icons/game_mode_banners/${id}.webp`)})`,
|
||||
background: `url(${asset(
|
||||
`icons/game_mode_banners/${id}.webp`,
|
||||
)})`,
|
||||
backgroundSize: 'cover',
|
||||
backgroundPosition: 'center',
|
||||
}}
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
import { resolveNearPenetration, tankDefinitions, Var } from '@blitzkit/core';
|
||||
import { Box, Flex, Heading, Text } from '@radix-ui/themes';
|
||||
import { Suspense, use, useEffect, useMemo, useRef, useState } from 'react';
|
||||
import { ThicknessRange } from '../../../../../../components/Armor/components/StaticArmor';
|
||||
import { classIcons } from '../../../../../../components/ClassIcon';
|
||||
import { NAVBAR_HEIGHT } from '../../../../../../components/Navbar/index.css';
|
||||
import { resolveNearPenetration } from '../../../../../../core/blitz/resolveNearPenetration';
|
||||
import { tankDefinitions } from '../../../../../../core/blitzkit/tankDefinitions';
|
||||
import { Var } from '../../../../../../core/blitzkit/var';
|
||||
import { useFullScreen } from '../../../../../../hooks/useFullScreen';
|
||||
import * as Duel from '../../../../../../stores/duel';
|
||||
import { TankSandbox } from './TankSandbox';
|
||||
@@ -22,8 +19,8 @@ export function HeroSection() {
|
||||
protagonist.treeType === 'collector'
|
||||
? 'blue'
|
||||
: protagonist.treeType === 'premium'
|
||||
? 'amber'
|
||||
: undefined;
|
||||
? 'amber'
|
||||
: undefined;
|
||||
const awaitedTankDefinitions = use(tankDefinitions);
|
||||
const thicknessRange = useMemo(() => {
|
||||
const entries = Object.values(awaitedTankDefinitions);
|
||||
|
||||
+20
-11
@@ -1,15 +1,16 @@
|
||||
import {
|
||||
assertSecret,
|
||||
asset,
|
||||
modelDefinitions,
|
||||
provisionDefinitions,
|
||||
} from '@blitzkit/core';
|
||||
import strings from '@blitzkit/core/lang/en-US.json';
|
||||
import { ChevronLeftIcon, MixIcon, UpdateIcon } from '@radix-ui/react-icons';
|
||||
import { Button, Code, Dialog, Flex } from '@radix-ui/themes';
|
||||
import { use, useState } from 'react';
|
||||
import { classIcons } from '../../../../../../../components/ClassIcon';
|
||||
import { Link } from '../../../../../../../components/Link';
|
||||
import { ScienceIcon } from '../../../../../../../components/ScienceIcon';
|
||||
import { asset } from '../../../../../../../core/blitzkit/asset';
|
||||
import { modelDefinitions } from '../../../../../../../core/blitzkit/modelDefinitions';
|
||||
import { provisionDefinitions } from '../../../../../../../core/blitzkit/provisionDefinitions';
|
||||
import { assertSecret } from '../../../../../../../core/blitzkit/secret';
|
||||
import { tankToDuelMember } from '../../../../../../../core/blitzkit/tankToDuelMember';
|
||||
import strings from '../../../../../../../lang/en-US.json';
|
||||
import * as App from '../../../../../../../stores/app';
|
||||
import * as Duel from '../../../../../../../stores/duel';
|
||||
import * as TankopediaEphemeral from '../../../../../../../stores/tankopediaEphemeral';
|
||||
@@ -132,8 +133,8 @@ export function MetaSection() {
|
||||
protagonist.treeType === 'collector'
|
||||
? 'blue'
|
||||
: protagonist.treeType === 'premium'
|
||||
? 'amber'
|
||||
: undefined
|
||||
? 'amber'
|
||||
: undefined
|
||||
}
|
||||
>
|
||||
{strings.common.tree_type[protagonist.treeType]}
|
||||
@@ -159,7 +160,11 @@ export function MetaSection() {
|
||||
</Listing>
|
||||
)}
|
||||
<Listing
|
||||
label={`${protagonist.treeType === 'researchable' ? 'Purchase' : 'Restoration'} price`}
|
||||
label={`${
|
||||
protagonist.treeType === 'researchable'
|
||||
? 'Purchase'
|
||||
: 'Restoration'
|
||||
} price`}
|
||||
>
|
||||
<Flex align="center" gap="1">
|
||||
{protagonist.price.value.toLocaleString()}
|
||||
@@ -167,7 +172,9 @@ export function MetaSection() {
|
||||
style={{ width: '1em', height: '1em' }}
|
||||
alt={protagonist.price.type}
|
||||
src={asset(
|
||||
`icons/currencies/${protagonist.price.type === 'gold' ? 'gold' : 'silver'}.webp`,
|
||||
`icons/currencies/${
|
||||
protagonist.price.type === 'gold' ? 'gold' : 'silver'
|
||||
}.webp`,
|
||||
)}
|
||||
/>
|
||||
</Flex>
|
||||
@@ -179,7 +186,9 @@ export function MetaSection() {
|
||||
style={{ width: '1em', height: '1em' }}
|
||||
alt={protagonist.price.type}
|
||||
src={asset(
|
||||
`icons/currencies/${protagonist.price.type === 'gold' ? 'gold' : 'silver'}.webp`,
|
||||
`icons/currencies/${
|
||||
protagonist.price.type === 'gold' ? 'gold' : 'silver'
|
||||
}.webp`,
|
||||
)}
|
||||
/>
|
||||
</Flex>
|
||||
|
||||
@@ -9,13 +9,7 @@ import {
|
||||
import { Armor } from '../../../../../../components/Armor';
|
||||
import { ArmorPlateDisplay } from '../../../../../../components/Armor/components/ArmorPlateDisplay';
|
||||
import { ShotDisplay } from '../../../../../../components/Armor/components/ShotDisplay';
|
||||
import {
|
||||
StaticArmor,
|
||||
ThicknessRange,
|
||||
} from '../../../../../../components/Armor/components/StaticArmor';
|
||||
import { applyPitchYawLimits } from '../../../../../../core/blitz/applyPitchYawLimits';
|
||||
import { modelTransformEvent } from '../../../../../../core/blitzkit/modelTransform';
|
||||
import { Pose, poseEvent } from '../../../../../../core/blitzkit/pose';
|
||||
import { StaticArmor } from '../../../../../../components/Armor/components/StaticArmor';
|
||||
import { useEquipment } from '../../../../../../hooks/useEquipment';
|
||||
import useOnScreen from '../../../../../../hooks/useOnScreen';
|
||||
import { useTankModelDefinition } from '../../../../../../hooks/useTankModelDefinition';
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
import { tankIcon } from '@blitzkit/core';
|
||||
import { Flex, FlexProps, Progress } from '@radix-ui/themes';
|
||||
import { useProgress } from '@react-three/drei';
|
||||
import { tankIcon } from '../../../../../../core/blitzkit/tankIcon';
|
||||
|
||||
type TankSandboxLoaderProps = Omit<FlexProps, 'id'> & {
|
||||
id: number;
|
||||
|
||||
+7
-5
@@ -1,11 +1,13 @@
|
||||
import {
|
||||
asset,
|
||||
averageDefinitions,
|
||||
formatCompact,
|
||||
tankDefinitions,
|
||||
TIER_ROMAN_NUMERALS,
|
||||
} from '@blitzkit/core';
|
||||
import { Box, Flex, Text } from '@radix-ui/themes';
|
||||
import Link from 'next/link';
|
||||
import { use } from 'react';
|
||||
import { asset } from '../../../../../../../../core/blitzkit/asset';
|
||||
import { averageDefinitions } from '../../../../../../../../core/blitzkit/averageDefinitions';
|
||||
import { tankDefinitions } from '../../../../../../../../core/blitzkit/tankDefinitions';
|
||||
import { TIER_ROMAN_NUMERALS } from '../../../../../../../../core/blitzkit/tankDefinitions/constants';
|
||||
import { formatCompact } from '../../../../../../../../core/math/formatCompact';
|
||||
import * as TankopediaEphemeral from '../../../../../../../../stores/tankopediaEphemeral';
|
||||
|
||||
interface NodeProps {
|
||||
|
||||
+1
-3
@@ -1,9 +1,7 @@
|
||||
import { asset, imgur, tankDefinitions } from '@blitzkit/core';
|
||||
import { CaretLeftIcon, CaretRightIcon, PlusIcon } from '@radix-ui/react-icons';
|
||||
import { Flex, Heading, IconButton, ScrollArea, Text } from '@radix-ui/themes';
|
||||
import { Fragment, use, useEffect, useMemo, useRef, useState } from 'react';
|
||||
import { asset } from '../../../../../../../core/blitzkit/asset';
|
||||
import { imgur } from '../../../../../../../core/blitzkit/imgur';
|
||||
import { tankDefinitions } from '../../../../../../../core/blitzkit/tankDefinitions';
|
||||
import * as Duel from '../../../../../../../stores/duel';
|
||||
import * as TankopediaEphemeral from '../../../../../../../stores/tankopediaEphemeral';
|
||||
import { Arrow } from './components/Arrow';
|
||||
|
||||
-1
@@ -1,6 +1,5 @@
|
||||
import { IconButton } from '@radix-ui/themes';
|
||||
import { invalidate } from '@react-three/fiber';
|
||||
import { asset } from '../../../../../../../../../core/blitzkit/asset';
|
||||
import { useArmor } from '../../../../../../../../../hooks/useArmor';
|
||||
import * as Duel from '../../../../../../../../../stores/duel';
|
||||
import * as TankopediaEphemeral from '../../../../../../../../../stores/tankopediaEphemeral';
|
||||
|
||||
+1
-11
@@ -1,3 +1,4 @@
|
||||
import { imgur, uniqueGuns } from '@blitzkit/core';
|
||||
import {
|
||||
CameraIcon,
|
||||
CopyIcon,
|
||||
@@ -21,17 +22,6 @@ import {
|
||||
} from '@radix-ui/themes';
|
||||
import { invalidate } from '@react-three/fiber';
|
||||
import { RefObject, useEffect, useState } from 'react';
|
||||
import { ThicknessRange } from '../../../../../../../../components/Armor/components/StaticArmor';
|
||||
import { ModuleButton } from '../../../../../../../../components/ModuleButtons/ModuleButton';
|
||||
import { SmallTankIcon } from '../../../../../../../../components/SmallTankIcon';
|
||||
import { resolveNearPenetration } from '../../../../../../../../core/blitz/resolveNearPenetration';
|
||||
import { resolvePenetrationCoefficient } from '../../../../../../../../core/blitz/resolvePenetrationCoefficient';
|
||||
import { asset } from '../../../../../../../../core/blitzkit/asset';
|
||||
import { imgur } from '../../../../../../../../core/blitzkit/imgur';
|
||||
import { Pose, poseEvent } from '../../../../../../../../core/blitzkit/pose';
|
||||
import { TIER_ROMAN_NUMERALS } from '../../../../../../../../core/blitzkit/tankDefinitions/constants';
|
||||
import { uniqueGuns } from '../../../../../../../../core/blitzkit/uniqueGuns';
|
||||
import { useArmor } from '../../../../../../../../hooks/useArmor';
|
||||
import { useEquipment } from '../../../../../../../../hooks/useEquipment';
|
||||
import { useFullScreen } from '../../../../../../../../hooks/useFullScreen';
|
||||
import { useFullscreenAvailability } from '../../../../../../../../hooks/useFullscreenAvailability';
|
||||
|
||||
-6
@@ -1,12 +1,6 @@
|
||||
import { invalidate, ThreeEvent, useThree } from '@react-three/fiber';
|
||||
import { memo, useRef } from 'react';
|
||||
import { Group, Mesh, MeshStandardMaterial, Vector2 } from 'three';
|
||||
import { ModelTankWrapper } from '../../../../../../../components/Armor/components/ModelTankWrapper';
|
||||
import { applyPitchYawLimits } from '../../../../../../../core/blitz/applyPitchYawLimits';
|
||||
import { hasEquipment } from '../../../../../../../core/blitzkit/hasEquipment';
|
||||
import { jsxTree } from '../../../../../../../core/blitzkit/jsxTree';
|
||||
import { modelTransformEvent } from '../../../../../../../core/blitzkit/modelTransform';
|
||||
import { normalizeAngleRad } from '../../../../../../../core/math/normalizeAngleRad';
|
||||
import { useModel } from '../../../../../../../hooks/useModel';
|
||||
import { useTankModelDefinition } from '../../../../../../../hooks/useTankModelDefinition';
|
||||
import { useTankTransform } from '../../../../../../../hooks/useTankTransform';
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
import { modelTransformEvent, ModelTransformEventData } from '@blitzkit/core';
|
||||
import { HeightIcon, WidthIcon } from '@radix-ui/react-icons';
|
||||
import { Flex, TextField } from '@radix-ui/themes';
|
||||
import { useEffect, useRef } from 'react';
|
||||
import { degToRad, radToDeg } from 'three/src/math/MathUtils';
|
||||
import { applyPitchYawLimits } from '../../../../../../core/blitz/applyPitchYawLimits';
|
||||
import {
|
||||
modelTransformEvent,
|
||||
ModelTransformEventData,
|
||||
} from '../../../../../../core/blitzkit/modelTransform';
|
||||
import { useEquipment } from '../../../../../../hooks/useEquipment';
|
||||
import { useTankModelDefinition } from '../../../../../../hooks/useTankModelDefinition';
|
||||
import * as Duel from '../../../../../../stores/duel';
|
||||
@@ -23,11 +19,6 @@ export function QuickInputs() {
|
||||
const gunModelDefinition = turretModelDefinition.guns[protagonist.gun.id];
|
||||
const initialGunPitch = tankModelDefinition.turretRotation?.pitch ?? 0;
|
||||
const hasImprovedVerticalStabilizer = useEquipment(122);
|
||||
const antagonist = Duel.use((state) => state.antagonist.tank);
|
||||
const compareTanks =
|
||||
protagonist.tank.id === antagonist.id
|
||||
? [protagonist.tank.id]
|
||||
: [protagonist.tank.id, antagonist.id];
|
||||
|
||||
useEffect(() => {
|
||||
yawInput.current!.value = radToDeg(protagonist.yaw).toFixed(1);
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { Flex } from '@radix-ui/themes';
|
||||
import { ShotDisplayCard } from '../../../../../components/Armor/components/ShotDisplayCard';
|
||||
import * as TankEphemeral from '../../../../../stores/tankopediaEphemeral';
|
||||
|
||||
export function ShotDisplaySection() {
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
import { reviews, Var, youtubers } from '@blitzkit/core';
|
||||
import { Box, Flex, Heading, Text } from '@radix-ui/themes';
|
||||
import { use } from 'react';
|
||||
import { Link } from '../../../../../components/Link';
|
||||
import PageWrapper from '../../../../../components/PageWrapper';
|
||||
import { VerifiedIcon } from '../../../../../components/VerifiedIcon';
|
||||
import { youtubers } from '../../../../../constants/youtubers';
|
||||
import { reviews } from '../../../../../core/blitzkit/reviews';
|
||||
import { Var } from '../../../../../core/blitzkit/var';
|
||||
import * as Duel from '../../../../../stores/duel';
|
||||
|
||||
export function VideoSection() {
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
import {
|
||||
modelDefinitions,
|
||||
provisionDefinitions,
|
||||
tankDefinitions,
|
||||
tankIcon,
|
||||
TIER_ROMAN_NUMERALS,
|
||||
} from '@blitzkit/core';
|
||||
import strings from '@blitzkit/core/lang/en-US.json';
|
||||
import { ReactNode } from 'react';
|
||||
import { modelDefinitions } from '../../../../core/blitzkit/modelDefinitions';
|
||||
import { provisionDefinitions } from '../../../../core/blitzkit/provisionDefinitions';
|
||||
import { tankDefinitions } from '../../../../core/blitzkit/tankDefinitions';
|
||||
import { TIER_ROMAN_NUMERALS } from '../../../../core/blitzkit/tankDefinitions/constants';
|
||||
import { tankIcon } from '../../../../core/blitzkit/tankIcon';
|
||||
import strings from '../../../../lang/en-US.json';
|
||||
import * as Duel from '../../../../stores/duel';
|
||||
import * as TankopediaEphemeral from '../../../../stores/tankopediaEphemeral';
|
||||
|
||||
|
||||
Loaded 100 of 305 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user