Add: test and practice
This commit is contained in:
+46
-19
@@ -47,7 +47,11 @@ class MenuApp {
|
||||
// console.log(replyJSON);
|
||||
|
||||
self.makeMouseAppButtons(replyJSON.MouseAppList);
|
||||
self.makeTypingButtons(replyJSON.TypingPracticeAppCount, replyJSON.TypingAppList);
|
||||
self.makeTypingButtons(
|
||||
replyJSON.TypingPracticeAppCount,
|
||||
replyJSON.TypingTestAppCount,
|
||||
replyJSON.TypingAppList
|
||||
);
|
||||
}
|
||||
|
||||
makeMouseAppButtons(mouseAppJSON) {
|
||||
@@ -73,12 +77,17 @@ class MenuApp {
|
||||
}
|
||||
}
|
||||
|
||||
makeTypingButtons(typingPracticeAppCount, typingAppJSON) {
|
||||
// console.log(typingPracticeAppCount);
|
||||
// console.log(typingAppJSON);
|
||||
makeTypingButtons(typingPracticeAppCount, typingTestAppCount, typingAppJSON) {
|
||||
console.log(typingPracticeAppCount);
|
||||
console.log(typingTestAppCount);
|
||||
console.log(typingAppJSON);
|
||||
|
||||
let isTypingPracticeAppExist = typingPracticeAppCount > 0 ? true : false;
|
||||
let typingAppTotalCount = Object.keys(typingAppJSON).length + (isTypingPracticeAppExist ? 1 : 0);
|
||||
let isTypingTestAppExist = typingTestAppCount > 0 ? true : false;
|
||||
|
||||
let typingAppTotalCount = Object.keys(typingAppJSON).length
|
||||
+ (isTypingPracticeAppExist ? 1 : 0)
|
||||
+ (isTypingTestAppExist ? 1 : 0);
|
||||
let typingAppIndex = 0;
|
||||
|
||||
for(let typingButtonIndex = 0; typingButtonIndex < typingAppTotalCount; typingButtonIndex++) {
|
||||
@@ -90,32 +99,50 @@ class MenuApp {
|
||||
typingButtonIndex, typingAppTotalCount, GameAppButton.BUTTON_LOWER_POS_Y
|
||||
);
|
||||
|
||||
if(typingButtonIndex == 0 && isTypingPracticeAppExist) {
|
||||
if(isTypingPracticeAppExist) {
|
||||
isTypingPracticeAppExist = false;
|
||||
|
||||
new GameAppButton(
|
||||
posX, posY, AppButton.TYPE_TYPING_PRACTICE,
|
||||
"", "타자 연습\n(임시)",
|
||||
"", "타자 연습",
|
||||
() => {
|
||||
location.href = '../../web/client/menu_typing_practice.html';
|
||||
}
|
||||
);
|
||||
} else {
|
||||
let app = typingAppJSON[typingAppIndex];
|
||||
let isKoreanTypingApp = app.AppID < 32 ? true : false;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if(isTypingTestAppExist) {
|
||||
isTypingTestAppExist = false;
|
||||
|
||||
new GameAppButton(
|
||||
posX, posY, AppButton.TYPE_TYPING_APP,
|
||||
"icon_fullscreen",
|
||||
// (isKoreanTypingApp ? "(한글)" : "(영문)") + "\n" + app.KoreanName,
|
||||
app.KoreanName,
|
||||
posX, posY, AppButton.TYPE_TYPING_PRACTICE,
|
||||
"", "타자 시험",
|
||||
() => {
|
||||
sessionStorageManager.playingAppID = app.AppID;
|
||||
sessionStorageManager.playingAppName = app.AppName;
|
||||
sessionStorageManager.playingAppKoreanName = app.KoreanName;
|
||||
location.href = '../../web/client/start.html';
|
||||
location.href = '../../web/client/menu_typing_test.html';
|
||||
}
|
||||
);
|
||||
typingAppIndex++;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
let app = typingAppJSON[typingAppIndex];
|
||||
let isKoreanTypingApp = app.AppID < 32 ? true : false;
|
||||
|
||||
new GameAppButton(
|
||||
posX, posY, AppButton.TYPE_TYPING_APP,
|
||||
"icon_fullscreen",
|
||||
// (isKoreanTypingApp ? "(한글)" : "(영문)") + "\n" + app.KoreanName,
|
||||
app.KoreanName,
|
||||
() => {
|
||||
sessionStorageManager.playingAppID = app.AppID;
|
||||
sessionStorageManager.playingAppName = app.AppName;
|
||||
sessionStorageManager.playingAppKoreanName = app.KoreanName;
|
||||
location.href = '../../web/client/start.html';
|
||||
}
|
||||
);
|
||||
typingAppIndex++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user