Add: TypingExamButton
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
TypingExamButton.prototype = Object.create(RoundRectButton.prototype);
|
||||
TypingExamButton.constructor = TypingExamButton;
|
||||
|
||||
function TypingExamButton(x, y, iconName, buttonText, writingID) {
|
||||
this.writingID = writingID;
|
||||
|
||||
var setting = new RoundRectButtonSetting(
|
||||
x, y,
|
||||
TypingExamButton.BUTTON_WIDTH, TypingExamButton.BUTTON_HEIGHT
|
||||
);
|
||||
setting.fontStyle.boundsAlignH = "center"; // left, center. right
|
||||
setting.fontStyle.boundsAlignV = "middle"; // top, middle, bottom
|
||||
setting.strokeWidthPx = 5;
|
||||
|
||||
setting.setStrokeColor(
|
||||
0x446688,
|
||||
0x6688aa,
|
||||
0x6688aa,
|
||||
0x333333
|
||||
);
|
||||
setting.setButtonColor(
|
||||
0xaabbdd,
|
||||
0xddeeff,
|
||||
0xddeeff,
|
||||
0x666666
|
||||
);
|
||||
setting.setTextColor(
|
||||
"#468",
|
||||
"#68a",
|
||||
"#68a",
|
||||
"#333"
|
||||
);
|
||||
|
||||
RoundRectButton.call(this, setting, iconName, buttonText, this.onClick);
|
||||
}
|
||||
|
||||
|
||||
TypingExamButton.prototype.onClick = function() {
|
||||
sessionStorageManager.setWritingID(this.writingID);
|
||||
// location.href = '../../web/client/typing_examination.html';
|
||||
printSessionStorage();
|
||||
}
|
||||
|
||||
|
||||
TypingExamButton.BUTTON_WIDTH = 490;
|
||||
TypingExamButton.BUTTON_HEIGHT = 80;
|
||||
|
||||
TypingExamButton.BUTTON_GAP = 5;
|
||||
TypingExamButton.MARGIN_VERTICAL = 100;
|
||||
|
||||
TypingExamButton.PRACTICE_BUTTON_POS_X = GAME_SCREEN_SIZE.x / 4 + TypingExamButton.BUTTON_GAP;
|
||||
TypingExamButton.TEST_BUTTON_POS_X = GAME_SCREEN_SIZE.x / 4 * 3 - TypingExamButton.BUTTON_GAP;
|
||||
|
||||
TypingExamButton.BUTTON_POS_Y = GAME_SCREEN_SIZE.y - 104;
|
||||
@@ -38,17 +38,7 @@ var sessionStorageManager = new SessionStorageManager();
|
||||
console.log("Running in TDD mode");
|
||||
} else {
|
||||
if(isDebugMode()) {
|
||||
console.log("maestroName : " + sessionStorageManager.getMaestroName());
|
||||
console.log("maestroID : " + sessionStorageManager.getMaestroID());
|
||||
console.log("maestroAccountType : " + sessionStorageManager.getMaestroAccountType());
|
||||
console.log("playerName : " + sessionStorageManager.getPlayerName());
|
||||
console.log("playerID : " + sessionStorageManager.getPlayerID());
|
||||
console.log("playerAccountType : " + sessionStorageManager.getPlayerAccountType());
|
||||
console.log("playingAppID : " + sessionStorageManager.getPlayingAppID());
|
||||
console.log("playingAppName : " + sessionStorageManager.getPlayingAppName());
|
||||
console.log("playingAppKoreanName : " + sessionStorageManager.getPlayingAppKoreanName());
|
||||
console.log("record : " + sessionStorageManager.getRecord());
|
||||
console.log("appHighestRecord : " + sessionStorageManager.getAppHighestRecord());
|
||||
printSessionStorage();
|
||||
}
|
||||
|
||||
if(sessionStorageManager.getMaestroID() === null && !isLogin()) {
|
||||
@@ -57,6 +47,21 @@ var sessionStorageManager = new SessionStorageManager();
|
||||
}
|
||||
}
|
||||
|
||||
function printSessionStorage() {
|
||||
console.log("maestroName : " + sessionStorageManager.getMaestroName());
|
||||
console.log("maestroID : " + sessionStorageManager.getMaestroID());
|
||||
console.log("maestroAccountType : " + sessionStorageManager.getMaestroAccountType());
|
||||
console.log("playerName : " + sessionStorageManager.getPlayerName());
|
||||
console.log("playerID : " + sessionStorageManager.getPlayerID());
|
||||
console.log("playerAccountType : " + sessionStorageManager.getPlayerAccountType());
|
||||
console.log("playingAppID : " + sessionStorageManager.getPlayingAppID());
|
||||
console.log("playingAppName : " + sessionStorageManager.getPlayingAppName());
|
||||
console.log("playingAppKoreanName : " + sessionStorageManager.getPlayingAppKoreanName());
|
||||
console.log("record : " + sessionStorageManager.getRecord());
|
||||
console.log("appHighestRecord : " + sessionStorageManager.getAppHighestRecord());
|
||||
console.log("writingID : " + sessionStorageManager.getWritingID());
|
||||
}
|
||||
|
||||
function isLogin() {
|
||||
var filename = location.pathname.substring(location.pathname.lastIndexOf("/") + 1);
|
||||
|
||||
|
||||
@@ -107,6 +107,14 @@ SessionStorageManager.prototype.getIsNewAppHighestRecord = function() {
|
||||
return sessionStorage.getItem("isNewAppHighestRecord");
|
||||
}
|
||||
|
||||
// writing ID
|
||||
SessionStorageManager.prototype.setWritingID = function(value) {
|
||||
sessionStorage.setItem("writingID", value);
|
||||
}
|
||||
SessionStorageManager.prototype.getWritingID = function() {
|
||||
return sessionStorage.getItem("writingID");
|
||||
}
|
||||
|
||||
SessionStorageManager.prototype.resetPlayingAppData = function() {
|
||||
this.removeItem("playingAppID");
|
||||
this.removeItem("playingAppName");
|
||||
|
||||
Reference in New Issue
Block a user