From 83ba5b0e655411c963c1ad8a7957b9778a5fe3ed Mon Sep 17 00:00:00 2001 From: unanmed <1319491857@qq.com> Date: Wed, 20 Nov 2024 22:20:03 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=BD=95=E5=83=8F=E6=8C=89=E9=94=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/libs/actions.js | 6 ------ src/core/main/custom/hotkey.ts | 2 +- src/core/main/init/hotkey.ts | 5 ++++- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/public/libs/actions.js b/public/libs/actions.js index 947a135..df4107c 100644 --- a/public/libs/actions.js +++ b/public/libs/actions.js @@ -253,12 +253,6 @@ actions.prototype._sys_onkeyUp_replay = function (e) { else if (e.keyCode == 78) // N core.stepReplay(); - else if (e.keyCode == 84) - // T - core.control._replay_toolbox(); - else if (e.keyCode == 81) - // Q_sys_onkeyUp - core.control._replay_equipbox(); else if (e.keyCode == 66) // B core.ui._drawStatistics(); diff --git a/src/core/main/custom/hotkey.ts b/src/core/main/custom/hotkey.ts index d8d0325..9c18653 100644 --- a/src/core/main/custom/hotkey.ts +++ b/src/core/main/custom/hotkey.ts @@ -228,9 +228,9 @@ export class Hotkey extends EventEmitter { // 检查全局启用情况 if (!this.enabled) return false; const when = this.conditionMap.get(this.scope)!; + if (!when()) return false; if (type === 'down') this.checkPress(key); else this.checkPressEnd(key); - if (!when()) return false; const toEmit = this.keyMap.get(key); if (!toEmit) return false; diff --git a/src/core/main/init/hotkey.ts b/src/core/main/init/hotkey.ts index 3165691..8266a2d 100644 --- a/src/core/main/init/hotkey.ts +++ b/src/core/main/init/hotkey.ts @@ -443,7 +443,10 @@ gameKey.use(mainScope); // ----- Realization gameKey - .when(() => !core.status.lockControl && !core.isMoving()) + .when( + () => + !core.status.lockControl && !core.isMoving() && !core.isReplaying() + ) .realize('book', () => { core.openBook(true); })