Skip to content

Sheetworkers

undefined

k.accessSheet

function

This is the default listener function for attributes that the K-Scaffold uses. It utilizes the triggerFuncs, listenerFunc, calculation, and affects properties of the K-scaffold trigger object (see the Pug section of the scaffold for more details).

  • event - Roll20Event -

    The Roll20 event object

  • Returns: voidundefined

Example

js
//Call from an attribute change
on('change:an_attribute',k.accessSheet);
//Call from an attribute change
on('change:an_attribute',k.accessSheet);

k.addItem

function

Function to add a repeating section when the add button of a customControlFieldset or inlineFieldset is clicked.

  • event - object -

    The R20 event object

k.callFunc

function

Function to call a function previously registered to the funcs object. May not be used that much in actual sheets, but very useful when writing unit tests for your sheet. Either returns the function or null if no function exists.

  • funcName - string -

    The name of the function to invoke.

  • args - any -

    The arguments to call the function with.

  • Returns: function|nullundefined

Example

js
//Call myFunc with two arguments
k.callFunc('myFunc','an argument','another argument');
//Call myFunc with two arguments
k.callFunc('myFunc','an argument','another argument');

k.kSwitchTab

function

The default tab navigation function of the K-scaffold. Courtesy of Riernar. It will add k-active-tab to the active tab-container and k-active-button to the active button. You can either write your own CSS to control display of these, or use the default CSS included in scaffold/_k.scss. Note that k-active-button has no default CSS as it is assumed that you will want to style the active button to match your system.

  • trigger - Object -

    The trigger object

  • attributes - object -

    The attribute values of the character

k.kTabOnOpen

function

Sets persistent tabs to their last active state

  • attributes - object -

    The attribute values of the character

k.parseKFormula

function

Function that reduces Roll20 macro syntax formulas down to their calculated value.

  • attributes - object -

    The attribute values of the character

  • sections - Array.<object> -

    All the repeating section IDs

k.setActionCalls

function

Function that sets up the action calls used in the roller mixin.

  • attributes - object -

    The attribute values of the character

  • sections - Array.<object> -

    All the repeating section IDs

Released under the MIT License