mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 10:47:04 +02:00
6 files changed
+94
-4
No files matched your search
@@ -39,6 +39,7 @@ message TankDefinition {
|
||||
required float camouflage_onFire = 29;
|
||||
required string equipment_preset = 30;
|
||||
required uint32 weight = 31;
|
||||
optional string dev_name = 32;
|
||||
}
|
||||
|
||||
message ResearchCost {
|
||||
|
||||
@@ -316,6 +316,7 @@ export interface TankDefinition {
|
||||
camouflage_onFire: number;
|
||||
equipment_preset: string;
|
||||
weight: number;
|
||||
dev_name: string;
|
||||
}
|
||||
|
||||
export interface TankDefinition_RolesEntry {
|
||||
@@ -693,6 +694,7 @@ function createBaseTankDefinition(): TankDefinition {
|
||||
camouflage_onFire: 0,
|
||||
equipment_preset: "",
|
||||
weight: 0,
|
||||
dev_name: "",
|
||||
};
|
||||
}
|
||||
|
||||
@@ -803,6 +805,9 @@ export const TankDefinition: MessageFns<TankDefinition> = {
|
||||
if (message.weight !== 0) {
|
||||
writer.uint32(248).uint32(message.weight);
|
||||
}
|
||||
if (message.dev_name !== "") {
|
||||
writer.uint32(258).string(message.dev_name);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
@@ -1094,6 +1099,14 @@ export const TankDefinition: MessageFns<TankDefinition> = {
|
||||
message.weight = reader.uint32();
|
||||
continue;
|
||||
}
|
||||
case 32: {
|
||||
if (tag !== 258) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.dev_name = reader.string();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
@@ -1181,6 +1194,7 @@ export const TankDefinition: MessageFns<TankDefinition> = {
|
||||
? globalThis.String(object.equipment_preset)
|
||||
: "",
|
||||
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) {
|
||||
obj.weight = Math.round(message.weight);
|
||||
}
|
||||
if (message.dev_name !== "") {
|
||||
obj.dev_name = message.dev_name;
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
@@ -1343,6 +1360,7 @@ export const TankDefinition: MessageFns<TankDefinition> = {
|
||||
message.camouflage_onFire = object.camouflage_onFire ?? 0;
|
||||
message.equipment_preset = object.equipment_preset ?? "";
|
||||
message.weight = object.weight ?? 0;
|
||||
message.dev_name = object.dev_name ?? "";
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1083,6 +1083,7 @@
|
||||
"tier": "Tier",
|
||||
"type": "Type",
|
||||
"dev_id": "DEV: ID",
|
||||
"dev_name": "DEV: NAME",
|
||||
"purchase": "Purchase price",
|
||||
"restoration": "Restoration price",
|
||||
"sale": "Sale price",
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { ReloadIcon } from "@radix-ui/react-icons";
|
||||
import {
|
||||
Card,
|
||||
Code,
|
||||
Flex,
|
||||
IconButton,
|
||||
Text,
|
||||
@@ -14,6 +13,7 @@ import { resolveArmorIndex } from "../../../core/blitzkit/resolveArmorIndex";
|
||||
import { App } from "../../../stores/app";
|
||||
import { Duel } from "../../../stores/duel";
|
||||
import { Tankopedia } from "../../../stores/tankopedia";
|
||||
import { CopyableCode } from "../../CopyableCode";
|
||||
import { layerTypeNames } from "./ShotDisplayCard";
|
||||
import { ArmorType } from "./SpacedArmorScene";
|
||||
|
||||
@@ -60,7 +60,15 @@ export function ArmorPlateDisplay() {
|
||||
{developerMode && (
|
||||
<>
|
||||
<Text mt="2" color="gray" size="2">
|
||||
<b>DEV:</b> <Code>{highlightArmor.name}</Code>
|
||||
<b>DEV:</b>{" "}
|
||||
<CopyableCode
|
||||
copy={highlightArmor.name}
|
||||
variant="soft"
|
||||
highContrast
|
||||
color="gray"
|
||||
>
|
||||
{highlightArmor.name}
|
||||
</CopyableCode>
|
||||
</Text>
|
||||
</>
|
||||
)}
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
import { Code, Tooltip, type CodeProps } from "@radix-ui/themes";
|
||||
import { useState } from "react";
|
||||
import { useLocale } from "../hooks/useLocale";
|
||||
|
||||
export interface CopyableCodeProps extends CodeProps {
|
||||
copy?: string;
|
||||
}
|
||||
|
||||
export function CopyableCode({
|
||||
copy,
|
||||
onClick,
|
||||
onPointerLeave,
|
||||
style,
|
||||
children,
|
||||
...props
|
||||
}: CopyableCodeProps) {
|
||||
const [copied, setCopied] = useState(false);
|
||||
const { strings } = useLocale();
|
||||
|
||||
return (
|
||||
<Tooltip open={copied} content={strings.website.common.copy_button.copied}>
|
||||
<Code
|
||||
{...props}
|
||||
style={{ ...style, cursor: "pointer" }}
|
||||
onClick={(event) => {
|
||||
onClick?.(event);
|
||||
if (!copy) return;
|
||||
navigator.clipboard.writeText(copy);
|
||||
setCopied(true);
|
||||
}}
|
||||
onPointerLeave={(event) => {
|
||||
onPointerLeave?.(event);
|
||||
setCopied(false);
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
</Code>
|
||||
</Tooltip>
|
||||
);
|
||||
}
|
||||
@@ -4,12 +4,13 @@ import {
|
||||
TankType,
|
||||
TIER_ROMAN_NUMERALS,
|
||||
} from '@blitzkit/core';
|
||||
import { Box, Code, Flex } from '@radix-ui/themes';
|
||||
import { Box, Flex } from '@radix-ui/themes';
|
||||
import { Var } from '../../../core/radix/var';
|
||||
import { useLocale } from '../../../hooks/useLocale';
|
||||
import { App } from '../../../stores/app';
|
||||
import { Duel } from '../../../stores/duel';
|
||||
import { classIcons } from '../../ClassIcon';
|
||||
import { CopyableCode } from '../../CopyableCode';
|
||||
import { Listing } from './components/Listing';
|
||||
|
||||
const NATIONAL_BANNER_POSITION_OVERRIDES: Record<string, string> = {
|
||||
@@ -101,7 +102,28 @@ export function MetaSection() {
|
||||
<Listing
|
||||
label={strings.website.tools.tankopedia.meta.dev_id}
|
||||
>
|
||||
<Code>{protagonist.id}</Code>
|
||||
<CopyableCode
|
||||
copy={`${protagonist.id}`}
|
||||
variant="soft"
|
||||
highContrast
|
||||
color="gray"
|
||||
>
|
||||
{protagonist.id}
|
||||
</CopyableCode>
|
||||
</Listing>
|
||||
)}
|
||||
{developerMode && (
|
||||
<Listing
|
||||
label={strings.website.tools.tankopedia.meta.dev_name}
|
||||
>
|
||||
<CopyableCode
|
||||
copy={devName}
|
||||
variant="soft"
|
||||
highContrast
|
||||
color="gray"
|
||||
>
|
||||
{protagonist.dev_name}
|
||||
</CopyableCode>
|
||||
</Listing>
|
||||
)}
|
||||
{protagonist.type === TankType.PREMIUM && (
|
||||
|
||||
Reference in new issue
Block a user