anvil-vtt / FateX

FateX is the extended Fate game system for FoundryVTT.
MIT License
22 stars 15 forks source link

Added "stunt to chat" button #110

Closed alxnsk closed 11 months ago

alxnsk commented 1 year ago

Hi, I wanted this feature, and I feel like stunt "short description" field is forgotten, so I have made it.

The user can now click on the button in title of a stunt to send its "title", "short description" and "description" to the chat. stunt button

I had to use an unbind() call in event listeners, because somehow specifically in stunts activateActorSheetListeners binds this click event twice. Couldn't yet trace the source and I am not sure this is even a bug, so this is a "future proof" workaround.

PatrickBauer commented 1 year ago

Thank you very much, I'll check this out and have a look why the unbind was necessary! :)

alxnsk commented 1 year ago

Hi, I have tinkered with this feature a little more. And I did three things: 1) Added same button to "extra", I forgot about it. 2) Changed the class and function names. Now they are not so specific about "stunts" 3) While I was there I explicitly set async:"false" in all .enrichHTML calls if it is not set to "true". In Foundry 10 we got warning and in Foundry 11 default behaivor of this function was reversed, and it returns [object Object] instead of text. This should fix the problem.

PatrickBauer commented 11 months ago

Sorry this took so long. I merged the feature into its own branch where I'll have to replace the inline html with templates and maybe add some CSS, before I release it into the main branch. Thank you very much for this contribution! 👍