130 lines
5.7 KiB
JSON
130 lines
5.7 KiB
JSON
{
|
|
"name": "API Documentation",
|
|
"pages": [
|
|
{
|
|
"sort": 100000,
|
|
"name": "Accessing the API",
|
|
"type": "text",
|
|
"_id": "Q4WPDTxUW6te0td1",
|
|
"title": {
|
|
"show": true,
|
|
"level": 1
|
|
},
|
|
"image": {},
|
|
"text": {
|
|
"format": 1,
|
|
"content": "<p>The swade-mb-helpers API can be accessed in a macro with the following line of code:</p><p></p><pre><code>const api = game.modules.get('swade-mb-helpers').api</code></pre><p></p><p>The name 'api' will be used for all examples but the variable name within your macro doesn't matter.</p>"
|
|
},
|
|
"video": {
|
|
"controls": true,
|
|
"volume": 0.5
|
|
},
|
|
"src": null,
|
|
"system": {},
|
|
"ownership": {
|
|
"default": -1,
|
|
"R9ZgY0IvWl8ovIuT": 3
|
|
},
|
|
"flags": {},
|
|
"_stats": {
|
|
"systemId": "swade",
|
|
"systemVersion": "3.2.2",
|
|
"coreVersion": "11.315",
|
|
"createdTime": 1700438788646,
|
|
"modifiedTime": 1700438788646,
|
|
"lastModifiedBy": "R9ZgY0IvWl8ovIuT"
|
|
},
|
|
"_key": "!journal.pages!Q4iS1LIiyy7acuaF.Q4WPDTxUW6te0td1"
|
|
},
|
|
{
|
|
"sort": 200000,
|
|
"name": "api.powerEffects",
|
|
"type": "text",
|
|
"_id": "X0rGr7qO1SRHwy9q",
|
|
"title": {
|
|
"show": true,
|
|
"level": 1
|
|
},
|
|
"image": {},
|
|
"text": {
|
|
"format": 1,
|
|
"content": "<pre><code>async function powerEffects (options = {})</code></pre><p></p><p>powerEffects is the dispatcher behind all of the power effects in swade-mb-helpers. It will parse the options to handle power dialogs and effects for every currently handled power effect within this module.</p><p></p><h2>Parameters</h2><p>The only parameter is the options parameter detailed below</p><h2><br />Options</h2><p>the options object has the following fields:</p><ul><li><p>token: a single token, the token that is initiating the power</p></li><li><p>targets: if appropriate to the power, a list of zero or more targets of the power</p></li><li><p>item: (optional) especially handy when used as an item macro effect, this is the item (power object) representing the power to find and handle</p></li><li><p>name: (optional) the name of the power to find and handle.</p></li></ul><p>One of 'item' or 'name' must be set.</p><p></p><h2>Returns</h2><p>There is no return value for this function.</p>"
|
|
},
|
|
"video": {
|
|
"controls": true,
|
|
"volume": 0.5
|
|
},
|
|
"src": null,
|
|
"system": {},
|
|
"ownership": {
|
|
"default": -1,
|
|
"R9ZgY0IvWl8ovIuT": 3
|
|
},
|
|
"flags": {},
|
|
"_stats": {
|
|
"systemId": "swade",
|
|
"systemVersion": "3.2.2",
|
|
"coreVersion": "11.315",
|
|
"createdTime": 1700439000261,
|
|
"modifiedTime": 1700439000261,
|
|
"lastModifiedBy": "R9ZgY0IvWl8ovIuT"
|
|
},
|
|
"_key": "!journal.pages!Q4iS1LIiyy7acuaF.X0rGr7qO1SRHwy9q"
|
|
},
|
|
{
|
|
"sort": 300000,
|
|
"name": "api.requestRollFromTokens",
|
|
"type": "text",
|
|
"_id": "zvPWCYx402kk2hsE",
|
|
"title": {
|
|
"show": true,
|
|
"level": 1
|
|
},
|
|
"image": {},
|
|
"text": {
|
|
"format": 1,
|
|
"content": "<pre><code>async function requestRollFromTokens (tokens, rollType, rollDesc, options = {})</code></pre><p></p><p>This will request a roll from the tokens given using socketlib to request the roll from the currently logged on owner of the token.</p><p></p><h2>Parameters</h2><ul><li><p>tokens: The list of tokens to request from</p></li><li><p>rollType: one of the strings 'attribute' or 'skill'</p></li><li><p>rollDesc: the name of the trait being requested</p></li><li><p>options: detailed below</p></li></ul><p></p><h2>Options</h2><p>The options object can be completely empty, but can have any or all of the following optional fields:</p><ul><li><p>title: The title for the roll dialog, if the default is not required. For the aid of those rolling for multiple tokens, the token's name will be appended to the title</p></li><li><p>flavour: flavour text for the roll chat card. If unspecified, the title text will be used</p></li><li><p>mods: a list of roll modifiers represented as objects of the following fields:</p><ul><li><p>label: Label for the modifier</p></li><li><p>value: a positive or negative number, the value of the roll modifier</p></li><li><p>ignore: an optional boolean which, if true, means that the modifier's ignore checkbox will be checked by default</p></li></ul></li><li><p>modCallback: a function that takes a token as parameter, and returns an array of modifiers as listed above. This will be run for each token and the individual token's mod list will have the resulting list of modifiers appended to the list from 'mods' above.</p></li></ul><h2>Returns</h2><p>The return value is a list of promises which, if fulfilled, are the resulting roll objects from the token's rolls.</p>"
|
|
},
|
|
"video": {
|
|
"controls": true,
|
|
"volume": 0.5
|
|
},
|
|
"src": null,
|
|
"system": {},
|
|
"ownership": {
|
|
"default": -1,
|
|
"R9ZgY0IvWl8ovIuT": 3
|
|
},
|
|
"flags": {},
|
|
"_stats": {
|
|
"systemId": "swade",
|
|
"systemVersion": "3.2.2",
|
|
"coreVersion": "11.315",
|
|
"createdTime": 1700439709611,
|
|
"modifiedTime": 1700440442904,
|
|
"lastModifiedBy": "R9ZgY0IvWl8ovIuT"
|
|
},
|
|
"_key": "!journal.pages!Q4iS1LIiyy7acuaF.zvPWCYx402kk2hsE"
|
|
}
|
|
],
|
|
"folder": null,
|
|
"ownership": {
|
|
"default": 0,
|
|
"R9ZgY0IvWl8ovIuT": 3
|
|
},
|
|
"flags": {
|
|
"core": {}
|
|
},
|
|
"_stats": {
|
|
"systemId": "swade",
|
|
"systemVersion": "3.2.2",
|
|
"coreVersion": "11.315",
|
|
"createdTime": 1700438778794,
|
|
"modifiedTime": 1700440473945,
|
|
"lastModifiedBy": "R9ZgY0IvWl8ovIuT"
|
|
},
|
|
"_id": "Q4iS1LIiyy7acuaF",
|
|
"sort": 100000,
|
|
"_key": "!journal!Q4iS1LIiyy7acuaF"
|
|
}
|