Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8d67ca01c3 | |||
| 80ff8832fd | |||
| c787b18fcb | |||
| c03dbc09ff | |||
| 27a2b46a8a | |||
| 94a8e6f147 | |||
| ab1f5b4c9b | |||
| 1974e6e4a3 |
@@ -1,3 +1,14 @@
|
||||
## 1.14.2
|
||||
### Bug fixes
|
||||
- Fixed a bug where tokens would snap to inconsistent distances on gridless scenes
|
||||
- Fixed a bug that caused the highlighted path on hex grids to be incorrect
|
||||
|
||||
|
||||
## 1.14.1
|
||||
### Bug fixes
|
||||
- The functionality Drag Ruler on gridless has been restored
|
||||
|
||||
|
||||
## 1.14.0
|
||||
### New features
|
||||
- Drag Ruler now supports hex tokens of size 5 (thanks KitCat!)
|
||||
|
||||
@@ -1,13 +1,17 @@
|
||||
[](https://ko-fi.com/staebchenfisch)
|
||||
|
||||
## Beware of bugs in v12 and onward
|
||||
Foundry v12 has introduced significant changes to how the grid and the ruler are implemented. While Drag Ruler has now been updated to generally work with v12, quite a lot of bugs remain. This is espeically true for Hex grids, but some bugs affect all the grid types. Some of the issues require a large code rewrite to address them properly. Unfortunately this means that Drag Ruler will not provide the same quality experience (snappyness, bugfreeness) you're used to in v12 (and possibly onward). If you're planning to update to v12 and depend on Drag Ruler, proceed with caution.
|
||||
|
||||
|
||||
# Drag Ruler
|
||||
|
||||
This module shows a ruler when you drag a token or measurement template to inform you how far you've dragged it from its start point. Additionally, if you're using a grid, the spaces the token will travel though will be colored depending on your tokens speed. By default, three colors are being used: green for spaces that your token can reach by walking normally are colored green, spaces that can only be reached by dashing will be colored yellow and spaces that cannot be reached with the token's speed will be colored red. If you're using a gridless map the ruler color will change to convey this information.
|
||||
|
||||

|
||||

|
||||

|
||||
|
||||
|
||||
## Supports Tokens of all sizes
|
||||
Terrain ruler has excellent support for tokens of all sizes. The Ruler will always originate from the token's center and will always highlight all the squares that tokens move over.
|
||||
|
||||
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
"id": "drag-ruler",
|
||||
"title": "Drag Ruler",
|
||||
"description": "When dragging a token displays a ruler showing how far you've moved that token.",
|
||||
"version": "1.14.0",
|
||||
"version": "1.14.2",
|
||||
"compatibility": {
|
||||
"minimum": "12",
|
||||
"verified": "12",
|
||||
@@ -81,7 +81,7 @@
|
||||
},
|
||||
"socket": true,
|
||||
"url": "https://github.com/manuelVo/foundryvtt-drag-ruler",
|
||||
"download": "https://github.com/manuelVo/foundryvtt-drag-ruler/archive/v1.14.0.zip",
|
||||
"download": "https://github.com/manuelVo/foundryvtt-drag-ruler/archive/v1.14.2.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",
|
||||
|
||||
@@ -195,7 +195,7 @@ export function highlightMeasurementNative(
|
||||
const pathUntilSpace = previousSegments.concat([{ray: new Ray(ray.A, center)}]);
|
||||
const distance = sum(canvas.grid.measureDistances(pathUntilSpace, {gridSpaces: true}));
|
||||
const color = this.dragRulerGetColorForDistance(distance);
|
||||
const snapPoint = getSnapPointForToken(point.x, point.y, this.draggedEntity);
|
||||
const snapPoint = getSnapPointForToken(point.x + 1, point.y + 1, this.draggedEntity);
|
||||
const [snapX, snapY] = getGridPositionFromPixels(snapPoint.x + 1, snapPoint.y + 1);
|
||||
highlightTokenShape.call(this, {x: snapX, y: snapY}, tokenShape, color, alpha);
|
||||
}
|
||||
|
||||
+3
-3
@@ -145,7 +145,7 @@ function onEntityLeftDragStart(wrapped, event) {
|
||||
}
|
||||
|
||||
function onEntityLeftDragMoveSnap(wrapped, event) {
|
||||
applyGridlessSnapping.call(this, event);
|
||||
applyGridlessSnapping.call(canvas.controls.ruler, event);
|
||||
onEntityLeftDragMove.call(this, wrapped, event);
|
||||
}
|
||||
|
||||
@@ -243,7 +243,7 @@ function applyGridlessSnapping(event) {
|
||||
}
|
||||
} else {
|
||||
let waypointDistance = 0;
|
||||
let origin = event.interactionData.origin;
|
||||
let origin = this.draggedEntity.getCenterPoint();
|
||||
if (ruler.waypoints.length > 1) {
|
||||
const segments = ruler.constructor
|
||||
.dragRulerGetRaysFromWaypoints(ruler.waypoints, destination)
|
||||
@@ -251,7 +251,7 @@ function applyGridlessSnapping(event) {
|
||||
return {ray};
|
||||
});
|
||||
origin = segments.pop().ray.A;
|
||||
waypointDistance = canvas.grid.measurePath(segments).reduce((a, b) => a + b);
|
||||
waypointDistance = canvas.grid.measureDistances(segments).reduce((a, b) => a + b);
|
||||
origin = {x: origin.x, y: origin.y};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user