With #141 support for a token argument was added to addLootToSelectedToken ().
This allows macros or other modules to give a single token or an array of tokens to the method to be used.
As a fallback the there still is a check for currently controlled tokens.
The options argument currently has no effect on the method.
Example
Where token is either a token or an array of tokens (like canvas.tokens.controlled).
const name = 'myLootRolltable',
rolltable = game.tables.getName(name);
game.betterTables.addLootToSelectedToken(rolltable, token);
Options argument
With #142
Developers can now use an optional options argument on several methods.
options
is expected to be a simple object like{key: value}
.As of version 1.8.4 the only option checked for is the rollMode option.
rollMode
optionblindroll
gmroll
selfroll
Example:
Populate loot to a token via API
With #141 support for a token argument was added to
addLootToSelectedToken ()
. This allows macros or other modules to give a single token or an array of tokens to the method to be used.As a fallback the there still is a check for currently controlled tokens.
The
options
argument currently has no effect on the method.Example
Where
token
is either a token or an array of tokens (likecanvas.tokens.controlled
).