mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-02-28 09:27:07 +08:00
fix: 按键移动不连贯
This commit is contained in:
parent
203fde1fbc
commit
a0f51092e2
@ -57,6 +57,7 @@ export class HeroKeyMover {
|
||||
}
|
||||
|
||||
private onPressKey = (code: KeyCode) => {
|
||||
if (core.isReplaying()) return;
|
||||
if (code === this.hotkeyData.left.key) this.press('left');
|
||||
else if (code === this.hotkeyData.right.key) this.press('right');
|
||||
else if (code === this.hotkeyData.up.key) this.press('up');
|
||||
|
@ -229,8 +229,8 @@ export class Hotkey extends EventEmitter<HotkeyEvent> {
|
||||
if (!this.enabled) return false;
|
||||
const when = this.conditionMap.get(this.scope)!;
|
||||
if (type === 'up') this.checkPressEnd(key);
|
||||
else if (type === 'down') this.checkPress(key);
|
||||
if (!when()) return false;
|
||||
if (type === 'down') this.checkPress(key);
|
||||
const toEmit = this.keyMap.get(key);
|
||||
if (!toEmit) return false;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user