feat: add puzzle residence configuration and reflection progress logic
- Introduced `puzzleResidences.ts` to define puzzle residence configurations including properties like display name, position, and puzzle availability. - Added `reflectionProgress.ts` to manage badge unlocking logic based on place completion, including functions to determine unlocked badges and video sources for scenes.
This commit is contained in:
1 parent
e0fa47d21a
commit
f5f36f75b5
153 files changed
+3846
-2352
No files matched your search
@@ -1,8 +1,15 @@
|
||||
import { createContext, useContext, ReactNode } from 'react'
|
||||
|
||||
interface TriggerPuzzleAnimationOptions {
|
||||
onComplete?: () => void
|
||||
}
|
||||
|
||||
interface PuzzleAnimationContextType {
|
||||
/** 触发碎片动画,传递碎片ID */
|
||||
triggerPuzzleAnimation: (pieceId: number) => void
|
||||
/** 触发碎片动画,传递碎片ID,并在动画结束后 resolve */
|
||||
triggerPuzzleAnimation: (
|
||||
pieceId: number,
|
||||
options?: TriggerPuzzleAnimationOptions
|
||||
) => Promise<void>
|
||||
}
|
||||
|
||||
const PuzzleAnimationContext = createContext<PuzzleAnimationContextType | null>(null)
|
||||
@@ -12,7 +19,10 @@ export const PuzzleAnimationProvider = ({
|
||||
triggerPuzzleAnimation,
|
||||
}: {
|
||||
children: ReactNode
|
||||
triggerPuzzleAnimation: (pieceId: number) => void
|
||||
triggerPuzzleAnimation: (
|
||||
pieceId: number,
|
||||
options?: TriggerPuzzleAnimationOptions
|
||||
) => Promise<void>
|
||||
}) => {
|
||||
return (
|
||||
<PuzzleAnimationContext.Provider value={{ triggerPuzzleAnimation }}>
|
||||
|
||||
Reference in new issue
Block a user