PDA

View Full Version : Developer Guide Missing Documentation for dragdata getDiceData()



Minty23185Fresh
July 18th, 2022, 02:46
I tripped over the dragdata function call getDiceData() in manager_actions.lua of the CoreRPG ruleset at ~line 368 of the current release, 2022-07.

getDiceData() is not documented in either the original refdoc documents (https://www.fantasygrounds.com/refdoc/dragdata.xcp) nor in Developer Guide (https://fantasygroundsunity.atlassian.net/wiki/spaces/FGCP/pages/996644741/dragdata) for Unity on atlassian.net



function decodeRollFromDrag(draginfo, i, bFinal)
draginfo.setSlot(i);
.
.
vRoll.nMod = draginfo.getNumberData();

vRoll.aDice = draginfo.getDiceData() or {};
vRoll.nTotal = vRoll.aDice.total;
.
.
.
return vRoll;
end

Moon Wizard
July 18th, 2022, 06:45
They were renamed from getDieList/setDieList to getDiceData/setDiceData; in order to be consistent with the other API functions as well as to indicate that there is more data than just the die list now.

I'll update the docs to the new names.

Regards,
JPG

Minty23185Fresh
July 18th, 2022, 13:51
Thank you Moon Wizard.

Just a heads up, getDieList() and setDieList() are still being used elsewhere in CoreRPG and 5E rulesets. In case that matters. I didn't check the other rulesets.

(The reason I checked is, I needed to see if I had to support all four function calls in my instantiable dragdata object (https://www.fantasygrounds.com/forums/showthread.php?48594-On-Demand-(pseudo)-dragdata-Object&p=430958#post430958).)