feat: 完善敲木鱼玩法模板链路

This commit is contained in:
2026-05-24 02:49:13 +08:00
parent 2ba4691bc0
commit 8638397faa
402 changed files with 2329 additions and 1781 deletions

View File

@@ -7589,8 +7589,6 @@ export function PlatformEntryFlowShellImpl({
hitObjectReferenceImageSrc:
payload?.hitObjectReferenceImageSrc ??
created.session.draft?.hitObjectReferenceImageSrc,
hitSoundPrompt:
payload?.hitSoundPrompt ?? created.session.draft?.hitSoundPrompt,
hitSoundAsset:
payload?.hitSoundAsset ?? created.session.draft?.hitSoundAsset,
floatingWords:
@@ -7643,7 +7641,7 @@ export function PlatformEntryFlowShellImpl({
}, [compileWoodenFishSession, setSelectionStage, woodenFishSession]);
const regenerateWoodenFishAsset = useCallback(
async (actionType: 'regenerate-hit-object' | 'generate-hit-sound') => {
async (actionType: 'regenerate-hit-object') => {
if (!woodenFishSession?.sessionId) {
setSelectionStage('wooden-fish-workspace');
return;
@@ -7665,7 +7663,6 @@ export function PlatformEntryFlowShellImpl({
hitObjectPrompt: woodenFishSession.draft?.hitObjectPrompt,
hitObjectReferenceImageSrc:
woodenFishSession.draft?.hitObjectReferenceImageSrc,
hitSoundPrompt: woodenFishSession.draft?.hitSoundPrompt,
hitSoundAsset: woodenFishSession.draft?.hitSoundAsset,
floatingWords: woodenFishSession.draft?.floatingWords,
},
@@ -7679,9 +7676,7 @@ export function PlatformEntryFlowShellImpl({
} catch (error) {
const errorMessage = resolveRpgCreationErrorMessage(
error,
actionType === 'regenerate-hit-object'
? '重新生成敲击物图案失败。'
: '生成敲击音效失败。',
'重新生成敲击物图案失败。',
);
setWoodenFishError(errorMessage);
setWoodenFishGenerationState(
@@ -7811,33 +7806,6 @@ export function PlatformEntryFlowShellImpl({
[setSelectionStage],
);
const restartWoodenFishRuntimeRun = useCallback(async () => {
const profileId =
woodenFishRun?.profileId?.trim() ??
woodenFishWork?.summary.profileId?.trim();
if (!profileId) {
await startWoodenFishTestRunFromProfile();
return;
}
setIsWoodenFishBusy(true);
setWoodenFishError(null);
try {
const response = await woodenFishClient.startRun(profileId);
setWoodenFishRun(response.run);
} catch (error) {
setWoodenFishError(
resolveRpgCreationErrorMessage(error, '重新开始敲木鱼失败。'),
);
} finally {
setIsWoodenFishBusy(false);
}
}, [
startWoodenFishTestRunFromProfile,
woodenFishRun?.profileId,
woodenFishWork?.summary.profileId,
]);
const checkpointWoodenFishRuntimeRun = useCallback(
async (payload: {
totalTapCount: number;
@@ -7853,31 +7821,6 @@ export function PlatformEntryFlowShellImpl({
[woodenFishRun?.runId],
);
const finishWoodenFishRuntimeRun = useCallback(
async (payload: {
totalTapCount: number;
wordCounters: WoodenFishRunResponse['run']['wordCounters'];
}) => {
const runId = woodenFishRun?.runId;
if (!runId) {
return;
}
setIsWoodenFishBusy(true);
setWoodenFishError(null);
try {
const response = await woodenFishClient.finishRun(runId, payload);
setWoodenFishRun(response.run);
} catch (error) {
setWoodenFishError(
resolveRpgCreationErrorMessage(error, '结束敲木鱼失败。'),
);
} finally {
setIsWoodenFishBusy(false);
}
},
[woodenFishRun?.runId],
);
const executePuzzleAction = puzzleFlow.executeAction;
const executePuzzleBackgroundAction = useCallback(
@@ -11479,11 +11422,7 @@ export function PlatformEntryFlowShellImpl({
onBack={() => {
setActiveRecommendRuntimeKind(null);
}}
onRestart={() => {
void restartWoodenFishRuntimeRun();
}}
onCheckpoint={checkpointWoodenFishRuntimeRun}
onFinish={finishWoodenFishRuntimeRun}
/>
);
}
@@ -11650,7 +11589,6 @@ export function PlatformEntryFlowShellImpl({
resolveSquareHoleErrorMessage,
reportBigFishObservedPlayTime,
restartBigFishRun,
restartWoodenFishRuntimeRun,
selectedPuzzleDetail,
selectionStage,
setMatch3DError,
@@ -11674,7 +11612,6 @@ export function PlatformEntryFlowShellImpl({
visualNovelSession,
visualNovelWork,
checkpointWoodenFishRuntimeRun,
finishWoodenFishRuntimeRun,
]);
useEffect(() => {
@@ -14449,9 +14386,6 @@ export function PlatformEntryFlowShellImpl({
onRegenerateHitObject={() => {
void regenerateWoodenFishAsset('regenerate-hit-object');
}}
onGenerateHitSound={() => {
void regenerateWoodenFishAsset('generate-hit-sound');
}}
/>
</Suspense>
</motion.div>
@@ -14476,11 +14410,7 @@ export function PlatformEntryFlowShellImpl({
onBack={() => {
setSelectionStage(woodenFishRuntimeReturnStage);
}}
onRestart={() => {
void restartWoodenFishRuntimeRun();
}}
onCheckpoint={checkpointWoodenFishRuntimeRun}
onFinish={finishWoodenFishRuntimeRun}
/>
</Suspense>
</motion.div>