From aa33c37eaf3d6c78a357178b0c6db2e1009c163d Mon Sep 17 00:00:00 2001 From: jasson31 <jasson31@naver.com> Date: Wed, 21 Aug 2019 20:01:37 +0900 Subject: [PATCH] =?UTF-8?q?=ED=98=B8=ED=8C=A8=20=EB=B2=84=EA=B7=B8=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/Client.js | 2 +- js/Input.js | 19 ++----------------- js/ResourceLoader.js | 8 +++++++- js/ScenesData.js | 10 +++++----- js/UIObject.js | 2 +- js/WordSpace.js | 8 ++------ 6 files changed, 18 insertions(+), 31 deletions(-) diff --git a/js/Client.js b/js/Client.js index 7d0a025..0fad79a 100644 --- a/js/Client.js +++ b/js/Client.js @@ -410,7 +410,7 @@ var gameEndMenu = function(isWin) x: game.config.width / 2, y: game.config.height / 2, - background: ScenesData.gameScene.add.sprite(game.config.width / 2, game.config.height / 2, 'panel').setOrigin(0.5, 0.5), + background: ScenesData.gameScene.add.sprite(game.config.width / 2, game.config.height / 2, 'noticeBackground').setOrigin(0.5, 0.5), content: ScenesData.gameScene.rexUI.add.dialog({ x: game.config.width / 2, diff --git a/js/Input.js b/js/Input.js index fe8ef14..101f7a8 100644 --- a/js/Input.js +++ b/js/Input.js @@ -29,20 +29,6 @@ Input.gameSceneEnterReaction = function() Input.isEntered = true; } } -Input.menuSceneEnterReaction = function() -{ - Input.finalInput = Input.removeConVow(Input.finalInput); - if (Input.finalInput.length > 1) - { - PlayerData.nickname = Input.finalInput; - Input.reset(); - } - else - { - alert('ì •í™•í•œ ê°€ëª…ì„ ìž…ë ¥í•´ì£¼ì„¸ìš”.'); - Input.reset(); - } -} Input.reset = function() { @@ -325,9 +311,8 @@ Input.inputField = scene.input.keyboard.on('keyup', function() {Input.pressCount--; Input.justPressed = ''; if(isHopaeScene) { - ScenesData.hopaeScene.checkBtn.setEnable(Input.checkProperInput(Input.inputField.text.text) ? true : false); - if(Input.finalInput.length > 4) ScenesData.hopaeScene.warningText.setVisible(true); - else ScenesData.hopaeScene.warningText.setVisible(false); + ScenesData.hopaeScene.checkBtn.setEnable(Input.checkProperInput(Input.inputField.text.text) || (Input.finalInput.length > 1) ? true : false); + ScenesData.hopaeScene.warningText.setVisible(Input.finalInput.length > 4 ? true : false); }}) scene.input.keyboard.on('keydown-SHIFT', function() {Input.isShifted = true}); scene.input.keyboard.on('keyup-SHIFT', function() {Input.isShifted = false}); diff --git a/js/ResourceLoader.js b/js/ResourceLoader.js index 2c70b08..8d56ef0 100644 --- a/js/ResourceLoader.js +++ b/js/ResourceLoader.js @@ -43,14 +43,20 @@ ResourceLoader.loadImage = function(scene) scene.load.spritesheet('wordBreak', 'assets/image/word/wordbreak.png', { frameWidth: 180, frameHeight: 180 }); scene.load.image('attackPaper', 'assets/image/etc/paper_crumbled.png'); - scene.load.image('panel', 'assets/placeholder/panel.png'); scene.load.image('button', 'assets/placeholder/button.png'); + scene.load.image('panel', 'assets/placeholder/panel.png'); + scene.load.image('noticeBackground', 'assets/image/UI/noticeWindow/background.png'); scene.load.image('itemBag', 'assets/image/etc/itembag2.png'); scene.load.image('friendlyPlayBtn', 'assets/image/UI/main/friendlyPlay.png'); scene.load.image('rankPlayBtn', 'assets/image/UI/main/rankPlay.png'); scene.load.image('shopBtn', 'assets/image/UI/main/shop.png'); scene.load.image('hopaeManageBtn', 'assets/image/UI/main/hopaeManage.png'); scene.load.image('helpBtn', 'assets/image/UI/main/help.png'); + + scene.load.image('helpBtn', 'assets/image/UI/decisionBtn/spectate.png'); + scene.load.image('helpBtn', 'assets/image/UI/decisionBtn/help.png'); + scene.load.image('helpBtn', 'assets/image/UI/decisionBtn/help.png'); + scene.load.image('helpBtn', 'assets/image/UI/decisionBtn/help.png'); diff --git a/js/ScenesData.js b/js/ScenesData.js index 8c86258..863fe6d 100644 --- a/js/ScenesData.js +++ b/js/ScenesData.js @@ -140,7 +140,7 @@ var menuScene = new Phaser.Class( x: game.config.width / 2, y: game.config.height / 2, - background: this.add.sprite(game.config.width / 2, game.config.height / 2, 'panel').setOrigin(0.5, 0.5), + background: this.add.sprite(game.config.width / 2, game.config.height / 2, 'noticeBackground').setOrigin(0.5, 0.5), content: this.add.text(0, 0, 'ëŒ€ê¸°ì‹¤ì— ì°¸ê°€í•˜ì‹œê² ìŠµë‹ˆê¹Œ?', { font: '50pt sejongFont' @@ -253,14 +253,14 @@ var hopaeScene = new Phaser.Class( Input.inputField.generate(this, function(){}, UIObject.createLabel(this, game.config.width / 2, game.config.height / 2, 10, 'nameBgr6', 2, 'center', '', 50, '#ffffff').getElement('text').setOrigin(0.45,0.5), true); - UIObject.createLabel(this, game.config.width / 2, game.config.height / 2 - 200, 2, 'panel', 1, 'center', + UIObject.createLabel(this, game.config.width / 2, game.config.height / 2 - 200, 2, 'noticeBackground', 1, 'center', '호패는 ì˜¤ì§ í•œê¸€ë§Œ ìž…ë ¥ì´ ê°€ëŠ¥í•©ë‹ˆë‹¤.\në„ì–´ì“°ê¸°ë„ ì‚¬ìš©í• ìˆ˜ 없습니다.', 50, '#000000').layout(); this.checkDialog = this.rexUI.add.dialog({ x: game.config.width / 2, y: game.config.height / 2, - background: this.add.sprite(game.config.width / 2, game.config.height / 2, 'panel').setOrigin(0.5, 0.5), + background: this.add.sprite(game.config.width / 2, game.config.height / 2, 'noticeBackground').setOrigin(0.5, 0.5), content: this.add.text(0, 0, 'ì´ ì´ë¦„으로 í•˜ì‹œê² ìŠµë‹ˆê¹Œ?' + (PlayerData.userData.hopae === undefined || PlayerData.userData.hopae.length == 0 ? '\n(최초 호패는 ë¹„ìš©ì´ ë“¤ì§€ 않습니다.)' : '\n변경ì—는 ì—½ì „ì´ ì†Œëª¨ë©ë‹ˆë‹¤.'), { @@ -294,7 +294,7 @@ var hopaeScene = new Phaser.Class( else { this.checkDialog.setVisible(false); - this.errorMsg = UIObject.createButton(this, UIObject.createLabel(this, game.config.width / 2, game.config.height / 2, 10, 'panel', 1, 'center', + this.errorMsg = UIObject.createButton(this, UIObject.createLabel(this, game.config.width / 2, game.config.height / 2, 10, 'noticeBackground', 1, 'center', 'ì—½ì „ì´ ë¶€ì¡±í•©ë‹ˆë‹¤', 50, '#000000').layout().popUp(200), 0, 0, 0, function() { @@ -315,7 +315,7 @@ var hopaeScene = new Phaser.Class( .on('button.out', function (button, groupName, index) { //console.log('button out'); }); - this.warningText = UIObject.createLabel(this, game.config.width / 2, game.config.height / 2 - 100, 5, 'panel', 1, 'center', + this.warningText = UIObject.createLabel(this, game.config.width / 2, game.config.height / 2 - 100, 5, 'noticeBackground', 1, 'center', 'ì´ë¦„ 타수가 ë§Žì•„ í”Œë ˆì´ì— 패ë„í‹°ê°€ ìžˆì„ ìˆ˜ 있습니다', 40, '#000000').setVisible(false).layout(); this.checkBtn = UIObject.createButton(this, UIObject.createLabel(this, game.config.width / 2, 900, 5, 'pyeongminWrite', 0.5, 'center'), 1, 0, 2, diff --git a/js/UIObject.js b/js/UIObject.js index 45e9abd..d68ef70 100644 --- a/js/UIObject.js +++ b/js/UIObject.js @@ -54,7 +54,7 @@ UIObject.createButton = function(scene, buttonGameObject, overFrame, outFrame, d }); let buttonGameObjectBackground = buttonGameObject.getElement('background'); temp.enabled = true; - buttonGameObjectBackground.setFrame(outFrame).setInteractive() + buttonGameObjectBackground.setFrame(outFrame > 0 ? outFrame : 0).setInteractive() .on('pointerover', () => { if(temp.enabled) { diff --git a/js/WordSpace.js b/js/WordSpace.js index 35f0eec..682924e 100644 --- a/js/WordSpace.js +++ b/js/WordSpace.js @@ -473,12 +473,8 @@ WordSpace.nameQueue = getCount: function(player) { WordSpace.nameQueue.counter = 0; - WordSpace.nameGroup.forEach(function(element){ - if(element.id == player.id) WordSpace.nameQueue.counter++; - }) - WordSpace.wordGroup.forEach(function(element){ - if(element instanceof NameWord && element.ownerId == player.id) WordSpace.nameQueue.counter++; - }) + WordSpace.nameGroup.forEach(function(element){ if(element.ownerId == player.id) WordSpace.nameQueue.counter++; }); + WordSpace.wordGroup.forEach(function(element){ if(element instanceof NameWord && element.ownerId == player.id) WordSpace.nameQueue.counter++; }); return WordSpace.nameQueue.counter; }, counter: 0, -- 2.22.0