Would a Dialog Window be enough for this functionality?
In this system I'm trying to implement on foundry you roll a pool of dice and keep 2, pretty simple. The problem is that you won't simply pick the 2 highest, you are allowed to choose which dice to keep since the discarded dice interact with the system by generating special effects.
I thought of showing a dialog window with each individual dice were you'd mark a checkbox for the chosen dice, and then print it on chat, but I don't know if it's possible to handle data that way inside a dialog.
3 Replies
You can do something like that with a Dialog, if you want it to re-render then it'd be more pain than it's worth, but if you only need it to render once then accept the data from the user, it's relatively straightforward.
The Cortex Prime system does this as one of its primary rolling mechanics I'd take a look at what they're doing
If i may tackle this feature here is how i will handle it.
1. Make a dialog that get in input data the roll
2. Foreach roll result dice show the dice result in an image with a
<a>
on it so i can click the dice
3. When i click on the <a>
i will change a data-keep
attribute and maybe add or remove a keep
class
4. When i click on the validate button of the dialog i just get with jquery html tool all the dices that got the data-keep
to true and send them in a chat message in an array