Fix: button classes revised
This commit is contained in:
@@ -26,6 +26,24 @@ class MenuTypingTest {
|
||||
screenBottom.printBottomCenterText("메뉴 > 타자 시험");
|
||||
screenBottom.printBottomRightText(sessionStorageManager.playerName);
|
||||
|
||||
// typing tab buttons
|
||||
let typingPracticeTabButton = new TypingTabButton(
|
||||
TypingTabButton.PRACTICE_BUTTON_POS_X, TypingTabButton.BUTTON_POS_Y,
|
||||
"", "타자 연습",
|
||||
() => {
|
||||
location.href = '../../web/client/menu_typing_practice.html';
|
||||
}
|
||||
);
|
||||
// typingPracticeTabButton.inputEnabled = false;
|
||||
|
||||
let typingTestTabButton = new TypingTabButton(
|
||||
TypingTabButton.TEST_BUTTON_POS_X, TypingTabButton.BUTTON_POS_Y,
|
||||
"", "타자 시험",
|
||||
() => {
|
||||
location.href = '../../web/client/menu_typing_test.html';
|
||||
}
|
||||
);
|
||||
typingTestTabButton.inputEnabled = false;
|
||||
|
||||
this.makeActiveTypingTestAppButtons();
|
||||
}
|
||||
@@ -41,26 +59,33 @@ class MenuTypingTest {
|
||||
|
||||
}
|
||||
|
||||
hasApp(appID, appList) {
|
||||
for(let i = 0; i < appList.length; i++) {
|
||||
if(appList[i].AppID === appID)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
downloadListSucceeded(replyJSON) {
|
||||
// console.log(replyJSON);
|
||||
|
||||
let buttonWidthGap = TypingPracticeButton.BUTTON_WIDTH + MenuTypingTest.BUTTON_GAP;
|
||||
|
||||
let koreanTypingTestAppCount = Object.keys(replyJSON.Korean).length;
|
||||
let englishTypingTestAppCount = Object.keys(replyJSON.English).length;
|
||||
let koreanTypingPracticeAppCount = Object.keys(replyJSON.KoreanAppList).length;
|
||||
let englishTypingPracticeAppCount = Object.keys(replyJSON.EnglishAppList).length;
|
||||
|
||||
// let startX = game.world.width / 2 - (buttonWidthGap * koreanTypingTestAppCount / 2) - (buttonWidthGap / 2);
|
||||
// let koreanTypingTestAppIndex = 0;
|
||||
for(let i = 0; i < koreanTypingTestAppCount; i++) {
|
||||
let activeApp = replyJSON.Korean[i];
|
||||
for(let i = 0; i < koreanTypingPracticeAppCount; i++) {
|
||||
let activeApp = replyJSON.KoreanAppList[i];
|
||||
|
||||
let posX = self.getButtonPosX(i, koreanTypingTestAppCount);
|
||||
let posY = self.getButtonPosY(i, koreanTypingTestAppCount,
|
||||
let posX = self.getButtonPosX(i, koreanTypingPracticeAppCount);
|
||||
let posY = self.getButtonPosY(i, koreanTypingPracticeAppCount,
|
||||
TypingPracticeButton.BUTTON_UPPER_POS_Y
|
||||
);
|
||||
|
||||
new TypingPracticeButton(
|
||||
posX, posY, LANGUAGE_KOREAN,
|
||||
let typingTestButton = new TypingPracticeButton(
|
||||
posX, posY,
|
||||
TypingPracticeButton.NONE_ICON,
|
||||
activeApp.KoreanName,
|
||||
() => {
|
||||
@@ -70,19 +95,21 @@ class MenuTypingTest {
|
||||
location.href = '../../web/client/start.html';
|
||||
}
|
||||
);
|
||||
|
||||
if(!self.hasApp(activeApp.AppID, replyJSON.KoreanActiveAppList))
|
||||
typingTestButton.inputEnabled = false;
|
||||
}
|
||||
|
||||
// startX = game.world.width / 2 - (buttonWidthGap * englishTypingTestAppCount / 2) - (buttonWidthGap / 2);
|
||||
for(let i = 0; i < englishTypingTestAppCount; i++) {
|
||||
let activeApp = replyJSON.English[i];
|
||||
for(let i = 0; i < englishTypingPracticeAppCount; i++) {
|
||||
let activeApp = replyJSON.EnglishAppList[i];
|
||||
|
||||
let posX = self.getButtonPosX(i, englishTypingTestAppCount);
|
||||
let posY = self.getButtonPosY(i, englishTypingTestAppCount,
|
||||
let posX = self.getButtonPosX(i, englishTypingPracticeAppCount);
|
||||
let posY = self.getButtonPosY(i, englishTypingPracticeAppCount,
|
||||
TypingPracticeButton.BUTTON_LOWER_POS_Y
|
||||
);
|
||||
|
||||
new TypingPracticeButton(
|
||||
posX, posY, LANGUAGE_ENGLISH,
|
||||
let typingTestButton = new TypingPracticeButton(
|
||||
posX, posY,
|
||||
TypingPracticeButton.NONE_ICON,
|
||||
activeApp.KoreanName,
|
||||
() => {
|
||||
@@ -92,6 +119,9 @@ class MenuTypingTest {
|
||||
location.href = '../../web/client/start.html';
|
||||
}
|
||||
);
|
||||
|
||||
if(!self.hasApp(activeApp.AppID, replyJSON.EnglishActiveAppList))
|
||||
typingTestButton.inputEnabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user