Fix: () => { } -> function() { }

This commit is contained in:
2018-09-13 15:13:14 +09:00
parent dad83205cd
commit e8c7304dba
22 changed files with 108 additions and 101 deletions
+2 -2
View File
@@ -29,13 +29,13 @@ class FullscreenButton extends RoundRectButton {
super(
setting,
RoundRectButton.NONE_ICON, RoundRectButton.NONE_BUTTON_TEXT,
() => {
(function() {
if(game.scale.isFullScreen) {
game.scale.stopFullScreen();
} else {
game.scale.startFullScreen();
}
}
})
);
let icon_fullscreen = game.add.sprite(0, 0, 'icon_fullscreen');
+3 -2
View File
@@ -4,12 +4,13 @@ class HeartGauge {
this.heartManager = heartManager;
this.hearts = [];
let self = this;
this.heartManager.addOnChangeCountListener(
() => { this.onChangeCountListener(); }
function() { self.onChangeCountListener(); }
);
this.heartManager.addOnChangeMaxCountListener(
() => { this.onChangeMaxCountListener(); }
function() { self.onChangeMaxCountListener(); }
);
let startPosX = GAME_SCREEN_SIZE.x - HeartGauge.GAP * 4;
+1 -1
View File
@@ -15,7 +15,7 @@ var Loading = {
let userID = sessionStorage.getItem("UserID");
console.log("userID : " + userID);
this.game.stage.backgroundColor = '#4d4d4d';
// Progress report
+1 -1
View File
@@ -17,7 +17,7 @@ class Login {
// top ui
let screenTopUI = new ScreenTopUI();
screenTopUI.makeBackButton( () => {
screenTopUI.makeBackButton( function() {
sessionStorageManager.clear();
location.href = '../../web/main/index.html';
});
+9 -9
View File
@@ -36,7 +36,7 @@ class MenuApp {
// top ui
let screenTopUI = new ScreenTopUI();
screenTopUI.makeBackButton( () => {
screenTopUI.makeBackButton( function() {
sessionStorageManager.clear();
location.href = '../../web/client/login.html';
});
@@ -105,12 +105,12 @@ class MenuApp {
posX, posY, GameAppButton.TYPE_MOUSE_APP,
RoundRectButton.NONE_ICON, // "icon_fullscreen",
app.KoreanName,
() => {
(function() {
sessionStorageManager.playingAppID = app.AppID;
sessionStorageManager.playingAppName = app.AppName;
sessionStorageManager.playingAppKoreanName = app.KoreanName;
location.href = '../../web/client/start.html';
}
})
);
if(!self.hasApp(app.AppID, activeAppList))
@@ -134,9 +134,9 @@ class MenuApp {
let typingPracticeTabButton = new TypingTabButton(
TypingTabButton.PRACTICE_BUTTON_POS_X, TypingTabButton.BUTTON_POS_Y,
"", "타자 연습",
() => {
(function() {
location.href = '../../web/client/menu_typing_practice.html';
}
})
);
if(typingPracticeAppCount === 0)
typingPracticeTabButton.inputEnabled = false;
@@ -144,9 +144,9 @@ class MenuApp {
let typingTestTabButton = new TypingTabButton(
TypingTabButton.TEST_BUTTON_POS_X, TypingTabButton.BUTTON_POS_Y,
"", "타자 시험",
() => {
(function() {
location.href = '../../web/client/menu_typing_test.html';
}
})
);
if(typingTestAppCount === 0)
typingTestTabButton.inputEnabled = false;
@@ -170,12 +170,12 @@ class MenuApp {
RoundRectButton.NONE_ICON, // "icon_fullscreen",
// (isKoreanTypingApp ? "(한글)" : "(영문)") + "\n" + app.KoreanName,
app.KoreanName,
() => {
(function() {
sessionStorageManager.playingAppID = app.AppID;
sessionStorageManager.playingAppName = app.AppName;
sessionStorageManager.playingAppKoreanName = app.KoreanName;
location.href = '../../web/client/start.html';
}
})
);
if(!self.hasApp(app.AppID, activeAppList))
+9 -9
View File
@@ -45,7 +45,7 @@ class MenuTypingPractice {
// top ui
let screenTopUI = new ScreenTopUI();
screenTopUI.makeBackButton( () => {
screenTopUI.makeBackButton( function() {
location.href = '../../web/client/menu_app.html';
});
screenTopUI.makeFullScreenButton();
@@ -55,18 +55,18 @@ class MenuTypingPractice {
let typingPracticeTabButton = new TypingTabButton(
TypingTabButton.PRACTICE_BUTTON_POS_X, TypingTabButton.BUTTON_POS_Y,
"", "타자 연습",
() => {
(function() {
location.href = '../../web/client/menu_typing_practice.html';
}
})
);
typingPracticeTabButton.inputEnabled = false;
let typingTestTabButton = new TypingTabButton(
TypingTabButton.TEST_BUTTON_POS_X, TypingTabButton.BUTTON_POS_Y,
"", "타자 시험",
() => {
(function() {
location.href = '../../web/client/menu_typing_test.html';
}
})
);
// typingTestTabButton.inputEnabled = false;
@@ -143,12 +143,12 @@ class MenuTypingPractice {
posX, posY,
self.getIconImage(replyJSON.KoreanHighScoreList, activeApp.AppID),
activeApp.KoreanName,
() => {
(function() {
sessionStorageManager.playingAppID = activeApp.AppID;
sessionStorageManager.playingAppName = activeApp.AppName;
sessionStorageManager.playingAppKoreanName = activeApp.KoreanName;
location.href = '../../web/client/start.html';
}
})
);
if(!self.hasApp(activeApp.AppID, replyJSON.KoreanActiveAppList))
@@ -168,12 +168,12 @@ class MenuTypingPractice {
posX, posY,
self.getIconImage(activeApp.AppID),
activeApp.KoreanName,
() => {
(function() {
sessionStorageManager.playingAppID = activeApp.AppID;
sessionStorageManager.playingAppName = activeApp.AppName;
sessionStorageManager.playingAppKoreanName = activeApp.KoreanName;
location.href = '../../web/client/start.html';
}
})
);
if(!self.hasApp(activeApp.AppID, replyJSON.EnglishActiveAppList))
+9 -9
View File
@@ -45,7 +45,7 @@ class MenuTypingTest {
// top ui
let screenTopUI = new ScreenTopUI();
screenTopUI.makeBackButton( () => {
screenTopUI.makeBackButton( function() {
location.href = '../../web/client/menu_app.html';
});
screenTopUI.makeFullScreenButton();
@@ -55,18 +55,18 @@ class MenuTypingTest {
let typingPracticeTabButton = new TypingTabButton(
TypingTabButton.PRACTICE_BUTTON_POS_X, TypingTabButton.BUTTON_POS_Y,
"", "타자 연습",
() => {
(function() {
location.href = '../../web/client/menu_typing_practice.html';
}
})
);
// typingPracticeTabButton.inputEnabled = false;
let typingTestTabButton = new TypingTabButton(
TypingTabButton.TEST_BUTTON_POS_X, TypingTabButton.BUTTON_POS_Y,
"", "타자 시험",
() => {
(function() {
location.href = '../../web/client/menu_typing_test.html';
}
})
);
typingTestTabButton.inputEnabled = false;
@@ -143,12 +143,12 @@ class MenuTypingTest {
posX, posY,
self.getIconImage(replyJSON.KoreanHighScoreList, activeApp.AppID),
activeApp.KoreanName,
() => {
(function() {
sessionStorageManager.playingAppID = activeApp.AppID;
sessionStorageManager.playingAppName = activeApp.AppName;
sessionStorageManager.playingAppKoreanName = activeApp.KoreanName;
location.href = '../../web/client/start.html';
}
})
);
if(!self.hasApp(activeApp.AppID, replyJSON.KoreanActiveAppList))
@@ -168,12 +168,12 @@ class MenuTypingTest {
posX, posY,
self.getIconImage(replyJSON.KoreanHighScoreList, activeApp.AppID),
activeApp.KoreanName,
() => {
(function() {
sessionStorageManager.playingAppID = activeApp.AppID;
sessionStorageManager.playingAppName = activeApp.AppName;
sessionStorageManager.playingAppKoreanName = activeApp.KoreanName;
location.href = '../../web/client/start.html';
}
})
);
if(!self.hasApp(activeApp.AppID, replyJSON.EnglishActiveAppList))
+11 -9
View File
@@ -4,24 +4,26 @@
class Game {
create() {
let self = this;
this.game.stage.backgroundColor = "#000000"; // '#4d4d4d';
sessionStorageManager.isNewBestRecrd = false;
// top ui
let screenTopUI = new ScreenTopUI();
screenTopUI.makeBackButton( () => {
screenTopUI.makeBackButton( function() {
sessionStorageManager.resetPlayingAppData();
location.href = '../../web/client/menu_app.html';
});
screenTopUI.makeFullScreenButton();
let scoreBoard = new ScoreBoard();
scoreManager.addOnChangeScoreListener( score => {
scoreManager.addOnChangeScoreListener( function(score) {
sessionStorageManager.record = score;
scoreBoard.printScore(NumberUtil.numberWithCommas(score));
});
scoreManager.addOnChangeHighScoreListener( highScore => {
scoreManager.addOnChangeHighScoreListener( function(highScore) {
console.log(highScore);
sessionStorageManager.bestRecord = highScore;
sessionStorageManager.isNewBestRecrd = true;
@@ -30,7 +32,7 @@ class Game {
let heartGauge = new HeartGauge(heartManager);
heartManager.addOnChangeGameOverListener(
() => { this.gameOver(); }
function() { self.gameOver(); }
);
heartGauge.start();
@@ -55,11 +57,11 @@ class Game {
this.aliens = [];
for(let i = 0; i < 10; i++) {
let alien = new Alien(150 + 80 * i, 150,
() => { this.activateNextAlien(); }, // onGoOnstage
(sprite) => {
scoreManager.plusScore(this.getScore());
let scoreText = new ScoreText(sprite.x, sprite.y, this.getScore());
}, // this.onAlienFired,
(function() { self.activateNextAlien(); }), // onGoOnstage
(function(sprite) {
scoreManager.plusScore(self.getScore());
let scoreText = new ScoreText(sprite.x, sprite.y, self.getScore());
}), // this.onAlienFired,
this.onAlienEscaped
);
alien.goWaitingRoom();
+5 -5
View File
@@ -24,7 +24,7 @@ class Ranking {
// top ui
let screenTopUI = new ScreenTopUI();
screenTopUI.makeBackButton( () => {
screenTopUI.makeBackButton( function() {
location.href = '../../web/client/start.html';
});
screenTopUI.makeFullScreenButton();
@@ -151,12 +151,12 @@ class Ranking {
this.dbConnectManager.requestAppRanking(
sessionStorageManager.maestroID,
sessionStorageManager.playingAppID,
(jsonData) => {
(function(jsonData) {
self.showRanking(jsonData);
},
(jsonData) => {
}),
(function(jsonData) {
self.showRanking(null);
}
})
);
}
+2 -2
View File
@@ -25,7 +25,7 @@ class HistoryBoard {
this.dbConnectManager.requestPlayerHistory(
sessionStorageManager.maestroID,
date,
historyRecordManager => {
(function(historyRecordManager) {
if(historyRecordManager.count == 0) {
console.log("history board - no data");
return;
@@ -38,7 +38,7 @@ class HistoryBoard {
if(date == data.date)
this.todayBestRecord = data.bestRecord;
}
}
})
);
}
+1 -1
View File
@@ -20,7 +20,7 @@ class Result {
// top ui
let screenTopUI = new ScreenTopUI();
screenTopUI.makeBackButton( () => {
screenTopUI.makeBackButton( function() {
if(isTypingPracticeStage())
location.href = '../../web/client/menu_typing_practice.html';
else if(isTypingTestStage())
+17 -13
View File
@@ -17,7 +17,7 @@ class Start {
// top ui
let screenTopUI = new ScreenTopUI();
screenTopUI.makeBackButton( () => {
screenTopUI.makeBackButton( function() {
if(isTypingPracticeStage())
location.href = '../../web/client/menu_typing_practice.html';
else if(isTypingTestStage())
@@ -54,11 +54,11 @@ class Start {
sessionStorageManager.maestroID,
sessionStorageManager.playerID,
sessionStorageManager.playingAppID,
replyJSON => {
function(replyJSON) {
sessionStorageManager.bestRecord = Number(replyJSON["BestRecord"]);
screenBottomUI.printLeftTextWithBestRecord(sessionStorageManager.bestRecord);
},
replyJSON => { // no data
function(replyJSON) { // no data
sessionStorageManager.bestRecord = 0;
screenBottomUI.printLeftTextWithBestRecord(sessionStorageManager.bestRecord);
}
@@ -66,26 +66,30 @@ class Start {
}
loadHowToPlay(appID) {
let self = this;
this.dbConnectManager.requestHowToPlay(
sessionStorageManager.playingAppID, // space_invaders app ID
(jsonData) => {
function(jsonData) {
let howToPlayText = jsonData["HowToPlay"].replace(/\\n/g, "\n");
this.howToPlay.printHowToPlay(howToPlayText);
self.howToPlay.printHowToPlay(howToPlayText);
},
(jsonData) => {
this.howToPlay.printHowToPlay("No data");
function(jsonData) {
self.howToPlay.printHowToPlay("No data");
}
);
}
loadChart() {
let self = this;
let today = new Date();
let date = DateUtil.getYYYYMMDD(today);
this.dbConnectManager.requestPlayerHistory(
sessionStorageManager.maestroID,
date,
historyRecordManager => {
(function(historyRecordManager) {
if(historyRecordManager.count == 0) {
console.log("start - history record : no data");
return;
@@ -103,7 +107,7 @@ class Start {
// break;
let historyRecord = historyRecordManager.getAt(i);
this.chart.drawRecordGraph(
self.chart.drawRecordGraph(
i,
historyRecord === undefined ? "-" : historyRecord.date,
historyRecord === undefined ? "" : historyRecord.bestRecord,
@@ -111,8 +115,8 @@ class Start {
);
}
this.chart.printChartBaseLine();
}
self.chart.printChartBaseLine();
})
);
}
@@ -154,9 +158,9 @@ class Start {
let rankingButton = new RoundRectButton(
setting, RoundRectButton.NONE_ICON, "순위\n보기",
() => {
(function() {
location.href = '../../web/client/ranking.html';
}
})
);
if(sessionStorageManager.maestroAccountType == 100)
rankingButton.inputEnabled = false;
+5 -5
View File
@@ -15,7 +15,7 @@ class TypingPractice {
// top ui
let screenTopUI = new ScreenTopUI();
screenTopUI.makeBackButton( () => {
screenTopUI.makeBackButton( function() {
sessionStorageManager.resetPlayingAppData();
location.href = '../../web/client/menu_typing_practice.html';
});
@@ -29,12 +29,12 @@ class TypingPractice {
this.typingScore = new TypingScore();
this.stageTimer = new StageTimer( TypingPractice.STAGE_TIMER_SEC, () => {
this.stageTimer = new StageTimer( TypingPractice.STAGE_TIMER_SEC, (function() {
self.isOnStage = false;
// self.goResult();
self.gameOver();
});
}));
// typing content
@@ -88,12 +88,12 @@ class TypingPractice {
else
this.keyboard = new Keyboard(this.keyMapper, Keyboard.ENGLISH);
game.input.keyboard.processKeyPress = () => {
game.input.keyboard.processKeyPress = (function() {
if(self.isOnStage === false)
return;
self.checkTypingContents(event);
}
});
this.shiftKey = game.input.keyboard.addKey(Phaser.Keyboard.SHIFT);
// hands
+1 -1
View File
@@ -13,7 +13,7 @@ class TypingTest {
// top ui
let screenTopUI = new ScreenTopUI();
screenTopUI.makeBackButton( () => {
screenTopUI.makeBackButton( function() {
sessionStorageManager.resetPlayingAppData();
location.href = '../../web/client/menu_typing_test.html';
});