feat: shell range

This commit is contained in:
tresabhi committed 2024-11-09 16:00:15 -06:00
1 parent 594b1eb311
commit 0722ff6bfb
7 files changed
+32 -1

No files matched your search

@@ -116,6 +116,14 @@ export function Sort() {
>
Shell velocity
</DropdownMenu.CheckboxItem>
<DropdownMenu.CheckboxItem
checked={tankopediaSort.by === 'fire.shellRange'}
onClick={() => {
$tankopediaSort.setKey('by', 'fire.shellRange');
}}
>
Shell range
</DropdownMenu.CheckboxItem>
<DropdownMenu.CheckboxItem
checked={tankopediaSort.by === 'fire.aimTime'}
onClick={() => {
@@ -265,6 +265,16 @@ export const TankSearch = memo<TankSearchProps>(
);
break;
case 'fire.shellRange':
sorted = filtered.sort(
(a, b) =>
a.turrets.at(-1)!.guns.at(-1)!.gun_type!.value.base.shells[0]
.range -
b.turrets.at(-1)!.guns.at(-1)!.gun_type!.value.base.shells[0]
.range,
);
break;
case 'fire.aimTime':
sorted = filtered.sort(
(a, b) =>