From e9c39530854d7713283e8b754b629918ea3c144c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tr=C3=A8sAbhi?= <43380238+tresabhi@users.noreply.github.com> Date: Thu, 1 Feb 2024 12:06:13 -0600 Subject: [PATCH] feat: stats organization --- .../Characteristics/components/Info.tsx | 26 +++-- .../[id]/components/Characteristics/index.tsx | 100 ++++++++---------- 2 files changed, 62 insertions(+), 64 deletions(-) diff --git a/src/app/tools/tankopedia/[id]/components/Characteristics/components/Info.tsx b/src/app/tools/tankopedia/[id]/components/Characteristics/components/Info.tsx index 5e991ef7f..d749faa78 100644 --- a/src/app/tools/tankopedia/[id]/components/Characteristics/components/Info.tsx +++ b/src/app/tools/tankopedia/[id]/components/Characteristics/components/Info.tsx @@ -4,7 +4,7 @@ import { theme } from '../../../../../../../stitches.config'; interface InfoProps { name: string; - children: ReactNode; + children?: ReactNode; unit?: string; indent?: boolean; highlight?: boolean; @@ -35,17 +35,21 @@ export function Info({ )} -
+ {children !== undefined && ( +
+ )} - {children} + {children !== undefined && ( + {children} + )} ); } diff --git a/src/app/tools/tankopedia/[id]/components/Characteristics/index.tsx b/src/app/tools/tankopedia/[id]/components/Characteristics/index.tsx index d60da564d..bb7315645 100644 --- a/src/app/tools/tankopedia/[id]/components/Characteristics/index.tsx +++ b/src/app/tools/tankopedia/[id]/components/Characteristics/index.tsx @@ -56,22 +56,23 @@ export function Characteristics() { {turret.view_range} - + + {(tank.camouflage.still * 100).toFixed(2)} - + {(tank.camouflage.moving * 100).toFixed(2)} - + {(tank.camouflage.still * gun.camouflageLoss * 100).toFixed(2)} - + {(tank.camouflage.moving * gun.camouflageLoss * 100).toFixed(2)} - - {(tank.camouflage.onFire * 100).toFixed(2)} + + {(tank.camouflage.onFire * tank.camouflage.still * 100).toFixed(2)} - + {size.map((component) => component.toFixed(2)).join(' x ')} @@ -79,9 +80,6 @@ export function Characteristics() { Fire {GUN_TYPE_NAMES[gun.type]} - - {dpm.toFixed(0)} - {gun.type === 'auto_reloader' && ( <> @@ -107,91 +105,84 @@ export function Characteristics() { {gun.reload.toFixed(2)} )} + + {dpm.toFixed(0)} + {shell.caliber} - {gun.shells.map((shell, index) => ( - 0} - name={`${SHELL_NAMES[shell.type]}${index === 0 ? ' penetration' : ''}`} - unit="mm" - > + + {gun.shells.map((shell) => ( + {resolveNearPenetration(shell.penetration)} ))} - {gun.shells.map((shell, index) => ( - 0} - name={`${SHELL_NAMES[shell.type]}${index === 0 ? ' damage' : ''}`} - unit="hp" - > + + {gun.shells.map((shell) => ( + {shell.damage.armor} ))} + {gun.shells.map((shell, index) => ( - 0} - name={`${SHELL_NAMES[shell.type]}${index === 0 ? ' module damage' : ''}`} - unit="hp" - > + {shell.damage.module} ))} + {gun.shells.map((shell, index) => ( - 0} - name={`${SHELL_NAMES[shell.type]}${index === 0 ? ' velocity' : ''}`} - unit="m/s" - > + {shell.speed} ))} TODO - + + TODO - + TODO - + TODO - + TODO - + TODO - + + {gunModelDefinition.pitch.max} - + {-gunModelDefinition.pitch.min} {gunModelDefinition.pitch.front && ( <> - + {gunModelDefinition.pitch.front.max} - + {-gunModelDefinition.pitch.front.min} )} {gunModelDefinition.pitch.back && ( <> - + {gunModelDefinition.pitch.back.max} - + {-gunModelDefinition.pitch.back.min} )} {turretModelDefinition.yaw && ( - + {-turretModelDefinition.yaw.min}, {turretModelDefinition.yaw.max} )} @@ -199,34 +190,37 @@ export function Characteristics() { Maneuverability - + + TODO - + TODO - + TODO - + + TODO - + TODO - + TODO TODO - + + TODO - + TODO - + TODO