From f91d9c0049eff7ac3e0d9e9da323f5abcda58391 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, 14 Sep 2018 23:00:16 +0900 Subject: [PATCH] Fix: menu typing ES5 bug --- src/game/menu/menu_typing_practice.js | 8 ++++---- src/game/menu/menu_typing_test.js | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/game/menu/menu_typing_practice.js b/src/game/menu/menu_typing_practice.js index ddf3507..c5fd870 100644 --- a/src/game/menu/menu_typing_practice.js +++ b/src/game/menu/menu_typing_practice.js @@ -102,7 +102,7 @@ var MenuTypingPractice = { }, getBestRecord: function(jsonList, appID) { - var count = Object.keys(jsonList).length; + var count = jsonList.length; // Object.keys(jsonList).length; for(var i = 0; i < count; i++) { if(jsonList[i].AppID === appID) @@ -127,8 +127,8 @@ var MenuTypingPractice = { var buttonWidthGap = TypingAppButton.BUTTON_WIDTH + MenuTypingPractice.BUTTON_GAP; - var koreanTypingPracticeAppCount = Object.keys(replyJSON.KoreanAppList).length; - var englishTypingPracticeAppCount = Object.keys(replyJSON.EnglishAppList).length; + var koreanTypingPracticeAppCount = replyJSON.KoreanAppList.length; // Object.keys(replyJSON.KoreanAppList).length; + var englishTypingPracticeAppCount = replyJSON.EnglishAppList.length; // Object.keys(replyJSON.EnglishAppList).length; for(var i = 0; i < koreanTypingPracticeAppCount; i++) { var activeApp = replyJSON.KoreanAppList[i]; @@ -165,7 +165,7 @@ var MenuTypingPractice = { var typingPracticeButton = new TypingAppButton( TypingAppButton.TYPE_PRACTICE_ENGLISH, posX, posY, - this.getIconImage(activeApp.AppID), + this.getIconImage(replyJSON.EnglishHighScoreList, activeApp.AppID), activeApp.KoreanName, { AppID: activeApp.AppID, diff --git a/src/game/menu/menu_typing_test.js b/src/game/menu/menu_typing_test.js index 245dc7d..73cfa31 100644 --- a/src/game/menu/menu_typing_test.js +++ b/src/game/menu/menu_typing_test.js @@ -104,7 +104,7 @@ var MenuTypingTest = { }, getBestRecord: function(jsonList, appID) { - var count = Object.keys(jsonList).length; + var count = jsonList.length; // Object.keys(jsonList).length; for(var i = 0; i < count; i++) { if(jsonList[i].AppID === appID) @@ -129,8 +129,8 @@ var MenuTypingTest = { var buttonWidthGap = TypingAppButton.BUTTON_WIDTH + MenuTypingTest.BUTTON_GAP; - var koreanTypingPracticeAppCount = Object.keys(replyJSON.KoreanAppList).length; - var englishTypingPracticeAppCount = Object.keys(replyJSON.EnglishAppList).length; + var koreanTypingPracticeAppCount = replyJSON.KoreanAppList.length; // Object.keys(replyJSON.KoreanAppList).length; + var englishTypingPracticeAppCount = replyJSON.EnglishAppList.length; // Object.keys(replyJSON.EnglishAppList).length; for(var i = 0; i < koreanTypingPracticeAppCount; i++) { var activeApp = replyJSON.KoreanAppList[i]; @@ -167,7 +167,7 @@ var MenuTypingTest = { var typingTestButton = new TypingAppButton( TypingAppButton.TYPE_TEST_ENGLISH, posX, posY, - this.getIconImage(replyJSON.KoreanHighScoreList, activeApp.AppID), + this.getIconImage(replyJSON.EnglishHighScoreList, activeApp.AppID), activeApp.KoreanName, { AppID: activeApp.AppID,