Feat: dev name

This commit is contained in:
GonnaHetzMe committed 2026-03-25 02:58:16 +01:00
1 parent 191843f972
commit e6fcfdb514
5 files changed
+94 -4

No files matched your search

@@ -39,6 +39,7 @@ message TankDefinition {
required float camouflage_onFire = 29; required float camouflage_onFire = 29;
required string equipment_preset = 30; required string equipment_preset = 30;
required uint32 weight = 31; required uint32 weight = 31;
optional string dev_name = 32;
} }
message ResearchCost { message ResearchCost {
@@ -316,6 +316,7 @@ export interface TankDefinition {
camouflage_onFire: number; camouflage_onFire: number;
equipment_preset: string; equipment_preset: string;
weight: number; weight: number;
dev_name: string;
} }
export interface TankDefinition_RolesEntry { export interface TankDefinition_RolesEntry {
@@ -693,6 +694,7 @@ function createBaseTankDefinition(): TankDefinition {
camouflage_onFire: 0, camouflage_onFire: 0,
equipment_preset: "", equipment_preset: "",
weight: 0, weight: 0,
dev_name: "",
}; };
} }
@@ -803,6 +805,9 @@ export const TankDefinition: MessageFns<TankDefinition> = {
if (message.weight !== 0) { if (message.weight !== 0) {
writer.uint32(248).uint32(message.weight); writer.uint32(248).uint32(message.weight);
} }
if (message.dev_name !== "") {
writer.uint32(258).string(message.dev_name);
}
return writer; return writer;
}, },
@@ -1094,6 +1099,14 @@ export const TankDefinition: MessageFns<TankDefinition> = {
message.weight = reader.uint32(); message.weight = reader.uint32();
continue; continue;
} }
case 32: {
if (tag !== 258) {
break;
}
message.dev_name = reader.string();
continue;
}
} }
if ((tag & 7) === 4 || tag === 0) { if ((tag & 7) === 4 || tag === 0) {
break; break;
@@ -1181,6 +1194,7 @@ export const TankDefinition: MessageFns<TankDefinition> = {
? globalThis.String(object.equipment_preset) ? globalThis.String(object.equipment_preset)
: "", : "",
weight: isSet(object.weight) ? globalThis.Number(object.weight) : 0, weight: isSet(object.weight) ? globalThis.Number(object.weight) : 0,
dev_name: isSet(object.dev_name) ? globalThis.String(object.dev_name) : "",
}; };
}, },
@@ -1282,6 +1296,9 @@ export const TankDefinition: MessageFns<TankDefinition> = {
if (message.weight !== 0) { if (message.weight !== 0) {
obj.weight = Math.round(message.weight); obj.weight = Math.round(message.weight);
} }
if (message.dev_name !== "") {
obj.dev_name = message.dev_name;
}
return obj; return obj;
}, },
@@ -1343,6 +1360,7 @@ export const TankDefinition: MessageFns<TankDefinition> = {
message.camouflage_onFire = object.camouflage_onFire ?? 0; message.camouflage_onFire = object.camouflage_onFire ?? 0;
message.equipment_preset = object.equipment_preset ?? ""; message.equipment_preset = object.equipment_preset ?? "";
message.weight = object.weight ?? 0; message.weight = object.weight ?? 0;
message.dev_name = object.dev_name ?? "";
return message; return message;
}, },
}; };
+1
View File
@@ -1083,6 +1083,7 @@
"tier": "Tier", "tier": "Tier",
"type": "Type", "type": "Type",
"dev_id": "DEV: ID", "dev_id": "DEV: ID",
"dev_name": "DEV: NAME",
"purchase": "Purchase price", "purchase": "Purchase price",
"restoration": "Restoration price", "restoration": "Restoration price",
"sale": "Sale price", "sale": "Sale price",
@@ -6,11 +6,13 @@ import {
IconButton, IconButton,
Text, Text,
TextField, TextField,
Tooltip,
} from "@radix-ui/themes"; } from "@radix-ui/themes";
import { Html } from "@react-three/drei"; import { Html } from "@react-three/drei";
import { useRef } from "react"; import { useRef, useState } from "react";
import { radToDeg } from "three/src/math/MathUtils.js"; import { radToDeg } from "three/src/math/MathUtils.js";
import { resolveArmorIndex } from "../../../core/blitzkit/resolveArmorIndex"; import { resolveArmorIndex } from "../../../core/blitzkit/resolveArmorIndex";
import { useLocale } from "../../../hooks/useLocale";
import { App } from "../../../stores/app"; import { App } from "../../../stores/app";
import { Duel } from "../../../stores/duel"; import { Duel } from "../../../stores/duel";
import { Tankopedia } from "../../../stores/tankopedia"; import { Tankopedia } from "../../../stores/tankopedia";
@@ -21,6 +23,8 @@ export function ArmorPlateDisplay() {
const highlightArmor = Tankopedia.use((state) => state.highlightArmor); const highlightArmor = Tankopedia.use((state) => state.highlightArmor);
const developerMode = App.useDeferred((state) => state.developerMode, false); const developerMode = App.useDeferred((state) => state.developerMode, false);
const input = useRef<HTMLInputElement>(null); const input = useRef<HTMLInputElement>(null);
const { strings } = useLocale();
const [copied, setCopied] = useState(false);
if (highlightArmor === undefined) return null; if (highlightArmor === undefined) return null;
@@ -60,7 +64,25 @@ export function ArmorPlateDisplay() {
{developerMode && ( {developerMode && (
<> <>
<Text mt="2" color="gray" size="2"> <Text mt="2" color="gray" size="2">
<b>DEV:</b> <Code>{highlightArmor.name}</Code> <b>DEV:</b>{" "}
<Tooltip
open={copied}
content={strings.website.common.copy_button.copied}
>
<Code
variant="soft"
highContrast
color="gray"
style={{ cursor: "copy" }}
onClick={() => {
navigator.clipboard.writeText(highlightArmor.name);
setCopied(true);
}}
onPointerLeave={() => setCopied(false)}
>
{highlightArmor.name}
</Code>
</Tooltip>
</Text> </Text>
</> </>
)} )}
@@ -4,7 +4,8 @@ import {
TankType, TankType,
TIER_ROMAN_NUMERALS, TIER_ROMAN_NUMERALS,
} from '@blitzkit/core'; } from '@blitzkit/core';
import { Box, Code, Flex } from '@radix-ui/themes'; import { Box, Code, Flex, Tooltip } from '@radix-ui/themes';
import { useState } from 'react';
import { Var } from '../../../core/radix/var'; import { Var } from '../../../core/radix/var';
import { useLocale } from '../../../hooks/useLocale'; import { useLocale } from '../../../hooks/useLocale';
import { App } from '../../../stores/app'; import { App } from '../../../stores/app';
@@ -23,6 +24,7 @@ export function MetaSection() {
const protagonist = Duel.use((state) => state.protagonist.tank); const protagonist = Duel.use((state) => state.protagonist.tank);
const ClassIcon = classIcons[protagonist.class]; const ClassIcon = classIcons[protagonist.class];
const { locale, strings } = useLocale(); const { locale, strings } = useLocale();
const [copied, setCopied] = useState<null | 'id' | 'name'>(null);
return ( return (
<Flex justify="center" mt="-9"> <Flex justify="center" mt="-9">
@@ -101,7 +103,53 @@ export function MetaSection() {
<Listing <Listing
label={strings.website.tools.tankopedia.meta.dev_id} label={strings.website.tools.tankopedia.meta.dev_id}
> >
<Code>{protagonist.id}</Code> <Tooltip
open={copied === 'id'}
content={strings.website.common.copy_button.copied}
>
<Code
variant="soft"
highContrast
color="gray"
style={{ cursor: 'copy' }}
onClick={() => {
navigator.clipboard.writeText(`${protagonist.id}`);
setCopied('id');
}}
onPointerLeave={() => {
if (copied === 'id') setCopied(null);
}}
>
{protagonist.id}
</Code>
</Tooltip>
</Listing>
)}
{developerMode && (
<Listing
label={strings.website.tools.tankopedia.meta.dev_name}
>
<Tooltip
open={copied === 'name'}
content={strings.website.common.copy_button.copied}
>
<Code
variant="soft"
highContrast
color="gray"
style={{ cursor: 'copy' }}
onClick={() => {
if (!protagonist.dev_name) return;
navigator.clipboard.writeText(protagonist.dev_name);
setCopied('name');
}}
onPointerLeave={() => {
if (copied === 'name') setCopied(null);
}}
>
{protagonist.dev_name ?? '-'}
</Code>
</Tooltip>
</Listing> </Listing>
)} )}
{protagonist.type === TankType.PREMIUM && ( {protagonist.type === TankType.PREMIUM && (