mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-28 04:59:50 +01:00
fix imports
This commit is contained in:
1 parent
10f8fa28f9
commit
45811b5c18
10 files changed
+106
-110
No files matched your search
@@ -20,6 +20,18 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
"tanks": {
|
"tanks": {
|
||||||
|
"tabs": {
|
||||||
|
"model": "Model",
|
||||||
|
"dynamic_armor": "Dynamic armor",
|
||||||
|
"static_armor": "Static armor"
|
||||||
|
},
|
||||||
|
|
||||||
|
"poses": {
|
||||||
|
"hull_down": "Hull down",
|
||||||
|
"face_hug": "Face hug",
|
||||||
|
"default": "Default"
|
||||||
|
},
|
||||||
|
|
||||||
"toys": {
|
"toys": {
|
||||||
"ricochet": {
|
"ricochet": {
|
||||||
"angle": "Angle",
|
"angle": "Angle",
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import { Duel } from "../../../stores/duel";
|
|||||||
import { Tankopedia } from "../../../stores/tankopedia";
|
import { Tankopedia } from "../../../stores/tankopedia";
|
||||||
import type { MaybeSkeletonComponentProps } from "../../../types/maybeSkeletonComponentProps";
|
import type { MaybeSkeletonComponentProps } from "../../../types/maybeSkeletonComponentProps";
|
||||||
import type { ThicknessRange } from "../../StaticArmor";
|
import type { ThicknessRange } from "../../StaticArmor";
|
||||||
import { Options } from "./components/Options";
|
import { TankopediaOptions } from "../../TankopediaOptions";
|
||||||
import { TankSandbox } from "./components/TankSandbox";
|
import { TankSandbox } from "./components/TankSandbox";
|
||||||
import { Title } from "./components/TankSandbox/Title";
|
import { Title } from "./components/TankSandbox/Title";
|
||||||
|
|
||||||
@@ -142,7 +142,7 @@ export function HeroSection({ skeleton }: MaybeSkeletonComponentProps) {
|
|||||||
|
|
||||||
<Title skeleton={skeleton} />
|
<Title skeleton={skeleton} />
|
||||||
|
|
||||||
<Options
|
<TankopediaOptions
|
||||||
skeleton={skeleton}
|
skeleton={skeleton}
|
||||||
canvas={canvas}
|
canvas={canvas}
|
||||||
thicknessRange={thicknessRange}
|
thicknessRange={thicknessRange}
|
||||||
|
|||||||
+2
-2
@@ -12,9 +12,9 @@ import {
|
|||||||
} from "@radix-ui/themes";
|
} from "@radix-ui/themes";
|
||||||
import { throttle } from "lodash-es";
|
import { throttle } from "lodash-es";
|
||||||
import { type ChangeEvent } from "react";
|
import { type ChangeEvent } from "react";
|
||||||
import { useLocale } from "../../../../../../hooks/useLocale";
|
|
||||||
import { Duel } from "../../../../../../stores/duel";
|
import { Duel } from "../../../../../../stores/duel";
|
||||||
import { Tankopedia } from "../../../../../../stores/tankopedia";
|
import { useLocale } from "../../../hooks/useLocale";
|
||||||
|
import { Tankopedia } from "../../../stores/tankopedia";
|
||||||
|
|
||||||
export function CustomShellButton() {
|
export function CustomShellButton() {
|
||||||
const customShell = Tankopedia.use((state) => state.customShell);
|
const customShell = Tankopedia.use((state) => state.customShell);
|
||||||
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
import { alias } from "@blitzkit/core";
|
import { alias } from "@blitzkit/core";
|
||||||
import { IconButton } from "@radix-ui/themes";
|
import { IconButton } from "@radix-ui/themes";
|
||||||
import { useArmor } from "../../../../../../hooks/useArmor";
|
|
||||||
import { Duel } from "../../../../../../stores/duel";
|
import { Duel } from "../../../../../../stores/duel";
|
||||||
import { Tankopedia } from "../../../../../../stores/tankopedia";
|
import { useArmor } from "../../../hooks/useArmor";
|
||||||
|
import { Tankopedia } from "../../../stores/tankopedia";
|
||||||
|
|
||||||
export function DynamicArmorSwitcher() {
|
export function DynamicArmorSwitcher() {
|
||||||
const tank = Duel.use((state) => state.protagonist.tank);
|
const tank = Duel.use((state) => state.protagonist.tank);
|
||||||
File renamed without changes.
+5
-5
@@ -3,14 +3,14 @@ import { Flex, TextField } from "@radix-ui/themes";
|
|||||||
import type { QuicklimeEvent } from "quicklime";
|
import type { QuicklimeEvent } from "quicklime";
|
||||||
import { useEffect, useRef } from "react";
|
import { useEffect, useRef } from "react";
|
||||||
import { degToRad, radToDeg } from "three/src/math/MathUtils.js";
|
import { degToRad, radToDeg } from "three/src/math/MathUtils.js";
|
||||||
import { applyPitchYawLimits } from "../../../../../../../core/blitz/applyPitchYawLimits";
|
import { useTankModelDefinition } from "../../../../../../../hooks/useTankModelDefinition";
|
||||||
|
import { Duel } from "../../../../../../../stores/duel";
|
||||||
|
import { applyPitchYawLimits } from "../../../../core/blitz/applyPitchYawLimits";
|
||||||
import {
|
import {
|
||||||
type ModelTransformEventData,
|
type ModelTransformEventData,
|
||||||
modelTransformEvent,
|
modelTransformEvent,
|
||||||
} from "../../../../../../../core/blitzkit/modelTransform";
|
} from "../../../../core/blitzkit/modelTransform";
|
||||||
import { useEquipment } from "../../../../../../../hooks/useEquipment";
|
import { useEquipment } from "../../../../hooks/useEquipment";
|
||||||
import { useTankModelDefinition } from "../../../../../../../hooks/useTankModelDefinition";
|
|
||||||
import { Duel } from "../../../../../../../stores/duel";
|
|
||||||
import "./index.css";
|
import "./index.css";
|
||||||
|
|
||||||
export function QuickInputs() {
|
export function QuickInputs() {
|
||||||
+3
-3
@@ -2,10 +2,10 @@ import { alias, availableProvisions } from "@blitzkit/core";
|
|||||||
import { ShuffleIcon } from "@radix-ui/react-icons";
|
import { ShuffleIcon } from "@radix-ui/react-icons";
|
||||||
import { Flex, IconButton, Popover } from "@radix-ui/themes";
|
import { Flex, IconButton, Popover } from "@radix-ui/themes";
|
||||||
import { api } from "../../../../../../core/blitzkit/api";
|
import { api } from "../../../../../../core/blitzkit/api";
|
||||||
import { SPALL_LINER_PROVISION_ID } from "../../../../../../core/blitzkit/spallLiner";
|
|
||||||
import { useLocale } from "../../../../../../hooks/useLocale";
|
|
||||||
import { Duel } from "../../../../../../stores/duel";
|
import { Duel } from "../../../../../../stores/duel";
|
||||||
import { Tankopedia } from "../../../../../../stores/tankopedia";
|
import { SPALL_LINER_PROVISION_ID } from "../../../core/blitzkit/spallLiner";
|
||||||
|
import { useLocale } from "../../../hooks/useLocale";
|
||||||
|
import { Tankopedia } from "../../../stores/tankopedia";
|
||||||
|
|
||||||
const provisionDefinitions = await api.provisionDefinitions();
|
const provisionDefinitions = await api.provisionDefinitions();
|
||||||
|
|
||||||
+9
-9
@@ -2,12 +2,12 @@ import { literals } from "@blitzkit/i18n/src/literals";
|
|||||||
import { EyeClosedIcon, EyeOpenIcon, ReloadIcon } from "@radix-ui/react-icons";
|
import { EyeClosedIcon, EyeOpenIcon, ReloadIcon } from "@radix-ui/react-icons";
|
||||||
import { Button, Checkbox, Flex, Text } from "@radix-ui/themes";
|
import { Button, Checkbox, Flex, Text } from "@radix-ui/themes";
|
||||||
import { Suspense } from "react";
|
import { Suspense } from "react";
|
||||||
import { useLocale } from "../../../../../../hooks/useLocale";
|
import { useLocale } from "../../../hooks/useLocale";
|
||||||
import { Tankopedia } from "../../../../../../stores/tankopedia";
|
import { Tankopedia } from "../../../stores/tankopedia";
|
||||||
import { TankopediaPersistent } from "../../../../../../stores/tankopediaPersistent";
|
import { TankopediaPersistent } from "../../../stores/tankopediaPersistent";
|
||||||
import { TankopediaDisplay } from "../../../../../../stores/tankopediaPersistent/constants";
|
import { TankopediaDisplay } from "../../../stores/tankopediaPersistent/constants";
|
||||||
import type { MaybeSkeletonComponentProps } from "../../../../../../types/maybeSkeletonComponentProps";
|
import type { MaybeSkeletonComponentProps } from "../../../types/maybeSkeletonComponentProps";
|
||||||
import type { ThicknessRange } from "../../../../../StaticArmor";
|
import type { ThicknessRange } from "../../StaticArmor";
|
||||||
import { DynamicArmorSwitcher } from "./DynamicArmorSwitcher";
|
import { DynamicArmorSwitcher } from "./DynamicArmorSwitcher";
|
||||||
|
|
||||||
type ThicknessesProps = MaybeSkeletonComponentProps & {
|
type ThicknessesProps = MaybeSkeletonComponentProps & {
|
||||||
@@ -17,13 +17,13 @@ type ThicknessesProps = MaybeSkeletonComponentProps & {
|
|||||||
export function Thicknesses({ thicknessRange, skeleton }: ThicknessesProps) {
|
export function Thicknesses({ thicknessRange, skeleton }: ThicknessesProps) {
|
||||||
const display = Tankopedia.use((state) => state.display);
|
const display = Tankopedia.use((state) => state.display);
|
||||||
const showExternalModules = TankopediaPersistent.use(
|
const showExternalModules = TankopediaPersistent.use(
|
||||||
(state) => state.showExternalModules
|
(state) => state.showExternalModules,
|
||||||
);
|
);
|
||||||
const showSpacedArmor = TankopediaPersistent.use(
|
const showSpacedArmor = TankopediaPersistent.use(
|
||||||
(state) => state.showSpacedArmor
|
(state) => state.showSpacedArmor,
|
||||||
);
|
);
|
||||||
const showPrimaryArmor = TankopediaPersistent.use(
|
const showPrimaryArmor = TankopediaPersistent.use(
|
||||||
(state) => state.showPrimaryArmor
|
(state) => state.showPrimaryArmor,
|
||||||
);
|
);
|
||||||
const editStatic = Tankopedia.use((state) => state.editStatic);
|
const editStatic = Tankopedia.use((state) => state.editStatic);
|
||||||
const { strings } = useLocale();
|
const { strings } = useLocale();
|
||||||
+69
-87
@@ -1,9 +1,4 @@
|
|||||||
import {
|
import { alias, romanize, uniqueGuns } from "@blitzkit/core";
|
||||||
alias,
|
|
||||||
resolvePenetrationCoefficient,
|
|
||||||
romanize,
|
|
||||||
uniqueGuns,
|
|
||||||
} from "@blitzkit/core";
|
|
||||||
import { literals } from "@blitzkit/i18n/src/literals";
|
import { literals } from "@blitzkit/i18n/src/literals";
|
||||||
import {
|
import {
|
||||||
Crosshair1Icon,
|
Crosshair1Icon,
|
||||||
@@ -27,39 +22,38 @@ import {
|
|||||||
Tooltip,
|
Tooltip,
|
||||||
} from "@radix-ui/themes";
|
} from "@radix-ui/themes";
|
||||||
import { Suspense, useState, type RefObject } from "react";
|
import { Suspense, useState, type RefObject } from "react";
|
||||||
import { Pose, poseEvent } from "../../../../../core/blitzkit/pose";
|
import { Pose, poseEvent } from "../../core/blitzkit/pose";
|
||||||
import { useEquipment } from "../../../../../hooks/useEquipment";
|
import { DuelModule, useDuel } from "../../hooks/useDuel";
|
||||||
import { useFullScreen } from "../../../../../hooks/useFullScreen";
|
import { useEquipment } from "../../hooks/useEquipment";
|
||||||
import { useFullscreenAvailability } from "../../../../../hooks/useFullscreenAvailability";
|
import { useFullScreen } from "../../hooks/useFullScreen";
|
||||||
import { useLocale } from "../../../../../hooks/useLocale";
|
import { useFullscreenAvailability } from "../../hooks/useFullscreenAvailability";
|
||||||
import { Duel } from "../../../../../stores/duel";
|
import { useStrings } from "../../hooks/useStrings";
|
||||||
import { Tankopedia } from "../../../../../stores/tankopedia";
|
import { useUnwrapper } from "../../hooks/useUnwrapper";
|
||||||
import { TankopediaPersistent } from "../../../../../stores/tankopediaPersistent";
|
import { Tankopedia } from "../../stores/tankopedia";
|
||||||
import { TankopediaDisplay } from "../../../../../stores/tankopediaPersistent/constants";
|
import { TankopediaPersistent } from "../../stores/tankopediaPersistent";
|
||||||
import type { MaybeSkeletonComponentProps } from "../../../../../types/maybeSkeletonComponentProps";
|
import { TankopediaDisplay } from "../../stores/tankopediaPersistent/constants";
|
||||||
import { EqualIcon } from "../../../../EqualIcon";
|
import type { MaybeSkeletonComponentProps } from "../../types/maybeSkeletonComponentProps";
|
||||||
import { ModuleButton } from "../../../../ModuleButtons/ModuleButton";
|
import { EqualIcon } from "../EqualIcon";
|
||||||
import { ScreenshotButton } from "../../../../ScreenshotButton";
|
import { ModuleButton } from "../ModuleButtons/ModuleButton";
|
||||||
import { SmallTankIcon } from "../../../../SmallTankIcon";
|
import { ScreenshotButton } from "../ScreenshotButton";
|
||||||
import type { ThicknessRange } from "../../../../StaticArmor";
|
import { SmallTankIcon } from "../SmallTankIcon";
|
||||||
import {
|
import {
|
||||||
SidebarIconButton,
|
SidebarIconButton,
|
||||||
SidebarIconGroup,
|
SidebarIconGroup,
|
||||||
} from "../../../../TankopediaSidebarIconButtons";
|
} from "../TankopediaSidebarIconButtons";
|
||||||
import { SkinSwitcher } from "../../../../TankopediaSkinSwitcher";
|
import { TankSearch } from "../TankSearch";
|
||||||
import { TankSearch } from "../../../../TankSearch";
|
|
||||||
import { CustomShellButton } from "./components/CustomShellButton";
|
import { CustomShellButton } from "./components/CustomShellButton";
|
||||||
import { DynamicArmorSwitcher } from "./components/DynamicArmorSwitcher";
|
import { DynamicArmorSwitcher } from "./components/DynamicArmorSwitcher";
|
||||||
import { QuickInputs } from "./components/QuickInputs";
|
|
||||||
import { SpallLinerSwitcher } from "./components/SpallLinerSwitcher";
|
import { SpallLinerSwitcher } from "./components/SpallLinerSwitcher";
|
||||||
import { Thicknesses } from "./components/Thicknesses";
|
|
||||||
|
|
||||||
type OptionsProps = MaybeSkeletonComponentProps & {
|
type OptionsProps = MaybeSkeletonComponentProps & {
|
||||||
thicknessRange: ThicknessRange;
|
|
||||||
canvas: RefObject<HTMLCanvasElement>;
|
canvas: RefObject<HTMLCanvasElement>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export function Options({ thicknessRange, canvas, skeleton }: OptionsProps) {
|
export function TankopediaOptions({ canvas, skeleton }: OptionsProps) {
|
||||||
|
const strings = useStrings();
|
||||||
|
const unwrap = useUnwrapper();
|
||||||
|
|
||||||
const hasCustomShell = Tankopedia.use(
|
const hasCustomShell = Tankopedia.use(
|
||||||
(state) => state.customShell !== undefined,
|
(state) => state.customShell !== undefined,
|
||||||
);
|
);
|
||||||
@@ -69,31 +63,23 @@ export function Options({ thicknessRange, canvas, skeleton }: OptionsProps) {
|
|||||||
(state) => state.advancedHighlighting,
|
(state) => state.advancedHighlighting,
|
||||||
);
|
);
|
||||||
const fullScreenAvailable = useFullscreenAvailability(true);
|
const fullScreenAvailable = useFullscreenAvailability(true);
|
||||||
const protagonistTank = Duel.use((state) => state.protagonist.tank);
|
const protagonistTank = useDuel("protagonist", DuelModule.Tank);
|
||||||
const antagonistGun = Duel.use((state) => state.antagonist.gun);
|
const antagonistGun = useDuel("antagonist", DuelModule.Gun);
|
||||||
const antagonistShell = Duel.use((state) => state.antagonist.shell);
|
const antagonistShell = useDuel("antagonist", DuelModule.Shell);
|
||||||
const [antagonistSelectorOpen, setAntagonistSelectorOpen] = useState(false);
|
const [antagonistSelectorOpen, setAntagonistSelectorOpen] = useState(false);
|
||||||
const antagonistTank = Duel.use((state) => state.antagonist.tank);
|
const antagonistTank = useDuel("antagonist", DuelModule.Tank);
|
||||||
const hasCalibratedShells = useEquipment("protagonist", 103, true);
|
const hasCalibratedShells = useEquipment("protagonist", 103);
|
||||||
const [tab, setTab] = useState("search");
|
const [tab, setTab] = useState("search");
|
||||||
const hasEnhancedArmor = useEquipment("protagonist", 110);
|
const hasEnhancedArmor = useEquipment("protagonist", 110);
|
||||||
const antagonistUniqueGuns = uniqueGuns(antagonistTank.turrets);
|
const antagonistUniqueGuns = uniqueGuns(antagonistTank.turrets);
|
||||||
const { strings, unwrap } = useLocale();
|
|
||||||
const revealed = Tankopedia.use((state) => state.revealed);
|
const revealed = Tankopedia.use((state) => state.revealed);
|
||||||
const disturbed = Tankopedia.use((state) => state.disturbed);
|
const disturbed = Tankopedia.use((state) => state.disturbed);
|
||||||
const highGraphics = TankopediaPersistent.use((state) => state.highGraphics);
|
const highGraphics = TankopediaPersistent.use((state) => state.highGraphics);
|
||||||
const modelRequested = Tankopedia.use((state) => state.modelRequested);
|
const modelRequested = Tankopedia.use((state) => state.modelRequested);
|
||||||
const equalize = Duel.use((state) => state.equalize);
|
const equalize = Tankopedia.use((state) => state.environment.equalize);
|
||||||
const equalizer = Duel.use((state) => state.antagonist.tank.equalizer);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{disturbed && <QuickInputs />}
|
|
||||||
|
|
||||||
<Thicknesses skeleton={skeleton} thicknessRange={thicknessRange} />
|
|
||||||
|
|
||||||
<SkinSwitcher />
|
|
||||||
|
|
||||||
<Flex
|
<Flex
|
||||||
gap="2"
|
gap="2"
|
||||||
direction="column"
|
direction="column"
|
||||||
@@ -110,7 +96,7 @@ export function Options({ thicknessRange, canvas, skeleton }: OptionsProps) {
|
|||||||
>
|
>
|
||||||
{!hasCustomShell && (
|
{!hasCustomShell && (
|
||||||
<Text color="gray" size={{ initial: "1", sm: "2" }}>
|
<Text color="gray" size={{ initial: "1", sm: "2" }}>
|
||||||
{literals(strings.common.units.mm, {
|
{/* {literals(strings.common.units.mm, {
|
||||||
value: (
|
value: (
|
||||||
resolvePenetrationCoefficient(
|
resolvePenetrationCoefficient(
|
||||||
hasCalibratedShells,
|
hasCalibratedShells,
|
||||||
@@ -119,7 +105,8 @@ export function Options({ thicknessRange, canvas, skeleton }: OptionsProps) {
|
|||||||
equalizer,
|
equalizer,
|
||||||
) * antagonistShell.penetration!.near
|
) * antagonistShell.penetration!.near
|
||||||
).toFixed(0),
|
).toFixed(0),
|
||||||
})}
|
})} */}
|
||||||
|
what
|
||||||
</Text>
|
</Text>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
@@ -165,13 +152,13 @@ export function Options({ thicknessRange, canvas, skeleton }: OptionsProps) {
|
|||||||
<ModuleButton
|
<ModuleButton
|
||||||
module="gun"
|
module="gun"
|
||||||
key={gun.id}
|
key={gun.id}
|
||||||
onClick={() =>
|
onClick={() => {
|
||||||
Duel.mutate((draft) => {
|
Tankopedia.mutate((draft) => {
|
||||||
draft.antagonist.turret = turret;
|
draft.antagonist.turret = turret.id;
|
||||||
draft.antagonist.gun = gun;
|
draft.antagonist.gun = gun.id;
|
||||||
draft.antagonist.shell = gun.shells[0];
|
draft.antagonist.shell = gun.shells[0].id;
|
||||||
})
|
});
|
||||||
}
|
}}
|
||||||
selected={gun.id === antagonistGun.id}
|
selected={gun.id === antagonistGun.id}
|
||||||
discriminator={romanize(gun.tier)}
|
discriminator={romanize(gun.tier)}
|
||||||
secondaryDiscriminator={
|
secondaryDiscriminator={
|
||||||
@@ -196,10 +183,8 @@ export function Options({ thicknessRange, canvas, skeleton }: OptionsProps) {
|
|||||||
alt={unwrap(thisShell.name!)}
|
alt={unwrap(thisShell.name!)}
|
||||||
src={alias("api", `/icons/shells/${thisShell.icon}.webp`)}
|
src={alias("api", `/icons/shells/${thisShell.icon}.webp`)}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
Duel.mutate((draft) => {
|
|
||||||
draft.antagonist.shell = thisShell;
|
|
||||||
});
|
|
||||||
Tankopedia.mutate((draft) => {
|
Tankopedia.mutate((draft) => {
|
||||||
|
draft.antagonist.shell = thisShell.id;
|
||||||
draft.shot = undefined;
|
draft.shot = undefined;
|
||||||
draft.customShell = undefined;
|
draft.customShell = undefined;
|
||||||
});
|
});
|
||||||
@@ -223,13 +208,14 @@ export function Options({ thicknessRange, canvas, skeleton }: OptionsProps) {
|
|||||||
size={{ initial: "2", sm: "3" }}
|
size={{ initial: "2", sm: "3" }}
|
||||||
radius="none"
|
radius="none"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
Duel.mutate((draft) => {
|
|
||||||
draft.antagonist.equipmentMatrix[0][0] = hasCalibratedShells
|
|
||||||
? 0
|
|
||||||
: 1;
|
|
||||||
});
|
|
||||||
Tankopedia.mutate((draft) => {
|
Tankopedia.mutate((draft) => {
|
||||||
draft.shot = undefined;
|
draft.shot = undefined;
|
||||||
|
|
||||||
|
if (hasCalibratedShells) {
|
||||||
|
delete draft.protagonist.equipment[0];
|
||||||
|
} else {
|
||||||
|
draft.antagonist.equipment[0] = 1;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -248,12 +234,13 @@ export function Options({ thicknessRange, canvas, skeleton }: OptionsProps) {
|
|||||||
size={{ initial: "2", sm: "3" }}
|
size={{ initial: "2", sm: "3" }}
|
||||||
radius="none"
|
radius="none"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
Duel.mutate((draft) => {
|
|
||||||
draft.protagonist.equipmentMatrix[1][1] = hasEnhancedArmor
|
|
||||||
? 0
|
|
||||||
: -1;
|
|
||||||
});
|
|
||||||
Tankopedia.mutate((draft) => {
|
Tankopedia.mutate((draft) => {
|
||||||
|
if (hasEnhancedArmor) {
|
||||||
|
delete draft.protagonist.equipment[4];
|
||||||
|
} else {
|
||||||
|
draft.antagonist.equipment[4] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
draft.shot = undefined;
|
draft.shot = undefined;
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
@@ -282,10 +269,8 @@ export function Options({ thicknessRange, canvas, skeleton }: OptionsProps) {
|
|||||||
size={{ initial: "2", sm: "3" }}
|
size={{ initial: "2", sm: "3" }}
|
||||||
color={equalize ? undefined : "gray"}
|
color={equalize ? undefined : "gray"}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
Duel.mutate((draft) => {
|
|
||||||
draft.equalize = !draft.equalize;
|
|
||||||
});
|
|
||||||
Tankopedia.mutate((draft) => {
|
Tankopedia.mutate((draft) => {
|
||||||
|
draft.environment.equalize = !draft.environment.equalize;
|
||||||
draft.shot = undefined;
|
draft.shot = undefined;
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
@@ -347,19 +332,19 @@ export function Options({ thicknessRange, canvas, skeleton }: OptionsProps) {
|
|||||||
<DropdownMenu.Item
|
<DropdownMenu.Item
|
||||||
onClick={() => poseEvent.emit(Pose.HullDown)}
|
onClick={() => poseEvent.emit(Pose.HullDown)}
|
||||||
>
|
>
|
||||||
{strings.website.tools.tankopedia.sandbox.poses.hull_down}
|
{strings.tanks.poses.hull_down}
|
||||||
</DropdownMenu.Item>
|
</DropdownMenu.Item>
|
||||||
|
|
||||||
<DropdownMenu.Item
|
<DropdownMenu.Item
|
||||||
onClick={() => poseEvent.emit(Pose.FaceHug)}
|
onClick={() => poseEvent.emit(Pose.FaceHug)}
|
||||||
>
|
>
|
||||||
{strings.website.tools.tankopedia.sandbox.poses.face_hug}
|
{strings.tanks.poses.face_hug}
|
||||||
</DropdownMenu.Item>
|
</DropdownMenu.Item>
|
||||||
|
|
||||||
<DropdownMenu.Item
|
<DropdownMenu.Item
|
||||||
onClick={() => poseEvent.emit(Pose.Default)}
|
onClick={() => poseEvent.emit(Pose.Default)}
|
||||||
>
|
>
|
||||||
{strings.website.tools.tankopedia.sandbox.poses.default}
|
{strings.tanks.poses.default}
|
||||||
</DropdownMenu.Item>
|
</DropdownMenu.Item>
|
||||||
</DropdownMenu.Content>
|
</DropdownMenu.Content>
|
||||||
</DropdownMenu.Root>
|
</DropdownMenu.Root>
|
||||||
@@ -422,9 +407,7 @@ export function Options({ thicknessRange, canvas, skeleton }: OptionsProps) {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<SegmentedControl.Item value={`${TankopediaDisplay.Model}`}>
|
<SegmentedControl.Item value={`${TankopediaDisplay.Model}`}>
|
||||||
<Tooltip
|
<Tooltip content={strings.tanks.tabs.model}>
|
||||||
content={strings.website.tools.tankopedia.sandbox.model.name}
|
|
||||||
>
|
|
||||||
<Flex height="100%" align="center">
|
<Flex height="100%" align="center">
|
||||||
<img
|
<img
|
||||||
src="/assets/images/icons/tankopedia-model.png"
|
src="/assets/images/icons/tankopedia-model.png"
|
||||||
@@ -434,9 +417,7 @@ export function Options({ thicknessRange, canvas, skeleton }: OptionsProps) {
|
|||||||
</Tooltip>
|
</Tooltip>
|
||||||
</SegmentedControl.Item>
|
</SegmentedControl.Item>
|
||||||
<SegmentedControl.Item value={`${TankopediaDisplay.DynamicArmor}`}>
|
<SegmentedControl.Item value={`${TankopediaDisplay.DynamicArmor}`}>
|
||||||
<Tooltip
|
<Tooltip content={strings.tanks.tabs.dynamic_armor}>
|
||||||
content={strings.website.tools.tankopedia.sandbox.dynamic.name}
|
|
||||||
>
|
|
||||||
<Flex height="100%" align="center">
|
<Flex height="100%" align="center">
|
||||||
<img
|
<img
|
||||||
src="/assets/images/icons/tankopedia-dynamic-armor.png"
|
src="/assets/images/icons/tankopedia-dynamic-armor.png"
|
||||||
@@ -446,9 +427,7 @@ export function Options({ thicknessRange, canvas, skeleton }: OptionsProps) {
|
|||||||
</Tooltip>
|
</Tooltip>
|
||||||
</SegmentedControl.Item>
|
</SegmentedControl.Item>
|
||||||
<SegmentedControl.Item value={`${TankopediaDisplay.StaticArmor}`}>
|
<SegmentedControl.Item value={`${TankopediaDisplay.StaticArmor}`}>
|
||||||
<Tooltip
|
<Tooltip content={strings.tanks.tabs.model}>
|
||||||
content={strings.website.tools.tankopedia.sandbox.static.name}
|
|
||||||
>
|
|
||||||
<Flex height="100%" align="center">
|
<Flex height="100%" align="center">
|
||||||
<img
|
<img
|
||||||
src="/assets/images/icons/tankopedia-static-armor.png"
|
src="/assets/images/icons/tankopedia-static-armor.png"
|
||||||
@@ -485,14 +464,17 @@ export function Options({ thicknessRange, canvas, skeleton }: OptionsProps) {
|
|||||||
<TankSearch
|
<TankSearch
|
||||||
compact
|
compact
|
||||||
onSelect={(tank) => {
|
onSelect={(tank) => {
|
||||||
Duel.mutate((draft) => {
|
Tankopedia.mutate((draft) => {
|
||||||
draft.antagonist.tank = tank;
|
draft.antagonist.tank = tank.id;
|
||||||
draft.antagonist.engine = tank.engines.at(-1)!;
|
draft.antagonist.engine = tank.engines.at(-1)!.id;
|
||||||
draft.antagonist.track = tank.tracks.at(-1)!;
|
draft.antagonist.track = tank.tracks.at(-1)!.id;
|
||||||
draft.antagonist.turret = tank.turrets.at(-1)!;
|
|
||||||
draft.antagonist.gun =
|
const turret = tank.turrets.at(-1)!;
|
||||||
draft.antagonist.turret.guns.at(-1)!;
|
const gun = turret.guns.at(-1)!;
|
||||||
draft.antagonist.shell = draft.antagonist.gun.shells[0];
|
|
||||||
|
draft.antagonist.turret = turret.id;
|
||||||
|
draft.antagonist.gun = gun.id;
|
||||||
|
draft.antagonist.shell = gun.shells[0].id;
|
||||||
});
|
});
|
||||||
setAntagonistSelectorOpen(false);
|
setAntagonistSelectorOpen(false);
|
||||||
}}
|
}}
|
||||||
@@ -21,6 +21,7 @@ import { ShotDisplay } from "../ShotDisplay";
|
|||||||
import { SmartCanvas } from "../SmartCanvas";
|
import { SmartCanvas } from "../SmartCanvas";
|
||||||
import { StaticArmor, type ThicknessRange } from "../StaticArmor";
|
import { StaticArmor, type ThicknessRange } from "../StaticArmor";
|
||||||
import { TankModel } from "../TankModel";
|
import { TankModel } from "../TankModel";
|
||||||
|
import { TankopediaOptions } from "../TankopediaOptions";
|
||||||
import { TankopediaSkinSwitcher } from "../TankopediaSkinSwitcher";
|
import { TankopediaSkinSwitcher } from "../TankopediaSkinSwitcher";
|
||||||
import styles from "./index.module.css";
|
import styles from "./index.module.css";
|
||||||
|
|
||||||
@@ -171,6 +172,7 @@ export function TankopediaSandbox({
|
|||||||
</SmartCanvas>
|
</SmartCanvas>
|
||||||
|
|
||||||
<TankopediaSkinSwitcher />
|
<TankopediaSkinSwitcher />
|
||||||
|
<TankopediaOptions />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user