Access basic blocks in javascript block #390
-
I would like to reuse some computed values (like the proficiency bonus in DnD 5e that is derived from However, many of the basic blocks are still useful and would save a lot of time in creating a statblock like this. Therefore, I'm wondering whether it is possible to somehow programmatically create some of the basic blocks within a javascript block. I am imagining something like: const myStatblock = document.createElement('div');
const spellBlock = fantasystatblocks.spellBlock(property=monster.spells; parseForDices=true);
myStatblock.appendChild(spellBlock);
return myStatblock; Is this possible at all? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This is a pretty good idea. Let me think through the structure of it. In the mean time, you can use computed values throughout the layout by assigning them to the |
Beta Was this translation helpful? Give feedback.
This is a pretty good idea. Let me think through the structure of it.
In the mean time, you can use computed values throughout the layout by assigning them to the
monster
object in the JS callback. Themonster
object is a cloned version of the underlying data, but the same object is used throughout the layout. If your JS block is the first block, anything you set there will be available in all the other blocks.