Can now toggle unit labels with L

This commit is contained in:
PeekabooSteam 2023-10-01 21:42:23 +01:00
parent 5a28974027
commit 91484e1c98
2 changed files with 12 additions and 1 deletions

View File

@ -253,6 +253,17 @@ export class OlympusApp {
this.getUnitsManager().deselectAllUnits();
},
"code": "Escape"
}).addKeyboardShortcut( "toggleUnitLabels", {
"altKey": false,
"callback": () => {
const chk = document.querySelector( `label[title="Show unit labels"] input[type="checkbox"]` );
if ( chk instanceof HTMLElement ) {
chk.click();
}
},
"code": "KeyL",
"ctrlKey": false,
"shiftKey": false
});
["KeyW", "KeyA", "KeyS", "KeyD", "ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown"].forEach(code => {

View File

@ -1,6 +1,6 @@
import { ShortcutKeyboardOptions, ShortcutMouseOptions } from "../interfaces";
import { Manager } from "../other/manager";
import { Shortcut, ShortcutKeyboard, ShortcutMouse } from "./shortcut";
import { ShortcutKeyboard, ShortcutMouse } from "./shortcut";
export class ShortcutManager extends Manager {