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/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)) diff --git a/js/foundry_imports.js b/js/foundry_imports.js index a9c90dc..80ab9ad 100644 --- a/js/foundry_imports.js +++ b/js/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/js/pathfinding.js b/js/pathfinding.js index a961e59..6ae7eea 100644 --- a/js/pathfinding.js +++ b/js/pathfinding.js @@ -11,6 +11,8 @@ let use5105 = false; let gridlessPathfinder = undefined; export function isPathfindingEnabled() { + if (this.user !== game.user) + return false; if (!game.user.isGM && !game.settings.get(settingsKey, "allowPathfinding")) return false; return game.settings.get(settingsKey, "autoPathfinding") != togglePathfinding; @@ -56,7 +58,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; } diff --git a/js/settings.js b/js/settings.js index 51caa58..bfa0a6b 100644 --- a/js/settings.js +++ b/js/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, }); diff --git a/module.json b/module.json index f1d01fa..51cbd84 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",