Add egg encounter logging with route-lock bypass
Egg hatches can now be logged at any location without consuming the route's encounter slot. Adds an EggEncounterModal with pokemon search and a "Log Egg" button on the run encounters page. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -6,6 +6,7 @@ import { useCreateEncounter, useUpdateEncounter, useBulkRandomize } from '../hoo
|
||||
import { usePokemonFamilies } from '../hooks/usePokemon'
|
||||
import { useGameBosses, useBossResults, useCreateBossResult } from '../hooks/useBosses'
|
||||
import {
|
||||
EggEncounterModal,
|
||||
EncounterModal,
|
||||
EncounterMethodBadge,
|
||||
StatCard,
|
||||
@@ -410,6 +411,7 @@ export function RunEncounters() {
|
||||
useState<EncounterDetail | null>(null)
|
||||
const [showEndRun, setShowEndRun] = useState(false)
|
||||
const [showShinyModal, setShowShinyModal] = useState(false)
|
||||
const [showEggModal, setShowEggModal] = useState(false)
|
||||
const [expandedBosses, setExpandedBosses] = useState<Set<number>>(new Set())
|
||||
const [showTeam, setShowTeam] = useState(true)
|
||||
const [filter, setFilter] = useState<'all' | RouteStatus>('all')
|
||||
@@ -675,6 +677,7 @@ export function RunEncounters() {
|
||||
setSelectedRoute(null)
|
||||
setEditingEncounter(null)
|
||||
setShowShinyModal(false)
|
||||
setShowEggModal(false)
|
||||
},
|
||||
})
|
||||
}
|
||||
@@ -752,6 +755,14 @@ export function RunEncounters() {
|
||||
✦ Log Shiny
|
||||
</button>
|
||||
)}
|
||||
{isActive && (
|
||||
<button
|
||||
onClick={() => setShowEggModal(true)}
|
||||
className="px-3 py-1 text-sm border border-green-400 dark:border-green-600 text-green-600 dark:text-green-400 rounded-full font-medium hover:bg-green-50 dark:hover:bg-green-900/20 transition-colors"
|
||||
>
|
||||
🥚 Log Egg
|
||||
</button>
|
||||
)}
|
||||
{isActive && (
|
||||
<button
|
||||
onClick={() => setShowEndRun(true)}
|
||||
@@ -1257,6 +1268,16 @@ export function RunEncounters() {
|
||||
/>
|
||||
)}
|
||||
|
||||
{/* Egg Encounter Modal */}
|
||||
{showEggModal && routes && (
|
||||
<EggEncounterModal
|
||||
routes={routes}
|
||||
onSubmit={handleCreate}
|
||||
onClose={() => setShowEggModal(false)}
|
||||
isPending={createEncounter.isPending}
|
||||
/>
|
||||
)}
|
||||
|
||||
{/* Status Change Modal (team pokemon) */}
|
||||
{selectedTeamEncounter && (
|
||||
<StatusChangeModal
|
||||
|
||||
Reference in New Issue
Block a user