PDA

View Full Version : Token.onDrop not been called.



bratch9
August 31st, 2021, 12:49
Token.onDrop not been called when you drop something onto a token 0n an image map. ( Used in coreRPG manager_token.lua )

I was dropping assets tokens on to try and trigger it. As I wanted to map my spell token extension dropping a spell token on a player on the map to add an aura effect link. I ended up doing this work in the image.onDrop call back and checking the image tokens list and position matching to resolve this.

But the Token.onDrop callback probably should have fired.

Moon Wizard
August 31st, 2021, 22:07
I just added a debug statement and dropped a die on a token. It appears to work for me, in general.

The issue is that "image" assets are special cases that are handled by the default imagecontrol logic, before tokens are checked. (same with "token", "portrait", "image", and "shortcut")

I'll have to see if that can be flipped around, and what kind of repercussions there might be. Hopefully, it's straightforward.

Regards,
JPG

bratch9
September 1st, 2021, 10:09
I just added a debug statement and dropped a die on a token. It appears to work for me, in general.

The issue is that "image" assets are special cases that are handled by the default imagecontrol logic, before tokens are checked. (same with "token", "portrait", "image", and "shortcut")

I'll have to see if that can be flipped around, and what kind of repercussions there might be. Hopefully, it's straightforward.

Regards,
JPG

Thanks for the information, if its not straightforward then no issue as I have a workaround in the image.onDrop side.