From d4da4576b68c069a376452020a6abe43fe1ffdfb Mon Sep 17 00:00:00 2001 From: Wickedness Date: Sun, 5 Jul 2026 04:01:05 +0900 Subject: [PATCH] Let escape clear deployment selection --- src/game/scenes/BattleScene.ts | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) 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; }