diff --git a/src/app/tools/tankopedia/components/Sort.tsx b/src/app/tools/tankopedia/components/Sort.tsx index e0a50f4a8..00727a65f 100644 --- a/src/app/tools/tankopedia/components/Sort.tsx +++ b/src/app/tools/tankopedia/components/Sort.tsx @@ -43,7 +43,17 @@ export function Sort() { }); }} > - DPM + Standard DPM + + { + mutateTankopediaFilters((draft) => { + draft.sort.by = 'fire.dpmPremium'; + }); + }} + > + Premium DPM ( ); break; + case 'fire.dpmPremium': + sorted = filtered.sort( + (a, b) => + (a.turrets.at(-1)!.guns.at(-1)!.shells[1] + ? resolveDpm( + a.turrets.at(-1)!.guns.at(-1)!, + a.turrets.at(-1)!.guns.at(-1)!.shells[1], + ) + : 0) - + (b.turrets.at(-1)!.guns.at(-1)!.shells[1] + ? resolveDpm( + b.turrets.at(-1)!.guns.at(-1)!, + b.turrets.at(-1)!.guns.at(-1)!.shells[1], + ) + : 0), + ); + break; + case 'fire.reload': sorted = filtered.sort( (a, b) => diff --git a/src/stores/tankopedia.ts b/src/stores/tankopedia.ts index 88d746e77..97f4e2af1 100644 --- a/src/stores/tankopedia.ts +++ b/src/stores/tankopedia.ts @@ -114,7 +114,8 @@ export const SORT_NAMES = { 'survivability.camouflageShooting': 'camouflage shooting', 'survivability.volume': 'volume', 'survivability.length': 'length', - 'fire.dpm': 'DPM', + 'fire.dpm': 'standard DPM', + 'fire.dpmPremium': 'premium DPM', 'fire.reload': 'reload', 'fire.caliber': 'caliber', 'fire.standardPenetration': 'standard penetration', @@ -143,6 +144,7 @@ export const SORT_UNITS: Record = { 'fire.dispersionMoving': 'm', 'fire.dispersionStill': 'm', 'fire.dpm': undefined, + 'fire.dpmPremium': undefined, 'fire.gunDepression': '°', 'fire.gunElevation': '°', 'fire.premiumPenetration': 'mm',