ShoyuVanilla / FoundryVTT-Chat-Portrait

Other
14 stars 24 forks source link

Portait shows a broken image when using token wildcards, and Better Rolls is enabled #58

Closed cs96and closed 3 years ago

cs96and commented 3 years ago

Environment Details

Issue Description

If you set Chat Portrait to use the token image, and the prototype token is set up to use wildcards, then the portrait shows a broken image. However, this only happens when Better Rolls is also enabled.

image

image

cs96and commented 3 years ago

Also, I just noticed that this only happens when rolling from the sheet (e.g. clicking on a skill check, saving throw, weapon attack etc). If I type a roll manually into the chat box, it works fine.

p4535992 commented 3 years ago

When you say the "token is setup to use wildcards" what did you mean exactly ?

cs96and commented 3 years ago

https://foundryvtt.com/article/tokens/

On the Image tab of prototype token page, you can enter a path that contains a wildcard and check the "Randomize Wildcard Images" box. E.g. if you enter the image path as...

path/to/image*.png

then path/to/image1.png, path/to/image2.png and path/to/image3.png could all be used as token images. When the actor is dragged onto a scene, one of the images is selected at random. You can then also manually select which one you want using a drop down on the Image tab of the individual token config.

The Token HUD Wildcard module is just a convenience module that makes it easier to switch between the different images. I do use that module, but the bug occurs even when that module is disabled.

p4535992 commented 3 years ago

KK didn't know that, i will checkout!

p4535992 commented 3 years ago

Ok it's bug of 'Better Roll' , i don't know why , but that module destroy the info on the hook 'createChatMessage' Here the workflow:

'preCreateChatMessage' // all the information are fine 'createChatMessage' // here mdi qol, Better roll and others modules work with their stuff in this case Better Roll 'renderChatMessage' // here come chat-portrait, but the info i expected are null or undefined

if i disable better roll the info are fine like in the 'preCreateChatMessage' hook.

There is no solution on my side, but i made a little patch on the version 0.4.0 where the token image is fine when you throw some dice, but is a volatile information when you refresh the page you will see all the broken image.

Try to open a issue to the Better Roll module and link this issue.

p4535992 commented 3 years ago

It's seem the last update of Better Roll fix the issue.