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

+28 -4
View File
@@ -1,6 +1,6 @@
import { Image, StudyGuideModal } from '@/components'
import { EndingOverlay, Image, StudyGuideModal } from '@/components'
import { cn, getBackgroundImage, getPublicPath, getStaticImage } from '@/lib/utils'
import { useMemo } from 'react'
import { useEffect, useMemo, useRef, useState } from 'react'
import { useNavigate, useParams } from 'react-router-dom'
import { LOBBY_COLUMNS, LOBBY_LAYOUT, LOBBY_TIMELINE } from './lobby.config'
import { useNieerStore } from '@/store/nieerStore'
@@ -50,6 +50,20 @@ const NieerReflection = () => {
[placeCompletion]
)
const [endingVisible, setEndingVisible] = useState(false)
const prevDialogModeRef = useRef(dialogState.mode)
useEffect(() => {
if (
prevDialogModeRef.current === 'result' &&
dialogState.mode === 'idle' &&
allPlacesCompleted
) {
setEndingVisible(true)
}
prevDialogModeRef.current = dialogState.mode
}, [dialogState.mode, allPlacesCompleted])
const handleResultShare = (sceneId: number, payload?: Record<string, unknown>) => {
handleShare({
payload,
@@ -244,13 +258,23 @@ const NieerReflection = () => {
visible={showGuideModal}
onContinue={markReflectionGuideSeen}
audioSrc={getPublicPath('audio/nieer/mp3_nieer_28.mp3')}
contentPaddingLeft="2em"
// firstLineIndent="2em"
firstLineIndent="2em"
>
{`同学你好,欢迎来到“跨越时空·体悟”学习模块!
请登陆“时空回溯・亲历时代”体验仓,下一站:1936年,上海。
请带上你的旅行包,穿越时空解锁6个国歌故事,集齐精神徽章,绘制属于你的国歌精神图谱吧~时空门已开,请出发吧!`}
</StudyGuideModal>
<EndingOverlay
visible={endingVisible}
audioSrc={getPublicPath('audio/nieer/mp3_nieer_35.mp3')}
animationSpeed={200}
text={`恭喜你完成所有时空旅行!成功绘制“国歌精神图谱”,解锁6个跨越时空的国歌故事~国歌的故事还在继续,它的精神藏在每一次唱响、每一次坚守中。愿你带着这份精神力量,做国歌的传承者、爱国的践行者!`}
onContinue={() => {
setEndingVisible(false)
navigate(`/${moduleName}/${starName}/home`)
}}
/>
</div>
)
}