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