Compare commits

...
15 Commits
Author SHA1 Message Date
TrèsAbhi f837aaf40a fix: use dropdown 2025-12-30 20:56:42 -06:00
TrèsAbhi 86e080aae9 feat: shells 2025-12-30 20:48:51 -06:00
TrèsAbhi 57efde83df Merge pull request #193 from Hitjack007/filter-by-provision 2025-12-31 02:39:06 +00:00
TrèsAbhi 6b29584424 feat: minor adjusments 2025-12-30 20:38:32 -06:00
TrèsAbhi 71e40a0113 feat: tank types 2025-12-30 20:30:18 -06:00
TrèsAbhi b5e7170697 feat: gun types 2025-12-30 20:23:06 -06:00
TrèsAbhi 4122856024 fix: reduce gap 2025-12-30 20:13:37 -06:00
TrèsAbhi 5b4c85138e feat: classes 2025-12-30 20:12:25 -06:00
TrèsAbhi 727ced967b feat: extract components 2025-12-30 20:05:00 -06:00
TrèsAbhi 4462ebe82c feat: tiers filter 2025-12-30 20:00:18 -06:00
TrèsAbhi 06ce263668 feat: compact nations selector 2025-12-30 19:53:06 -06:00
TrèsAbhi b6d6fa7212 Remove unused React import from FilterControl.tsx 2025-12-30 09:52:11 -06:00
TrèsAbhi dfa8be63b4 Pet peeve 2025-12-30 09:51:10 -06:00
TrèsAbhi 9eb6acc624 Fix formatting of consumables array in tankFilters 2025-12-30 09:49:06 -06:00
Mark Greene b6204b1c2c Added ability to filter tanks by available provisions 2025-12-30 20:45:44 +13:00
6 changed files with 547 additions and 563 deletions

No files matched your search

+4 -2
View File
@@ -26,8 +26,8 @@
"shells": {
"ap": "AP",
"apcr": "APCR",
"heat": "HEAT",
"ap_cr": "APCR",
"hc": "HEAT",
"he": "HE"
},
@@ -759,11 +759,13 @@
"count_singular": "1 tank",
"count_plural": "{count} tanks",
"sorting_by": "Sorting by {name}",
"no_tanks_found": {
"body": "No tanks found.",
"search_again": "Try searching again.",
"clear_filters": "Try clearing filters."
},
"sort": {
"meta.none": "none",
"survivability.health": "health",
File diff suppressed because it is too large. Load diff
@@ -429,7 +429,7 @@ export const TankSearch = memo<TankSearchProps>(
}, [tankFilters, tankopediaSort]);
return (
<Flex direction="column" gap="4" flexGrow="1" {...props}>
<Flex direction="column" gap="2" flexGrow="1" {...props}>
<SearchBar
skeleton={skeleton}
topResult={tanks?.[0]}
@@ -108,10 +108,10 @@ export function CustomShellButton() {
{strings.common.shells.ap}
</Select.Item>
<Select.Item value={`${ShellType.APCR}`}>
{strings.common.shells.apcr}
{strings.common.shells.ap_cr}
</Select.Item>
<Select.Item value={`${ShellType.HEAT}`}>
{strings.common.shells.heat}
{strings.common.shells.hc}
</Select.Item>
<Select.Item value={`${ShellType.HE}`}>
{strings.common.shells.he}
@@ -1,9 +1,13 @@
import type { TankDefinition } from "@blitzkit/core";
import { checkConsumableProvisionInclusivity } from "@blitzkit/core/src/blitzkit/checkConsumableProvisionInclusivity";
import { times } from "lodash-es";
import { awaitableConsumableDefinitions } from "../../core/awaitables/consumableDefinitions";
import type { TankFilters } from "../../stores/tankFilters";
const SHELLS = times(3, (index) => index);
const consumableDefinitions = await awaitableConsumableDefinitions;
export async function filterTank(
filters: TankFilters,
tank: TankDefinition,
@@ -40,6 +44,18 @@ export async function filterTank(
gun.shells[index].type === filters.shells[index]
)
)
)
) &&
(filters.consumables.length === 0 ||
filters.consumables.every((consumableId) =>
tank.turrets.some((turret) =>
turret.guns.some((gun) =>
checkConsumableProvisionInclusivity(
consumableDefinitions.consumables[consumableId],
tank,
gun
)
)
)
))
);
}
@@ -21,6 +21,7 @@ export interface TankFilters {
searching: boolean;
gunType: CaseType<GunDefinition>[];
shells: [ShellType | null, ShellType | null, ShellType | null];
consumables: number[];
showTesting: boolean;
showNonTesting: boolean;
@@ -37,6 +38,7 @@ export const TankFilters = new Varuna<TankFilters>({
searching: false,
gunType: [],
shells: [null, null, null],
consumables: [],
showTesting: true,
showNonTesting: true,