1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2025-06-13 13:04:03 +00:00

Minor adjustments

This commit is contained in:
tobspr 2021-05-03 15:59:23 +02:00
parent 331d08d61c
commit 77eaf33060
2 changed files with 22 additions and 19 deletions

View File

@ -130,7 +130,7 @@ export class HUDPuzzleCompleteNotification extends BaseHUDPart {
report() { report() {
const mode = /** @type {PuzzlePlayGameMode} */ (this.root.gameMode); const mode = /** @type {PuzzlePlayGameMode} */ (this.root.gameMode);
mode.reportPuzzle(); mode.reportPuzzle().then(() => this.close());
} }
updateState() { updateState() {

View File

@ -147,25 +147,28 @@ export class PuzzlePlayGameMode extends PuzzleGameMode {
} }
); );
optionSelected.add(option => { return new Promise(resolve => {
const closeLoading = this.root.hud.parts.dialogs.showLoadingDialog(); optionSelected.add(option => {
const closeLoading = this.root.hud.parts.dialogs.showLoadingDialog();
this.root.app.clientApi.apiReportPuzzle(this.puzzle.meta.id, option).then( this.root.app.clientApi.apiReportPuzzle(this.puzzle.meta.id, option).then(
() => { () => {
closeLoading(); closeLoading();
this.root.hud.parts.dialogs.showInfo( const { ok } = this.root.hud.parts.dialogs.showInfo(
T.dialogs.puzzleReportComplete.title, T.dialogs.puzzleReportComplete.title,
T.dialogs.puzzleReportComplete.desc T.dialogs.puzzleReportComplete.desc
); );
}, ok.add(resolve);
err => { },
closeLoading(); err => {
this.root.hud.parts.dialogs.showInfo( closeLoading();
T.dialogs.puzzleReportError.title, const { ok } = this.root.hud.parts.dialogs.showInfo(
T.dialogs.puzzleReportError.desc + " " + err T.dialogs.puzzleReportError.title,
); T.dialogs.puzzleReportError.desc + " " + err
} );
); }
);
});
}); });
} }
} }