alt-r to redraw graphics

This commit is contained in:
evanpelle
2024-12-25 16:33:59 -08:00
parent 99e5a62ba6
commit fbdf26cff8
7 changed files with 52 additions and 15 deletions
+8
View File
@@ -48,6 +48,10 @@ export class AlternateViewEvent implements GameEvent {
constructor(public readonly alternateView: boolean) { }
}
export class RefreshGraphicsEvent implements GameEvent {
}
export class InputHandler {
private lastPointerX: number = 0;
@@ -96,6 +100,10 @@ export class InputHandler {
this.alternateView = false
this.eventBus.emit(new AlternateViewEvent(false))
}
if (e.key.toLowerCase() === 'r' && e.altKey && !e.ctrlKey) {
e.preventDefault();
this.eventBus.emit(new RefreshGraphicsEvent())
}
});
}