feat: filter matchmaker to official maps and active gamemodes

This commit is contained in:
2026-04-04 14:02:17 -07:00
parent 0dfe919d4f
commit b1697282e3
2 changed files with 21 additions and 3 deletions
+3 -3
View File
@@ -1,5 +1,5 @@
import { ipcRenderer } from 'electron';
import { fetchGame, MATCHMAKER_GAMEMODES, MATCHMAKER_REGIONS, MATCHMAKER_REGION_NAMES, MAP_ICON_INDICES, MATCHMAKER_MAP_NAMES } from './matchmaker';
import { fetchGame, MATCHMAKER_GAMEMODE_FILTER, MATCHMAKER_REGIONS, MATCHMAKER_REGION_NAMES, MATCHMAKER_MAP_FILTER, MATCHMAKER_MAP_NAMES } from './matchmaker';
import type { MatchmakerConfig } from './matchmaker';
import { initUserscripts, getInstances, setScriptEnabled } from './userscripts';
import type { UserscriptInstance } from './userscripts';
@@ -844,7 +844,7 @@ function buildMatchmakerSection(body: HTMLElement, mmConf: any, bag: SettingsBag
body.appendChild(createCheckboxGrid({
header: 'Gamemodes (none selected = all)',
items: MATCHMAKER_GAMEMODES.map(gm => ({ value: gm, label: gm })),
items: MATCHMAKER_GAMEMODE_FILTER.map(gm => ({ value: gm, label: gm })),
selected: mm.gamemodes,
onChange: () => saveMM(),
}));
@@ -852,7 +852,7 @@ function buildMatchmakerSection(body: HTMLElement, mmConf: any, bag: SettingsBag
if (!mm.maps) mm.maps = [];
body.appendChild(createCheckboxGrid({
header: 'Maps (none selected = all)',
items: MAP_ICON_INDICES.map(m => ({ value: m, label: MATCHMAKER_MAP_NAMES[m] || m })),
items: MATCHMAKER_MAP_FILTER.map(m => ({ value: m, label: MATCHMAKER_MAP_NAMES[m] || m })),
selected: mm.maps,
onChange: () => saveMM(),
}));
+18
View File
@@ -7,7 +7,16 @@ import { ipcRenderer } from 'electron';
import type { Keybind } from '../main/config';
import type { SavedConsole } from './utils';
// Full array — indices must match the server's gamemode IDs (game[4].g)
export const MATCHMAKER_GAMEMODES = ['Free for All', 'Team Deathmatch', 'Hardpoint', 'Capture the Flag', 'Parkour', 'Hide & Seek', 'Infected', 'Race', 'Last Man Standing', 'Simon Says', 'Gun Game', 'Prop Hunt', 'Boss Hunt', 'Classic FFA', 'Deposit', 'Stalker', 'King of the Hill', 'One in the Chamber', 'Trade', 'Kill Confirmed', 'Defuse', 'Sharp Shooter', 'Traitor', 'Raid', 'Blitz', 'Domination', 'Squad Deathmatch', 'Kranked FFA', 'Team Defender', 'Deposit FFA', 'Chaos Snipers', 'Bighead FFA'];
// Modes shown in matchmaker settings
export const MATCHMAKER_GAMEMODE_FILTER = [
'Free for All', 'Team Deathmatch', 'Hardpoint', 'Capture the Flag', 'Parkour',
'Gun Game', 'Classic FFA', 'Deposit', 'Kill Confirmed', 'Sharp Shooter',
'Domination', 'Kranked FFA', 'Team Defender', 'Deposit FFA', 'Chaos Snipers',
'Bighead FFA',
];
export const MATCHMAKER_REGIONS = ['MBI', 'NY', 'FRA', 'SIN', 'DAL', 'SYD', 'MIA', 'BHN', 'TOK', 'BRZ', 'AFR', 'LON', 'CHI', 'SV', 'STL', 'MX'];
export const MATCHMAKER_REGION_NAMES: Record<string, string> = { MBI: 'Mumbai', NY: 'New York', FRA: 'Frankfurt', SIN: 'Singapore', DAL: 'Dallas', SYD: 'Sydney', MIA: 'Miami', BHN: 'Middle East', TOK: 'Tokyo', BRZ: 'Brazil', AFR: 'South Africa', LON: 'London', CHI: 'China', SV: 'Silicon Valley', STL: 'Seattle', MX: 'Mexico' };
export const MAP_ICON_INDICES = ['Burg', 'Littletown', 'Sandstorm', 'Subzero', 'Undergrowth', 'Shipment', 'Freight', 'Lostworld', 'Citadel', 'Oasis', 'Kanji', 'Industry', 'Lumber', 'Evacuation', 'Site', 'SkyTemple', 'Lagoon', 'Bureau', 'Tortuga', 'Tropicano', 'Krunk_Plaza', 'Arena', 'Habitat', 'Atomic', 'Old_Burg', 'Throwback', 'Stockade', 'Facility', 'Clockwork', 'Laboratory', 'Shipyard', 'Soul Sanctum', 'Bazaar', 'Erupt', 'HQ', 'Khepri', 'Lush', 'Vivo', 'Slide Moonlight', 'Eterno Sim'];
@@ -16,6 +25,15 @@ export const MATCHMAKER_MAP_NAMES: Record<string, string> = {
'Soul Sanctum': 'Soul Sanctum', 'Slide Moonlight': 'Slide Moonlight', 'Eterno Sim': 'Eterno Sim',
};
// Official maps shown in matchmaker settings
export const MATCHMAKER_MAP_FILTER = [
'Burg', 'Littletown', 'Sandstorm', 'Subzero', 'Undergrowth', 'Freight',
'Lostworld', 'Citadel', 'Oasis', 'Kanji', 'Industry', 'Lumber', 'Evacuation',
'Site', 'SkyTemple', 'Lagoon', 'Tropicano', 'Habitat', 'Atomic', 'Old_Burg',
'Throwback', 'Clockwork', 'Bazaar', 'Erupt', 'HQ', 'Lush', 'Vivo',
'Slide Moonlight', 'Eterno Sim',
];
// ── Animation constants ──
const MAX_FEED_ENTRIES = 4;
const MAX_ANIMATION_MS = 2000;