diff --git a/src/app/tools/tankopedia/[id]/page.tsx b/src/app/tools/tankopedia/[id]/page.tsx index 1e4092517..8471f5140 100644 --- a/src/app/tools/tankopedia/[id]/page.tsx +++ b/src/app/tools/tankopedia/[id]/page.tsx @@ -1,16 +1,13 @@ 'use client'; import { ArrowLeftIcon } from '@radix-ui/react-icons'; -import { Button, Flex, Heading, Text, Theme, Tooltip } from '@radix-ui/themes'; +import { Flex, Heading, Text } from '@radix-ui/themes'; import Link from 'next/link'; import { use, useEffect } from 'react'; import { Flag } from '../../../../components/Flag'; +import { ModuleButton } from '../../../../components/ModuleButton'; import PageWrapper from '../../../../components/PageWrapper'; -import { asset } from '../../../../core/blitzkrieg/asset'; -import { - TIER_ROMAN_NUMERALS, - tankDefinitions, -} from '../../../../core/blitzkrieg/tankDefinitions'; +import { tankDefinitions } from '../../../../core/blitzkrieg/tankDefinitions'; import mutateTankopedia, { useTankopedia } from '../../../../stores/tankopedia'; import { AntagonistBar } from './components/AntagonistBar'; import { TankDisplay } from './components/Model/TankDisplay'; @@ -101,66 +98,81 @@ export default function Page({ params }: { params: { id: string } }) { - - - - {protagonist.tank.turrets.map((thisTurret) => { - return ( - - - - ); - })} - + + + {protagonist.tank.turrets.map((thisTurret, index) => { + return ( + { + mutateTankopedia((draft) => { + if (!draft.areTanksAssigned) return; - - {protagonist.turret.guns.map((thisGun) => { - return ( - - - - ); - })} - + draft.protagonist.turret = thisTurret; + draft.protagonist.gun = thisTurret.guns.at(-1)!; + draft.protagonist.shell = + draft.protagonist.gun.shells[0]; + }); + }} + /> + ); + })} - + + + {protagonist.turret.guns.map((thisGun, index) => { + return ( + { + mutateTankopedia((draft) => { + if (!draft.areTanksAssigned) return; + + draft.protagonist.gun = thisGun; + draft.protagonist.shell = thisGun.shells[0]; + }); + }} + /> + ); + + // return ( + // + // + // + // ); + })} + +