A scene can have multiple combat encounters, but only one can be active at a time. Changing from one to the other does not trigger any of the regular combat hooks, but it can be detected using a combat /document/ hook. Register on the combat document update hook and update the borders when the active state of the encounter is changed. Both the previous and new active combats produce an update, and the previous combat becoming inactive always comes first. This means that we can safely set all token borders from the previous document to the default border and they will be updated accordingly by the new combat becoming active. Update the comment of the data member for `combat_hook_update_token_borders()`, as we re-use it for the combat switch and we didn't use the `turn` member anymore. |
||
---|---|---|
.. | ||
mills_fabula.mjs | ||
token_combat_border.mjs | ||
token_ui_adjust.mjs |