diff --git a/src/js/game/hud/parts/puzzle_complete_notification.js b/src/js/game/hud/parts/puzzle_complete_notification.js index 4d68daa9..b0235417 100644 --- a/src/js/game/hud/parts/puzzle_complete_notification.js +++ b/src/js/game/hud/parts/puzzle_complete_notification.js @@ -52,12 +52,22 @@ export class HUDPuzzleCompleteNotification extends BaseHUDPart { this.updateState(); }); - this.btnClose = document.createElement("button"); - this.btnClose.classList.add("close", "styledButton"); - this.btnClose.innerText = T.ingame.puzzleCompletion.buttonSubmit; - dialog.appendChild(this.btnClose); + this.continueBtn = document.createElement("button"); + this.continueBtn.classList.add("close", "styledButton"); + this.continueBtn.innerText = T.ingame.puzzleCompletion.continueBtn; + dialog.appendChild(this.continueBtn); - this.trackClicks(this.btnClose, this.close); + this.menuBtn = document.createElement("button"); + this.menuBtn.classList.add("close", "styledButton"); + this.menuBtn.innerText = T.ingame.puzzleCompletion.menuBtn; + dialog.appendChild(this.menuBtn); + + this.trackClicks(this.continueBtn, () => { + this.close(false); + }); + this.trackClicks(this.menuBtn, () => { + this.close(true); + }); } updateState() { @@ -79,13 +89,16 @@ export class HUDPuzzleCompleteNotification extends BaseHUDPart { return this.visible; } - close() { + close(toMenu) { /** @type {PuzzlePlayGameMode} */ (this.root.gameMode) .trackCompleted(this.userDidLikePuzzle, Math.round(this.timeOfCompletion)) .then(() => { - // this.root.gameState.moveToState("PuzzleMenuState"); - this.visible = false; - this.cleanup(); + if (toMenu) { + this.root.gameState.moveToState("PuzzleMenuState"); + } else { + this.visible = false; + this.cleanup(); + } }); } diff --git a/translations/base-en.yaml b/translations/base-en.yaml index 565cf377..aba636b6 100644 --- a/translations/base-en.yaml +++ b/translations/base-en.yaml @@ -626,7 +626,8 @@ ingame: titleRating: How difficult did you find the puzzle? titleRatingDesc: Your rating will help me to make you better suggestions in the future - buttonSubmit: Continue + continueBtn: Continue + menuBtn: Menu puzzleMetadata: author: Author