From e05275073a5e1ad2eacc789f2e70ee16637571ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=8B=E1=85=A2=E1=84=91=E1=85=B3=E1=86=AF=20=E1=84=82?= =?UTF-8?q?=E1=85=A9=E1=84=90=E1=85=B3=E1=84=87=E1=85=AE=E1=86=A8?= Date: Fri, 22 Jun 2018 20:59:00 +0900 Subject: [PATCH] Fix: best record display, replay button --- src/game/lib/screen_bottom.js | 3 ++- src/game/result/result.js | 16 +++++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/game/lib/screen_bottom.js b/src/game/lib/screen_bottom.js index 219cbc3..5fcdb5f 100644 --- a/src/game/lib/screen_bottom.js +++ b/src/game/lib/screen_bottom.js @@ -64,7 +64,8 @@ class ScreenBottom { } printBottomLeftTextWithBestRecord(bestRecord) { - let highScoreWithCommas = NumberUtil.numberWithCommas(bestRecord); + let roundUpBestRecord = Math.round(bestRecord); + let highScoreWithCommas = NumberUtil.numberWithCommas(roundUpBestRecord); this.printBottomLeftText("오늘의 최고 기록 : " + highScoreWithCommas); } diff --git a/src/game/result/result.js b/src/game/result/result.js index 1157b77..327cd73 100644 --- a/src/game/result/result.js +++ b/src/game/result/result.js @@ -33,7 +33,7 @@ class Result { this.printRecord(); this.uploadRecord(); - this.makeStartButton(); + this.makeRestartButton(); let recordBoard = new RecordBoard(); @@ -92,15 +92,21 @@ class Result { ); } - makeStartButton() { + makeRestartButton() { let setting = new RoundRectButtonSetting(game.world.centerX, game.world.height / 2 - 70, 200, 100); setting.fontStyle.fontWeight = "bold"; - let startButton = new RoundRectButton(setting, RoundRectButton.NONE_ICON, "다시 시작", this.startStage); + let startButton = new RoundRectButton(setting, RoundRectButton.NONE_ICON, "다시 시작", this.restartStage); } - startStage() { - location.href = "../../web/client/" + sessionStorageManager.playingAppName + ".html"; + restartStage() { + if(sessionStorageManager.playingAppName.indexOf("practice_") == 0) { + location.href = "../../web/client/typing_practice.html"; + } else if(sessionStorageManager.playingAppName.indexOf("test_") == 0) { + location.href = "../../web/client/typing_test.html"; + } else { + location.href = "../../web/client/" + sessionStorageManager.playingAppName + ".html"; + } } } \ No newline at end of file