From c4237508855842495c3ebae86882ec9bc7405108 Mon Sep 17 00:00:00 2001 From: unanmed <1319491857@qq.com> Date: Mon, 20 Nov 2023 20:05:01 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=81=93=E5=85=B7=E6=A0=8F=E5=92=8C?= =?UTF-8?q?=E8=A3=85=E5=A4=87=E6=A0=8F=E8=BD=AC=E6=8D=A2=E4=BD=BF=E6=8C=89?= =?UTF-8?q?=E9=94=AE=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/main/init/hotkey.ts | 16 ++++++++++++++-- src/ui/equipbox.vue | 4 +++- src/ui/fixedDetail.vue | 2 ++ src/ui/toolbox.vue | 16 ++++++++++------ 4 files changed, 29 insertions(+), 9 deletions(-) diff --git a/src/core/main/init/hotkey.ts b/src/core/main/init/hotkey.ts index f7934bb..14cc820 100644 --- a/src/core/main/init/hotkey.ts +++ b/src/core/main/init/hotkey.ts @@ -468,10 +468,22 @@ gameKey } }) .realize('special', () => { - mainUi.open('fixedDetail', { panel: 'special' }); + if (hovered) { + const { x, y } = hovered; + const enemy = core.status.thisMap.enemy.list.find(v => { + return v.x === x && v.y === y; + }); + if (enemy) mainUi.open('fixedDetail', { panel: 'special' }); + } }) .realize('critical', () => { - mainUi.open('fixedDetail', { panel: 'critical' }); + if (hovered) { + const { x, y } = hovered; + const enemy = core.status.thisMap.enemy.list.find(v => { + return v.x === x && v.y === y; + }); + if (enemy) mainUi.open('fixedDetail', { panel: 'critical' }); + } }) .realize('restart', () => { core.confirmRestart(); diff --git a/src/ui/equipbox.vue b/src/ui/equipbox.vue index e201012..53dfc1f 100644 --- a/src/ui/equipbox.vue +++ b/src/ui/equipbox.vue @@ -438,7 +438,9 @@ function dragout(e: Event) { function toTool() { mota.ui.main.holdOn(); exit(); - mota.ui.main.open('toolbox'); + nextTick(() => { + mota.ui.main.open('toolbox'); + }); } gameKey.use(props.ui.symbol); diff --git a/src/ui/fixedDetail.vue b/src/ui/fixedDetail.vue index 79317e2..9d4925b 100644 --- a/src/ui/fixedDetail.vue +++ b/src/ui/fixedDetail.vue @@ -36,6 +36,8 @@ if (hovered) { } else { close(); } +} else { + close(); } function close() { diff --git a/src/ui/toolbox.vue b/src/ui/toolbox.vue index 4f9d0df..dd66d81 100644 --- a/src/ui/toolbox.vue +++ b/src/ui/toolbox.vue @@ -108,7 +108,7 @@