From a3be4ceb03e5276e05966735df18da4da302e651 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20V=C3=B6gele?= Date: Sun, 21 Nov 2021 16:51:36 +0100 Subject: [PATCH] Remove support for TerrainLayer (Enhanced Terrain Layer stays supported) --- src/compatibility.js | 3 --- src/foundry_imports.js | 2 +- src/movement_tracking.js | 2 +- src/speed_provider.js | 8 ++++---- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/compatibility.js b/src/compatibility.js index 503ac8b..88c3d07 100644 --- a/src/compatibility.js +++ b/src/compatibility.js @@ -62,9 +62,6 @@ export function checkDependencies() { if (game.modules.get("enhanced-terrain-layer")?.active) { enabledTerrainModule = game.modules.get("enhanced-terrain-layer").data.title; } - else if (game.modules.get("TerrainLayer")?.active) { - enabledTerrainModule = game.modules.get("TerrainLayer").data.title; - } if (enabledTerrainModule) { new Dialog({ title: game.i18n.localize("drag-ruler.dependencies.terrain-ruler.title"), diff --git a/src/foundry_imports.js b/src/foundry_imports.js index 2ddd30b..59e08f9 100644 --- a/src/foundry_imports.js +++ b/src/foundry_imports.js @@ -168,7 +168,7 @@ export function measure(destination, options={}) { options.ignoreGrid = false; } - options.enableTerrainRuler = isToken && game.modules.get("terrain-ruler")?.active && (!game.modules.get("TerrainLayer")?.active || canvas.grid.type !== CONST.GRID_TYPES.GRIDLESS); + options.enableTerrainRuler = isToken && game.modules.get("terrain-ruler")?.active; const waypoints = this.waypoints.concat([destination]); // Move the waypoints to the center of the grid if a size is used that measures from edge to edge diff --git a/src/movement_tracking.js b/src/movement_tracking.js index 6edc92f..2dd2122 100644 --- a/src/movement_tracking.js +++ b/src/movement_tracking.js @@ -49,7 +49,7 @@ function calculateUpdate(combat, token, rays) { } // Add the passed waypoints to the combatant - const terrainRulerAvailable = game.modules.get("terrain-ruler")?.active && (!game.modules.get("TerrainLayer")?.active || canvas.grid.type !== CONST.GRID_TYPES.GRIDLESS); + const terrainRulerAvailable = game.modules.get("terrain-ruler")?.active; const dragRulerFlags = combatant.data.flags.dragRuler; const waypoints = dragRulerFlags.passedWaypoints; for (const ray of rays) { diff --git a/src/speed_provider.js b/src/speed_provider.js index 20a8d53..78e1e17 100644 --- a/src/speed_provider.js +++ b/src/speed_provider.js @@ -61,11 +61,11 @@ export class SpeedProvider { * The area indicates the whole area that the token will occupy (for tokens larger than 1x1) the array will more than one entry. * The return value should be an integer indicating a multiplicator by that the cost of that step should be increased. * (1 is regular cost, 2 costs double, 3 costs triple, ...) - * + * * Parameters: - * - options: An object used to configure TerrainLayer's cost calculation. Ex: If options.ignoreGrid is set to true, then Euclidean measurement can be forced on a gridded map. - * - * This function is only called if the TerrainLayer and TerrainRuler modules are enabled. + * - options: An object used to configure Enhanced Terrain Layer's cost calculation. Ex: If options.ignoreGrid is set to true, then Euclidean measurement can be forced on a gridded map. + * + * This function is only called if the Enhanced Terrain Layer and Terrain Ruler modules are enabled. * * Implementing this method is optional and only needs to be done if you want to provide a custom cost function (for example to allow tokens to ignore difficult terrain) */