From f3e96718eb17f927f6332394edaf04deb8ef0af4 Mon Sep 17 00:00:00 2001 From: tresabhi <43380238+tresabhi@users.noreply.github.com> Date: Fri, 15 May 2026 21:18:01 -0500 Subject: [PATCH] exclusive alternate guns --- .../website-ue/src/components/Price/index.tsx | 2 +- .../TankopediaLoadout/index.module.css | 2 +- .../components/TankopediaLoadout/index.tsx | 50 +++++++++++++++---- .../website-ue/src/config/alternativeLines.ts | 8 +++ .../src/tankopedia/aggregateParameters.ts | 23 ++++++++- .../src/tankopedia/computeCharacteristics.ts | 6 ++- .../src/tankopedia/createTankState.ts | 12 +++++ .../website-ue/src/tankopedia/tankState.ts | 1 + 8 files changed, 89 insertions(+), 15 deletions(-) diff --git a/packages/website-ue/src/components/Price/index.tsx b/packages/website-ue/src/components/Price/index.tsx index 2ee8feb0d..7da0fb868 100644 --- a/packages/website-ue/src/components/Price/index.tsx +++ b/packages/website-ue/src/components/Price/index.tsx @@ -39,7 +39,7 @@ function PriceEntry({ entry }: PriceEntryProps) { const [, iconName] = entry.currency_price.currency_catalog_id.split("."); return ( - +
{formatCompact(locale, entry.currency_price.amount)} diff --git a/packages/website-ue/src/components/TankopediaLoadout/index.module.css b/packages/website-ue/src/components/TankopediaLoadout/index.module.css index 4cf2f3dea..d26528faf 100644 --- a/packages/website-ue/src/components/TankopediaLoadout/index.module.css +++ b/packages/website-ue/src/components/TankopediaLoadout/index.module.css @@ -21,7 +21,7 @@ width: 1em; height: 1em; - padding: var(--space-4) 0; + padding: var(--space-3) 0; transform: translate(var(--space-1), calc(-1 * var(--space-1))); } diff --git a/packages/website-ue/src/components/TankopediaLoadout/index.tsx b/packages/website-ue/src/components/TankopediaLoadout/index.tsx index 108433f55..a3db1c873 100644 --- a/packages/website-ue/src/components/TankopediaLoadout/index.tsx +++ b/packages/website-ue/src/components/TankopediaLoadout/index.tsx @@ -7,6 +7,7 @@ import { useMemo } from "react"; import { alternativeLines, isAlternativeLine, + originalLineName, } from "../../config/alternativeLines"; import { useProtagonist } from "../../hooks/useProtagonist"; import { useStrings } from "../../hooks/useStrings"; @@ -90,6 +91,7 @@ interface LineElementProps { function LineElement({ index, lineName, stage }: LineElementProps) { const upgrades = Tankopedia.use((state) => state.protagonist.upgrades); + const alternates = Tankopedia.use((state) => state.protagonist.alternates); const tank = useProtagonist(); const strings = useStrings(); const upgradePreset = useUpgradePreset(tank.tank!.tank_upgrade_preset); @@ -119,7 +121,18 @@ function LineElement({ index, lineName, stage }: LineElementProps) { price = override.price; } - const isSelected = upgrades[lineName] === index; + let isSelected: boolean; + + if (isAlternativeLine(lineName)) { + const originalLine = originalLineName(lineName); + isSelected = alternates[originalLine!]; + } else { + if (alternates[lineName]) { + isSelected = false; + } else { + isSelected = upgrades[lineName] === index; + } + } return (