Compare commits

..

5 Commits

Author SHA1 Message Date
Manuel Vögele 1334703877 Release v1.12.2 2022-02-17 00:58:33 +01:00
Manuel Vögele d6cccf4466 Ensure pathfinding on gridless is possible by always generating a pathfinding point when a virtual wall is being inserted 2022-02-17 00:53:51 +01:00
Manuel Vögele 074d2f5052 Disable pathfinding when the hotkey for moving tokens without pathfinding is enabled (fixes #158) 2022-02-17 00:47:13 +01:00
Manuel Vögele e5b8f896f8 Release v1.12.1 2022-02-16 12:48:59 +01:00
Manuel Vögele 3de350d3e9 Remove wasm snippets from release builds 2022-02-16 12:47:23 +01:00
8 changed files with 43 additions and 27 deletions
+11
View File
@@ -1,3 +1,14 @@
## 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
## 1.12.0 ## 1.12.0
### New features ### New features
- Pathfinding is now supported on gridless scenes - Pathfinding is now supported on gridless scenes
+1 -1
View File
@@ -11,7 +11,7 @@ wasm_pack = Path("~/.cargo/bin/wasm-pack").expanduser()
root_files = ["module.json", "README.md", "CHANGELOG.md", "LICENSE"] root_files = ["module.json", "README.md", "CHANGELOG.md", "LICENSE"]
wasm_files = ["gridless_pathfinding_bg.wasm", "gridless_pathfinding.js"] wasm_files = ["gridless_pathfinding_bg.wasm", "gridless_pathfinding.js"]
output_dir = Path("artifact") output_dir = Path("artifact")
copy_everything_directories = ["js", "lang", "templates", "wasm/snippets"] copy_everything_directories = ["js", "lang", "templates"]
wasm_dir = Path("wasm") wasm_dir = Path("wasm")
root_dir = Path(".") root_dir = Path(".")
rust_dir = Path("rust") rust_dir = Path("rust")
+10
View File
@@ -113,6 +113,16 @@ function handleDisableSnap(event) {
function handleMoveWithoutAnimation(event) { function handleMoveWithoutAnimation(event) {
moveWithoutAnimation = !event.up; 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) { function handleTogglePathfinding(event) {
+3 -1
View File
@@ -1,5 +1,5 @@
import {getGridPositionFromPixelsObj, getPixelsFromGridPositionObj} from "./foundry_fixes.js"; import {getGridPositionFromPixelsObj, getPixelsFromGridPositionObj} from "./foundry_fixes.js";
import {togglePathfinding} from "./keybindings.js"; import {moveWithoutAnimation, togglePathfinding} from "./keybindings.js";
import {debugGraphics} from "./main.js"; import {debugGraphics} from "./main.js";
import {settingsKey} from "./settings.js"; import {settingsKey} from "./settings.js";
import {getSnapPointForTokenObj, iterPairs} from "./util.js"; import {getSnapPointForTokenObj, iterPairs} from "./util.js";
@@ -15,6 +15,8 @@ export function isPathfindingEnabled() {
return false; return false;
if (!game.user.isGM && !game.settings.get(settingsKey, "allowPathfinding")) if (!game.user.isGM && !game.settings.get(settingsKey, "allowPathfinding"))
return false; return false;
if (moveWithoutAnimation)
return false;
return game.settings.get(settingsKey, "autoPathfinding") != togglePathfinding; return game.settings.get(settingsKey, "autoPathfinding") != togglePathfinding;
} }
+2 -2
View File
@@ -2,7 +2,7 @@
"name": "drag-ruler", "name": "drag-ruler",
"title": "Drag Ruler", "title": "Drag Ruler",
"description": "When dragging a token displays a ruler showing how far you've moved that token.", "description": "When dragging a token displays a ruler showing how far you've moved that token.",
"version": "1.12.0", "version": "1.12.2",
"minimumCoreVersion" : "9.245", "minimumCoreVersion" : "9.245",
"compatibleCoreVersion" : "9", "compatibleCoreVersion" : "9",
"authors": [ "authors": [
@@ -65,7 +65,7 @@
], ],
"socket": true, "socket": true,
"url": "https://github.com/manuelVo/foundryvtt-drag-ruler", "url": "https://github.com/manuelVo/foundryvtt-drag-ruler",
"download": "https://github.com/manuelVo/foundryvtt-drag-ruler/archive/v1.12.0.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", "manifest": "https://raw.githubusercontent.com/manuelVo/foundryvtt-drag-ruler/master/module.json",
"readme": "https://github.com/manuelVo/foundryvtt-drag-ruler/blob/master/README.md", "readme": "https://github.com/manuelVo/foundryvtt-drag-ruler/blob/master/README.md",
"changelog": "https://github.com/manuelVo/foundryvtt-drag-ruler/blob/master/CHANGELOG.md", "changelog": "https://github.com/manuelVo/foundryvtt-drag-ruler/blob/master/CHANGELOG.md",
+1 -1
View File
@@ -26,7 +26,7 @@ dependencies = [
[[package]] [[package]]
name = "gridless-pathfinding" name = "gridless-pathfinding"
version = "0.1.0" version = "1.12.2"
dependencies = [ dependencies = [
"console_error_panic_hook", "console_error_panic_hook",
"js-sys", "js-sys",
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "gridless-pathfinding" name = "gridless-pathfinding"
version = "0.1.0" version = "1.12.2"
edition = "2021" edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+2 -9
View File
@@ -188,18 +188,13 @@ impl Pathfinder {
if angle_diff <= PI { if angle_diff <= PI {
continue; continue;
} }
{
let angle_between = angle_diff / 2.0 + angle1; let angle_between = angle_diff / 2.0 + angle1;
let pathfinding_node = calc_pathfinding_node( nodes.push(calc_pathfinding_node(
point, point,
angle_between, angle_between,
distance_from_walls, distance_from_walls,
&mut line_segments, &mut line_segments,
); ));
if angle_diff > 1.5 * PI {
nodes.push(pathfinding_node);
}
}
nodes.push(calc_pathfinding_node( nodes.push(calc_pathfinding_node(
point, point,
angle1 + 0.5 * PI, angle1 + 0.5 * PI,
@@ -219,7 +214,6 @@ impl Pathfinder {
if angle_diff <= PI { if angle_diff <= PI {
continue; continue;
} }
if angle_diff > 1.5 * PI {
let angle_between = angle_diff / 2.0 + angle1; let angle_between = angle_diff / 2.0 + angle1;
nodes.push(calc_pathfinding_node( nodes.push(calc_pathfinding_node(
point, point,
@@ -227,7 +221,6 @@ impl Pathfinder {
distance_from_walls, distance_from_walls,
&mut line_segments, &mut line_segments,
)); ));
}
nodes.push(calc_pathfinding_node( nodes.push(calc_pathfinding_node(
point, point,
angle1 + 0.5 * PI, angle1 + 0.5 * PI,