Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0456fb0849 | |||
| 01d01f9887 | |||
| 9042b79967 | |||
| 4159d20e18 | |||
| 3897577756 | |||
| 5c29f401d6 | |||
| 1328d52f94 |
@@ -1,3 +1,17 @@
|
|||||||
|
## 1.7.5
|
||||||
|
### Bugfixes
|
||||||
|
- Decimal speeds (as often used in metric game systems) are no longer being rounded down (thanks to DarKDinDoN for diagnosing this bug)
|
||||||
|
|
||||||
|
|
||||||
|
## 1.7.4
|
||||||
|
### Bugfixes
|
||||||
|
- Fixed a bug where the ruler would wrongly snap to the grid center for other players when dragging a measurement template
|
||||||
|
|
||||||
|
### Compatibility
|
||||||
|
- Drag Ruler is now compatiblie with the "Monk's Active Tile Triggers" module
|
||||||
|
- Drag Ruler's Generic Speed Provider is now aware of good default values for the D&D 3.5 game system
|
||||||
|
- Drag Ruler is now compatible with Foundry 0.8.7
|
||||||
|
|
||||||
## 1.7.3
|
## 1.7.3
|
||||||
### Compatibility
|
### Compatibility
|
||||||
- Drag Ruler is now compatible with Foundry 0.8.5
|
- Drag Ruler is now compatible with Foundry 0.8.5
|
||||||
|
|||||||
+3
-3
@@ -2,9 +2,9 @@
|
|||||||
"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.7.3",
|
"version": "1.7.5",
|
||||||
"minimumCoreVersion" : "0.8.5",
|
"minimumCoreVersion" : "0.8.5",
|
||||||
"compatibleCoreVersion" : "0.8.5",
|
"compatibleCoreVersion" : "0.8.7",
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "Manuel Vögele",
|
"name": "Manuel Vögele",
|
||||||
@@ -49,7 +49,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.7.3.zip",
|
"download": "https://github.com/manuelVo/foundryvtt-drag-ruler/archive/v1.7.5.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",
|
||||||
|
|||||||
@@ -72,6 +72,10 @@ async function animateEntities(entities, draggedEntity, draggedRays, wasPaused)
|
|||||||
const isToken = draggedEntity instanceof Token;
|
const isToken = draggedEntity instanceof Token;
|
||||||
const animate = isToken && !game.keyboard.isDown("Alt");
|
const animate = isToken && !game.keyboard.isDown("Alt");
|
||||||
const startWaypoint = animate ? 0 : entityAnimationData[0].rays.length - 1;
|
const startWaypoint = animate ? 0 : entityAnimationData[0].rays.length - 1;
|
||||||
|
|
||||||
|
// This is a flag of the "Monk's Active Tile Triggers" module that signals that the movement should be cancelled early
|
||||||
|
this.cancelMovement = false;
|
||||||
|
|
||||||
for (let i = startWaypoint;i < entityAnimationData[0].rays.length; i++) {
|
for (let i = startWaypoint;i < entityAnimationData[0].rays.length; i++) {
|
||||||
if (!wasPaused && game.paused) break;
|
if (!wasPaused && game.paused) break;
|
||||||
const entityPaths = entityAnimationData.map(({entity, rays, dx, dy}) => {
|
const entityPaths = entityAnimationData.map(({entity, rays, dx, dy}) => {
|
||||||
@@ -86,6 +90,12 @@ async function animateEntities(entities, draggedEntity, draggedRays, wasPaused)
|
|||||||
await draggedEntity.scene.updateEmbeddedDocuments(draggedEntity.constructor.embeddedName, updates, {animate});
|
await draggedEntity.scene.updateEmbeddedDocuments(draggedEntity.constructor.embeddedName, updates, {animate});
|
||||||
if (animate)
|
if (animate)
|
||||||
await Promise.all(entityPaths.map(({entity, path}) => entity.animateMovement(path)));
|
await Promise.all(entityPaths.map(({entity, path}) => entity.animateMovement(path)));
|
||||||
|
|
||||||
|
// This is a flag of the "Monk's Active Tile Triggers" module that signals that the movement should be cancelled early
|
||||||
|
if (this.cancelMovement) {
|
||||||
|
entityAnimationData.forEach(ead => ead.rays = ead.rays.slice(0, i + 1));
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (isToken)
|
if (isToken)
|
||||||
trackRays(entities, entityAnimationData.map(({rays}) => rays)).then(() => recalculate(entities));
|
trackRays(entities, entityAnimationData.map(({rays}) => rays)).then(() => recalculate(entities));
|
||||||
|
|||||||
+8
-2
@@ -33,8 +33,11 @@ export class DragRulerRuler extends Ruler {
|
|||||||
|
|
||||||
toJSON() {
|
toJSON() {
|
||||||
const json = super.toJSON();
|
const json = super.toJSON();
|
||||||
if (this.draggedEntity)
|
if (this.draggedEntity) {
|
||||||
|
const isToken = this.draggedEntity instanceof Token;
|
||||||
|
json["draggedEntityIsToken"] = isToken;
|
||||||
json["draggedEntity"] = this.draggedEntity.id;
|
json["draggedEntity"] = this.draggedEntity.id;
|
||||||
|
}
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -44,7 +47,10 @@ export class DragRulerRuler extends Ruler {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (data.draggedEntity) {
|
if (data.draggedEntity) {
|
||||||
this.draggedEntity = canvas.tokens.get(data.draggedEntity);
|
if (data.draggedEntityIsToken)
|
||||||
|
this.draggedEntity = canvas.tokens.get(data.draggedEntity);
|
||||||
|
else
|
||||||
|
this.draggedEntity = canvas.templates.get(data.draggedEntity);
|
||||||
}
|
}
|
||||||
super.update(data);
|
super.update(data);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ export class GenericSpeedProvider extends SpeedProvider {
|
|||||||
const speedAttribute = this.getSetting("speedAttribute")
|
const speedAttribute = this.getSetting("speedAttribute")
|
||||||
if (!speedAttribute)
|
if (!speedAttribute)
|
||||||
return []
|
return []
|
||||||
const tokenSpeed = parseInt(getProperty(token, speedAttribute));
|
const tokenSpeed = parseFloat(getProperty(token, speedAttribute));
|
||||||
if (tokenSpeed === undefined) {
|
if (tokenSpeed === undefined) {
|
||||||
console.warn(`Drag Ruler (Generic Speed Provider) | The configured token speed attribute "${speedAttribute}" didn't return a speed value. To use colors based on drag distance set the setting to the correct value (or clear the box to disable this feature).`)
|
console.warn(`Drag Ruler (Generic Speed Provider) | The configured token speed attribute "${speedAttribute}" didn't return a speed value. To use colors based on drag distance set the setting to the correct value (or clear the box to disable this feature).`)
|
||||||
return []
|
return []
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ export function getDefaultSpeedAttribute() {
|
|||||||
case "lancer":
|
case "lancer":
|
||||||
return "actor.data.data.mech.speed"
|
return "actor.data.data.mech.speed"
|
||||||
case "pf1":
|
case "pf1":
|
||||||
|
case "D35E":
|
||||||
return "actor.data.data.attributes.speed.land.total"
|
return "actor.data.data.attributes.speed.land.total"
|
||||||
case "sfrpg":
|
case "sfrpg":
|
||||||
return "actor.data.data.attributes.speed.value";
|
return "actor.data.data.attributes.speed.value";
|
||||||
@@ -27,6 +28,7 @@ export function getDefaultDashMultiplier() {
|
|||||||
case "dnd5e":
|
case "dnd5e":
|
||||||
case "lancer":
|
case "lancer":
|
||||||
case "pf1":
|
case "pf1":
|
||||||
|
case "D35E":
|
||||||
case "sfrpg":
|
case "sfrpg":
|
||||||
case "shadowrun5e":
|
case "shadowrun5e":
|
||||||
return 2
|
return 2
|
||||||
|
|||||||
Reference in New Issue
Block a user