mirror of
https://github.com/unanmed/HumanBreak.git
synced 2026-11-29 05:24:30 +08:00
fix: 优化移动手感
This commit is contained in:
1 parent
1c369251b1
commit
e5afdb73fd
3 files changed
+46
-41
No files matched your search
@@ -86,7 +86,8 @@ export class Hotkey extends EventEmitter<HotkeyEvent> {
|
||||
enabled: boolean = false;
|
||||
conditionMap: Map<symbol, () => boolean> = new Map();
|
||||
|
||||
private scope: symbol = Symbol();
|
||||
/** 当前作用域 */
|
||||
scope: symbol = Symbol();
|
||||
private scopeStack: symbol[] = [];
|
||||
private grouping: string = 'none';
|
||||
|
||||
@@ -226,6 +227,8 @@ export class Hotkey extends EventEmitter<HotkeyEvent> {
|
||||
// 检查全局启用情况
|
||||
if (!this.enabled) return false;
|
||||
const when = this.conditionMap.get(this.scope)!;
|
||||
if (type === 'down') this.checkPress(key);
|
||||
else this.checkPressEnd(key);
|
||||
if (!when()) return false;
|
||||
const toEmit = this.keyMap.get(key);
|
||||
if (!toEmit) return false;
|
||||
@@ -253,9 +256,6 @@ export class Hotkey extends EventEmitter<HotkeyEvent> {
|
||||
});
|
||||
this.emit('emit', key, assist, type);
|
||||
|
||||
if (type === 'down') this.checkPress(key);
|
||||
else this.checkPressEnd(key);
|
||||
|
||||
return emitted;
|
||||
}
|
||||
|
||||
|
||||
@@ -289,4 +289,8 @@ export class LayerOpenDoorAnimate implements ILayerRenderExtends {
|
||||
awake(layer: Layer) {
|
||||
this.layer = layer;
|
||||
}
|
||||
|
||||
openDoor(x: number, y: number) {}
|
||||
|
||||
closeDoor(x: number, y: number) {}
|
||||
}
|
||||
Reference in new issue
Block a user