feat: add progression logic for puzzle residences

- Implemented functions to manage puzzle progress including checking if residences are started, complete, and unlocked.
- Added utility functions to retrieve piece IDs based on residence and route.
- Introduced a new TypeScript file for progression management.
- Integrated puzzle data configuration and residence data for seamless progression tracking.
This commit is contained in:
zhongyidian committed 2026-05-01 21:19:25 +08:00
1 parent 5a1c3cc368
commit 284302341c
72 files changed
+1104 -517

No files matched your search

+19 -1
View File
@@ -48,6 +48,7 @@ const RongdeshengPlace4 = () => {
const [activeExhibitId, setActiveExhibitId] = useState<1 | 2 | 3 | 4 | null>(null)
const [showVideo, setShowVideo] = useState(false)
const [showEndingVideo, setShowEndingVideo] = useState(false)
const [guide1Visible, setGuide1Visible] = useState(false)
const [guide1Step, setGuide1Step] = useState(0)
const [guide1AfterVideoVisible, setGuide1AfterVideoVisible] = useState(false)
@@ -95,6 +96,11 @@ const RongdeshengPlace4 = () => {
setGuide1AfterVideoVisible(true)
}
const handleEndingVideoEnded = () => {
setShowEndingVideo(false)
setEndingGuideVisible(true)
}
return (
<div
className="w-full h-full bg-cover bg-center bg-no-repeat"
@@ -174,7 +180,7 @@ const RongdeshengPlace4 = () => {
})
if (closingId === 4) {
setEndingGuideVisible(true)
setShowEndingVideo(true)
}
}
@@ -196,6 +202,18 @@ const RongdeshengPlace4 = () => {
/>
)}
{showEndingVideo && (
<Video
src={getPublicPath('video/rongdesheng/rongdesheng_11.mp4')}
className="fixed inset-0 z-20000"
autoPlay
playsInline
showSkipButton
onEnded={handleEndingVideoEnded}
onSkip={handleEndingVideoEnded}
/>
)}
<GuideSteps
visible={guide1Visible}
onVisibleChange={setGuide1Visible}