Foundry-Workshop / Item-Macro

Store macros in your items, execute them from your character sheet or from your favorite automation module!
MIT License
1 stars 4 forks source link

Tidy 5e rewrite integration charsheet hook is stacking #6

Closed kgar closed 10 months ago

kgar commented 10 months ago

The Tidy 5e sheet rewrite integration call was placed in getSheetHooks(), which is called

The Tidy integration is designed to be called only once. Because it is being wired every time the sheet renders, the character sheet hook feature is stacking and causing the macro to execute multiple times in a single click.

image

image

image

image

Essentially, it is calling a "Hook within a Hook" right now, which is why it is stacking the event handler additively. If possible, the Tidy integration code needs to be moved somewhere where it is only called one time, such as during systemHandler().

Also, the Tidy integration is already checking the "charsheet" and "click" settings, so it does not require the extra check:

image

image