Disable pathfinding when the hotkey for moving tokens without pathfinding is enabled (fixes #158)
This commit is contained in:
@@ -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
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user