Compare commits

..

5 Commits

Author SHA1 Message Date
Manuel Vögele 9042b79967 Release v1.7.4 2021-06-18 13:58:54 +02:00
Manuel Vögele 4159d20e18 Verified to work with Foundry 0.8.7 2021-06-18 13:39:10 +02:00
Manuel Vögele 3897577756 Allow the "Monk's Active Tile Triggers" module to interrupt a token movement early 2021-06-18 13:37:26 +02:00
irbian 5c29f401d6 Support D&D 3.5 (#76) 2021-05-27 01:09:12 +02:00
Manuel Vögele 1328d52f94 Send the info whether the dragged entity is a token or a template to the other players (fixes a snapping issue in other players clients) 2021-05-26 16:17:23 +02:00
5 changed files with 33 additions and 6 deletions
+9
View File
@@ -1,3 +1,12 @@
## 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
View File
@@ -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.4",
"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.4.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",
+10
View File
@@ -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
View File
@@ -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);
} }
+3 -1
View File
@@ -8,7 +8,8 @@ export function getDefaultSpeedAttribute() {
case "lancer": case "lancer":
return "actor.data.data.mech.speed" return "actor.data.data.mech.speed"
case "pf1": case "pf1":
return "actor.data.data.attributes.speed.land.total" case "D35E":
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";
case "shadowrun5e": case "shadowrun5e":
@@ -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