Add naming scheme support for genlockes with lineage-aware suggestions (#20)
Genlockes can now select a naming scheme at creation time, which is automatically applied to every leg's run. When catching a pokemon whose evolution family appeared in a previous leg, the system suggests the original nickname with a roman numeral suffix (e.g., "Heracles II"). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Reviewed-on: TheFurya/nuzlocke-tracker#20 Co-authored-by: Julian Tabel <juliantabel.jt@gmail.com> Co-committed-by: Julian Tabel <juliantabel.jt@gmail.com>
This commit was merged in pull request #20.
This commit is contained in:
@@ -18,6 +18,7 @@ interface EncounterModalProps {
|
||||
gameId: number
|
||||
runId: number
|
||||
namingScheme?: string | null
|
||||
isGenlocke?: boolean
|
||||
existing?: EncounterDetail
|
||||
dupedPokemonIds?: Set<number>
|
||||
retiredPokemonIds?: Set<number>
|
||||
@@ -97,6 +98,7 @@ export function EncounterModal({
|
||||
gameId,
|
||||
runId,
|
||||
namingScheme,
|
||||
isGenlocke,
|
||||
existing,
|
||||
dupedPokemonIds,
|
||||
retiredPokemonIds,
|
||||
@@ -126,8 +128,9 @@ export function EncounterModal({
|
||||
const isEditing = !!existing
|
||||
|
||||
const showSuggestions = !!namingScheme && status === 'caught' && !isEditing
|
||||
const lineagePokemonId = isGenlocke && selectedPokemon ? selectedPokemon.pokemonId : null
|
||||
const { data: suggestions, refetch: regenerate, isFetching: loadingSuggestions } =
|
||||
useNameSuggestions(showSuggestions ? runId : null)
|
||||
useNameSuggestions(showSuggestions ? runId : null, lineagePokemonId)
|
||||
|
||||
// Pre-select pokemon when editing
|
||||
useEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user