From 6748617f6ac46772ed2990ce861734827680cec6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20V=C3=B6gele?= Date: Tue, 1 Feb 2022 20:57:44 +0100 Subject: [PATCH 1/5] Add "DnD5e Drag Ruler Integration" and "Shadow of the Demon Lord" to list of Drag Ruler integraion --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 9a25520..914fae8 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,7 @@ Drag Ruler will work with all Foundry VTT game systems. However, some game syste The game systems that offer Drag Ruler integration are: - Cypher System (starting with version 1.13.0) +- DnD5e (via the module [DnD5e Drag Ruler Integration](https://foundryvtt.com/packages/elevation-drag-ruler)) - GURPS 4th Edition Game Aid (Unofficial) (starting with version 0.9.1) - Ironclaw Second Edition (starting with version 0.2.2) - Lancer (via the module [Lancer Speed Provider](https://foundryvtt.com/packages/lancer-speed-provider)) @@ -44,6 +45,7 @@ The game systems that offer Drag Ruler integration are: - Pathfinder 1 (starting with version 0.77.3) - Pathfinder 2e (via the module [PF2E Drag Ruler Integration](https://foundryvtt.com/packages/pf2e-dragruler/)) - Shadowrun 5th Edition (via the module [Drag Ruler Integration for Shadowrun 5E](https://foundryvtt.com/packages/drag-ruler-integration-for-shadowrun-5e)) +- Shadow of the Demon Lord (starting with version 1.7.15) - Starfinder (via the module [Starfinder Drag Ruler Integration](https://foundryvtt.com/packages/starfinder-drag-ruler)) - Stargate RPG (starting with version 1.6.0) - Symbaroum (via the module [Symbaroum drag ruler integration](https://foundryvtt.com/packages/symbaroum-drag-ruler-integration)) From 68885385eadcb4d5390e8867d471062e5e1e9ec5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20V=C3=B6gele?= Date: Thu, 3 Feb 2022 17:42:35 +0100 Subject: [PATCH 2/5] Formatting fix --- src/pathfinding.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pathfinding.js b/src/pathfinding.js index 507ae3f..35a0218 100644 --- a/src/pathfinding.js +++ b/src/pathfinding.js @@ -45,7 +45,7 @@ function getNode(pos, token, initialize=true) { if (!cachedNodes[pos.layer]) cachedNodes[pos.layer] = new Array(Math.ceil(canvas.dimensions.height / canvas.grid.h)); if (!cachedNodes[pos.layer][pos.y]) - cachedNodes[pos.layer][pos.y] = new Array(Math.ceil(canvas.dimensions.width / canvas.grid.w)); + cachedNodes[pos.layer][pos.y] = new Array(Math.ceil(canvas.dimensions.width / canvas.grid.w)); if (!cachedNodes[pos.layer][pos.y][pos.x]) { cachedNodes[pos.layer][pos.y][pos.x] = pos; } From 1509307313d857af861ea37a98a0a2d30d5067cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20V=C3=B6gele?= Date: Thu, 3 Feb 2022 17:59:09 +0100 Subject: [PATCH 3/5] Show the setting for automatic pathfinding to players if they are allowed to use pathfinding --- src/settings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/settings.js b/src/settings.js index 51caa58..bfa0a6b 100644 --- a/src/settings.js +++ b/src/settings.js @@ -97,7 +97,7 @@ export function registerSettings() { name: "drag-ruler.settings.autoPathfinding.name", hint: "drag-ruler.settings.autoPathfinding.hint", scpoe: "client", - config: early_isGM(), + config: early_isGM() || game.settings.get(settingsKey, "allowPathfinding"), type: Boolean, defualt: false, }); From 56e15be4ca1863a9c68f925ddbecd69736594124 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20V=C3=B6gele?= Date: Thu, 3 Feb 2022 17:59:35 +0100 Subject: [PATCH 4/5] Don't perform pathfinding on other player's rulers --- src/foundry_imports.js | 2 +- src/pathfinding.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/foundry_imports.js b/src/foundry_imports.js index a9c90dc..80ab9ad 100644 --- a/src/foundry_imports.js +++ b/src/foundry_imports.js @@ -168,7 +168,7 @@ export function measure(destination, options={}) { this.dragRulerRemovePathfindingWaypoints(); - if (isToken && isPathfindingEnabled()) { + if (isToken && isPathfindingEnabled.call(this)) { const from = getGridPositionFromPixelsObj(this.waypoints[this.waypoints.length - 1]); const to = getGridPositionFromPixelsObj(destination); let path = findPath(from, to, this.draggedEntity, this.waypoints); diff --git a/src/pathfinding.js b/src/pathfinding.js index 35a0218..9b94144 100644 --- a/src/pathfinding.js +++ b/src/pathfinding.js @@ -8,6 +8,8 @@ let cachedNodes = undefined; let use5105 = false; export function isPathfindingEnabled() { + if (this.user !== game.user) + return false; if (canvas.grid.type === CONST.GRID_TYPES.GRIDLESS) return false; if (!game.user.isGM && !game.settings.get(settingsKey, "allowPathfinding")) From fa581ddfc3c67827ad83dd195c405290de3c8e2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20V=C3=B6gele?= Date: Thu, 3 Feb 2022 18:23:35 +0100 Subject: [PATCH 5/5] Release v1.11.3 --- CHANGELOG.md | 6 ++++++ module.json | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f4a3172..f7c970d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 1.11.3 +### Bugfixes +- The setting to automatically start pathfinding is now visible to players again (this was a regression introduced in 1.11.2) +- Fixed a bug that would show the measurements of other players as if they were using the pathfinder, even if they were not using it. + + ## 1.11.2 ### Bugfixes - Fixed a memory leak that could cause the rule to slow down after using the pathfinding functionality for a while diff --git a/module.json b/module.json index fa03a5f..40db651 100644 --- a/module.json +++ b/module.json @@ -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.11.2", + "version": "1.11.3", "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/archive/v1.11.2.zip", + "download": "https://github.com/manuelVo/foundryvtt-drag-ruler/archive/v1.11.3.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",