Add: hide rank button for test players

This commit is contained in:
2018-09-05 09:52:41 +09:00
parent 3d4852c42c
commit 37e623e95e
3 changed files with 50 additions and 74 deletions
+1 -1
View File
@@ -25,7 +25,7 @@ class Game {
console.log(highScore); console.log(highScore);
sessionStorageManager.bestRecord = highScore; sessionStorageManager.bestRecord = highScore;
sessionStorageManager.isNewBestRecrd = true; sessionStorageManager.isNewBestRecrd = true;
screenBottomUI.printBottomLeftTextWithBestRecord(sessionStorageManager.bestRecord); screenBottomUI.printLeftTextWithBestRecord(sessionStorageManager.bestRecord);
}); });
let heartGauge = new HeartGauge(heartManager); let heartGauge = new HeartGauge(heartManager);
+44 -71
View File
@@ -38,22 +38,13 @@ class Ranking {
this.textTitle.anchor.set(0.5); this.textTitle.anchor.set(0.5);
this.textTitle.addColor("#ff6666", 0); this.textTitle.addColor("#ff6666", 0);
// let typingRecordTextStyle = textStyleBasic;
// typingRecordTextStyle.font = "bold 62px Arial";
// let bestRecordTextStyle = textStyleBasic; // contents
// bestRecordTextStyle.font = "32px Arial";
// rank // rank
let rankAreaPositionY = 280;
let typingTextStyle = textStyleBasic;
// typingTextStyle.font = "bold 84px Arial";
rankAreaPositionY = 90;
let style = { font: "34px Arial", fill: "#fff", tabs: [ 60, 160, 160 ] };
let rankAreaPositionX = 160; let rankAreaPositionX = 160;
let rankAreaPositionY = 90;
let style = { font: "34px Arial", fill: "#fff", tabs: [ 60, 160, 160 ] };
this.textRanking1to10 = game.add.text(rankAreaPositionX, rankAreaPositionY , '', style) this.textRanking1to10 = game.add.text(rankAreaPositionX, rankAreaPositionY , '', style)
.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2); .setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
this.textRanking11to20 = game.add.text(rankAreaPositionX + 420, rankAreaPositionY, '', style) this.textRanking11to20 = game.add.text(rankAreaPositionX + 420, rankAreaPositionY, '', style)
@@ -62,11 +53,11 @@ class Ranking {
let buttonPositionY = 640; let buttonPositionY = 640;
let buttonHour = this.makeTextButton(game.world.centerX - 220, buttonPositionY, "수업시간 순위", this.showRankingHour); let buttonHour = this.makeTextButton(game.world.centerX - 220, buttonPositionY, "수업시간 순위", this.showRankingHour);
// buttonHour.startButton.inputEnabled = false; // buttonHour.inputEnabled = false;
let buttonDay = this.makeTextButton(game.world.centerX, buttonPositionY, "오늘의 순위", this.showRankingDay); let buttonDay = this.makeTextButton(game.world.centerX, buttonPositionY, "오늘의 순위", this.showRankingDay);
// buttonDay.startButton.inputEnabled = false; // buttonDay.inputEnabled = false;
let buttonMonth = this.makeTextButton(game.world.centerX + 220, buttonPositionY, "이달의 순위", this.showRankingMonth); let buttonMonth = this.makeTextButton(game.world.centerX + 220, buttonPositionY, "이달의 순위", this.showRankingMonth);
// buttonMonth.startButton.inputEnabled = false; // buttonMonth.inputEnabled = false;
// bottom ui // bottom ui
@@ -157,11 +148,6 @@ class Ranking {
// console.log("getRecordToRankingServer : " + this.mode); // console.log("getRecordToRankingServer : " + this.mode);
let self = this; let self = this;
this.showRanking(null);
// let totalInfo = new Object();
// this.showRanking(totalInfo);
this.dbConnectManager.requestAppRanking( this.dbConnectManager.requestAppRanking(
sessionStorageManager.maestroID, sessionStorageManager.maestroID,
sessionStorageManager.playingAppID, sessionStorageManager.playingAppID,
@@ -172,29 +158,6 @@ class Ranking {
self.showRanking(null); self.showRanking(null);
} }
); );
// console.log('playerUserID : ' + playerUserID);
// console.log('playerName : ' + playerName);
// console.log('playingStageData.language : ' + playingStageData.language);
// console.log('playingStageData.level : ' + playingStageData.level + ", " + getStageCodeByStageNo(playingStageData.level));
// let xhr = new XMLHttpRequest();
// xhr.onreadystatechange = function() {
// // console.log("onreadystatechange : " + xhr);
// // console.log("xhr.readyState : " + xhr.readyState);
// // console.log("xhr.status : " + xhr.status);
// if(xhr.readyState == 4 && xhr.status == 200) {
// // console.log(xhr.responseText);
// self.jsonData = JSON.parse(xhr.responseText);
// // console.log(JSON.stringify(jsonData));
// self.showRanking(self.jsonData);
// }
// }
// xhr.open('POST', 'stage_ranking.php', true);
// xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
// let param = 'maestro_id=' + sessionStorageManager.maestroID + 'app_id=' + sessionStorageManager.playingAppID;
// // console.log(param);
// xhr.send(param);
} }
showRankingHour() { showRankingHour() {
@@ -221,6 +184,13 @@ class Ranking {
showRanking(jsonRankingData) { showRanking(jsonRankingData) {
// console.log(jsonRankingData); // console.log(jsonRankingData);
if(sessionStorageManager.maestroAccountType == 101) {
let recordArray = this.getDummyRankList();
this.printRanking(recordArray);
return;
}
if(jsonRankingData === null) { if(jsonRankingData === null) {
let rankEmpty = [ ]; let rankEmpty = [ ];
this.textRanking1to10.parseList(rankEmpty); this.textRanking1to10.parseList(rankEmpty);
@@ -246,6 +216,11 @@ class Ranking {
} }
let recordArray = this.getRankingArrayFromJSON(jsonRankingList); let recordArray = this.getRankingArrayFromJSON(jsonRankingList);
this.printRanking(recordArray);
}
printRanking(recordArray) {
let recordTop10 = []; let recordTop10 = [];
let recordTop20 = []; let recordTop20 = [];
for(let i = 0; i < 10; i++) { for(let i = 0; i < 10; i++) {
@@ -260,7 +235,7 @@ class Ranking {
getRankingArrayFromJSON(jsonRankingList) { getRankingArrayFromJSON(jsonRankingList) {
// if(isDebugMode()) // if(isDebugMode())
// return this.getDummyArray(); // return this.getDummyRankList();
let rankingListCount = jsonRankingList.length; let rankingListCount = jsonRankingList.length;
@@ -279,32 +254,32 @@ class Ranking {
return recordArray; return recordArray;
} }
getDummyArray() { getDummyRankList() {
let recordArray2 = [ let dummyRankList = [
[ '1', '박지상', '22' ], [ '1', 'test1', '400' ],
[ '2', '박지상', '21' ], [ '2', 'test2', '300' ],
[ '3', '박지상', '20' ], [ '3', 'test3', '200' ],
[ '4', '박지상', '19' ], [ '4', 'test4', '100' ],
[ '5', '박지상', '18' ], [ '5', 'test5', '90' ],
[ '6', '박지상', '17' ], [ '6', 'test6', '80' ],
[ '7', '박지상', '16' ], [ '7', 'test7', '70' ],
[ '8', '박지상', '15' ], [ '8', 'test8', '60' ],
[ '9', '박지상', '14' ], [ '9', 'test9', '50' ],
[ '10', '박지상', '13' ], [ '10', 'test10', '40' ],
[ '11', '박지상', '12' ], [ '11', 'test11', '30' ],
[ '12', '박지상', '11' ], [ '12', 'test12', '20' ],
[ '13', '박지상', '10' ], [ '13', 'test13', '10' ],
[ '14', '박지상', '9' ], [ '14', 'test14', '9' ],
[ '15', '박지상', '8' ], [ '15', 'test15', '8' ],
[ '16', '박지상', '7' ], [ '16', 'test16', '7' ],
[ '17', '박지상', '6' ], [ '17', 'test17', '6' ],
[ '18', '박지상', '5' ], [ '18', 'test18', '5' ],
[ '19', '박지상', '4' ], [ '19', 'test19', '4' ],
[ '20', '박지상', '3' ], [ '20', 'test20', '3' ],
[ '21', '박지상', '2' ], [ '21', 'test21', '2' ],
[ '22', '박지상', '1' ], [ '22', 'test22', '1' ],
]; ];
return recordArray2; return dummyRankList;
} }
} }
@@ -312,5 +287,3 @@ class Ranking {
Ranking.MODE_HOUR = "mode_hour"; Ranking.MODE_HOUR = "mode_hour";
Ranking.MODE_DAY = "mode_day"; Ranking.MODE_DAY = "mode_day";
Ranking.MODE_MONTH = "mode_month"; Ranking.MODE_MONTH = "mode_month";
Ranking.OFFSET_RIGHT_ALIGN = 10;
+4 -1
View File
@@ -156,7 +156,10 @@ class Start {
setting, RoundRectButton.NONE_ICON, "순위\n보기", setting, RoundRectButton.NONE_ICON, "순위\n보기",
() => { () => {
location.href = '../../web/client/ranking.html'; location.href = '../../web/client/ranking.html';
}); }
);
if(sessionStorageManager.maestroAccountType == 100)
rankingButton.inputEnabled = false;
} }