This commit is contained in:
tresabhi committed 2026-10-15 00:38:01 -05:00
1 parent 8ec7fcb90a
commit b00a63a9f8
19 files changed
+340 -736

No files matched your search

+2 -12
View File
@@ -1,4 +1,4 @@
import { createDefaultSkills } from "@blitzkit/core";
import { createDefaultEnvironment, type TankEnvironment } from "@blitzkit/core";
import type { ShellDefinition, TankDefinition } from "@blitzkit/protos";
import { Soapstone } from "soapstone";
import type { Vector3 } from "three";
@@ -76,12 +76,6 @@ export enum TankopediaRelativeAgainst {
All,
}
export interface TankEnvironment {
equalize: boolean;
distance: number;
skills: Record<string, number>;
}
interface Tankopedia {
disturbed: boolean;
revealed: boolean;
@@ -128,11 +122,7 @@ export const Tankopedia = new Soapstone<Tankopedia, [TankDefinition]>(
antagonist: createTankState(tank),
model: models.models[tank.id],
environment: {
equalize: false,
distance: 0,
skills: createDefaultSkills(skills),
},
environment: createDefaultEnvironment(skills),
relative_against: TankopediaRelativeAgainst.ClassAndTier,
@@ -1,39 +1,3 @@
import type { TankopediaSortBy } from '.';
export const SORT_UNITS: Record<TankopediaSortBy, string | undefined> = {
'meta.none': undefined,
'survivability.health': 'hp',
'fire.aimTime': 's',
'fire.caliber': 'mm',
'fire.damage': 'hp',
'fire.moduleDamage': 'hp',
'fire.dispersionMoving': 'm',
'fire.dispersionStill': 'm',
'fire.dpm': undefined,
'fire.dpmPremium': undefined,
'fire.gunDepression': '°',
'fire.gunElevation': '°',
'fire.premiumPenetration': 'mm',
'fire.tertiaryPenetration': 'mm',
'fire.reload': 's',
'fire.shellVelocity': 'm/s',
'fire.shellRange': 'm',
'fire.shellCapacity': undefined,
'fire.standardPenetration': 'mm',
'maneuverability.backwardsSpeed': 'kph',
'maneuverability.forwardsSpeed': 'kph',
'maneuverability.power': 'hp',
'maneuverability.powerToWeight': 'hp/tn',
'maneuverability.traverseSpeed': '°/s',
'maneuverability.weight': 'tn',
'survivability.camouflageMoving': '%',
'survivability.camouflageShooting': '%',
'survivability.camouflageStill': '%',
'survivability.length': 'm',
'survivability.viewRange': 'm',
'survivability.volume': 'm^3',
};
export enum TankopediaDisplay {
Model,
DynamicArmor,
@@ -1,9 +1,9 @@
import type en from "@blitzkit/i18n/strings/en.json";
import { Soapstone } from "soapstone";
export type TankopediaSortBy = keyof typeof en.website.common.tank_search.sort;
export type TankopediaSortDirection = "ascending" | "descending";
export type TankopediaTestTankDisplay = "include" | "exclude" | "only";
export enum TankopediaSortDirection {
Ascending,
Descending,
}
export interface TankopediaPersistent {
wireframe: boolean;
@@ -16,11 +16,6 @@ export interface TankopediaPersistent {
recentlyViewed: number[];
hideTankModelUnderArmor: boolean;
highGraphics: boolean;
sort: {
by: TankopediaSortBy;
direction: TankopediaSortDirection;
};
}
export const TankopediaPersistent = new Soapstone<TankopediaPersistent>(
@@ -35,10 +30,6 @@ export const TankopediaPersistent = new Soapstone<TankopediaPersistent>(
showPrimaryArmor: true,
recentlyViewed: [],
highGraphics: true,
sort: {
by: "meta.none",
direction: "ascending",
},
},
"tankopedia-3",
);
@@ -1,15 +1,13 @@
import { Soapstone } from 'soapstone';
import {
type TankopediaSortBy,
type TankopediaSortDirection,
} from './tankopediaPersistent';
import { Soapstone } from "soapstone";
import type { CharacteristicName } from "../types/characteristics";
import { TankopediaSortDirection } from "./tankopediaPersistent";
export interface TankSort {
by: TankopediaSortBy;
by: CharacteristicName | null;
direction: TankopediaSortDirection;
}
export const TankSort = new Soapstone<TankSort>({
by: 'meta.none',
direction: 'descending',
by: null,
direction: TankopediaSortDirection.Descending,
});