Disable pathfinding when the hotkey for moving tokens without pathfinding is enabled (fixes #158)

This commit is contained in:
Manuel Vögele
2022-02-17 00:47:13 +01:00
parent e5b8f896f8
commit 074d2f5052
2 changed files with 13 additions and 1 deletions
+10
View File
@@ -113,6 +113,16 @@ function handleDisableSnap(event) {
function handleMoveWithoutAnimation(event) {
moveWithoutAnimation = !event.up;
const ruler = canvas.controls.ruler;
if (!ruler?.isDragRuler)
return false;
if (ruler._state !== Ruler.STATES.MEASURING)
return false;
ruler.measure(getMeasurePosition(), {snap: !disableSnap});
ruler.dragRulerSendState();
return false;
}
function handleTogglePathfinding(event) {
+3 -1
View File
@@ -1,5 +1,5 @@
import {getGridPositionFromPixelsObj, getPixelsFromGridPositionObj} from "./foundry_fixes.js";
import {togglePathfinding} from "./keybindings.js";
import {moveWithoutAnimation, togglePathfinding} from "./keybindings.js";
import {debugGraphics} from "./main.js";
import {settingsKey} from "./settings.js";
import {getSnapPointForTokenObj, iterPairs} from "./util.js";
@@ -15,6 +15,8 @@ export function isPathfindingEnabled() {
return false;
if (!game.user.isGM && !game.settings.get(settingsKey, "allowPathfinding"))
return false;
if (moveWithoutAnimation)
return false;
return game.settings.get(settingsKey, "autoPathfinding") != togglePathfinding;
}