Compare commits
7 Commits
pathfinding
...
v1.12.2
| Author | SHA1 | Date | |
|---|---|---|---|
| 1334703877 | |||
| d6cccf4466 | |||
| 074d2f5052 | |||
| e5b8f896f8 | |||
| 3de350d3e9 | |||
| 8f97081236 | |||
| 18253dc42b |
@@ -1,3 +1,19 @@
|
|||||||
|
## 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
|
||||||
|
### New features
|
||||||
|
- Pathfinding is now supported on gridless scenes
|
||||||
|
|
||||||
|
|
||||||
## 1.11.5
|
## 1.11.5
|
||||||
### Bugfixes
|
### Bugfixes
|
||||||
- Fixed a bug that was causing Drag Ruler to spam useless warnings into the console (this was a regression introduced in 1.11.4)
|
- Fixed a bug that was causing Drag Ruler to spam useless warnings into the console (this was a regression introduced in 1.11.4)
|
||||||
|
|||||||
+1
-1
@@ -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")
|
||||||
|
|||||||
@@ -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
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
-1
@@ -10,6 +10,10 @@ export const RightClickAction = Object.freeze({
|
|||||||
ABORT_DRAG:2,
|
ABORT_DRAG:2,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function delayedReload() {
|
||||||
|
window.setTimeout(() => location.reload(), 500);
|
||||||
|
}
|
||||||
|
|
||||||
export function registerSettings() {
|
export function registerSettings() {
|
||||||
game.settings.register(settingsKey, "dataVersion", {
|
game.settings.register(settingsKey, "dataVersion", {
|
||||||
scope: "world",
|
scope: "world",
|
||||||
@@ -90,7 +94,7 @@ export function registerSettings() {
|
|||||||
config: true,
|
config: true,
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
onChange: () => location.reload(),
|
onChange: delayedReload,
|
||||||
});
|
});
|
||||||
|
|
||||||
game.settings.register(settingsKey, "autoPathfinding", {
|
game.settings.register(settingsKey, "autoPathfinding", {
|
||||||
|
|||||||
+2
-2
@@ -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.11.5",
|
"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.11.5.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",
|
||||||
|
|||||||
Generated
+1
-1
@@ -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
@@ -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
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user