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 @@