feat: 结局AI改写支持pathHistory回放和完成通知

This commit is contained in:
wangwuww111
2026-03-10 14:19:13 +08:00
parent aa23db8a89
commit 2b941cc4e0
5 changed files with 119 additions and 29 deletions

View File

@@ -128,6 +128,14 @@ export default class StoryScene extends BaseScene {
const draft = await this.main.storyManager.getDraftDetail(this.draftId);
console.log('[StoryScene] 草稿详情:', JSON.stringify({
hasDraft: !!draft,
hasAiNodes: !!draft?.aiNodes,
aiNodesKeys: draft?.aiNodes ? Object.keys(draft.aiNodes) : [],
entryNodeKey: draft?.entryNodeKey,
pathHistoryLength: draft?.pathHistory?.length
}));
if (draft && draft.aiNodes && draft.storyId) {
// 先加载原故事
this.story = await this.main.storyManager.loadStoryDetail(draft.storyId);
@@ -1197,8 +1205,8 @@ export default class StoryScene extends BaseScene {
if (this.waitingForClick) {
this.waitingForClick = false;
// AI改写内容 - 直接跳转到新结局
if (this.aiContent && this.aiContent.is_ending) {
// AI改写内容 - 直接跳转到新结局(但回放模式下先显示选项)
if (this.aiContent && this.aiContent.is_ending && !this.isReplayMode) {
console.log('AI改写内容:', JSON.stringify(this.aiContent));
this.main.sceneManager.switchScene('ending', {
storyId: this.storyId,