diff --git a/src/game/scenes/BattleScene.ts b/src/game/scenes/BattleScene.ts index 148d5d1..149fb31 100644 --- a/src/game/scenes/BattleScene.ts +++ b/src/game/scenes/BattleScene.ts @@ -3189,6 +3189,11 @@ export class BattleScene extends Phaser.Scene { return; } + if (this.cancelDeploymentSelection()) { + soundDirector.playSelect(); + return; + } + if (this.cancelAttackTargeting()) { return; } @@ -5463,6 +5468,23 @@ export class BattleScene extends Phaser.Scene { : undefined; } + private cancelDeploymentSelection(forceNotice = false) { + if (this.phase !== 'deployment') { + return false; + } + + if (!this.deploymentSelectedUnitId && !forceNotice) { + return false; + } + + this.deploymentSelectedUnitId = undefined; + this.deploymentNotice = '선택을 해제했습니다. 배치할 장수를 다시 선택하세요.'; + this.renderDeploymentMap(); + this.renderDeploymentPanel(); + this.clearPointerFeedback(); + return true; + } + private handleDeploymentUnitClick(unit: UnitData) { if (this.phase !== 'deployment') { return; @@ -10837,11 +10859,7 @@ export class BattleScene extends Phaser.Scene { } if (this.phase === 'deployment') { - this.deploymentSelectedUnitId = undefined; - this.deploymentNotice = '선택을 해제했습니다. 배치할 장수를 다시 선택하세요.'; - this.renderDeploymentMap(); - this.renderDeploymentPanel(); - this.clearPointerFeedback(); + this.cancelDeploymentSelection(true); return; }