Add: SpriteIconTimer

This commit is contained in:
2018-12-15 10:59:04 +09:00
parent 990a203b98
commit 3dd42ffe02
11 changed files with 126 additions and 29 deletions
+15
View File
@@ -113,4 +113,19 @@ SessionStorageManager.prototype.resetPlayingAppData = function() {
this.removeItem("playingAppKoreanName");
this.removeItem("record");
this.removeItem("appHighestRecord");
}
SessionStorageManager.prototype.resetAllAppData = function() {
this.removeItem("maestroID");
this.removeItem("maestroName");
this.removeItem("maestroAccountType");
this.removeItem("playerName");
this.removeItem("playerID");
this.removeItem("playerAccountType");
this.removeItem("playingAppID");
this.removeItem("playingAppName");
this.removeItem("playingAppKoreanName");
this.removeItem("record");
this.removeItem("appHighestRecord");
this.removeItem("isNewAppHighestRecord");
}
+17
View File
@@ -0,0 +1,17 @@
function SpriteIconTimer(width, height, frame) {
var sprite = game.add.sprite(0, 0, "icon_timer_spritesheet");
sprite.width = width;
sprite.height = height;
sprite.frame = frame;
return sprite;
}
SpriteIconTimer.loadResources = function() {
game.load.spritesheet('icon_timer_spritesheet', '../../../resources/image/icon/timer_spritesheet.png', 100, 100);
}
SpriteIconTimer.FRAME_RESET = 0;
SpriteIconTimer.FRAME_PLAY = 1;
SpriteIconTimer.FRAME_PAUSE = 2;
+5 -2
View File
@@ -309,8 +309,11 @@ InputScore.prototype.onClickSendToServerButton = function() {
return;
}
if(this.passwordText.value == "") {
this.showAlertWindow("자격증 타이머용 비밀번호를 입력해 주세요.");
if(sessionStorageManager.getMaestroID() == 1 && sessionStorageManager.getPlayerID() == 1 && this.passwordText.value != "1111") {
this.showAlertWindow("체험용 마에스트로 비밀번호는 1111 입니다.");
return;
} if(this.passwordText.value == "") {
this.showAlertWindow("비밀번호를 입력해 주세요.\n마에스트로 관리자 페이지에 가서, 자격증 타이머용 비밀번호를 확인하고 입력해 주세요.");
return;
}
this.maestroPassword = this.passwordText.value;
+5 -1
View File
@@ -20,7 +20,11 @@ var LicenseTimer = {
screenTopUI.makeFullScreenButton();
var titleTextStyle = { font: "36px Arial", fill: "#fff", align: "center"};
this.titleText = game.add.text(game.world.centerX, 35, "자격증 타이머", titleTextStyle);
this.titleText = game.add.text(
game.world.centerX, 35,
"자격증 타이머 - " + sessionStorageManager.getPlayerName(),
titleTextStyle
);
this.titleText.anchor.set(0.5);
// this.fullscreenButton = new FullscreenButton();
+2
View File
@@ -30,6 +30,8 @@ var Loading = {
game.load.image('icon_fullscreen', '../../../resources/image/icon/fullscreen_white.png');
game.load.image('icon_home', '../../../resources/image/icon/home.png');
SpriteIconTimer.loadResources();
game.load.start();
},
+58 -14
View File
@@ -1,7 +1,7 @@
var Login = {
create: function() {
// sessionStorageManager.resetPlayingAppData();
sessionStorageManager.resetAllAppData();
this.game.stage.backgroundColor = '#4d4d4d';
this.textStyle = { font: "bold 32px Arial", fill: "#fff", align: "right", boundsAlignH: "right", boundsAlignV: "middle" };
@@ -48,20 +48,9 @@ var Login = {
this.inputTextName.canvasInput.focus();
this.makeStartButton(game.world.centerX, game.world.centerY + 100);
this.makeExperienceButton(game.world.centerX + 225, game.world.centerY + 100);
this.makeInfoText();
/*
if(isDebugMode()) {
sessionStorageManager.setMaestroID(3);
sessionStorageManager.setMaestroAccountType(4);
sessionStorageManager.setPlayerID(35);
sessionStorageManager.setPlayerName("박지상");
sessionStorageManager.setPlayerAccountType(0);
game.state.start('LicenseTimer');
}
*/
},
back: function() {
@@ -122,6 +111,61 @@ var Login = {
startButton.addShortcutText("Enter");
},
makeExperienceButton: function(x, y) {
var BUTTON_SIZE = 90;
// var setting = new RoundRectButtonSetting(x, y, BUTTON_SIZE, BUTTON_SIZE);
var setting = new RoundRectButtonSetting(x, y, 150, 100);
// setting.roundAmount = 60;
// setting.strokeWidthPx = 5;
// setting.fontStyle.fontSize = 40;
setting.fontStyle.fontWeight = "bold";
setting.setStrokeColor(
0x309090,
0x208080,
0x205050,
0x666666
);
setting.setButtonColor(
0x40c0c0,
0x30a0a0,
0x208080,
0x666666
);
/*
setting.setTextColor(
"#fff",
"#edd",
"#dbb",
"#333"
);
*/
var startButton = new RoundRectButton(
setting,
RoundRectButton.NONE_ICON, "체험",
(function() {
this.setExperiencePlayerSessionStorage();
// this.startMenu();
game.state.start('LicenseTimer');
}).bind(this)
);
},
setExperiencePlayerSessionStorage: function() {
sessionStorageManager.setMaestroName("");
sessionStorageManager.setMaestroID(1);
sessionStorageManager.setMaestroAccountType(100);
sessionStorageManager.setPlayerName("체험 학생");
sessionStorageManager.setPlayerID(1);
sessionStorageManager.setPlayerAccountType(0);
sessionStorageManager.setPlayingAppID(null);
sessionStorageManager.setPlayingAppName(null);
sessionStorageManager.setPlayingAppKoreanName(null);
sessionStorageManager.setRecord(0);
sessionStorageManager.setAppHighestRecord(0);
},
makeInfoText: function(x, y) {
var textStyle = { font: "30px Arial", fill: "#faa" };
this.infoText = game.add.text(game.world.centerX, 640, "", textStyle);
@@ -175,7 +219,7 @@ var Login = {
sessionStorageManager.setPlayerName(jsonData['PlayerName']);
sessionStorageManager.setPlayerAccountType(jsonData['PlayerAccountType']);
sessionStorageManager.setPlayingAppName("menu");
// sessionStorageManager.setPlayingAppName("menu");
// location.href = '../../web/client/menu_app.html';
game.state.start('LicenseTimer');
+23 -12
View File
@@ -68,10 +68,13 @@ Timer.prototype.setSubjectName = function(subjectName) {
Timer.prototype.makeTimer = function() {
this.timeHourText = this.makeTimerTextContent(this.timerCenterX - 240, this.timerCenterY, 160, "00");
this.timeHourMinuteSeperator = this.makeTimerTextContent(this.timerCenterX - 185, this.timerCenterY, 160, ":");
// this.timeHourMinuteSeperator = this.makeTimerTextContent(this.timerCenterX - 185, this.timerCenterY, 160, ":");
this.timeHourSeperator = this.makeTimerTextContent(this.timerCenterX - 190, this.timerCenterY + 45, 30, "시간");
this.timeMinuteText = this.makeTimerTextContent(this.timerCenterX, this.timerCenterY, 160, "00");
this.timeMinuteSecondSeperator = this.makeTimerTextContent(this.timerCenterX + 40, this.timerCenterY + 20, 100, ":");
this.timeSecondText = this.makeTimerTextContent(this.timerCenterX + 160, this.timerCenterY + 20, 100, "00");
// this.timeMinuteSecondSeperator = this.makeTimerTextContent(this.timerCenterX + 40, this.timerCenterY + 20, 100, ":");
this.timeMinuteSeperator = this.makeTimerTextContent(this.timerCenterX + 30, this.timerCenterY + 45, 30, "");
this.timeSecondText = this.makeTimerTextContent(this.timerCenterX + 160, this.timerCenterY + 24, 100, "00");
this.timeSecondSeperator = this.makeTimerTextContent(this.timerCenterX + 180, this.timerCenterY + 50, 20, "초");
}
Timer.prototype.makeTimerButtons = function() {
@@ -136,14 +139,15 @@ Timer.prototype.makeResetButton = function() {
"#333"
);
return new RoundRectButton(
var button = new RoundRectButton(
setting,
null, "C",
null, "",
(function() {
this.resetTimer();
this.resetLeftTimeToServer();
}).bind(this)
);
button.setIcon(new SpriteIconTimer(50, 50, SpriteIconTimer.FRAME_RESET));
}
Timer.prototype.makePlayButton = function() {
@@ -176,11 +180,14 @@ Timer.prototype.makePlayButton = function() {
"#333"
);
return new RoundRectButton(
var button = new RoundRectButton(
setting,
null, "",
null, "",
(function() { this.startTimer(); }).bind(this)
);
button.setIcon(new SpriteIconTimer(100, 100, SpriteIconTimer.FRAME_PLAY));
return button;
}
Timer.prototype.makePauseButton = function() {
@@ -215,9 +222,9 @@ Timer.prototype.makePauseButton = function() {
);
return new RoundRectButton(
var button = new RoundRectButton(
setting,
null, "",
new SpriteIconTimer(50, 50, SpriteIconTimer.FRAME_PAUSE), "",
(function() {
this.pauseTimer();
@@ -227,6 +234,9 @@ Timer.prototype.makePauseButton = function() {
this.resetLeftTimeToServer();
}).bind(this)
);
button.setIcon(new SpriteIconTimer(100, 100, SpriteIconTimer.FRAME_PAUSE));
return button;
}
Timer.prototype.showButton = function(button, flag) {
@@ -264,10 +274,11 @@ Timer.prototype.showTimerButtons = function() {
Timer.prototype.setTimerTextColor = function(color) {
this.timeHourText.tint = color;
this.timeHourMinuteSeperator.tint = color;
this.timeHourSeperator.tint = color;
this.timeMinuteText.tint = color;
this.timeMinuteSecondSeperator.tint = color;
this.timeMinuteSeperator.tint = color;
this.timeSecondText.tint = color;
this.timeSecondSeperator.tint = color;
}
Timer.prototype.startTimer = function() {
@@ -607,7 +618,7 @@ Timer.prototype.updateLeftTimeToServer = function() {
Timer.Timer_CENTER_OFFSET_X = 125;
Timer.Timer_CENTER_OFFSET_X = 120;
Timer.TIME_MILLISECONDS = 1000;
+1
View File
@@ -38,6 +38,7 @@
<script src="../../game/global/global_variables.js"></script>
<!-- library source files -->
<script src="../../game/lib/sprite/sprite_icon_timer.js"></script>
<script src="../../game/lib/keyboard_shortcut.js"></script>
<script src="../../game/lib/string_util.js"></script>
<script src="../../game/lib/number_util.js"></script>