manuelVo / foundryvtt-drag-ruler

A Foundry VTT module that shows a ruler when dragging tokens so you can see how far you've dragged them
MIT License
39 stars 52 forks source link

dragRulerStart() broken under v11.297 #270

Closed n0q closed 1 year ago

n0q commented 1 year ago

OS: Linux Systems Tested: D&D5e, Hackmaster, Wicked Ones Foundry Version: 11.297 (Testing 2)

Drag-Ruler no longer functions. It's the same error messages on every system. There's no measurement and the token does not move.

Steps to Reproduce:

  1. Drag token.

image

n0q commented 1 year ago

Appears broken under v11 stable, as well. Seems like the issue is the jump from pixi v4 to v7 retiring some of the calls you were using.

MiniGrief commented 1 year ago

Appears broken under v11 stable, as well. Seems like the issue is the jump from pixi v4 to v7 retiring some of the calls you were using.

Quick fix to stop errors is changing mouse to pointer on line 486 of ruler.js. However, the ruler text doesn't work so there's more to it. Don't know enough about the module to debug it without it spitting out obvious errors.

Edit: Better to change that entire line to this below to remove the deprecation warning from PixiJS const mousePosition = canvas.app.renderer.events.pointer.getLocalPosition(

Edit 2: Got the ruler text working by just bypassing the if statement in _computeDistance to ensure it always enters the else part of it. This likely will break stuff but it worked for me.

Tookie03 commented 1 year ago

Appears broken under v11 stable, as well. Seems like the issue is the jump from pixi v4 to v7 retiring some of the calls you were using.

Quick fix to stop errors is changing mouse to pointer on line 486 of ruler.js. However, the ruler text doesn't work so there's more to it. Don't know enough about the module to debug it without it spitting out obvious errors.

Edit: Better to change that entire line to this below to remove the deprecation warning from PixiJS const mousePosition = canvas.app.renderer.events.pointer.getLocalPosition(

Edit 2: Got the ruler text working by just bypassing the if statement in _computeDistance to ensure it always enters the else part of it. This likely will break stuff but it worked for me.

Thanks to @MiniGrief 's instructions I made a version that seems to work fine without any issue besides it not having terrain compatibility for the meantime till an official/better release is released

https://github.com/TookieKun/foundryvtt-drag-ruler-partial-v11-compability/tree/develop

manuelVo commented 1 year ago

A v11 compatible version has just been released.