mirror of
https://github.com/tobspr/shapez.io.git
synced 2025-06-13 13:04:03 +00:00
added another button to return to the menu
This commit is contained in:
parent
05418c2163
commit
a9d0a9fb2d
@ -52,12 +52,20 @@ 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);
|
||||
this.trackClicks(this.menuBtn, () => {
|
||||
this.close(true);
|
||||
});
|
||||
}
|
||||
|
||||
updateState() {
|
||||
@ -79,11 +87,13 @@ export class HUDPuzzleCompleteNotification extends BaseHUDPart {
|
||||
return this.visible;
|
||||
}
|
||||
|
||||
close() {
|
||||
close(toMenu = false) {
|
||||
/** @type {PuzzlePlayGameMode} */ (this.root.gameMode)
|
||||
.trackCompleted(this.userDidLikePuzzle, Math.round(this.timeOfCompletion))
|
||||
.then(() => {
|
||||
// this.root.gameState.moveToState("PuzzleMenuState");
|
||||
if (toMenu) {
|
||||
this.root.gameState.moveToState("PuzzleMenuState");
|
||||
}
|
||||
this.visible = false;
|
||||
this.cleanup();
|
||||
});
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user