Compare commits

...

3 Commits

7 changed files with 37 additions and 26 deletions
+6
View File
@@ -1,3 +1,9 @@
## 1.12.2
### Bugfixes
- Fixed a bug where the pathfinder on gridless scenes sometimes wasn't able to find a way around corners with specific angles
- Pathfinding will now be disabled when the hotkey to move tokens without animation is being pressed, to allow GMs to move their tokens through walls
## 1.12.1
### Hotfix
- Version 1.12.0 was incorrectly packaged, which caused it to fail to load
+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;
}
+2 -2
View File
@@ -2,7 +2,7 @@
"name": "drag-ruler",
"title": "Drag Ruler",
"description": "When dragging a token displays a ruler showing how far you've moved that token.",
"version": "1.12.1",
"version": "1.12.2",
"minimumCoreVersion" : "9.245",
"compatibleCoreVersion" : "9",
"authors": [
@@ -65,7 +65,7 @@
],
"socket": true,
"url": "https://github.com/manuelVo/foundryvtt-drag-ruler",
"download": "https://github.com/manuelVo/foundryvtt-drag-ruler/releases/download/v1.12.1/drag-ruler-1.12.1.zip",
"download": "https://github.com/manuelVo/foundryvtt-drag-ruler/releases/download/v1.12.2/drag-ruler-1.12.2.zip",
"manifest": "https://raw.githubusercontent.com/manuelVo/foundryvtt-drag-ruler/master/module.json",
"readme": "https://github.com/manuelVo/foundryvtt-drag-ruler/blob/master/README.md",
"changelog": "https://github.com/manuelVo/foundryvtt-drag-ruler/blob/master/CHANGELOG.md",
+1 -1
View File
@@ -26,7 +26,7 @@ dependencies = [
[[package]]
name = "gridless-pathfinding"
version = "1.12.1"
version = "1.12.2"
dependencies = [
"console_error_panic_hook",
"js-sys",
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "gridless-pathfinding"
version = "1.12.1"
version = "1.12.2"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+14 -21
View File
@@ -188,18 +188,13 @@ impl Pathfinder {
if angle_diff <= PI {
continue;
}
{
let angle_between = angle_diff / 2.0 + angle1;
let pathfinding_node = calc_pathfinding_node(
point,
angle_between,
distance_from_walls,
&mut line_segments,
);
if angle_diff > 1.5 * PI {
nodes.push(pathfinding_node);
}
}
let angle_between = angle_diff / 2.0 + angle1;
nodes.push(calc_pathfinding_node(
point,
angle_between,
distance_from_walls,
&mut line_segments,
));
nodes.push(calc_pathfinding_node(
point,
angle1 + 0.5 * PI,
@@ -219,15 +214,13 @@ impl Pathfinder {
if angle_diff <= PI {
continue;
}
if angle_diff > 1.5 * PI {
let angle_between = angle_diff / 2.0 + angle1;
nodes.push(calc_pathfinding_node(
point,
angle_between,
distance_from_walls,
&mut line_segments,
));
}
let angle_between = angle_diff / 2.0 + angle1;
nodes.push(calc_pathfinding_node(
point,
angle_between,
distance_from_walls,
&mut line_segments,
));
nodes.push(calc_pathfinding_node(
point,
angle1 + 0.5 * PI,