Add keybinding for the pathfinding feature

This commit is contained in:
Manuel Vögele
2022-01-27 23:58:51 +01:00
parent 9140ef3acf
commit 4c006d34c9
5 changed files with 26 additions and 1 deletions
+2 -1
View File
@@ -1,4 +1,5 @@
import {getCenterFromGridPositionObj} from "./foundry_fixes.js";
import { togglePathfinding } from "./keybindings.js";
import {settingsKey} from "./settings.js";
// TODO Wipe cache if walls layer is being modified
@@ -7,7 +8,7 @@ let cached_nodes = undefined;
export function is_pathfinding_enabled() {
if (!game.settings.get(settingsKey, "allowPathfinding"))
return false;
return game.settings.get(settingsKey, "autoPathfinding") != game.keyboard.isDown("y")
return game.settings.get(settingsKey, "autoPathfinding") != togglePathfinding;
}
function get_node(pos, initialize=true) {