Open caewok opened 2 years ago
Making _onMouseMove
and moveTokens
override is a fair request. Unfortunately, I'm myself currently in a very stuck situation, where I have a huge backlog of changes that awaits releasing, but is currently blocked by a change in Enhanced Terrain Layer that needs to happen first. I'm currently working on resolving that, but the next release of Drag Ruler could be awhile for that reason (I suppose no further releases for v9 will happen and instead the next Drag Ruler release will happen after v10, given my current speed of progress), but I'll definitely look at making this happen.
I am working on better compatibility between modules like Elevation Ruler and Drag Ruler. I am running into a bit of a show-stopper with how
onEntityLeftDragMove
andonEntityDragLeftDrop
work (in main.js).hookDragHandlers
wraps_onDragLeftMove
and_onDragLeftDrop
using libWrapper. That is fine, but thenonEntityLeftDragMove
andonEntityDragLeftDrop
both use thecall
method to override ruler functions (_onMouseMove
andmoveTokens
, respectively). The issue for me is that because thecall
is to an internal DragRuler function, there is basically no way to stop or modify this chain of events.The solution, as I see it, is relatively straightforward. The other functions of this type call a ruler method, which I can then wrap or modify because the
DragRulerRuler
class is available atwindow.Ruler.
But if you could migrateonMouseMove
andmoveEntities
into theDragRulerRuler
class, this problem would go away. This would also be consistent with other libWrapper wrapping functions in main.js, which usually callruler.METHOD
directly. Thus, if we hadDragRulerRuler.prototype.onMouseMove
andDragRulerRuler.prototype.moveEntities
, then the above code becomes:Thanks for considering this! Let me know if you would like me to open a PR to accomplish this.