## Modules
AboutApp module
Request a roll or display concentration checks when damage is taken.
Form application for managing mapping of Conditions to Icons and JournalEntries
Enhanced Condition Macro Config Application
Enhanced Condition Trigger Config Application
Builds a mapping between status icons and journal entries that represent conditions
Pan/Select Gadget
Rerolls initiative for all combatants
Provides helper methods for use elsewhere in the module (and has your back in a melee)
Initiates module classes (and shines a light on the dark night sky)
Handles triggers for other gadgets in the module... or does it?!
From Valentin "Moerill" Henkys the code is licensed under LGPL v3. Original is implemented in his module "Mess": https://github.com/Moerill/Mess LICENSE: https://github.com/Moerill/Mess/blob/master/LICENSE
Stores information about well known game systems. All other systems will resolve to "other"
Create the sidebar button
Get data for template rendering
Override default update object behaviour
FormApplication
* _instance_
* [.getData()](#module_about..AboutApp+getData)
* [.fetchPatrons()](#module_about..AboutApp+fetchPatrons)
* _static_
* [.defaultOptions](#module_about..AboutApp.defaultOptions)
### about~AboutApp ⇐ FormApplication
About this module FormApp
**Kind**: inner class of [about
](#module_about)
**Extends**: FormApplication
* [~AboutApp](#module_about..AboutApp) ⇐ FormApplication
* _instance_
* [.getData()](#module_about..AboutApp+getData)
* [.fetchPatrons()](#module_about..AboutApp+fetchPatrons)
* _static_
* [.defaultOptions](#module_about..AboutApp.defaultOptions)
#### aboutApp.getData()
Supplies data to the template
**Kind**: instance method of [AboutApp
](#module_about..AboutApp)
#### aboutApp.fetchPatrons()
Fetches a list of Patrons to display on the About page
**Kind**: instance method of [AboutApp
](#module_about..AboutApp)
#### AboutApp.defaultOptions
Call app default options
**Kind**: static property of [AboutApp
](#module_about..AboutApp)
## Concentrator
Request a roll or display concentration checks when damage is taken.
**Kind**: global class
**Author**: JacobMcAuley
**Author**: Evan Clarke
**Todo**
- [ ] Supply DC
* [Concentrator](#Concentrator)
* [._onRenderChatMessage(app, html, data)](#Concentrator._onRenderChatMessage)
* [._onPreUpdateActor(actor, update, options, userId)](#Concentrator._onPreUpdateActor)
* [._onUpdateActor(actor, update, options)](#Concentrator._onUpdateActor)
* [._onPreUpdateToken(scene, tokenData, update, options)](#Concentrator._onPreUpdateToken)
* [._onUpdateToken(scene, token, update, options, userId)](#Concentrator._onUpdateToken)
* [._onDeleteActiveEffect(effect, options, userId)](#Concentrator._onDeleteActiveEffect)
* [._onSocket(message)](#Concentrator._onSocket)
* [._processDamage(entity, options)](#Concentrator._processDamage) ⇒ [\_processDeath
](#Concentrator._processDeath) \| [\_determinePromptedUsers
](#Concentrator._determinePromptedUsers)
* [._processDeath(entity)](#Concentrator._processDeath)
* [._determinePromptedUsers(options)](#Concentrator._determinePromptedUsers)
* [._distributePrompts(actorId, users)](#Concentrator._distributePrompts)
* [._displayPrompt(actorId, userId)](#Concentrator._displayPrompt)
* [._processConcentrationCheck(event, actor, dc)](#Concentrator._processConcentrationCheck)
* [._cancelPrompt(userId)](#Concentrator._cancelPrompt)
* [._displayChat(entity, damage)](#Concentrator._displayChat)
* [._startConcentration(entity, spell, conditionName, options)](#Concentrator._startConcentration) ⇒ Actor.setFlag
* [._endConcentration(entity, options)](#Concentrator._endConcentration) ⇒ Actor.unsetFlag
* [._promptEnableEnhancedConditions()](#Concentrator._promptEnableEnhancedConditions)
* [._createCondition()](#Concentrator._createCondition)
* [._wasDamageTaken(newHealth, oldHealth)](#Concentrator._wasDamageTaken) ⇒ Boolean
* [._isConcentrating(token)](#Concentrator._isConcentrating) ⇒ Boolean
* [._calculateDamage(newHealth, oldHealth)](#Concentrator._calculateDamage) ⇒ Number
* [._calculateDC(damage)](#Concentrator._calculateDC) ⇒ Number
* [.getConcentrationSpell(entity)](#Concentrator.getConcentrationSpell) ⇒
* [.getBetterRollsTotal(brInstance)](#Concentrator.getBetterRollsTotal)
* [._shouldSendMessage(eventType)](#Concentrator._shouldSendMessage)
* [._getWhisperRecipients(entity, desiredVisibility)](#Concentrator._getWhisperRecipients) ⇒ Array
### Concentrator.\_onRenderChatMessage(app, html, data)
Handle render ChatMessage
**Kind**: static method of [Concentrator
](#Concentrator)
| Param | Type |
| --- | --- |
| app | \*
|
| html | \*
|
| data | \*
|
### Concentrator.\_onPreUpdateActor(actor, update, options, userId)
preUpdateActor Handler
**Kind**: static method of [Concentrator
](#Concentrator)
| Param | Type |
| --- | --- |
| actor | \*
|
| update | \*
|
| options | \*
|
| userId | \*
|
### Concentrator.\_onUpdateActor(actor, update, options)
Update Actor handler
**Kind**: static method of [Concentrator
](#Concentrator)
| Param | Type |
| --- | --- |
| actor | \*
|
| update | \*
|
| options | \*
|
### Concentrator.\_onPreUpdateToken(scene, tokenData, update, options)
preUpdateToken handler
**Kind**: static method of [Concentrator
](#Concentrator)
| Param | Type |
| --- | --- |
| scene | \*
|
| tokenData | \*
|
| update | \*
|
| options | \*
|
### Concentrator.\_onUpdateToken(scene, token, update, options, userId)
Update Token handler
**Kind**: static method of [Concentrator
](#Concentrator)
| Param | Type |
| --- | --- |
| scene | \*
|
| token | \*
|
| update | \*
|
| options | \*
|
| userId | \*
|
### Concentrator.\_onDeleteActiveEffect(effect, options, userId)
Delete ActiveEffect handler
**Kind**: static method of [Concentrator
](#Concentrator)
| Param | Type |
| --- | --- |
| effect | \*
|
| options | \*
|
| userId | \*
|
### Concentrator.\_onSocket(message)
Socket message handler
**Kind**: static method of [Concentrator
](#Concentrator)
| Param | Type |
| --- | --- |
| message | \*
|
### Concentrator.\_processDamage(entity, options) ⇒ [\_processDeath
](#Concentrator._processDeath) \| [\_determinePromptedUsers
](#Concentrator._determinePromptedUsers)
Processes a damage event for Concentration purposes
**Kind**: static method of [Concentrator
](#Concentrator)
| Param | Type |
| --- | --- |
| entity | \*
|
| options | \*
|
### Concentrator.\_processDeath(entity)
Processes the steps necessary when the concentrating token is dead
**Kind**: static method of [Concentrator
](#Concentrator)
| Param | Type |
| --- | --- |
| entity | \*
|
### Concentrator.\_determinePromptedUsers(options)
Determines which users should receive a prompt
**Kind**: static method of [Concentrator
](#Concentrator)
| Param | Type |
| --- | --- |
| options | \*
|
### Concentrator.\_distributePrompts(actorId, users)
Distribute concentration prompts to affected users
**Kind**: static method of [Concentrator
](#Concentrator)
| Param | Type |
| --- | --- |
| actorId | \*
|
| users | \*
|
### Concentrator.\_displayPrompt(actorId, userId)
Displays the prompt to roll a concentration check
**Kind**: static method of [Concentrator
](#Concentrator)
| Param | Type |
| --- | --- |
| actorId | \*
|
| userId | \*
|
### Concentrator.\_processConcentrationCheck(event, actor, dc)
Processes a Concentration check for the given entity and DC
**Kind**: static method of [Concentrator
](#Concentrator)
| Param | Type |
| --- | --- |
| event | \*
|
| actor | \*
|
| dc | \*
|
### Concentrator.\_cancelPrompt(userId)
Cancels any open prompts to roll Concentration checks
**Kind**: static method of [Concentrator
](#Concentrator)
| Param | Type |
| --- | --- |
| userId | \*
|
### Concentrator.\_displayChat(entity, damage)
Displays a chat message for concentration checks
**Kind**: static method of [Concentrator
](#Concentrator)
| Param | Type |
| --- | --- |
| entity | \*
|
| damage | \*
|
### Concentrator.\_startConcentration(entity, spell, conditionName, options) ⇒ Actor.setFlag
Processes steps to start Concentration for an entity
**Kind**: static method of [Concentrator
](#Concentrator)
| Param | Type |
| --- | --- |
| entity | \*
|
| spell | \*
|
| conditionName | \*
|
| options | \*
|
### Concentrator.\_endConcentration(entity, options) ⇒ Actor.unsetFlag
Processes end of Concentration
**Kind**: static method of [Concentrator
](#Concentrator)
| Param | Type |
| --- | --- |
| entity | \*
|
| options | \*
|
### Concentrator.\_promptEnableEnhancedConditions()
Executes when the module setting is enabled
**Kind**: static method of [Concentrator
](#Concentrator)
### Concentrator.\_createCondition()
Creates a condition for Concentrating if none exists
**Kind**: static method of [Concentrator
](#Concentrator)
**Todo**
- [ ] extract to Enhanced Conditions and make it generic
### Concentrator.\_wasDamageTaken(newHealth, oldHealth) ⇒ Boolean
Determines if health has been reduced
**Kind**: static method of [Concentrator
](#Concentrator)
| Param | Type |
| --- | --- |
| newHealth | \*
|
| oldHealth | \*
|
### Concentrator.\_isConcentrating(token) ⇒ Boolean
Checks for the presence of the concentration condition effect
**Kind**: static method of [Concentrator
](#Concentrator)
| Param | Type |
| --- | --- |
| token | \*
|
### Concentrator.\_calculateDamage(newHealth, oldHealth) ⇒ Number
Calculates damage taken based on two health values
**Kind**: static method of [Concentrator
](#Concentrator)
| Param | Type |
| --- | --- |
| newHealth | \*
|
| oldHealth | \*
|
### Concentrator.\_calculateDC(damage) ⇒ Number
Calculates a Concentration DC based on a damage amount
**Kind**: static method of [Concentrator
](#Concentrator)
| Param | Type |
| --- | --- |
| damage | \*
|
### Concentrator.getConcentrationSpell(entity) ⇒
For a given entity, gets and returns their concentrated spell (if any)
**Kind**: static method of [Concentrator
](#Concentrator)
**Returns**: Concentration Spell object
| Param | Type |
| --- | --- |
| entity | \*
|
### Concentrator.getBetterRollsTotal(brInstance)
**Kind**: static method of [Concentrator
](#Concentrator)
| Param | Type |
| --- | --- |
| brInstance | \*
|
### Concentrator.\_shouldSendMessage(eventType)
Checks setting for a given Concentration event and determines whether a message should be sent
**Kind**: static method of [Concentrator
](#Concentrator)
| Param | Type |
| --- | --- |
| eventType | \*
|
### Concentrator.\_getWhisperRecipients(entity, desiredVisibility) ⇒ Array
Finds whisper recipients for given entity and desired visibility
**Kind**: static method of [Concentrator
](#Concentrator)
| Param | Type |
| --- | --- |
| entity | \*
|
| desiredVisibility | \*
|
## ConditionLab
Form application for managing mapping of Conditions to Icons and JournalEntries
**Kind**: global class
* [ConditionLab](#ConditionLab)
* _instance_
* [.updatedMap](#ConditionLab+updatedMap)
* [.prepareData()](#ConditionLab+prepareData)
* [.getData()](#ConditionLab+getData)
* [._buildSubmitData()](#ConditionLab+_buildSubmitData)
* [._processFormData(formData)](#ConditionLab+_processFormData)
* [._restoreDefaults()](#ConditionLab+_restoreDefaults)
* [._updateObject(event, formData)](#ConditionLab+_updateObject)
* [._exportToJSON()](#ConditionLab+_exportToJSON)
* [._importFromJSONDialog()](#ConditionLab+_importFromJSONDialog)
* [._processImport(html)](#ConditionLab+_processImport)
* [._getHeaderButtons()](#ConditionLab+_getHeaderButtons)
* [.activateListeners(html)](#ConditionLab+activateListeners)
* [._onChangeInputs(event)](#ConditionLab+_onChangeInputs) ⇒ Application.render
* [._onChangeFilter()](#ConditionLab+_onChangeFilter)
* [._filterMapByName(map, filter)](#ConditionLab+_filterMapByName) ⇒
* [._onChangeMapType(event)](#ConditionLab+_onChangeMapType)
* [._onChangeIconPath(event)](#ConditionLab+_onChangeIconPath)
* [._onClickActiveEffectConfig(event)](#ConditionLab+_onClickActiveEffectConfig)
* [._onChangeReferenceId(event)](#ConditionLab+_onChangeReferenceId)
* [._onOpenTrigglerForm(event)](#ConditionLab+_onOpenTrigglerForm)
* [._onAddRow(event)](#ConditionLab+_onAddRow)
* [._onRemoveRow(event)](#ConditionLab+_onRemoveRow)
* [._onChangeSortOrder(event)](#ConditionLab+_onChangeSortOrder)
* [._onClickSortButton(event)](#ConditionLab+_onClickSortButton)
* [._sortMapByName(map, direction)](#ConditionLab+_sortMapByName) ⇒ Array
* [._onRestoreDefaults(event)](#ConditionLab+_onRestoreDefaults)
* [._onResetForm(event)](#ConditionLab+_onResetForm)
* [._onSaveClose(event)](#ConditionLab+_onSaveClose)
* [._onClickMacroConfig(event)](#ConditionLab+_onClickMacroConfig)
* [._onClickTriggerConfig(event)](#ConditionLab+_onClickTriggerConfig)
* [._hasMapChanged()](#ConditionLab+_hasMapChanged)
* [._hasPropertyChanged(propertyName, original, comparison)](#ConditionLab+_hasPropertyChanged) ⇒ Boolean
* _static_
* [.defaultOptions](#ConditionLab.defaultOptions)
* [._onRender(app, html, data)](#ConditionLab._onRender)
* [._onRenderDialog(app, html, data)](#ConditionLab._onRenderDialog)
### conditionLab.updatedMap
Get updated map by combining existing in-memory map with current formdata
**Kind**: instance property of [ConditionLab
](#ConditionLab)
### conditionLab.prepareData()
Prepare data for form rendering
**Kind**: instance method of [ConditionLab
](#ConditionLab)
### conditionLab.getData()
Gets data for the template render
**Kind**: instance method of [ConditionLab
](#ConditionLab)
### conditionLab.\_buildSubmitData()
Enriches submit data with existing map to ensure continuity
**Kind**: instance method of [ConditionLab
](#ConditionLab)
### conditionLab.\_processFormData(formData)
Processes the Form Data and builds a usable Condition Map
**Kind**: instance method of [ConditionLab
](#ConditionLab)
| Param | Type |
| --- | --- |
| formData | \*
|
### conditionLab.\_restoreDefaults()
Restore defaults for a mapping
**Kind**: instance method of [ConditionLab
](#ConditionLab)
### conditionLab.\_updateObject(event, formData)
Take the new map and write it back to settings, overwriting existing
**Kind**: instance method of [ConditionLab
](#ConditionLab)
| Param | Type |
| --- | --- |
| event | Object
|
| formData | Object
|
### conditionLab.\_exportToJSON()
Exports the current map to JSON
**Kind**: instance method of [ConditionLab
](#ConditionLab)
### conditionLab.\_importFromJSONDialog()
Initiates an import via a dialog
Borrowed from foundry.js Entity class
**Kind**: instance method of [ConditionLab
](#ConditionLab)
### conditionLab.\_processImport(html)
Process a Condition Map Import
**Kind**: instance method of [ConditionLab
](#ConditionLab)
| Param | Type |
| --- | --- |
| html | \*
|
### conditionLab.\_getHeaderButtons()
Override the header buttons method
**Kind**: instance method of [ConditionLab
](#ConditionLab)
### conditionLab.activateListeners(html)
Activate app listeners
**Kind**: instance method of [ConditionLab
](#ConditionLab)
| Param | Type |
| --- | --- |
| html | \*
|
### conditionLab.\_onChangeInputs(event) ⇒ Application.render
Input change handler
**Kind**: instance method of [ConditionLab
](#ConditionLab)
| Param | Type |
| --- | --- |
| event | \*
|
### conditionLab.\_onChangeFilter()
Filter input change handler
**Kind**: instance method of [ConditionLab
](#ConditionLab)
### conditionLab.\_filterMapByName(map, filter) ⇒
Filter the given map by the name property using the supplied filter value, marking filtered entries as "hidden"
**Kind**: instance method of [ConditionLab
](#ConditionLab)
**Returns**: filteredMap
| Param | Type |
| --- | --- |
| map | Array
|
| filter | String
|
### conditionLab.\_onChangeMapType(event)
Change Map Type event handler
**Kind**: instance method of [ConditionLab
](#ConditionLab)
| Param | Type |
| --- | --- |
| event | \*
|
### conditionLab.\_onChangeIconPath(event)
Handle icon path change
**Kind**: instance method of [ConditionLab
](#ConditionLab)
| Param | Type |
| --- | --- |
| event | \*
|
### conditionLab.\_onClickActiveEffectConfig(event)
Handle click Active Effect Config button
**Kind**: instance method of [ConditionLab
](#ConditionLab)
| Param | Type |
| --- | --- |
| event | \*
|
### conditionLab.\_onChangeReferenceId(event)
Reference Link change handler
**Kind**: instance method of [ConditionLab
](#ConditionLab)
| Param | Type |
| --- | --- |
| event | \*
|
### conditionLab.\_onOpenTrigglerForm(event)
Open Triggler form event handler
**Kind**: instance method of [ConditionLab
](#ConditionLab)
| Param | Type |
| --- | --- |
| event | \*
|
### conditionLab.\_onAddRow(event)
Add Row event handler
**Kind**: instance method of [ConditionLab
](#ConditionLab)
| Param | Type |
| --- | --- |
| event | \*
|
### conditionLab.\_onRemoveRow(event)
Handler for remove row event
**Kind**: instance method of [ConditionLab
](#ConditionLab)
| Param | Type |
| --- | --- |
| event | \*
|
### conditionLab.\_onChangeSortOrder(event)
Handle a change sort order click
**Kind**: instance method of [ConditionLab
](#ConditionLab)
| Param | Type |
| --- | --- |
| event | \*
|
### conditionLab.\_onClickSortButton(event)
Sort button handler
**Kind**: instance method of [ConditionLab
](#ConditionLab)
| Param | Type |
| --- | --- |
| event | \*
|
### conditionLab.\_sortMapByName(map, direction) ⇒ Array
Sorts the given map by the name property
**Kind**: instance method of [ConditionLab
](#ConditionLab)
| Param | Type |
| --- | --- |
| map | Array
|
| direction | \*
|
### conditionLab.\_onRestoreDefaults(event)
**Kind**: instance method of [ConditionLab
](#ConditionLab)
| Param | Type |
| --- | --- |
| event | \*
|
### conditionLab.\_onResetForm(event)
Reset form handler
**Kind**: instance method of [ConditionLab
](#ConditionLab)
| Param | Type |
| --- | --- |
| event | \*
|
### conditionLab.\_onSaveClose(event)
Save and Close handler
**Kind**: instance method of [ConditionLab
](#ConditionLab)
| Param | Type |
| --- | --- |
| event | \*
|
### conditionLab.\_onClickMacroConfig(event)
Macro Config button click handler
**Kind**: instance method of [ConditionLab
](#ConditionLab)
| Param | Type |
| --- | --- |
| event | \*
|
### conditionLab.\_onClickTriggerConfig(event)
Trigger Config button click handler
**Kind**: instance method of [ConditionLab
](#ConditionLab)
| Param | Type |
| --- | --- |
| event | \*
|
### conditionLab.\_hasMapChanged()
Checks the updatedMap property against the initial map
**Kind**: instance method of [ConditionLab
](#ConditionLab)
### conditionLab.\_hasPropertyChanged(propertyName, original, comparison) ⇒ Boolean
Checks a given propertyName on an original and comparison object to see if it has changed
**Kind**: instance method of [ConditionLab
](#ConditionLab)
| Param | Type |
| --- | --- |
| propertyName | \*
|
| original | \*
|
| comparison | \*
|
### ConditionLab.defaultOptions
Get options for the form
**Kind**: static property of [ConditionLab
](#ConditionLab)
### ConditionLab.\_onRender(app, html, data)
Condition Lab Render handler
**Kind**: static method of [ConditionLab
](#ConditionLab)
| Param | Type |
| --- | --- |
| app | \*
|
| html | \*
|
| data | \*
|
### ConditionLab.\_onRenderDialog(app, html, data)
Render dialog hook handler
**Kind**: static method of [ConditionLab
](#ConditionLab)
| Param | Type |
| --- | --- |
| app | \*
|
| html | jQuery
|
| data | \*
|
## EnhancedConditionMacroConfig
Enhanced Condition Macro Config Application
**Kind**: global class
* [EnhancedConditionMacroConfig](#EnhancedConditionMacroConfig)
* _instance_
* [.getData()](#EnhancedConditionMacroConfig+getData) ⇒ Object
* [._updateObject(event, formData)](#EnhancedConditionMacroConfig+_updateObject)
* _static_
* [.defaultOptions](#EnhancedConditionMacroConfig.defaultOptions)
### enhancedConditionMacroConfig.getData() ⇒ Object
Gets data for template rendering
**Kind**: instance method of [EnhancedConditionMacroConfig
](#EnhancedConditionMacroConfig)
**Returns**: Object
- data
### enhancedConditionMacroConfig.\_updateObject(event, formData)
Update Object on Form Submission
**Kind**: instance method of [EnhancedConditionMacroConfig
](#EnhancedConditionMacroConfig)
| Param | Type |
| --- | --- |
| event | \*
|
| formData | \*
|
### EnhancedConditionMacroConfig.defaultOptions
defaultOptions
**Kind**: static property of [EnhancedConditionMacroConfig
](#EnhancedConditionMacroConfig)
## EnhancedConditionTriggerConfig
Enhanced Condition Trigger Config Application
**Kind**: global class
* [EnhancedConditionTriggerConfig](#EnhancedConditionTriggerConfig)
* _instance_
* [.getData()](#EnhancedConditionTriggerConfig+getData) ⇒ Object
* [._updateObject(event, formData)](#EnhancedConditionTriggerConfig+_updateObject)
* _static_
* [.defaultOptions](#EnhancedConditionTriggerConfig.defaultOptions)
### enhancedConditionTriggerConfig.getData() ⇒ Object
Gets data for template rendering
**Kind**: instance method of [EnhancedConditionTriggerConfig
](#EnhancedConditionTriggerConfig)
**Returns**: Object
- data
### enhancedConditionTriggerConfig.\_updateObject(event, formData)
Update Object on Form Submission
**Kind**: instance method of [EnhancedConditionTriggerConfig
](#EnhancedConditionTriggerConfig)
| Param | Type |
| --- | --- |
| event | \*
|
| formData | \*
|
### EnhancedConditionTriggerConfig.defaultOptions
defaultOptions
**Kind**: static property of [EnhancedConditionTriggerConfig
](#EnhancedConditionTriggerConfig)
## EnhancedConditions
Builds a mapping between status icons and journal entries that represent conditions
**Kind**: global class
* [EnhancedConditions](#EnhancedConditions)
* [._onReady()](#EnhancedConditions._onReady)
* [._onPreUpdateToken(scene, update, options, userId)](#EnhancedConditions._onPreUpdateToken)
* [._onUpdateToken()](#EnhancedConditions._onUpdateToken)
* [._onCreateActiveEffect(actor, update, options, userId)](#EnhancedConditions._onCreateActiveEffect)
* [._onDeleteActiveEffect(actor, update, options, userId)](#EnhancedConditions._onDeleteActiveEffect)
* [._onUpdateCombat(combat, update, options, userId)](#EnhancedConditions._onUpdateCombat)
* [._onRenderChatMessage(app, html, data)](#EnhancedConditions._onRenderChatMessage)
* [._onRenderChatLog(app, html, data)](#EnhancedConditions._onRenderChatLog)
* [._onRenderCombatTracker(app, html, data)](#EnhancedConditions._onRenderCombatTracker)
* [._processActiveEffectChange(effect, type)](#EnhancedConditions._processActiveEffectChange)
* [.lookupEntryMapping(effectIds, [map])](#EnhancedConditions.lookupEntryMapping)
* [.outputChatMessage()](#EnhancedConditions.outputChatMessage)
* [._toggleDefeated(entities)](#EnhancedConditions._toggleDefeated)
* [._removeOtherConditions(entity, conditionId)](#EnhancedConditions._removeOtherConditions)
* [._migrateConditionIds(conditionMap)](#EnhancedConditions._migrateConditionIds)
* [._processMacros(macroIds, entity)](#EnhancedConditions._processMacros)
* [.updateConditionTimestamps()](#EnhancedConditions.updateConditionTimestamps)
* [._createLabButton(html)](#EnhancedConditions._createLabButton)
* [._toggleLabButtonVisibility(display)](#EnhancedConditions._toggleLabButtonVisibility)
* [._loadDefaultMaps()](#EnhancedConditions._loadDefaultMaps)
* [._prepareMap(conditionMap)](#EnhancedConditions._prepareMap)
* [._backupCoreEffects()](#EnhancedConditions._backupCoreEffects)
* [._createJournalEntry(condition)](#EnhancedConditions._createJournalEntry)
* [._lookupConditionByName(conditionName, map)](#EnhancedConditions._lookupConditionByName)
* [._updateStatusEffects(conditionMap)](#EnhancedConditions._updateStatusEffects)
* [._prepareStatusEffects(conditionMap)](#EnhancedConditions._prepareStatusEffects) ⇒ Array
* [._prepareActiveEffects(effects)](#EnhancedConditions._prepareActiveEffects)
* [.getConditionIcons()](#EnhancedConditions.getConditionIcons)
* [.getIconsByCondition(condition)](#EnhancedConditions.getIconsByCondition)
* [.getConditionsByIcon(icon)](#EnhancedConditions.getConditionsByIcon)
* [.mapFromJson(json)](#EnhancedConditions.mapFromJson)
* [.getDefaultMap(system)](#EnhancedConditions.getDefaultMap)
* [.buildDefaultMap(system)](#EnhancedConditions.buildDefaultMap)
* [._preventativeSaveReminder()](#EnhancedConditions._preventativeSaveReminder)
* ~~[.applyCondition(...params)](#EnhancedConditions.applyCondition)~~
* [.addCondition(conditionName, [entities])](#EnhancedConditions.addCondition)
* [.getCondition(conditionName, map)](#EnhancedConditions.getCondition)
* [.getConditions(entities)](#EnhancedConditions.getConditions) ⇒ Array
* [.getActiveEffect(condition)](#EnhancedConditions.getActiveEffect)
* [.getConditionEffects(entities, map, warn)](#EnhancedConditions.getConditionEffects) ⇒ Map
\| Object
* [.hasCondition(conditionName, entities, [options])](#EnhancedConditions.hasCondition) ⇒ Boolean
* [.removeCondition(entities, conditionName, options)](#EnhancedConditions.removeCondition)
* [.removeAllConditions(entities)](#EnhancedConditions.removeAllConditions)
### EnhancedConditions.\_onReady()
Ready Hook handler
Steps:
1. Get default maps
2. Get mapType
3. Get Condition Map
4. Override status effects
**Kind**: static method of [EnhancedConditions
](#EnhancedConditions)
### EnhancedConditions.\_onPreUpdateToken(scene, update, options, userId)
Handle PreUpdate Token Hook.
If the update includes effect data, add an `option` for the update hook handler to look for
**Kind**: static method of [EnhancedConditions
](#EnhancedConditions)
| Param | Type |
| --- | --- |
| scene | \*
|
| update | \*
|
| options | \*
|
| userId | \*
|
### EnhancedConditions.\_onUpdateToken()
Hooks on token updates. If the update includes effects, calls the journal entry lookup
**Kind**: static method of [EnhancedConditions
](#EnhancedConditions)
### EnhancedConditions.\_onCreateActiveEffect(actor, update, options, userId)
Create Active Effect handler
**Kind**: static method of [EnhancedConditions
](#EnhancedConditions)
| Param | Type |
| --- | --- |
| actor | \*
|
| update | \*
|
| options | \*
|
| userId | \*
|
### EnhancedConditions.\_onDeleteActiveEffect(actor, update, options, userId)
Create Active Effect handler
**Kind**: static method of [EnhancedConditions
](#EnhancedConditions)
| Param | Type |
| --- | --- |
| actor | \*
|
| update | \*
|
| options | \*
|
| userId | \*
|
### EnhancedConditions.\_onUpdateCombat(combat, update, options, userId)
Update Combat Handler
**Kind**: static method of [EnhancedConditions
](#EnhancedConditions)
| Param | Type |
| --- | --- |
| combat | \*
|
| update | \*
|
| options | \*
|
| userId | \*
|
### EnhancedConditions.\_onRenderChatMessage(app, html, data)
Render Chat Message handler
**Kind**: static method of [EnhancedConditions
](#EnhancedConditions)
**Todo**
- [ ] move to chatlog render?
| Param | Type |
| --- | --- |
| app | \*
|
| html | \*
|
| data | \*
|
### EnhancedConditions.\_onRenderChatLog(app, html, data)
ChatLog render hook
**Kind**: static method of [EnhancedConditions
](#EnhancedConditions)
| Param | Type |
| --- | --- |
| app | \*
|
| html | \*
|
| data | \*
|
### EnhancedConditions.\_onRenderCombatTracker(app, html, data)
**Kind**: static method of [EnhancedConditions
](#EnhancedConditions)
| Param | Type |
| --- | --- |
| app | \*
|
| html | \*
|
| data | \*
|
### EnhancedConditions.\_processActiveEffectChange(effect, type)
Process the addition/removal of an Active Effect
**Kind**: static method of [EnhancedConditions
](#EnhancedConditions)
| Param | Type | Default | Description |
| --- | --- | --- | --- |
| effect | ActiveEffect
| | the effect |
| type | String
| create
| the type of change to process |
### EnhancedConditions.lookupEntryMapping(effectIds, [map])
Checks statusEffect icons against map and returns matching condition mappings
**Kind**: static method of [EnhancedConditions
](#EnhancedConditions)
| Param | Type | Default | Description |
| --- | --- | --- | --- |
| effectIds | Array
\| String
| | A list of effectIds, or a single effectId to check |
| [map] | Array
| []
| the condition map to look in |
### EnhancedConditions.outputChatMessage()
Output one or more condition entries to chat
**Kind**: static method of [EnhancedConditions
](#EnhancedConditions)
**Todo**
- [ ] refactor to use actor or token
### EnhancedConditions.\_toggleDefeated(entities)
Marks a Combatants for a particular entity as defeated
**Kind**: static method of [EnhancedConditions
](#EnhancedConditions)
| Param | Type | Description |
| --- | --- | --- |
| entities | Actor
\| Token
| the entity to mark defeated |
| options.markDefeated | Boolean
| an optional state flag (default=true) |
### EnhancedConditions.\_removeOtherConditions(entity, conditionId)
For a given entity, removes conditions other than the one supplied
**Kind**: static method of [EnhancedConditions
](#EnhancedConditions)
| Param | Type |
| --- | --- |
| entity | \*
|
| conditionId | \*
|
### EnhancedConditions.\_migrateConditionIds(conditionMap)
Migrates Condition Ids to be truly unique-ish
**Kind**: static method of [EnhancedConditions
](#EnhancedConditions)
| Param | Type |
| --- | --- |
| conditionMap | \*
|
### EnhancedConditions.\_processMacros(macroIds, entity)
Process macros based on given Ids
**Kind**: static method of [EnhancedConditions
](#EnhancedConditions)
| Param | Type | Default |
| --- | --- | --- |
| macroIds | \*
| |
| entity | \*
|
|
### EnhancedConditions.updateConditionTimestamps()
Update condition added/removed timestamps
**Kind**: static method of [EnhancedConditions
](#EnhancedConditions)
### EnhancedConditions.\_createLabButton(html)
Creates a button for the Condition Lab
**Kind**: static method of [EnhancedConditions
](#EnhancedConditions)
| Param | Type | Description |
| --- | --- | --- |
| html | Object
| the html element where the button will be created |
### EnhancedConditions.\_toggleLabButtonVisibility(display)
Determines whether to display the combat utility belt div in the settings sidebar
**Kind**: static method of [EnhancedConditions
](#EnhancedConditions)
**Todo:**: extract to helper in sidekick class?
| Param | Type |
| --- | --- |
| display | Boolean
|
### EnhancedConditions.\_loadDefaultMaps()
Returns the default maps supplied with the module
**Kind**: static method of [EnhancedConditions
](#EnhancedConditions)
**Todo:**: map to entryId and then rebuild on import
### EnhancedConditions.\_prepareMap(conditionMap)
Parse the provided Condition Map and prepare it for storage, validating and correcting bad or missing data where possible
**Kind**: static method of [EnhancedConditions
](#EnhancedConditions)
| Param | Type |
| --- | --- |
| conditionMap | \*
|
### EnhancedConditions.\_backupCoreEffects()
Duplicate the core status icons, freeze the duplicate then store a copy in settings
**Kind**: static method of [EnhancedConditions
](#EnhancedConditions)
### EnhancedConditions.\_createJournalEntry(condition)
Creates journal entries for any conditions that don't have one
**Kind**: static method of [EnhancedConditions
](#EnhancedConditions)
| Param | Type | Description |
| --- | --- | --- |
| condition | String
| the condition being evaluated |
### EnhancedConditions.\_lookupConditionByName(conditionName, map)
Gets one or more conditions from the map by their name
**Kind**: static method of [EnhancedConditions
](#EnhancedConditions)
| Param | Type | Default | Description |
| --- | --- | --- | --- |
| conditionName | String
| | the condition to get |
| map | Array
|
| the condition map to search |
### EnhancedConditions.\_updateStatusEffects(conditionMap)
Updates the CONFIG.statusEffect effects with Condition Map ones
**Kind**: static method of [EnhancedConditions
](#EnhancedConditions)
| Param | Type |
| --- | --- |
| conditionMap | \*
|
### EnhancedConditions.\_prepareStatusEffects(conditionMap) ⇒ Array
Converts the given Condition Map (one or more Conditions) into a Status Effects array or object
**Kind**: static method of [EnhancedConditions
](#EnhancedConditions)
**Returns**: Array
- statusEffects
| Param | Type |
| --- | --- |
| conditionMap | Array
\| Object
|
### EnhancedConditions.\_prepareActiveEffects(effects)
Prepares one or more ActiveEffects from Conditions for placement on an actor
**Kind**: static method of [EnhancedConditions
](#EnhancedConditions)
| Param | Type | Description |
| --- | --- | --- |
| effects | Object
\| Array
| a single ActiveEffect data object or an array of ActiveEffect data objects |
### EnhancedConditions.getConditionIcons()
Returns just the icon side of the map
**Kind**: static method of [EnhancedConditions
](#EnhancedConditions)
### EnhancedConditions.getIconsByCondition(condition)
Retrieves a condition icon by its mapped name
**Kind**: static method of [EnhancedConditions
](#EnhancedConditions)
| Param | Type |
| --- | --- |
| condition | \*
|
### EnhancedConditions.getConditionsByIcon(icon)
Retrieves a condition name by its mapped icon
**Kind**: static method of [EnhancedConditions
](#EnhancedConditions)
| Param | Type |
| --- | --- |
| icon | \*
|
### EnhancedConditions.mapFromJson(json)
Parses a condition map JSON and returns a map
**Kind**: static method of [EnhancedConditions
](#EnhancedConditions)
| Param | Type |
| --- | --- |
| json | \*
|
### EnhancedConditions.getDefaultMap(system)
Returns the default condition map for a given system
**Kind**: static method of [EnhancedConditions
](#EnhancedConditions)
| Param | Type |
| --- | --- |
| system | \*
|
### EnhancedConditions.buildDefaultMap(system)
Builds a default map for a given system
**Kind**: static method of [EnhancedConditions
](#EnhancedConditions)
**Todo**
- [ ] #281 update for active effects
| Param | Type |
| --- | --- |
| system | \*
|
### EnhancedConditions.\_preventativeSaveReminder()
Create a dialog reminding users to Save the Condition Lab as a preventation for issues arising from the transition to Active Effects
**Kind**: static method of [EnhancedConditions
](#EnhancedConditions)
### ~~EnhancedConditions.applyCondition(...params)~~
***Deprecated***
Apply the named condition to the provided entities (Actors or Tokens)
**Kind**: static method of [EnhancedConditions
](#EnhancedConditions)
**See**: EnhancedConditions#addCondition
| Param | Type |
| --- | --- |
| ...params | any
|
### EnhancedConditions.addCondition(conditionName, [entities])
Applies the named condition to the provided entities (Actors or Tokens)
**Kind**: static method of [EnhancedConditions
](#EnhancedConditions)
| Param | Type | Default | Description |
| --- | --- | --- | --- |
| conditionName | Array.<String>
\| String
| | the name of the condition to add |
| [entities] | Array.<Actor>
\| Array.<Token>
\| Actor
\| Token
|
| one or more Actors or Tokens to apply the Condition to |
| [options.warn] | Boolean
| true
| raise warnings on errors |
| [options.allowDuplicates] | Boolean
| false
| if one or more of the Conditions specified is already active on the Entity, this will still add the Condition. Use in conjunction with `replaceExisting` to determine how duplicates are handled |
| [options.replaceExisting] | Boolean
| false
| whether or not to replace existing Conditions with any duplicates in the `conditionName` parameter. If `allowDuplicates` is true and `replaceExisting` is false then a duplicate condition is created. Has no effect is `keepDuplicates` is `false` |
**Example**
```js
// Add the Condition "Blinded" to an Actor named "Bob". Duplicates will not be created.
game.cub.addCondition("Blinded", game.actors.getName("Bob"));
```
**Example**
```js
// Add the Condition "Charmed" to the currently controlled Token/s. Duplicates will not be created.
game.cub.addCondition("Charmed");
```
**Example**
```js
// Add the Conditions "Blinded" and "Charmed" to the targeted Token/s and create duplicates, replacing any existing Conditions of the same names.
game.cub.addCondition(["Blinded", "Charmed"], [...game.user.targets], {allowDuplicates: true, replaceExisting: true});
```
### EnhancedConditions.getCondition(conditionName, map)
Gets a condition by name from the Condition Map
**Kind**: static method of [EnhancedConditions
](#EnhancedConditions)
| Param | Type | Default |
| --- | --- | --- |
| conditionName | \*
| |
| map | \*
|
|
| options.warn | \*
| |
### EnhancedConditions.getConditions(entities) ⇒ Array
Retrieves all active conditions for one or more given entities (Actors or Tokens)
**Kind**: static method of [EnhancedConditions
](#EnhancedConditions)
**Returns**: Array
- entityConditionMap a mapping of conditions for each provided entity
| Param | Type | Default | Description |
| --- | --- | --- | --- |
| entities | Actor
\| Token
|
| one or more Actors or Tokens to get Conditions from |
| options.warn | Boolean
| | output notifications |
**Example**
```js
// Get conditions for an Actor named "Bob"
game.cub.getConditions(game.actors.getName("Bob"));
```
**Example**
```js
// Get conditions for the currently controlled Token
game.cub.getConditions();
```
### EnhancedConditions.getActiveEffect(condition)
Gets the Active Effect data (if any) for the given condition
**Kind**: static method of [EnhancedConditions
](#EnhancedConditions)
| Param | Type |
| --- | --- |
| condition | \*
|
### EnhancedConditions.getConditionEffects(entities, map, warn) ⇒ Map
\| Object
Gets any Active Effect instances present on the entities (Actor/s or Token/s) that are mapped Conditions
**Kind**: static method of [EnhancedConditions
](#EnhancedConditions)
**Returns**: Map
\| Object
- A Map containing the Actor Id and the Condition Active Effect instances if any
| Param | Type | Default | Description |
| --- | --- | --- | --- |
| entities | String
| | the entities to check |
| map | Array
|
| the Condition map to check (optional) |
| warn | Boolean
| | output notifications |
### EnhancedConditions.hasCondition(conditionName, entities, [options]) ⇒ Boolean
Checks if the provided Entity (Actor or Token) has the given condition
**Kind**: static method of [EnhancedConditions
](#EnhancedConditions)
**Returns**: Boolean
- hasCondition Returns true if one or more of the provided entities has one or more of the provided conditions
| Param | Type | Default | Description |
| --- | --- | --- | --- |
| conditionName | String
\| Array
| | the name/s of the condition or conditions to check for |
| entities | Actor
\| Token
\| Array
|
| the entity or entities to check (Actor/s or Token/s) |
| [options] | Object
| | options object |
| [options.warn] | Boolean
| | whether or not to output notifications |
**Example**
```js
// Check for the "Blinded" condition on Actor "Bob"
game.cub.hasCondition("Blinded", game.actors.getName("Bob"));
```
**Example**
```js
// Check for the "Charmed" and "Deafened" conditions on the controlled tokens
game.cub.hasCondition(["Charmed", "Deafened"]);
```
### EnhancedConditions.removeCondition(entities, conditionName, options)
Removes one or more named conditions from an Entity (Actor/Token)
**Kind**: static method of [EnhancedConditions
](#EnhancedConditions)
| Param | Type | Default | Description |
| --- | --- | --- | --- |
| entities | Actor
\| Token
|
| One or more Actors or Tokens |
| conditionName | String
| | the name of the Condition to remove |
| options | Object
| | options for removal |
| options.warn | Boolean
| | whether or not to raise warnings on errors |
**Example**
```js
// Remove Condition named "Blinded" from an Actor named Bob
game.cub.removeCondition("Blinded", game.actors.getName("Bob"));
```
**Example**
```js
// Remove Condition named "Charmed" from the currently controlled Token, but don't show any warnings if it fails.
game.cub.removeCondition("Charmed", {warn=false});
```
### EnhancedConditions.removeAllConditions(entities)
Removes all conditions from the provided entities
**Kind**: static method of [EnhancedConditions
](#EnhancedConditions)
| Param | Type | Default | Description |
| --- | --- | --- | --- |
| entities | Actors
\| Tokens
|
| One or more Actors or Tokens to remove Conditions from |
| options.warn | Boolean
| | output notifications |
**Example**
```js
// Remove all Conditions on an Actor named Bob
game.cub.removeAllConditions(game.actors.getName("Bob"));
```
**Example**
```js
// Remove all Conditions on the currently controlled Token
game.cub.removeAllConditions();
```
## PanSelect
Pan/Select Gadget
**Kind**: global class
* [PanSelect](#PanSelect)
* [._onPreUpdateCombat(combat, update, options, userId)](#PanSelect._onPreUpdateCombat)
* [._onUpdateCombat(combat, update, options, userId)](#PanSelect._onUpdateCombat)
* [._updateHandler(combatant)](#PanSelect._updateHandler)
* [._checkPlayerPan(token)](#PanSelect._checkPlayerPan)
* [._checkGMPan(token)](#PanSelect._checkGMPan)
* [._panToToken(token)](#PanSelect._panToToken)
* [._checkGMSelect(token)](#PanSelect._checkGMSelect)
* [._checkPlayerSelect(token)](#PanSelect._checkPlayerSelect)
* [._checkObserverDeselect(token)](#PanSelect._checkObserverDeselect)
### PanSelect.\_onPreUpdateCombat(combat, update, options, userId)
Pre-update Combat handler
**Kind**: static method of [PanSelect
](#PanSelect)
| Param | Type |
| --- | --- |
| combat | \*
|
| update | \*
|
| options | \*
|
| userId | \*
|
### PanSelect.\_onUpdateCombat(combat, update, options, userId)
Update Combat handler
**Kind**: static method of [PanSelect
](#PanSelect)
| Param | Type |
| --- | --- |
| combat | \*
|
| update | \*
|
| options | \*
|
| userId | \*
|
### PanSelect.\_updateHandler(combatant)
Determines if a pan/select workflow should begin
**Kind**: static method of [PanSelect
](#PanSelect)
| Param | Type |
| --- | --- |
| combatant | Combatant
|
### PanSelect.\_checkPlayerPan(token)
Determine if the player should be panned
**Kind**: static method of [PanSelect
](#PanSelect)
| Param | Type |
| --- | --- |
| token | \*
|
### PanSelect.\_checkGMPan(token)
Determine if the GM should be panned
**Kind**: static method of [PanSelect
](#PanSelect)
| Param | Type |
| --- | --- |
| token | \*
|
### PanSelect.\_panToToken(token)
Pans user to the token
**Kind**: static method of [PanSelect
](#PanSelect)
| Param | Type |
| --- | --- |
| token | \*
|
### PanSelect.\_checkGMSelect(token)
Determine if the current combatant token should be selected for the GM
**Kind**: static method of [PanSelect
](#PanSelect)
| Param | Type |
| --- | --- |
| token | \*
|
### PanSelect.\_checkPlayerSelect(token)
Determines if Player can select the current combatant token
**Kind**: static method of [PanSelect
](#PanSelect)
| Param | Type |
| --- | --- |
| token | \*
|
### PanSelect.\_checkObserverDeselect(token)
Determines if tokens should be deselected when a non-owned Combatant has a turn
**Kind**: static method of [PanSelect
](#PanSelect)
| Param | Type |
| --- | --- |
| token | \*
|
## RerollInitiative
Rerolls initiative for all combatants
**Kind**: global class
* [RerollInitiative](#RerollInitiative)
* [._onPreUpdateCombat(combat, update, options)](#RerollInitiative._onPreUpdateCombat)
* [._onUpdateCombat(combat, update, options, userId)](#RerollInitiative._onUpdateCombat)
### RerollInitiative.\_onPreUpdateCombat(combat, update, options)
**Kind**: static method of [RerollInitiative
](#RerollInitiative)
| Param | Type |
| --- | --- |
| combat | \*
|
| update | \*
|
| options | \*
|
### RerollInitiative.\_onUpdateCombat(combat, update, options, userId)
Update Combat handler
**Kind**: static method of [RerollInitiative
](#RerollInitiative)
| Param | Type |
| --- | --- |
| combat | \*
|
| update | \*
|
| options | \*
|
| userId | \*
|
## Sidekick
Provides helper methods for use elsewhere in the module (and has your back in a melee)
**Kind**: global class
* [Sidekick](#Sidekick)
* [.createCUBDiv(html)](#Sidekick.createCUBDiv)
* [.getSetting(key)](#Sidekick.getSetting) ⇒ Object
* [.getAllSettings()](#Sidekick.getAllSettings) ⇒ Array
* [.setSetting(key, value, awaitResult)](#Sidekick.setSetting) ⇒ Promise
\| ClientSetting
* [.registerSetting(key, metadata)](#Sidekick.registerSetting) ⇒ ClientSettings.register
* [.registerMenu(key, metadata)](#Sidekick.registerMenu) ⇒ ClientSettings.registerMenu
* [.registerAllSettings(settingsData)](#Sidekick.registerAllSettings) ⇒ Array
* [.getSystemChoices()](#Sidekick.getSystemChoices)
* [.fetchJsons(source, path)](#Sidekick.fetchJsons)
* [.fetchJson(file)](#Sidekick.fetchJson) ⇒
* [.validateObject(object)](#Sidekick.validateObject) ⇒ Boolean
* [.convertMapToArray(map)](#Sidekick.convertMapToArray)
* [.getKeyByValue(object, value)](#Sidekick.getKeyByValue)
* [.getInverseMap()](#Sidekick.getInverseMap)
* [.handlebarsHelpers()](#Sidekick.handlebarsHelpers)
* [.jQueryHelpers()](#Sidekick.jQueryHelpers)
* [.getTerms(arr)](#Sidekick.getTerms)
* [.escapeRegExp(string)](#Sidekick.escapeRegExp) ⇒ String
* [.coerceType(target, type)](#Sidekick.coerceType) ⇒ \*
* [.buildFormData(FD)](#Sidekick.buildFormData)
* [.createId(existingIds)](#Sidekick.createId)
* [.toTitleCase(string)](#Sidekick.toTitleCase)
* [.replaceOnDocument(pattern, string, param2)](#Sidekick.replaceOnDocument)
* [.getTextNodesIn(el)](#Sidekick.getTextNodesIn) ⇒ jQuery
* [.generateUniqueSlugId(string, idList)](#Sidekick.generateUniqueSlugId)
* [.getNameFromFilePath(path)](#Sidekick.getNameFromFilePath) ⇒ String
* [.getFirstGM()](#Sidekick.getFirstGM) ⇒ GM
\| null
* [.isFirstGM()](#Sidekick.isFirstGM) ⇒ Boolean
* [.getActorFromUuid(uuid)](#Sidekick.getActorFromUuid)
* [.findArrayDuplicates(arrayToCheck, filterProperty)](#Sidekick.findArrayDuplicates) ⇒ Array
* [.identifyArrayDuplicatesByProperty(arrayToCheck, filterProperty)](#Sidekick.identifyArrayDuplicatesByProperty) ⇒ Boolean
* [.loadTemplates()](#Sidekick.loadTemplates)
* [.getDocumentOwners(document)](#Sidekick.getDocumentOwners) ⇒ Array
### Sidekick.createCUBDiv(html)
Creates the CUB div in the Sidebar
**Kind**: static method of [Sidekick
](#Sidekick)
| Param | Type |
| --- | --- |
| html | \*
|
### Sidekick.getSetting(key) ⇒ Object
Get a single setting using the provided key
**Kind**: static method of [Sidekick
](#Sidekick)
**Returns**: Object
- setting
| Param | Type |
| --- | --- |
| key | \*
|
### Sidekick.getAllSettings() ⇒ Array
Get all CUB settings
**Kind**: static method of [Sidekick
](#Sidekick)
**Returns**: Array
- settings
### Sidekick.setSetting(key, value, awaitResult) ⇒ Promise
\| ClientSetting
Sets a single game setting
**Kind**: static method of [Sidekick
](#Sidekick)
| Param | Type | Default |
| --- | --- | --- |
| key | \*
| |
| value | \*
| |
| awaitResult | \*
| false
|
### Sidekick.registerSetting(key, metadata) ⇒ ClientSettings.register
Register a single setting using the provided key and setting data
**Kind**: static method of [Sidekick
](#Sidekick)
| Param | Type |
| --- | --- |
| key | \*
|
| metadata | \*
|
### Sidekick.registerMenu(key, metadata) ⇒ ClientSettings.registerMenu
Register a menu setting using the provided key and setting data
**Kind**: static method of [Sidekick
](#Sidekick)
| Param | Type |
| --- | --- |
| key | \*
|
| metadata | \*
|
### Sidekick.registerAllSettings(settingsData) ⇒ Array
Register all provided setting data
**Kind**: static method of [Sidekick
](#Sidekick)
| Param | Type |
| --- | --- |
| settingsData | \*
|
### Sidekick.getSystemChoices()
Gets the default game system names stored in the constants butler class
**Kind**: static method of [Sidekick
](#Sidekick)
### Sidekick.fetchJsons(source, path)
Use FilePicker to browse then Fetch one or more JSONs and return them
**Kind**: static method of [Sidekick
](#Sidekick)
| Param | Type |
| --- | --- |
| source | \*
|
| path | \*
|
### Sidekick.fetchJson(file) ⇒
Fetch a JSON from a given file
**Kind**: static method of [Sidekick
](#Sidekick)
**Returns**: JSON | null
| Param | Type |
| --- | --- |
| file | File
|
### Sidekick.validateObject(object) ⇒ Boolean
Validate that an object is actually an object
**Kind**: static method of [Sidekick
](#Sidekick)
| Param | Type |
| --- | --- |
| object | Object
|
### Sidekick.convertMapToArray(map)
Convert any ES6 Maps/Sets to objects for settings use
**Kind**: static method of [Sidekick
](#Sidekick)
| Param | Type |
| --- | --- |
| map | Map
|
### Sidekick.getKeyByValue(object, value)
Retrieves a key using the given value
**Kind**: static method of [Sidekick
](#Sidekick)
| Param | Type | Description |
| --- | --- | --- |
| object | Object
| - the object that contains the key/value |
| value | \*
| |
### Sidekick.getInverseMap()
Inverts the key and value in a map
**Kind**: static method of [Sidekick
](#Sidekick)
**Todo:**: rework
### Sidekick.handlebarsHelpers()
Adds additional handlebars helpers
**Kind**: static method of [Sidekick
](#Sidekick)
### Sidekick.jQueryHelpers()
Adds additional jquery helpers
**Kind**: static method of [Sidekick
](#Sidekick)
### Sidekick.getTerms(arr)
Takes an array of terms (eg. name parts) and returns groups of neighbouring terms
**Kind**: static method of [Sidekick
](#Sidekick)
| Param | Type |
| --- | --- |
| arr | \*
|
### Sidekick.escapeRegExp(string) ⇒ String
Escapes regex special chars
**Kind**: static method of [Sidekick
](#Sidekick)
**Returns**: String
- escapedString
| Param | Type |
| --- | --- |
| string | String
|
### Sidekick.coerceType(target, type) ⇒ \*
Attempts to coerce a target value into the exemplar's type
**Kind**: static method of [Sidekick
](#Sidekick)
**Returns**: \*
- coercedValue
| Param | Type |
| --- | --- |
| target | \*
|
| type | \*
|
### Sidekick.buildFormData(FD)
Builds a FD returned from FormDataExtended into a formData array
Borrowed from foundry.js
**Kind**: static method of [Sidekick
](#Sidekick)
| Param | Type |
| --- | --- |
| FD | \*
|
### Sidekick.createId(existingIds)
Get a random unique Id, checking an optional supplied array of ids for a match
**Kind**: static method of [Sidekick
](#Sidekick)
| Param | Type |
| --- | --- |
| existingIds | \*
|
### Sidekick.toTitleCase(string)
Sets a string to Title Case
**Kind**: static method of [Sidekick
](#Sidekick)
| Param | Type |
| --- | --- |
| string | \*
|
### Sidekick.replaceOnDocument(pattern, string, param2)
Parses HTML and replaces instances of a matched pattern
**Kind**: static method of [Sidekick
](#Sidekick)
| Param | Type |
| --- | --- |
| pattern | \*
|
| string | \*
|
| param2 | \*
|
### Sidekick.getTextNodesIn(el) ⇒ jQuery
Get text nodes in a given element
**Kind**: static method of [Sidekick
](#Sidekick)
| Param | Type |
| --- | --- |
| el | \*
|
### Sidekick.generateUniqueSlugId(string, idList)
For a given string generate a slug, optionally checking a list of existing Ids for uniqueness
**Kind**: static method of [Sidekick
](#Sidekick)
| Param | Type |
| --- | --- |
| string | \*
|
| idList | \*
|
### Sidekick.getNameFromFilePath(path) ⇒ String
For a given file path, find the filename and then apply title case
**Kind**: static method of [Sidekick
](#Sidekick)
| Param | Type |
| --- | --- |
| path | String
|
### Sidekick.getFirstGM() ⇒ GM
\| null
Gets the first GM user
**Kind**: static method of [Sidekick
](#Sidekick)
**Returns**: GM
\| null
- a GM object or null if none found
### Sidekick.isFirstGM() ⇒ Boolean
Checks if the current user is the first active GM
**Kind**: static method of [Sidekick
](#Sidekick)
### Sidekick.getActorFromUuid(uuid)
Gets an Actor from an Actor or Token UUID
**Kind**: static method of [Sidekick
](#Sidekick)
| Param | Type |
| --- | --- |
| uuid | \*
|
### Sidekick.findArrayDuplicates(arrayToCheck, filterProperty) ⇒ Array
Filters an array down to just its duplicate elements based on the property specified
**Kind**: static method of [Sidekick
](#Sidekick)
| Param | Type |
| --- | --- |
| arrayToCheck | \*
|
| filterProperty | \*
|
### Sidekick.identifyArrayDuplicatesByProperty(arrayToCheck, filterProperty) ⇒ Boolean
Returns true for each array element that is a duplicate based on the property specified
**Kind**: static method of [Sidekick
](#Sidekick)
| Param | Type |
| --- | --- |
| arrayToCheck | \*
|
| filterProperty | \*
|
### Sidekick.loadTemplates()
Loads templates for partials
**Kind**: static method of [Sidekick
](#Sidekick)
### Sidekick.getDocumentOwners(document) ⇒ Array
Retrieves all the owners of a given document
**Kind**: static method of [Sidekick
](#Sidekick)
| Param | Type |
| --- | --- |
| document | \*
|
## Signal
Initiates module classes (and shines a light on the dark night sky)
**Kind**: global class
* [Signal](#Signal)
* [.lightUp()](#Signal.lightUp)
* [._onSocket(message)](#Signal._onSocket)
### Signal.lightUp()
Registers hooks
**Kind**: static method of [Signal
](#Signal)
### Signal.\_onSocket(message)
Socket dispatcher
**Kind**: static method of [Signal
](#Signal)
| Param | Type |
| --- | --- |
| message | \*
|
## TemporaryCombatantForm
**Kind**: global class
### temporaryCombatantForm.activateListeners(html)
Activate listeners for the form
**Kind**: instance method of [TemporaryCombatantForm
](#TemporaryCombatantForm)
| Param | Type |
| --- | --- |
| html | \*
|
## Triggler
Handles triggers for other gadgets in the module... or does it?!
**Kind**: global class
* [Triggler](#Triggler)
* [._createTrigglerButton(html)](#Triggler._createTrigglerButton)
* [._executeTrigger(trigger, target)](#Triggler._executeTrigger)
* [._processUpdate(entity, update, entryPoint1, entryPoint2)](#Triggler._processUpdate)
* [._onUpdateActor(actor, update, options, userId)](#Triggler._onUpdateActor)
* [._onUpdateToken(token, update, options, userId)](#Triggler._onUpdateToken)
* [._onRenderMacroConfig(app, html, data)](#Triggler._onRenderMacroConfig)
### Triggler.\_createTrigglerButton(html)
Creates a button for the Condition Lab
**Kind**: static method of [Triggler
](#Triggler)
| Param | Type | Description |
| --- | --- | --- |
| html | Object
| the html element where the button will be created |
### Triggler.\_executeTrigger(trigger, target)
Executes a trigger calling predefined actions
**Kind**: static method of [Triggler
](#Triggler)
| Param | Type |
| --- | --- |
| trigger | \*
|
| target | \*
|
### Triggler.\_processUpdate(entity, update, entryPoint1, entryPoint2)
Processes an entity update and evaluates triggers
**Kind**: static method of [Triggler
](#Triggler)
| Param | Type |
| --- | --- |
| entity | \*
|
| update | \*
|
| entryPoint1 | \*
|
| entryPoint2 | \*
|
### Triggler.\_onUpdateActor(actor, update, options, userId)
Update Actor handler
**Kind**: static method of [Triggler
](#Triggler)
| Param | Type |
| --- | --- |
| actor | \*
|
| update | \*
|
| options | \*
|
| userId | \*
|
### Triggler.\_onUpdateToken(token, update, options, userId)
Update token handler
**Kind**: static method of [Triggler
](#Triggler)
| Param | Type |
| --- | --- |
| token | Token
|
| update | \*
|
| options | \*
|
| userId | \*
|
### Triggler.\_onRenderMacroConfig(app, html, data)
**Kind**: static method of [Triggler
](#Triggler)
| Param | Type |
| --- | --- |
| app | \*
|
| html | \*
|
| data | \*
|
## DraggableList
From Valentin "Moerill" Henkys
the code is licensed under LGPL v3.
Original is implemented in his module "Mess":
https://github.com/Moerill/Mess
LICENSE: https://github.com/Moerill/Mess/blob/master/LICENSE
**Kind**: global class
## KNOWN\_GAME\_SYSTEMS
Stores information about well known game systems. All other systems will resolve to "other"
**Kind**: global constant
## createCUBPuterButton(html)
Create the sidebar button
**Kind**: global function
| Param | Type |
| --- | --- |
| html | \*
|
## getData(options)
Get data for template rendering
**Kind**: global function
| Param | Type |
| --- | --- |
| options | \*
|
## \_updateObject(formData)
Override default update object behaviour
**Kind**: global function
| Param | Type |
| --- | --- |
| formData | \*
|