Fix variant-aware fleet card map labels (Refs #150)
CI / checks (push) Successful in 5m47s

This commit is contained in:
2026-10-12 19:55:26 -04:00
parent 106d3a5ded
commit bcd3b99ee4
5 changed files with 220 additions and 10 deletions
+5 -6
View File
@@ -7,13 +7,12 @@ export function gameTitle(game: string | null | undefined, compact = false): str
}
export function mapTitle(map: string | null | undefined): string {
return (
[...T5_ZOMBIE_MAPS, ...T6_ZOMBIE_MAPS].find(
(entry) => entry.canonical === map?.toLowerCase()
)?.friendly ??
map ??
'—'
const matches = [...T5_ZOMBIE_MAPS, ...T6_ZOMBIE_MAPS].filter(
(entry) => entry.canonical === map?.toLowerCase()
);
// Engine identifiers alone cannot distinguish selections such as Town and TranZit.
if (matches.length > 1) return `${map} (variant unknown)`;
return matches[0]?.friendly ?? map ?? '—';
}
export function serverTitle(name: string): string {