- game system selector: standalone, existing system (MTG/Pokemon/Lorcana/ SWU/FaB/One Piece/Sorcery/Grand Archive — codes match catalog imports), or a user's custom game - custom_games table + CRUD API (private per user, unique names) - /games hub with create form; /games/[id] space with rename, delete, card gallery, and ?game= deep-link into the designer - catalog twin resolves game: system code, custom game name, or 'Custom' - my-designs shows each design's game association - migration 1787693311000
24 lines
911 B
JavaScript
24 lines
911 B
JavaScript
/**
|
|
* Game systems available for card targeting. Values match the codes the
|
|
* catalog already uses for imported cards ('MTG', 'Pokemon', 'Lorcana')
|
|
* so designer cards filter correctly alongside imports.
|
|
*/
|
|
export const EXISTING_GAMES = [
|
|
{ value: 'MTG', label: 'Magic: The Gathering' },
|
|
{ value: 'Pokemon', label: 'Pokémon' },
|
|
{ value: 'Lorcana', label: 'Disney Lorcana' },
|
|
{ value: 'Star Wars Unlimited', label: 'Star Wars: Unlimited' },
|
|
{ value: 'Flesh and Blood', label: 'Flesh and Blood' },
|
|
{ value: 'One Piece', label: 'One Piece' },
|
|
{ value: 'Sorcery', label: 'Sorcery: Contested Realm' },
|
|
{ value: 'Grand Archive', label: 'Grand Archive' },
|
|
];
|
|
|
|
export function isExistingGame(value) {
|
|
return EXISTING_GAMES.some((g) => g.value === value);
|
|
}
|
|
|
|
export function gameLabel(value) {
|
|
const match = EXISTING_GAMES.find((g) => g.value === value);
|
|
return match ? match.label : value;
|
|
}
|