Adding custom Roll class to CONFIG.Dice.rolls
Hi guys,
Currently re-implementing an abandoned system to be able to use it in Foundry 11+. I have a custom created Roll class that extends Roll<D> as defined in the foundry-vtt-types module. I got the class to actually roll the way I want but no I'm focussing on the Chat Message it should give out. However for the system to be able to recreate the instance of my roll object from the provisioned data I probably need to configure the
CONFIG.Dice.rolls
to accept my custom class, because if I do not the message holds a rolls variable that holds the following as an array element
This in theory is the correct object, however it is stored as a string, presumably because it can't convert/parse it correctly.
I tried configuring the CONFIG variable to accept my class in the array given to Dice.rolls
This however results in a type issue, basically sying 'undefined' is not assignable to RealRoll
.
This is the type I'm using to type my custom class.
1 Reply
I'm also passing a constructor to call the super function with my type
The actual error I get is
Maybe some of you instantly see my issue and can be help with this problem. Any help that leads me into the right direction is greatly appreciated.