Add type restriction rule (monolocke)
Adds allowedTypes: string[] to NuzlockeRules. When set, the encounter selector hides non-matching Pokemon and the routes endpoint filters out routes with no matching encounters, so only eligible locations appear. Type picker UI in RulesConfiguration; active restriction shown in RuleBadges. Backend accepts allowed_types query param and joins through RouteEncounter.pokemon to filter by type. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -15,10 +15,10 @@ export function useGame(id: number) {
|
||||
})
|
||||
}
|
||||
|
||||
export function useGameRoutes(gameId: number | null) {
|
||||
export function useGameRoutes(gameId: number | null, allowedTypes?: string[]) {
|
||||
return useQuery({
|
||||
queryKey: ['games', gameId, 'routes'],
|
||||
queryFn: () => getGameRoutes(gameId!),
|
||||
queryKey: ['games', gameId, 'routes', allowedTypes],
|
||||
queryFn: () => getGameRoutes(gameId!, allowedTypes),
|
||||
enabled: gameId !== null,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user