refactor: 收口生成进度 tick 判定

This commit is contained in:
2026-06-04 02:49:23 +08:00
parent 80dab35646
commit 5dd73186b0
7 changed files with 320 additions and 25 deletions

View File

@@ -498,6 +498,7 @@ import type {
import { PlatformEntryWorldDetailView } from './PlatformEntryWorldDetailView';
import { PlatformErrorDialog } from './PlatformErrorDialog';
import { PlatformFeedbackView } from './PlatformFeedbackView';
import { resolvePlatformGenerationProgressTickDecision } from './platformGenerationProgressTickModel';
import {
buildMatch3DProfileFromSession,
hasMatch3DRuntimeAsset,
@@ -3807,32 +3808,25 @@ export function PlatformEntryFlowShellImpl({
]);
useEffect(() => {
const activeGenerationState =
selectionStage === 'puzzle-generating'
? puzzleGenerationState
: selectionStage === 'match3d-generating'
? match3dGenerationState
: selectionStage === 'big-fish-generating'
? bigFishGenerationState
: selectionStage === 'square-hole-generating'
? squareHoleGenerationState
: selectionStage === 'jump-hop-generating'
? jumpHopGenerationState
: selectionStage === 'wooden-fish-generating'
? woodenFishGenerationState
: selectionStage === 'baby-object-match-generating'
? babyObjectMatchGenerationState
: null;
const shouldTickProgress =
selectionStage === 'visual-novel-generating'
? visualNovelGenerationStartedAtMs != null &&
visualNovelGenerationPhase !== 'ready' &&
visualNovelGenerationPhase !== 'failed'
: activeGenerationState != null &&
activeGenerationState.phase !== 'ready' &&
activeGenerationState.phase !== 'failed';
const progressTickDecision =
resolvePlatformGenerationProgressTickDecision({
selectionStage,
miniGameStates: {
puzzle: puzzleGenerationState,
match3d: match3dGenerationState,
'big-fish': bigFishGenerationState,
'square-hole': squareHoleGenerationState,
'jump-hop': jumpHopGenerationState,
'wooden-fish': woodenFishGenerationState,
'baby-object-match': babyObjectMatchGenerationState,
},
visualNovel: {
startedAtMs: visualNovelGenerationStartedAtMs,
phase: visualNovelGenerationPhase,
},
});
if (!shouldTickProgress) {
if (!progressTickDecision.shouldTick) {
return undefined;
}