From c6028b9868720a0cf1b5fd987542a2ffce2035b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tr=C3=A8sAbhi?= <43380238+tresabhi@users.noreply.github.com> Date: Sat, 13 Jul 2024 14:20:07 -0500 Subject: [PATCH] feat: remove battle count --- .../tools/tank-performance/components/TankRow.tsx | 5 ----- .../tools/tank-performance/components/Tanks.tsx | 14 +++++++------- .../tools/tank-performance/components/Total.tsx | 1 - src/stores/tankPerformanceSort/constants.ts | 1 - 4 files changed, 7 insertions(+), 14 deletions(-) diff --git a/src/app/tools/tank-performance/components/TankRow.tsx b/src/app/tools/tank-performance/components/TankRow.tsx index c39a891c9..f780fd439 100644 --- a/src/app/tools/tank-performance/components/TankRow.tsx +++ b/src/app/tools/tank-performance/components/TankRow.tsx @@ -32,11 +32,6 @@ export const TankRow = memo( Math.round(ratio * averages.samples[playerCountPeriod]), )} - - {formatCompact( - Math.round(ratio * averages.mu.battles * averages.samples.total), - )} - {Math.round( averages.mu.damage_dealt / averages.mu.battles, diff --git a/src/app/tools/tank-performance/components/Tanks.tsx b/src/app/tools/tank-performance/components/Tanks.tsx index 62172989c..897b967af 100644 --- a/src/app/tools/tank-performance/components/Tanks.tsx +++ b/src/app/tools/tank-performance/components/Tanks.tsx @@ -7,6 +7,7 @@ import { averageDefinitionsArray } from '../../../../core/blitzkit/averageDefini import { filterTank } from '../../../../core/blitzkit/filterTank'; import { tankDefinitions } from '../../../../core/blitzkit/tankDefinitions'; import * as TankFilters from '../../../../stores/tankFilters'; +import * as TankPerformancePersistent from '../../../../stores/tankPerformancePersistent'; import * as TankPerformanceSort from '../../../../stores/tankPerformanceSort'; import { RowLoader } from './RowLoader'; import { TankRow } from './TankRow'; @@ -20,19 +21,16 @@ export function Tanks() { const awaitedAverageDefinitionsArray = use(averageDefinitionsArray); const filters = TankFilters.use(); const sort = TankPerformanceSort.use(); + const tankPerformancePersistentStore = TankPerformancePersistent.useStore(); const tanksSorted = useMemo(() => { + const { playerCountPeriod } = tankPerformancePersistentStore.getState(); + switch (sort.type) { case 'accuracy': return awaitedAverageDefinitionsArray.sort( (a, b) => sort.direction * (a.mu.hits / a.mu.shots - b.mu.hits / b.mu.shots), ); - case 'battles': - return awaitedAverageDefinitionsArray.sort( - (a, b) => - sort.direction * - (a.samples.total * a.mu.battles - b.samples.total * b.mu.battles), - ); case 'capturePoints': return awaitedAverageDefinitionsArray.sort( (a, b) => @@ -81,7 +79,9 @@ export function Tanks() { ); case 'players': return awaitedAverageDefinitionsArray.sort( - (a, b) => sort.direction * (a.samples.d_30 - b.samples.d_30), + (a, b) => + sort.direction * + (a.samples[playerCountPeriod] - b.samples[playerCountPeriod]), ); case 'spots': return awaitedAverageDefinitionsArray.sort( diff --git a/src/app/tools/tank-performance/components/Total.tsx b/src/app/tools/tank-performance/components/Total.tsx index 543800ba0..3a002c620 100644 --- a/src/app/tools/tank-performance/components/Total.tsx +++ b/src/app/tools/tank-performance/components/Total.tsx @@ -57,7 +57,6 @@ export const Total = memo( ratio * awaitedAverageDefinitions.samples[playerCountPeriod], )} - {formatCompact(ratio * battles)} {Math.round(damage).toLocaleString()} diff --git a/src/stores/tankPerformanceSort/constants.ts b/src/stores/tankPerformanceSort/constants.ts index 01f23929a..2c619b8a6 100644 --- a/src/stores/tankPerformanceSort/constants.ts +++ b/src/stores/tankPerformanceSort/constants.ts @@ -3,7 +3,6 @@ import { TankPerformanceSortType } from '.'; export const TankPerformanceSortTypeNames = { winrate: 'Winrate', players: 'Players', - battles: 'Battles (total)', damage: 'Damage', survival: 'Survival', xp: 'XP',