Sheetworkers
k.accessSheet
functionThis 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:
void
undefined
Example
//Call from an attribute change
on('change:an_attribute',k.accessSheet);
//Call from an attribute change
on('change:an_attribute',k.accessSheet);
k.addItem
functionFunction to add a repeating section when the add button of a customControlFieldset or inlineFieldset is clicked.
- event -
object
-The R20 event object
k.callFunc
functionFunction 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|null
undefined
Example
//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
functionThe 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
functionSets persistent tabs to their last active state
- attributes -
object
-The attribute values of the character
k.parseKFormula
functionFunction 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
functionFunction 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