diff --git a/client/js/scenes/EndingScene.js b/client/js/scenes/EndingScene.js index 99bad3a..e086036 100644 --- a/client/js/scenes/EndingScene.js +++ b/client/js/scenes/EndingScene.js @@ -645,6 +645,9 @@ export default class EndingScene extends BaseScene { // 返回首页 if (this.isInRect(x, y, padding + buttonWidth + buttonMargin, row3Y, buttonWidth, buttonHeight)) { + // 清除当前故事状态 + this.main.storyManager.currentStory = null; + this.main.storyManager.currentNodeKey = 'start'; this.main.sceneManager.switchScene('home'); return; } diff --git a/client/js/scenes/StoryScene.js b/client/js/scenes/StoryScene.js index a8a9bc6..1eca790 100644 --- a/client/js/scenes/StoryScene.js +++ b/client/js/scenes/StoryScene.js @@ -252,11 +252,12 @@ export default class StoryScene extends BaseScene { ctx.fillText(title, this.screenWidth / 2, 35); } - // AI改写按钮(右上角) - const btnX = this.screenWidth - 70; - const btnY = 18; - const btnW = 55; - const btnH = 26; + // AI改写按钮(对话框上方右侧) + const boxY = this.screenHeight * 0.42; + const btnW = 70; + const btnH = 30; + const btnX = this.screenWidth - btnW - 15; + const btnY = boxY - btnH - 12; // 按钮背景 if (this.isAIRewriting) { @@ -267,14 +268,14 @@ export default class StoryScene extends BaseScene { gradient.addColorStop(1, '#ec4899'); ctx.fillStyle = gradient; } - this.roundRect(ctx, btnX, btnY, btnW, btnH, 13); + this.roundRect(ctx, btnX, btnY, btnW, btnH, 15); ctx.fill(); // 按钮文字 ctx.fillStyle = '#ffffff'; - ctx.font = '11px sans-serif'; + ctx.font = '12px sans-serif'; ctx.textAlign = 'center'; - ctx.fillText(this.isAIRewriting ? '生成中' : 'AI改写', btnX + btnW / 2, btnY + 17); + ctx.fillText(this.isAIRewriting ? '✨ 生成中...' : '✨ AI改写', btnX + btnW / 2, btnY + 20); } renderDialogBox(ctx) { @@ -554,11 +555,12 @@ export default class StoryScene extends BaseScene { return; } - // AI改写按钮点击 - const btnX = this.screenWidth - 70; - const btnY = 18; - const btnW = 55; - const btnH = 26; + // AI改写按钮点击(对话框上方右侧) + const boxY = this.screenHeight * 0.42; + const btnW = 70; + const btnH = 30; + const btnX = this.screenWidth - btnW - 15; + const btnY = boxY - btnH - 12; if (y >= btnY && y <= btnY + btnH && x >= btnX && x <= btnX + btnW) { if (!this.isAIRewriting) { this.showAIRewriteInput();