feat: update residence learning flows
Commit non-media application and asset changes while leaving audio, video, and environment files out of version control. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
68ba22a33f
commit
6d40e19346
184 files changed
+7663
-2203
No files matched your search
@@ -3,6 +3,15 @@ import { PUZZLE_RESIDENCES } from './puzzleResidences'
|
||||
|
||||
export type PuzzleProgress = Record<string, Set<number>>
|
||||
|
||||
const BUILD_UNLOCK_ALL = import.meta.env.VITE_PROGRESS_UNLOCK_ALL === 'true'
|
||||
const UNLOCK_ALL_STORAGE_KEY = 'debug:progression-unlock-all'
|
||||
|
||||
const isUnlockAllEnabled = () => {
|
||||
if (!BUILD_UNLOCK_ALL) return false
|
||||
if (typeof window === 'undefined') return true
|
||||
return window.sessionStorage.getItem(UNLOCK_ALL_STORAGE_KEY) !== 'false'
|
||||
}
|
||||
|
||||
const getResidenceIndex = (residence: string) =>
|
||||
PUZZLE_RESIDENCES.findIndex((item) => item.residence === residence)
|
||||
|
||||
@@ -24,10 +33,13 @@ export const isResidenceStarted = (residence: string, puzzles: PuzzleProgress) =
|
||||
}
|
||||
|
||||
export const isResidenceComplete = (residence: string, puzzles: PuzzleProgress) => {
|
||||
if (isUnlockAllEnabled()) return true
|
||||
return arePiecesUnlocked(residence, puzzles, getConfiguredPieceIds(residence))
|
||||
}
|
||||
|
||||
export const isResidenceUnlocked = (residence: string, puzzles: PuzzleProgress) => {
|
||||
if (isUnlockAllEnabled()) return true
|
||||
|
||||
const index = getResidenceIndex(residence)
|
||||
if (index === 0) return true
|
||||
if (index < 0) return false
|
||||
@@ -50,6 +62,8 @@ export const isMenuModuleStarted = (moduleName: string, puzzles: PuzzleProgress)
|
||||
}
|
||||
|
||||
export const isMenuModuleComplete = (moduleName: string, puzzles: PuzzleProgress) => {
|
||||
if (isUnlockAllEnabled()) return true
|
||||
|
||||
const residences = PUZZLE_RESIDENCES.filter((item) => item.moduleName === moduleName)
|
||||
if (residences.length === 0) return false
|
||||
return residences.every((item) => isResidenceComplete(item.residence, puzzles))
|
||||
@@ -65,6 +79,14 @@ const getPieceIdsByRoute = (residence: string, routePrefix: string) => {
|
||||
}
|
||||
|
||||
export const getResidenceStageUnlocks = (residence: string, puzzles: PuzzleProgress) => {
|
||||
if (isUnlockAllEnabled()) {
|
||||
return {
|
||||
dialogueUnlocked: true,
|
||||
reflectionUnlocked: true,
|
||||
internalizationUnlocked: true,
|
||||
}
|
||||
}
|
||||
|
||||
const residenceUnlocked = isResidenceUnlocked(residence, puzzles)
|
||||
|
||||
return {
|
||||
|
||||
+24
-26
@@ -80,7 +80,7 @@ export const puzzleDataConfig: Record<string, Record<number, PuzzlePieceData>> =
|
||||
},
|
||||
// 碎片11
|
||||
11: {
|
||||
title: '陈云起草的关于发展国民 经济"一五"计划报告的手稿',
|
||||
title: '陈云起草的关于发展国民 经济“一五”计划报告的手稿',
|
||||
detailImage: 'chenyun/details/11',
|
||||
route: 'place8',
|
||||
},
|
||||
@@ -148,7 +148,7 @@ export const puzzleDataConfig: Record<string, Record<number, PuzzlePieceData>> =
|
||||
},
|
||||
// 碎片6
|
||||
6: {
|
||||
title: '中华职业教育 和中华职业学校',
|
||||
title: '职业教育 和中华职业学校',
|
||||
detailImage: 'huangyanpei/details/6',
|
||||
route: 'place4',
|
||||
},
|
||||
@@ -184,7 +184,7 @@ export const puzzleDataConfig: Record<string, Record<number, PuzzlePieceData>> =
|
||||
},
|
||||
// 碎片12
|
||||
12: {
|
||||
title: '窑洞对话',
|
||||
title: '窑洞对',
|
||||
detailImage: 'huangyanpei/details/12',
|
||||
route: 'place5',
|
||||
},
|
||||
@@ -196,7 +196,7 @@ export const puzzleDataConfig: Record<string, Record<number, PuzzlePieceData>> =
|
||||
},
|
||||
// 碎片14
|
||||
14: {
|
||||
title: '黄炎培对浦东中学新生的教导',
|
||||
title: '黄炎培对浦东中学 新生的教导',
|
||||
detailImage: 'huangyanpei/details/14',
|
||||
route: 'reflection2',
|
||||
},
|
||||
@@ -260,7 +260,7 @@ export const puzzleDataConfig: Record<string, Record<number, PuzzlePieceData>> =
|
||||
route: 'place3',
|
||||
},
|
||||
10: {
|
||||
title: '《中国国民党第一次 全国代表大会宣言》',
|
||||
title: '中国国民党第一次 全国代表大会宣言',
|
||||
detailImage: 'sunzhongshan/details/10',
|
||||
route: 'place3',
|
||||
},
|
||||
@@ -399,22 +399,22 @@ export const puzzleDataConfig: Record<string, Record<number, PuzzlePieceData>> =
|
||||
route: 'place2',
|
||||
},
|
||||
5: {
|
||||
title: '中共三大会议召开',
|
||||
title: '中共三大召开',
|
||||
detailImage: 'maozedong/details/5',
|
||||
route: 'place3',
|
||||
},
|
||||
6: {
|
||||
title: '《孙中山手书名单》',
|
||||
title: '孙中山手书名单',
|
||||
detailImage: 'maozedong/details/6',
|
||||
route: 'place3',
|
||||
},
|
||||
7: {
|
||||
title: '《孙文越飞联合宣言》',
|
||||
title: '孙文越飞联合宣言',
|
||||
detailImage: 'maozedong/details/7',
|
||||
route: 'place3',
|
||||
},
|
||||
8: {
|
||||
title: '毛泽东签发的两份中共四大通知',
|
||||
title: '毛泽东签发的两份 中共四大通知',
|
||||
detailImage: 'maozedong/details/8',
|
||||
route: 'place4',
|
||||
},
|
||||
@@ -424,7 +424,7 @@ export const puzzleDataConfig: Record<string, Record<number, PuzzlePieceData>> =
|
||||
route: 'place4',
|
||||
},
|
||||
10: {
|
||||
title: '毛泽东中国社会分析',
|
||||
title: '中国社会各阶级的分析',
|
||||
detailImage: 'maozedong/details/10',
|
||||
route: 'place4',
|
||||
},
|
||||
@@ -501,34 +501,34 @@ export const puzzleDataConfig: Record<string, Record<number, PuzzlePieceData>> =
|
||||
route: 'place4',
|
||||
},
|
||||
9: {
|
||||
title: '刘良模指挥数千人齐唱',
|
||||
title: '国歌选定',
|
||||
detailImage: 'nieer/details/9',
|
||||
route: 'place4',
|
||||
route: 'place5',
|
||||
},
|
||||
10: {
|
||||
title: '国歌选定',
|
||||
title: '国歌入宪',
|
||||
detailImage: 'nieer/details/10',
|
||||
route: 'place5',
|
||||
},
|
||||
11: {
|
||||
title: '国歌入宪',
|
||||
title: '国歌立法',
|
||||
detailImage: 'nieer/details/11',
|
||||
route: 'place5',
|
||||
},
|
||||
12: {
|
||||
title: '国歌立法',
|
||||
title: '新中国奏响国歌的场景(上)',
|
||||
detailImage: 'nieer/details/12',
|
||||
route: 'place5',
|
||||
route: 'place6',
|
||||
},
|
||||
13: {
|
||||
title: '新中国奏响国歌的场景(上)',
|
||||
title: '新中国奏响国歌的场景(下)',
|
||||
detailImage: 'nieer/details/13',
|
||||
route: 'place6',
|
||||
},
|
||||
14: {
|
||||
title: '新中国奏响国歌的场景(下)',
|
||||
title: '唱国家一定要站起来',
|
||||
detailImage: 'nieer/details/14',
|
||||
route: 'place6',
|
||||
route: 'reflection',
|
||||
},
|
||||
15: {
|
||||
title: '聂耳「人民音乐家」',
|
||||
@@ -578,7 +578,7 @@ export const puzzleDataConfig: Record<string, Record<number, PuzzlePieceData>> =
|
||||
route: 'place3',
|
||||
},
|
||||
8: {
|
||||
title: '三毛新生(《向日葵》张乐平,1950-1965)',
|
||||
title: '三毛新生',
|
||||
detailImage: 'zhangleping/details/8',
|
||||
route: 'place3',
|
||||
},
|
||||
@@ -608,17 +608,17 @@ export const puzzleDataConfig: Record<string, Record<number, PuzzlePieceData>> =
|
||||
route: 'place5',
|
||||
},
|
||||
14: {
|
||||
title: '画自己',
|
||||
title: '创作心路',
|
||||
detailImage: 'zhangleping/details/14',
|
||||
route: 'place5',
|
||||
route: 'reflection',
|
||||
},
|
||||
15: {
|
||||
title: '平民立场',
|
||||
title: '艺术来源于生活',
|
||||
detailImage: 'zhangleping/details/15',
|
||||
route: 'internalization',
|
||||
},
|
||||
16: {
|
||||
title: '笔耕不辍',
|
||||
title: '核心创作理念',
|
||||
detailImage: 'zhangleping/details/16',
|
||||
route: 'internalization',
|
||||
},
|
||||
@@ -705,8 +705,6 @@ export const puzzleDataConfig: Record<string, Record<number, PuzzlePieceData>> =
|
||||
route: 'internalization',
|
||||
},
|
||||
},
|
||||
// 后续可以添加其他故居的数据
|
||||
// sunzhongshan: { ... },
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user