tidy5e-sheet
tidy5e-sheet copied to clipboard
suggestion: integration with DFreds Convenient Effects
Similarly to what is done for CUB, maybe the module could use the Exhaustion active effects defined by DFreds Convenient Effects module, if present.
This has the code required to add/remove an effect: https://github.com/DFreds/dfreds-convenient-effects/blob/main/scripts/effect-interface.js
It lives on game.dfreds.effectInterface
. If helpful, I could add a hasEffect
method to the effect-interface.
Could add code that checks whether CUB or CE is in effect (hopefully not both) and if CE is there then use it's interface else if CUB is there use it's interface.
Another option to do this is to use the generic status effects on the tokens instead of a specific CUB or CE integration. This would also add compatibility for other modules that just change the status effects that are available in the token HUD without adding any active effects. Monk's Little Details can do that, but I'm not sure it adds separate ones for the different exhaustion levels. Anyways, this would add "Exhaustion 1" to a token:
const effect = CONFIG.statusEffects.filter(e => e.name === "Exhaustion 1")[0];
token.toggleEffect(effect, { active: true });
I tested it with CE and it puts the icon on the token and the active effect on the character sheet. It should work fine for CUB if it adds an active effect on top of just the icon. The catch is we'd have to add an updateToken
hook to detect if a simple status effect was added without any active effects tied to it, but it should be an easy one. Not too different than the existing createActiveEffect
and deleteActiveEffect
hooks.