Files
blitzkit/packages/website-ue/src/core/tankopedia/characteristicsOrder.tsx
T

163 lines
3.8 KiB
TypeScript
Raw Normal View History

2026-04-29 10:31:36 -05:00
import type { Strings } from "@blitzkit/i18n";
2025-12-26 14:14:29 -06:00
import {
Nation,
TankClass,
TankType,
2026-04-14 20:34:28 -05:00
} from "@protos/game/proto/legacy/blitz_static_tank_component";
2026-04-29 10:46:37 -05:00
import type { ReactNode } from "react";
import { VintageIcon } from "../../icons/Vintage";
2025-12-26 14:14:29 -06:00
import {
GunType,
type CharacteristicName,
type CharacteristicOutput,
} from "./characteristics";
2025-12-18 15:30:18 -06:00
2025-12-18 16:12:01 -06:00
export enum BetterDirection {
Higher,
Lower,
}
2025-12-24 19:48:01 -06:00
export interface CharacteristicRenderConfig {
name: CharacteristicName;
decimals?: number;
units?: string;
2026-04-29 10:17:53 -05:00
strings?: string;
2026-04-29 10:31:36 -05:00
render?: (data: {
output: CharacteristicOutput;
strings: Strings;
gameStrings: Record<string, string>;
2026-04-29 10:46:37 -05:00
}) => ReactNode;
2025-12-24 19:48:01 -06:00
}
2025-12-18 15:30:18 -06:00
type CharacteristicsOrder = {
group: string;
2025-12-18 16:29:13 -06:00
order: (
2025-12-24 19:48:01 -06:00
| CharacteristicRenderConfig
2025-12-18 16:29:13 -06:00
| {
toy: string;
}
)[];
2025-12-18 15:30:18 -06:00
}[];
2025-12-19 15:11:33 -06:00
export const characteristicsOrder: CharacteristicsOrder = [
2025-12-26 14:14:29 -06:00
{
group: "meta",
order: [
2026-04-29 10:31:36 -05:00
{
name: "name",
strings: "TankEntity",
render({ output, gameStrings }) {
return gameStrings[output as string];
},
},
2026-04-29 15:17:59 -05:00
{
name: "class",
render({ output, strings }) {
return strings.classes.full[output as TankClass];
},
},
{
name: "type",
render({ output, strings }) {
return strings.types[output as TankType];
},
},
{
name: "nation",
render({ output, strings }) {
return strings.nations[output as Nation];
},
},
2026-04-29 10:31:36 -05:00
{
name: "tier",
render({ output, strings }) {
const [, name] = (output as string).split(".");
2026-04-29 10:46:37 -05:00
if (name == "vintage") {
return <VintageIcon />;
}
2026-04-29 10:31:36 -05:00
return strings.tiers[name as keyof typeof strings.tiers];
},
},
2025-12-26 14:14:29 -06:00
{ name: "compensation" },
{ name: "id" },
2025-12-26 20:07:22 -06:00
{ name: "slug" },
2025-12-26 14:14:29 -06:00
],
},
2025-12-18 15:30:18 -06:00
{
group: "firepower",
2025-12-18 16:12:01 -06:00
order: [
2025-12-26 14:14:29 -06:00
{
name: "gun_type",
2026-04-29 10:31:36 -05:00
render({ output }) {
2025-12-26 14:14:29 -06:00
return GunType[output as GunType];
},
},
2025-12-19 15:04:35 -06:00
{ name: "dpm", decimals: 0, units: "hp_min" },
2025-12-24 19:48:01 -06:00
{ name: "reload", decimals: 2, units: "s" },
{ name: "reloads", decimals: 2, units: "s" },
2025-12-19 15:04:35 -06:00
{ name: "damage", units: "hp" },
{ name: "module_damage", units: "hp" },
{ name: "penetration", units: "mm" },
2025-12-19 14:51:18 -06:00
{ name: "clip_size" },
2025-12-19 15:04:35 -06:00
{ name: "intra_clip", decimals: 2, units: "s" },
2025-12-18 16:29:13 -06:00
{ toy: "reload" },
2025-12-19 15:04:35 -06:00
{ name: "caliber", units: "mm" },
{ name: "normalization", units: "deg" },
{ name: "ricochet", units: "deg" },
2025-12-18 16:29:13 -06:00
{ toy: "ricochet" },
2025-12-19 15:09:46 -06:00
{ name: "shell_velocity", units: "m_s" },
2025-12-19 15:04:35 -06:00
{ name: "shell_range", units: "m" },
2025-12-18 16:29:13 -06:00
{ name: "shell_capacity" },
2025-12-18 21:29:10 -06:00
2025-12-20 10:15:23 -06:00
{ name: "aim_time", decimals: 1, units: "s" },
2025-12-18 21:29:10 -06:00
2025-12-19 15:09:46 -06:00
{ toy: "aim_time" },
2025-12-20 10:15:23 -06:00
{ name: "dispersion", decimals: 3, units: "m" },
2025-12-18 21:29:10 -06:00
2025-12-20 19:03:57 -06:00
{ name: "gun_depression", decimals: 0, units: "deg" },
{ name: "gun_elevation", decimals: 0, units: "deg" },
2025-12-18 21:29:10 -06:00
{ toy: "flexibility" },
2025-12-18 16:12:01 -06:00
],
2025-12-18 15:30:18 -06:00
},
{
group: "maneuverability",
2025-12-18 21:29:10 -06:00
order: [
2025-12-19 15:04:35 -06:00
{ name: "speed_forward", units: "km_h" },
{ name: "speed_backward", units: "km_h" },
2025-12-18 21:29:10 -06:00
2025-12-19 15:04:35 -06:00
{ name: "engine_power", units: "bhp" },
2025-12-24 20:10:06 -06:00
{ name: "weight", decimals: 1, units: "t" },
2025-12-18 21:29:10 -06:00
2025-12-24 19:37:21 -06:00
{ name: "terrain_coefficient" },
2025-12-24 20:10:06 -06:00
{ name: "power_to_weight", decimals: 1, units: "bhp_t" },
2025-12-24 19:37:21 -06:00
{ name: "hull_traverse_speed", units: "deg_s" },
2025-12-19 15:04:35 -06:00
{ name: "turret_traverse_speed", units: "deg_s" },
2025-12-18 21:29:10 -06:00
{ toy: "traverse" },
],
2025-12-18 15:30:18 -06:00
},
{
group: "survivability",
2025-12-18 21:29:10 -06:00
order: [
2025-12-19 15:04:35 -06:00
{ name: "health", units: "hp" },
{ name: "fire_chance", units: "%" },
{ name: "view_range", units: "m" },
2025-12-18 21:29:10 -06:00
{ toy: "view_range" },
2025-12-24 20:30:19 -06:00
{ name: "camouflage", decimals: 0, units: "%" },
2025-12-18 21:29:10 -06:00
2025-12-19 15:04:35 -06:00
{ name: "height", units: "m" },
{ name: "length", units: "m" },
{ name: "volume", units: "m" },
2025-12-18 21:29:10 -06:00
],
2025-12-18 15:30:18 -06:00
},
2025-12-18 21:29:10 -06:00
];