All user data for FoundryVTT. Includes worlds, systems, modules, and any asset in the "foundryuserdata" directory. Does NOT include the FoundryVTT installation itself.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2277 lines
73 KiB

1 year ago
  1. ## Modules
  2. <dl>
  3. <dt><a href="#module_about">about</a></dt>
  4. <dd><p>AboutApp module</p>
  5. </dd>
  6. </dl>
  7. ## Classes
  8. <dl>
  9. <dt><a href="#Concentrator">Concentrator</a></dt>
  10. <dd><p>Request a roll or display concentration checks when damage is taken.</p>
  11. </dd>
  12. <dt><a href="#ConditionLab">ConditionLab</a></dt>
  13. <dd><p>Form application for managing mapping of Conditions to Icons and JournalEntries</p>
  14. </dd>
  15. <dt><a href="#EnhancedConditionMacroConfig">EnhancedConditionMacroConfig</a></dt>
  16. <dd><p>Enhanced Condition Macro Config Application</p>
  17. </dd>
  18. <dt><a href="#EnhancedConditionTriggerConfig">EnhancedConditionTriggerConfig</a></dt>
  19. <dd><p>Enhanced Condition Trigger Config Application</p>
  20. </dd>
  21. <dt><a href="#EnhancedConditions">EnhancedConditions</a></dt>
  22. <dd><p>Builds a mapping between status icons and journal entries that represent conditions</p>
  23. </dd>
  24. <dt><a href="#PanSelect">PanSelect</a></dt>
  25. <dd><p>Pan/Select Gadget</p>
  26. </dd>
  27. <dt><a href="#RerollInitiative">RerollInitiative</a></dt>
  28. <dd><p>Rerolls initiative for all combatants</p>
  29. </dd>
  30. <dt><a href="#Sidekick">Sidekick</a></dt>
  31. <dd><p>Provides helper methods for use elsewhere in the module (and has your back in a melee)</p>
  32. </dd>
  33. <dt><a href="#Signal">Signal</a></dt>
  34. <dd><p>Initiates module classes (and shines a light on the dark night sky)</p>
  35. </dd>
  36. <dt><a href="#TemporaryCombatantForm">TemporaryCombatantForm</a></dt>
  37. <dd></dd>
  38. <dt><a href="#Triggler">Triggler</a></dt>
  39. <dd><p>Handles triggers for other gadgets in the module... or does it?!</p>
  40. </dd>
  41. <dt><a href="#DraggableList">DraggableList</a></dt>
  42. <dd><p>From Valentin &quot;Moerill&quot; Henkys
  43. the code is licensed under LGPL v3.
  44. Original is implemented in his module &quot;Mess&quot;:
  45. <a href="https://github.com/Moerill/Mess">https://github.com/Moerill/Mess</a>
  46. LICENSE: <a href="https://github.com/Moerill/Mess/blob/master/LICENSE">https://github.com/Moerill/Mess/blob/master/LICENSE</a></p>
  47. </dd>
  48. </dl>
  49. ## Constants
  50. <dl>
  51. <dt><a href="#KNOWN_GAME_SYSTEMS">KNOWN_GAME_SYSTEMS</a></dt>
  52. <dd><p>Stores information about well known game systems. All other systems will resolve to &quot;other&quot;</p>
  53. </dd>
  54. </dl>
  55. ## Functions
  56. <dl>
  57. <dt><a href="#createCUBPuterButton">createCUBPuterButton(html)</a></dt>
  58. <dd><p>Create the sidebar button</p>
  59. </dd>
  60. <dt><a href="#getData">getData(options)</a></dt>
  61. <dd><p>Get data for template rendering</p>
  62. </dd>
  63. <dt><a href="#_updateObject">_updateObject(formData)</a></dt>
  64. <dd><p>Override default update object behaviour</p>
  65. </dd>
  66. </dl>
  67. <a name="module_about"></a>
  68. ## about
  69. AboutApp module
  70. * [about](#module_about)
  71. * [~AboutApp](#module_about..AboutApp) ⇐ <code>FormApplication</code>
  72. * _instance_
  73. * [.getData()](#module_about..AboutApp+getData)
  74. * [.fetchPatrons()](#module_about..AboutApp+fetchPatrons)
  75. * _static_
  76. * [.defaultOptions](#module_about..AboutApp.defaultOptions)
  77. <a name="module_about..AboutApp"></a>
  78. ### about~AboutApp ⇐ <code>FormApplication</code>
  79. About this module FormApp
  80. **Kind**: inner class of [<code>about</code>](#module_about)
  81. **Extends**: <code>FormApplication</code>
  82. * [~AboutApp](#module_about..AboutApp) ⇐ <code>FormApplication</code>
  83. * _instance_
  84. * [.getData()](#module_about..AboutApp+getData)
  85. * [.fetchPatrons()](#module_about..AboutApp+fetchPatrons)
  86. * _static_
  87. * [.defaultOptions](#module_about..AboutApp.defaultOptions)
  88. <a name="module_about..AboutApp+getData"></a>
  89. #### aboutApp.getData()
  90. Supplies data to the template
  91. **Kind**: instance method of [<code>AboutApp</code>](#module_about..AboutApp)
  92. <a name="module_about..AboutApp+fetchPatrons"></a>
  93. #### aboutApp.fetchPatrons()
  94. Fetches a list of Patrons to display on the About page
  95. **Kind**: instance method of [<code>AboutApp</code>](#module_about..AboutApp)
  96. <a name="module_about..AboutApp.defaultOptions"></a>
  97. #### AboutApp.defaultOptions
  98. Call app default options
  99. **Kind**: static property of [<code>AboutApp</code>](#module_about..AboutApp)
  100. <a name="Concentrator"></a>
  101. ## Concentrator
  102. Request a roll or display concentration checks when damage is taken.
  103. **Kind**: global class
  104. **Author**: JacobMcAuley
  105. **Author**: Evan Clarke
  106. **Todo**
  107. - [ ] Supply DC
  108. * [Concentrator](#Concentrator)
  109. * [._onRenderChatMessage(app, html, data)](#Concentrator._onRenderChatMessage)
  110. * [._onPreUpdateActor(actor, update, options, userId)](#Concentrator._onPreUpdateActor)
  111. * [._onUpdateActor(actor, update, options)](#Concentrator._onUpdateActor)
  112. * [._onPreUpdateToken(scene, tokenData, update, options)](#Concentrator._onPreUpdateToken)
  113. * [._onUpdateToken(scene, token, update, options, userId)](#Concentrator._onUpdateToken)
  114. * [._onDeleteActiveEffect(effect, options, userId)](#Concentrator._onDeleteActiveEffect)
  115. * [._onSocket(message)](#Concentrator._onSocket)
  116. * [._processDamage(entity, options)](#Concentrator._processDamage) ⇒ [<code>\_processDeath</code>](#Concentrator._processDeath) \| [<code>\_determinePromptedUsers</code>](#Concentrator._determinePromptedUsers)
  117. * [._processDeath(entity)](#Concentrator._processDeath)
  118. * [._determinePromptedUsers(options)](#Concentrator._determinePromptedUsers)
  119. * [._distributePrompts(actorId, users)](#Concentrator._distributePrompts)
  120. * [._displayPrompt(actorId, userId)](#Concentrator._displayPrompt)
  121. * [._processConcentrationCheck(event, actor, dc)](#Concentrator._processConcentrationCheck)
  122. * [._cancelPrompt(userId)](#Concentrator._cancelPrompt)
  123. * [._displayChat(entity, damage)](#Concentrator._displayChat)
  124. * [._startConcentration(entity, spell, conditionName, options)](#Concentrator._startConcentration) ⇒ <code>Actor.setFlag</code>
  125. * [._endConcentration(entity, options)](#Concentrator._endConcentration) ⇒ <code>Actor.unsetFlag</code>
  126. * [._promptEnableEnhancedConditions()](#Concentrator._promptEnableEnhancedConditions)
  127. * [._createCondition()](#Concentrator._createCondition)
  128. * [._wasDamageTaken(newHealth, oldHealth)](#Concentrator._wasDamageTaken) ⇒ <code>Boolean</code>
  129. * [._isConcentrating(token)](#Concentrator._isConcentrating) ⇒ <code>Boolean</code>
  130. * [._calculateDamage(newHealth, oldHealth)](#Concentrator._calculateDamage) ⇒ <code>Number</code>
  131. * [._calculateDC(damage)](#Concentrator._calculateDC) ⇒ <code>Number</code>
  132. * [.getConcentrationSpell(entity)](#Concentrator.getConcentrationSpell) ⇒
  133. * [.getBetterRollsTotal(brInstance)](#Concentrator.getBetterRollsTotal)
  134. * [._shouldSendMessage(eventType)](#Concentrator._shouldSendMessage)
  135. * [._getWhisperRecipients(entity, desiredVisibility)](#Concentrator._getWhisperRecipients) ⇒ <code>Array</code>
  136. <a name="Concentrator._onRenderChatMessage"></a>
  137. ### Concentrator.\_onRenderChatMessage(app, html, data)
  138. Handle render ChatMessage
  139. **Kind**: static method of [<code>Concentrator</code>](#Concentrator)
  140. | Param | Type |
  141. | --- | --- |
  142. | app | <code>\*</code> |
  143. | html | <code>\*</code> |
  144. | data | <code>\*</code> |
  145. <a name="Concentrator._onPreUpdateActor"></a>
  146. ### Concentrator.\_onPreUpdateActor(actor, update, options, userId)
  147. preUpdateActor Handler
  148. **Kind**: static method of [<code>Concentrator</code>](#Concentrator)
  149. | Param | Type |
  150. | --- | --- |
  151. | actor | <code>\*</code> |
  152. | update | <code>\*</code> |
  153. | options | <code>\*</code> |
  154. | userId | <code>\*</code> |
  155. <a name="Concentrator._onUpdateActor"></a>
  156. ### Concentrator.\_onUpdateActor(actor, update, options)
  157. Update Actor handler
  158. **Kind**: static method of [<code>Concentrator</code>](#Concentrator)
  159. | Param | Type |
  160. | --- | --- |
  161. | actor | <code>\*</code> |
  162. | update | <code>\*</code> |
  163. | options | <code>\*</code> |
  164. <a name="Concentrator._onPreUpdateToken"></a>
  165. ### Concentrator.\_onPreUpdateToken(scene, tokenData, update, options)
  166. preUpdateToken handler
  167. **Kind**: static method of [<code>Concentrator</code>](#Concentrator)
  168. | Param | Type |
  169. | --- | --- |
  170. | scene | <code>\*</code> |
  171. | tokenData | <code>\*</code> |
  172. | update | <code>\*</code> |
  173. | options | <code>\*</code> |
  174. <a name="Concentrator._onUpdateToken"></a>
  175. ### Concentrator.\_onUpdateToken(scene, token, update, options, userId)
  176. Update Token handler
  177. **Kind**: static method of [<code>Concentrator</code>](#Concentrator)
  178. | Param | Type |
  179. | --- | --- |
  180. | scene | <code>\*</code> |
  181. | token | <code>\*</code> |
  182. | update | <code>\*</code> |
  183. | options | <code>\*</code> |
  184. | userId | <code>\*</code> |
  185. <a name="Concentrator._onDeleteActiveEffect"></a>
  186. ### Concentrator.\_onDeleteActiveEffect(effect, options, userId)
  187. Delete ActiveEffect handler
  188. **Kind**: static method of [<code>Concentrator</code>](#Concentrator)
  189. | Param | Type |
  190. | --- | --- |
  191. | effect | <code>\*</code> |
  192. | options | <code>\*</code> |
  193. | userId | <code>\*</code> |
  194. <a name="Concentrator._onSocket"></a>
  195. ### Concentrator.\_onSocket(message)
  196. Socket message handler
  197. **Kind**: static method of [<code>Concentrator</code>](#Concentrator)
  198. | Param | Type |
  199. | --- | --- |
  200. | message | <code>\*</code> |
  201. <a name="Concentrator._processDamage"></a>
  202. ### Concentrator.\_processDamage(entity, options) ⇒ [<code>\_processDeath</code>](#Concentrator._processDeath) \| [<code>\_determinePromptedUsers</code>](#Concentrator._determinePromptedUsers)
  203. Processes a damage event for Concentration purposes
  204. **Kind**: static method of [<code>Concentrator</code>](#Concentrator)
  205. | Param | Type |
  206. | --- | --- |
  207. | entity | <code>\*</code> |
  208. | options | <code>\*</code> |
  209. <a name="Concentrator._processDeath"></a>
  210. ### Concentrator.\_processDeath(entity)
  211. Processes the steps necessary when the concentrating token is dead
  212. **Kind**: static method of [<code>Concentrator</code>](#Concentrator)
  213. | Param | Type |
  214. | --- | --- |
  215. | entity | <code>\*</code> |
  216. <a name="Concentrator._determinePromptedUsers"></a>
  217. ### Concentrator.\_determinePromptedUsers(options)
  218. Determines which users should receive a prompt
  219. **Kind**: static method of [<code>Concentrator</code>](#Concentrator)
  220. | Param | Type |
  221. | --- | --- |
  222. | options | <code>\*</code> |
  223. <a name="Concentrator._distributePrompts"></a>
  224. ### Concentrator.\_distributePrompts(actorId, users)
  225. Distribute concentration prompts to affected users
  226. **Kind**: static method of [<code>Concentrator</code>](#Concentrator)
  227. | Param | Type |
  228. | --- | --- |
  229. | actorId | <code>\*</code> |
  230. | users | <code>\*</code> |
  231. <a name="Concentrator._displayPrompt"></a>
  232. ### Concentrator.\_displayPrompt(actorId, userId)
  233. Displays the prompt to roll a concentration check
  234. **Kind**: static method of [<code>Concentrator</code>](#Concentrator)
  235. | Param | Type |
  236. | --- | --- |
  237. | actorId | <code>\*</code> |
  238. | userId | <code>\*</code> |
  239. <a name="Concentrator._processConcentrationCheck"></a>
  240. ### Concentrator.\_processConcentrationCheck(event, actor, dc)
  241. Processes a Concentration check for the given entity and DC
  242. **Kind**: static method of [<code>Concentrator</code>](#Concentrator)
  243. | Param | Type |
  244. | --- | --- |
  245. | event | <code>\*</code> |
  246. | actor | <code>\*</code> |
  247. | dc | <code>\*</code> |
  248. <a name="Concentrator._cancelPrompt"></a>
  249. ### Concentrator.\_cancelPrompt(userId)
  250. Cancels any open prompts to roll Concentration checks
  251. **Kind**: static method of [<code>Concentrator</code>](#Concentrator)
  252. | Param | Type |
  253. | --- | --- |
  254. | userId | <code>\*</code> |
  255. <a name="Concentrator._displayChat"></a>
  256. ### Concentrator.\_displayChat(entity, damage)
  257. Displays a chat message for concentration checks
  258. **Kind**: static method of [<code>Concentrator</code>](#Concentrator)
  259. | Param | Type |
  260. | --- | --- |
  261. | entity | <code>\*</code> |
  262. | damage | <code>\*</code> |
  263. <a name="Concentrator._startConcentration"></a>
  264. ### Concentrator.\_startConcentration(entity, spell, conditionName, options) ⇒ <code>Actor.setFlag</code>
  265. Processes steps to start Concentration for an entity
  266. **Kind**: static method of [<code>Concentrator</code>](#Concentrator)
  267. | Param | Type |
  268. | --- | --- |
  269. | entity | <code>\*</code> |
  270. | spell | <code>\*</code> |
  271. | conditionName | <code>\*</code> |
  272. | options | <code>\*</code> |
  273. <a name="Concentrator._endConcentration"></a>
  274. ### Concentrator.\_endConcentration(entity, options) ⇒ <code>Actor.unsetFlag</code>
  275. Processes end of Concentration
  276. **Kind**: static method of [<code>Concentrator</code>](#Concentrator)
  277. | Param | Type |
  278. | --- | --- |
  279. | entity | <code>\*</code> |
  280. | options | <code>\*</code> |
  281. <a name="Concentrator._promptEnableEnhancedConditions"></a>
  282. ### Concentrator.\_promptEnableEnhancedConditions()
  283. Executes when the module setting is enabled
  284. **Kind**: static method of [<code>Concentrator</code>](#Concentrator)
  285. <a name="Concentrator._createCondition"></a>
  286. ### Concentrator.\_createCondition()
  287. Creates a condition for Concentrating if none exists
  288. **Kind**: static method of [<code>Concentrator</code>](#Concentrator)
  289. **Todo**
  290. - [ ] extract to Enhanced Conditions and make it generic
  291. <a name="Concentrator._wasDamageTaken"></a>
  292. ### Concentrator.\_wasDamageTaken(newHealth, oldHealth) ⇒ <code>Boolean</code>
  293. Determines if health has been reduced
  294. **Kind**: static method of [<code>Concentrator</code>](#Concentrator)
  295. | Param | Type |
  296. | --- | --- |
  297. | newHealth | <code>\*</code> |
  298. | oldHealth | <code>\*</code> |
  299. <a name="Concentrator._isConcentrating"></a>
  300. ### Concentrator.\_isConcentrating(token) ⇒ <code>Boolean</code>
  301. Checks for the presence of the concentration condition effect
  302. **Kind**: static method of [<code>Concentrator</code>](#Concentrator)
  303. | Param | Type |
  304. | --- | --- |
  305. | token | <code>\*</code> |
  306. <a name="Concentrator._calculateDamage"></a>
  307. ### Concentrator.\_calculateDamage(newHealth, oldHealth) ⇒ <code>Number</code>
  308. Calculates damage taken based on two health values
  309. **Kind**: static method of [<code>Concentrator</code>](#Concentrator)
  310. | Param | Type |
  311. | --- | --- |
  312. | newHealth | <code>\*</code> |
  313. | oldHealth | <code>\*</code> |
  314. <a name="Concentrator._calculateDC"></a>
  315. ### Concentrator.\_calculateDC(damage) ⇒ <code>Number</code>
  316. Calculates a Concentration DC based on a damage amount
  317. **Kind**: static method of [<code>Concentrator</code>](#Concentrator)
  318. | Param | Type |
  319. | --- | --- |
  320. | damage | <code>\*</code> |
  321. <a name="Concentrator.getConcentrationSpell"></a>
  322. ### Concentrator.getConcentrationSpell(entity) ⇒
  323. For a given entity, gets and returns their concentrated spell (if any)
  324. **Kind**: static method of [<code>Concentrator</code>](#Concentrator)
  325. **Returns**: Concentration Spell object
  326. | Param | Type |
  327. | --- | --- |
  328. | entity | <code>\*</code> |
  329. <a name="Concentrator.getBetterRollsTotal"></a>
  330. ### Concentrator.getBetterRollsTotal(brInstance)
  331. **Kind**: static method of [<code>Concentrator</code>](#Concentrator)
  332. | Param | Type |
  333. | --- | --- |
  334. | brInstance | <code>\*</code> |
  335. <a name="Concentrator._shouldSendMessage"></a>
  336. ### Concentrator.\_shouldSendMessage(eventType)
  337. Checks setting for a given Concentration event and determines whether a message should be sent
  338. **Kind**: static method of [<code>Concentrator</code>](#Concentrator)
  339. | Param | Type |
  340. | --- | --- |
  341. | eventType | <code>\*</code> |
  342. <a name="Concentrator._getWhisperRecipients"></a>
  343. ### Concentrator.\_getWhisperRecipients(entity, desiredVisibility) ⇒ <code>Array</code>
  344. Finds whisper recipients for given entity and desired visibility
  345. **Kind**: static method of [<code>Concentrator</code>](#Concentrator)
  346. | Param | Type |
  347. | --- | --- |
  348. | entity | <code>\*</code> |
  349. | desiredVisibility | <code>\*</code> |
  350. <a name="ConditionLab"></a>
  351. ## ConditionLab
  352. Form application for managing mapping of Conditions to Icons and JournalEntries
  353. **Kind**: global class
  354. * [ConditionLab](#ConditionLab)
  355. * _instance_
  356. * [.updatedMap](#ConditionLab+updatedMap)
  357. * [.prepareData()](#ConditionLab+prepareData)
  358. * [.getData()](#ConditionLab+getData)
  359. * [._buildSubmitData()](#ConditionLab+_buildSubmitData)
  360. * [._processFormData(formData)](#ConditionLab+_processFormData)
  361. * [._restoreDefaults()](#ConditionLab+_restoreDefaults)
  362. * [._updateObject(event, formData)](#ConditionLab+_updateObject)
  363. * [._exportToJSON()](#ConditionLab+_exportToJSON)
  364. * [._importFromJSONDialog()](#ConditionLab+_importFromJSONDialog)
  365. * [._processImport(html)](#ConditionLab+_processImport)
  366. * [._getHeaderButtons()](#ConditionLab+_getHeaderButtons)
  367. * [.activateListeners(html)](#ConditionLab+activateListeners)
  368. * [._onChangeInputs(event)](#ConditionLab+_onChangeInputs) ⇒ <code>Application.render</code>
  369. * [._onChangeFilter()](#ConditionLab+_onChangeFilter)
  370. * [._filterMapByName(map, filter)](#ConditionLab+_filterMapByName) ⇒
  371. * [._onChangeMapType(event)](#ConditionLab+_onChangeMapType)
  372. * [._onChangeIconPath(event)](#ConditionLab+_onChangeIconPath)
  373. * [._onClickActiveEffectConfig(event)](#ConditionLab+_onClickActiveEffectConfig)
  374. * [._onChangeReferenceId(event)](#ConditionLab+_onChangeReferenceId)
  375. * [._onOpenTrigglerForm(event)](#ConditionLab+_onOpenTrigglerForm)
  376. * [._onAddRow(event)](#ConditionLab+_onAddRow)
  377. * [._onRemoveRow(event)](#ConditionLab+_onRemoveRow)
  378. * [._onChangeSortOrder(event)](#ConditionLab+_onChangeSortOrder)
  379. * [._onClickSortButton(event)](#ConditionLab+_onClickSortButton)
  380. * [._sortMapByName(map, direction)](#ConditionLab+_sortMapByName) ⇒ <code>Array</code>
  381. * [._onRestoreDefaults(event)](#ConditionLab+_onRestoreDefaults)
  382. * [._onResetForm(event)](#ConditionLab+_onResetForm)
  383. * [._onSaveClose(event)](#ConditionLab+_onSaveClose)
  384. * [._onClickMacroConfig(event)](#ConditionLab+_onClickMacroConfig)
  385. * [._onClickTriggerConfig(event)](#ConditionLab+_onClickTriggerConfig)
  386. * [._hasMapChanged()](#ConditionLab+_hasMapChanged)
  387. * [._hasPropertyChanged(propertyName, original, comparison)](#ConditionLab+_hasPropertyChanged) ⇒ <code>Boolean</code>
  388. * _static_
  389. * [.defaultOptions](#ConditionLab.defaultOptions)
  390. * [._onRender(app, html, data)](#ConditionLab._onRender)
  391. * [._onRenderDialog(app, html, data)](#ConditionLab._onRenderDialog)
  392. <a name="ConditionLab+updatedMap"></a>
  393. ### conditionLab.updatedMap
  394. Get updated map by combining existing in-memory map with current formdata
  395. **Kind**: instance property of [<code>ConditionLab</code>](#ConditionLab)
  396. <a name="ConditionLab+prepareData"></a>
  397. ### conditionLab.prepareData()
  398. Prepare data for form rendering
  399. **Kind**: instance method of [<code>ConditionLab</code>](#ConditionLab)
  400. <a name="ConditionLab+getData"></a>
  401. ### conditionLab.getData()
  402. Gets data for the template render
  403. **Kind**: instance method of [<code>ConditionLab</code>](#ConditionLab)
  404. <a name="ConditionLab+_buildSubmitData"></a>
  405. ### conditionLab.\_buildSubmitData()
  406. Enriches submit data with existing map to ensure continuity
  407. **Kind**: instance method of [<code>ConditionLab</code>](#ConditionLab)
  408. <a name="ConditionLab+_processFormData"></a>
  409. ### conditionLab.\_processFormData(formData)
  410. Processes the Form Data and builds a usable Condition Map
  411. **Kind**: instance method of [<code>ConditionLab</code>](#ConditionLab)
  412. | Param | Type |
  413. | --- | --- |
  414. | formData | <code>\*</code> |
  415. <a name="ConditionLab+_restoreDefaults"></a>
  416. ### conditionLab.\_restoreDefaults()
  417. Restore defaults for a mapping
  418. **Kind**: instance method of [<code>ConditionLab</code>](#ConditionLab)
  419. <a name="ConditionLab+_updateObject"></a>
  420. ### conditionLab.\_updateObject(event, formData)
  421. Take the new map and write it back to settings, overwriting existing
  422. **Kind**: instance method of [<code>ConditionLab</code>](#ConditionLab)
  423. | Param | Type |
  424. | --- | --- |
  425. | event | <code>Object</code> |
  426. | formData | <code>Object</code> |
  427. <a name="ConditionLab+_exportToJSON"></a>
  428. ### conditionLab.\_exportToJSON()
  429. Exports the current map to JSON
  430. **Kind**: instance method of [<code>ConditionLab</code>](#ConditionLab)
  431. <a name="ConditionLab+_importFromJSONDialog"></a>
  432. ### conditionLab.\_importFromJSONDialog()
  433. Initiates an import via a dialog
  434. Borrowed from foundry.js Entity class
  435. **Kind**: instance method of [<code>ConditionLab</code>](#ConditionLab)
  436. <a name="ConditionLab+_processImport"></a>
  437. ### conditionLab.\_processImport(html)
  438. Process a Condition Map Import
  439. **Kind**: instance method of [<code>ConditionLab</code>](#ConditionLab)
  440. | Param | Type |
  441. | --- | --- |
  442. | html | <code>\*</code> |
  443. <a name="ConditionLab+_getHeaderButtons"></a>
  444. ### conditionLab.\_getHeaderButtons()
  445. Override the header buttons method
  446. **Kind**: instance method of [<code>ConditionLab</code>](#ConditionLab)
  447. <a name="ConditionLab+activateListeners"></a>
  448. ### conditionLab.activateListeners(html)
  449. Activate app listeners
  450. **Kind**: instance method of [<code>ConditionLab</code>](#ConditionLab)
  451. | Param | Type |
  452. | --- | --- |
  453. | html | <code>\*</code> |
  454. <a name="ConditionLab+_onChangeInputs"></a>
  455. ### conditionLab.\_onChangeInputs(event) ⇒ <code>Application.render</code>
  456. Input change handler
  457. **Kind**: instance method of [<code>ConditionLab</code>](#ConditionLab)
  458. | Param | Type |
  459. | --- | --- |
  460. | event | <code>\*</code> |
  461. <a name="ConditionLab+_onChangeFilter"></a>
  462. ### conditionLab.\_onChangeFilter()
  463. Filter input change handler
  464. **Kind**: instance method of [<code>ConditionLab</code>](#ConditionLab)
  465. <a name="ConditionLab+_filterMapByName"></a>
  466. ### conditionLab.\_filterMapByName(map, filter) ⇒
  467. Filter the given map by the name property using the supplied filter value, marking filtered entries as "hidden"
  468. **Kind**: instance method of [<code>ConditionLab</code>](#ConditionLab)
  469. **Returns**: filteredMap
  470. | Param | Type |
  471. | --- | --- |
  472. | map | <code>Array</code> |
  473. | filter | <code>String</code> |
  474. <a name="ConditionLab+_onChangeMapType"></a>
  475. ### conditionLab.\_onChangeMapType(event)
  476. Change Map Type event handler
  477. **Kind**: instance method of [<code>ConditionLab</code>](#ConditionLab)
  478. | Param | Type |
  479. | --- | --- |
  480. | event | <code>\*</code> |
  481. <a name="ConditionLab+_onChangeIconPath"></a>
  482. ### conditionLab.\_onChangeIconPath(event)
  483. Handle icon path change
  484. **Kind**: instance method of [<code>ConditionLab</code>](#ConditionLab)
  485. | Param | Type |
  486. | --- | --- |
  487. | event | <code>\*</code> |
  488. <a name="ConditionLab+_onClickActiveEffectConfig"></a>
  489. ### conditionLab.\_onClickActiveEffectConfig(event)
  490. Handle click Active Effect Config button
  491. **Kind**: instance method of [<code>ConditionLab</code>](#ConditionLab)
  492. | Param | Type |
  493. | --- | --- |
  494. | event | <code>\*</code> |
  495. <a name="ConditionLab+_onChangeReferenceId"></a>
  496. ### conditionLab.\_onChangeReferenceId(event)
  497. Reference Link change handler
  498. **Kind**: instance method of [<code>ConditionLab</code>](#ConditionLab)
  499. | Param | Type |
  500. | --- | --- |
  501. | event | <code>\*</code> |
  502. <a name="ConditionLab+_onOpenTrigglerForm"></a>
  503. ### conditionLab.\_onOpenTrigglerForm(event)
  504. Open Triggler form event handler
  505. **Kind**: instance method of [<code>ConditionLab</code>](#ConditionLab)
  506. | Param | Type |
  507. | --- | --- |
  508. | event | <code>\*</code> |
  509. <a name="ConditionLab+_onAddRow"></a>
  510. ### conditionLab.\_onAddRow(event)
  511. Add Row event handler
  512. **Kind**: instance method of [<code>ConditionLab</code>](#ConditionLab)
  513. | Param | Type |
  514. | --- | --- |
  515. | event | <code>\*</code> |
  516. <a name="ConditionLab+_onRemoveRow"></a>
  517. ### conditionLab.\_onRemoveRow(event)
  518. Handler for remove row event
  519. **Kind**: instance method of [<code>ConditionLab</code>](#ConditionLab)
  520. | Param | Type |
  521. | --- | --- |
  522. | event | <code>\*</code> |
  523. <a name="ConditionLab+_onChangeSortOrder"></a>
  524. ### conditionLab.\_onChangeSortOrder(event)
  525. Handle a change sort order click
  526. **Kind**: instance method of [<code>ConditionLab</code>](#ConditionLab)
  527. | Param | Type |
  528. | --- | --- |
  529. | event | <code>\*</code> |
  530. <a name="ConditionLab+_onClickSortButton"></a>
  531. ### conditionLab.\_onClickSortButton(event)
  532. Sort button handler
  533. **Kind**: instance method of [<code>ConditionLab</code>](#ConditionLab)
  534. | Param | Type |
  535. | --- | --- |
  536. | event | <code>\*</code> |
  537. <a name="ConditionLab+_sortMapByName"></a>
  538. ### conditionLab.\_sortMapByName(map, direction) ⇒ <code>Array</code>
  539. Sorts the given map by the name property
  540. **Kind**: instance method of [<code>ConditionLab</code>](#ConditionLab)
  541. | Param | Type |
  542. | --- | --- |
  543. | map | <code>Array</code> |
  544. | direction | <code>\*</code> |
  545. <a name="ConditionLab+_onRestoreDefaults"></a>
  546. ### conditionLab.\_onRestoreDefaults(event)
  547. **Kind**: instance method of [<code>ConditionLab</code>](#ConditionLab)
  548. | Param | Type |
  549. | --- | --- |
  550. | event | <code>\*</code> |
  551. <a name="ConditionLab+_onResetForm"></a>
  552. ### conditionLab.\_onResetForm(event)
  553. Reset form handler
  554. **Kind**: instance method of [<code>ConditionLab</code>](#ConditionLab)
  555. | Param | Type |
  556. | --- | --- |
  557. | event | <code>\*</code> |
  558. <a name="ConditionLab+_onSaveClose"></a>
  559. ### conditionLab.\_onSaveClose(event)
  560. Save and Close handler
  561. **Kind**: instance method of [<code>ConditionLab</code>](#ConditionLab)
  562. | Param | Type |
  563. | --- | --- |
  564. | event | <code>\*</code> |
  565. <a name="ConditionLab+_onClickMacroConfig"></a>
  566. ### conditionLab.\_onClickMacroConfig(event)
  567. Macro Config button click handler
  568. **Kind**: instance method of [<code>ConditionLab</code>](#ConditionLab)
  569. | Param | Type |
  570. | --- | --- |
  571. | event | <code>\*</code> |
  572. <a name="ConditionLab+_onClickTriggerConfig"></a>
  573. ### conditionLab.\_onClickTriggerConfig(event)
  574. Trigger Config button click handler
  575. **Kind**: instance method of [<code>ConditionLab</code>](#ConditionLab)
  576. | Param | Type |
  577. | --- | --- |
  578. | event | <code>\*</code> |
  579. <a name="ConditionLab+_hasMapChanged"></a>
  580. ### conditionLab.\_hasMapChanged()
  581. Checks the updatedMap property against the initial map
  582. **Kind**: instance method of [<code>ConditionLab</code>](#ConditionLab)
  583. <a name="ConditionLab+_hasPropertyChanged"></a>
  584. ### conditionLab.\_hasPropertyChanged(propertyName, original, comparison) ⇒ <code>Boolean</code>
  585. Checks a given propertyName on an original and comparison object to see if it has changed
  586. **Kind**: instance method of [<code>ConditionLab</code>](#ConditionLab)
  587. | Param | Type |
  588. | --- | --- |
  589. | propertyName | <code>\*</code> |
  590. | original | <code>\*</code> |
  591. | comparison | <code>\*</code> |
  592. <a name="ConditionLab.defaultOptions"></a>
  593. ### ConditionLab.defaultOptions
  594. Get options for the form
  595. **Kind**: static property of [<code>ConditionLab</code>](#ConditionLab)
  596. <a name="ConditionLab._onRender"></a>
  597. ### ConditionLab.\_onRender(app, html, data)
  598. Condition Lab Render handler
  599. **Kind**: static method of [<code>ConditionLab</code>](#ConditionLab)
  600. | Param | Type |
  601. | --- | --- |
  602. | app | <code>\*</code> |
  603. | html | <code>\*</code> |
  604. | data | <code>\*</code> |
  605. <a name="ConditionLab._onRenderDialog"></a>
  606. ### ConditionLab.\_onRenderDialog(app, html, data)
  607. Render dialog hook handler
  608. **Kind**: static method of [<code>ConditionLab</code>](#ConditionLab)
  609. | Param | Type |
  610. | --- | --- |
  611. | app | <code>\*</code> |
  612. | html | <code>jQuery</code> |
  613. | data | <code>\*</code> |
  614. <a name="EnhancedConditionMacroConfig"></a>
  615. ## EnhancedConditionMacroConfig
  616. Enhanced Condition Macro Config Application
  617. **Kind**: global class
  618. * [EnhancedConditionMacroConfig](#EnhancedConditionMacroConfig)
  619. * _instance_
  620. * [.getData()](#EnhancedConditionMacroConfig+getData) ⇒ <code>Object</code>
  621. * [._updateObject(event, formData)](#EnhancedConditionMacroConfig+_updateObject)
  622. * _static_
  623. * [.defaultOptions](#EnhancedConditionMacroConfig.defaultOptions)
  624. <a name="EnhancedConditionMacroConfig+getData"></a>
  625. ### enhancedConditionMacroConfig.getData() ⇒ <code>Object</code>
  626. Gets data for template rendering
  627. **Kind**: instance method of [<code>EnhancedConditionMacroConfig</code>](#EnhancedConditionMacroConfig)
  628. **Returns**: <code>Object</code> - data
  629. <a name="EnhancedConditionMacroConfig+_updateObject"></a>
  630. ### enhancedConditionMacroConfig.\_updateObject(event, formData)
  631. Update Object on Form Submission
  632. **Kind**: instance method of [<code>EnhancedConditionMacroConfig</code>](#EnhancedConditionMacroConfig)
  633. | Param | Type |
  634. | --- | --- |
  635. | event | <code>\*</code> |
  636. | formData | <code>\*</code> |
  637. <a name="EnhancedConditionMacroConfig.defaultOptions"></a>
  638. ### EnhancedConditionMacroConfig.defaultOptions
  639. defaultOptions
  640. **Kind**: static property of [<code>EnhancedConditionMacroConfig</code>](#EnhancedConditionMacroConfig)
  641. <a name="EnhancedConditionTriggerConfig"></a>
  642. ## EnhancedConditionTriggerConfig
  643. Enhanced Condition Trigger Config Application
  644. **Kind**: global class
  645. * [EnhancedConditionTriggerConfig](#EnhancedConditionTriggerConfig)
  646. * _instance_
  647. * [.getData()](#EnhancedConditionTriggerConfig+getData) ⇒ <code>Object</code>
  648. * [._updateObject(event, formData)](#EnhancedConditionTriggerConfig+_updateObject)
  649. * _static_
  650. * [.defaultOptions](#EnhancedConditionTriggerConfig.defaultOptions)
  651. <a name="EnhancedConditionTriggerConfig+getData"></a>
  652. ### enhancedConditionTriggerConfig.getData() ⇒ <code>Object</code>
  653. Gets data for template rendering
  654. **Kind**: instance method of [<code>EnhancedConditionTriggerConfig</code>](#EnhancedConditionTriggerConfig)
  655. **Returns**: <code>Object</code> - data
  656. <a name="EnhancedConditionTriggerConfig+_updateObject"></a>
  657. ### enhancedConditionTriggerConfig.\_updateObject(event, formData)
  658. Update Object on Form Submission
  659. **Kind**: instance method of [<code>EnhancedConditionTriggerConfig</code>](#EnhancedConditionTriggerConfig)
  660. | Param | Type |
  661. | --- | --- |
  662. | event | <code>\*</code> |
  663. | formData | <code>\*</code> |
  664. <a name="EnhancedConditionTriggerConfig.defaultOptions"></a>
  665. ### EnhancedConditionTriggerConfig.defaultOptions
  666. defaultOptions
  667. **Kind**: static property of [<code>EnhancedConditionTriggerConfig</code>](#EnhancedConditionTriggerConfig)
  668. <a name="EnhancedConditions"></a>
  669. ## EnhancedConditions
  670. Builds a mapping between status icons and journal entries that represent conditions
  671. **Kind**: global class
  672. * [EnhancedConditions](#EnhancedConditions)
  673. * [._onReady()](#EnhancedConditions._onReady)
  674. * [._onPreUpdateToken(scene, update, options, userId)](#EnhancedConditions._onPreUpdateToken)
  675. * [._onUpdateToken()](#EnhancedConditions._onUpdateToken)
  676. * [._onCreateActiveEffect(actor, update, options, userId)](#EnhancedConditions._onCreateActiveEffect)
  677. * [._onDeleteActiveEffect(actor, update, options, userId)](#EnhancedConditions._onDeleteActiveEffect)
  678. * [._onUpdateCombat(combat, update, options, userId)](#EnhancedConditions._onUpdateCombat)
  679. * [._onRenderChatMessage(app, html, data)](#EnhancedConditions._onRenderChatMessage)
  680. * [._onRenderChatLog(app, html, data)](#EnhancedConditions._onRenderChatLog)
  681. * [._onRenderCombatTracker(app, html, data)](#EnhancedConditions._onRenderCombatTracker)
  682. * [._processActiveEffectChange(effect, type)](#EnhancedConditions._processActiveEffectChange)
  683. * [.lookupEntryMapping(effectIds, [map])](#EnhancedConditions.lookupEntryMapping)
  684. * [.outputChatMessage()](#EnhancedConditions.outputChatMessage)
  685. * [._toggleDefeated(entities)](#EnhancedConditions._toggleDefeated)
  686. * [._removeOtherConditions(entity, conditionId)](#EnhancedConditions._removeOtherConditions)
  687. * [._migrateConditionIds(conditionMap)](#EnhancedConditions._migrateConditionIds)
  688. * [._processMacros(macroIds, entity)](#EnhancedConditions._processMacros)
  689. * [.updateConditionTimestamps()](#EnhancedConditions.updateConditionTimestamps)
  690. * [._createLabButton(html)](#EnhancedConditions._createLabButton)
  691. * [._toggleLabButtonVisibility(display)](#EnhancedConditions._toggleLabButtonVisibility)
  692. * [._loadDefaultMaps()](#EnhancedConditions._loadDefaultMaps)
  693. * [._prepareMap(conditionMap)](#EnhancedConditions._prepareMap)
  694. * [._backupCoreEffects()](#EnhancedConditions._backupCoreEffects)
  695. * [._createJournalEntry(condition)](#EnhancedConditions._createJournalEntry)
  696. * [._lookupConditionByName(conditionName, map)](#EnhancedConditions._lookupConditionByName)
  697. * [._updateStatusEffects(conditionMap)](#EnhancedConditions._updateStatusEffects)
  698. * [._prepareStatusEffects(conditionMap)](#EnhancedConditions._prepareStatusEffects) ⇒ <code>Array</code>
  699. * [._prepareActiveEffects(effects)](#EnhancedConditions._prepareActiveEffects)
  700. * [.getConditionIcons()](#EnhancedConditions.getConditionIcons)
  701. * [.getIconsByCondition(condition)](#EnhancedConditions.getIconsByCondition)
  702. * [.getConditionsByIcon(icon)](#EnhancedConditions.getConditionsByIcon)
  703. * [.mapFromJson(json)](#EnhancedConditions.mapFromJson)
  704. * [.getDefaultMap(system)](#EnhancedConditions.getDefaultMap)
  705. * [.buildDefaultMap(system)](#EnhancedConditions.buildDefaultMap)
  706. * [._preventativeSaveReminder()](#EnhancedConditions._preventativeSaveReminder)
  707. * ~~[.applyCondition(...params)](#EnhancedConditions.applyCondition)~~
  708. * [.addCondition(conditionName, [entities])](#EnhancedConditions.addCondition)
  709. * [.getCondition(conditionName, map)](#EnhancedConditions.getCondition)
  710. * [.getConditions(entities)](#EnhancedConditions.getConditions) ⇒ <code>Array</code>
  711. * [.getActiveEffect(condition)](#EnhancedConditions.getActiveEffect)
  712. * [.getConditionEffects(entities, map, warn)](#EnhancedConditions.getConditionEffects) ⇒ <code>Map</code> \| <code>Object</code>
  713. * [.hasCondition(conditionName, entities, [options])](#EnhancedConditions.hasCondition) ⇒ <code>Boolean</code>
  714. * [.removeCondition(entities, conditionName, options)](#EnhancedConditions.removeCondition)
  715. * [.removeAllConditions(entities)](#EnhancedConditions.removeAllConditions)
  716. <a name="EnhancedConditions._onReady"></a>
  717. ### EnhancedConditions.\_onReady()
  718. Ready Hook handler
  719. Steps:
  720. 1. Get default maps
  721. 2. Get mapType
  722. 3. Get Condition Map
  723. 4. Override status effects
  724. **Kind**: static method of [<code>EnhancedConditions</code>](#EnhancedConditions)
  725. <a name="EnhancedConditions._onPreUpdateToken"></a>
  726. ### EnhancedConditions.\_onPreUpdateToken(scene, update, options, userId)
  727. Handle PreUpdate Token Hook.
  728. If the update includes effect data, add an `option` for the update hook handler to look for
  729. **Kind**: static method of [<code>EnhancedConditions</code>](#EnhancedConditions)
  730. | Param | Type |
  731. | --- | --- |
  732. | scene | <code>\*</code> |
  733. | update | <code>\*</code> |
  734. | options | <code>\*</code> |
  735. | userId | <code>\*</code> |
  736. <a name="EnhancedConditions._onUpdateToken"></a>
  737. ### EnhancedConditions.\_onUpdateToken()
  738. Hooks on token updates. If the update includes effects, calls the journal entry lookup
  739. **Kind**: static method of [<code>EnhancedConditions</code>](#EnhancedConditions)
  740. <a name="EnhancedConditions._onCreateActiveEffect"></a>
  741. ### EnhancedConditions.\_onCreateActiveEffect(actor, update, options, userId)
  742. Create Active Effect handler
  743. **Kind**: static method of [<code>EnhancedConditions</code>](#EnhancedConditions)
  744. | Param | Type |
  745. | --- | --- |
  746. | actor | <code>\*</code> |
  747. | update | <code>\*</code> |
  748. | options | <code>\*</code> |
  749. | userId | <code>\*</code> |
  750. <a name="EnhancedConditions._onDeleteActiveEffect"></a>
  751. ### EnhancedConditions.\_onDeleteActiveEffect(actor, update, options, userId)
  752. Create Active Effect handler
  753. **Kind**: static method of [<code>EnhancedConditions</code>](#EnhancedConditions)
  754. | Param | Type |
  755. | --- | --- |
  756. | actor | <code>\*</code> |
  757. | update | <code>\*</code> |
  758. | options | <code>\*</code> |
  759. | userId | <code>\*</code> |
  760. <a name="EnhancedConditions._onUpdateCombat"></a>
  761. ### EnhancedConditions.\_onUpdateCombat(combat, update, options, userId)
  762. Update Combat Handler
  763. **Kind**: static method of [<code>EnhancedConditions</code>](#EnhancedConditions)
  764. | Param | Type |
  765. | --- | --- |
  766. | combat | <code>\*</code> |
  767. | update | <code>\*</code> |
  768. | options | <code>\*</code> |
  769. | userId | <code>\*</code> |
  770. <a name="EnhancedConditions._onRenderChatMessage"></a>
  771. ### EnhancedConditions.\_onRenderChatMessage(app, html, data)
  772. Render Chat Message handler
  773. **Kind**: static method of [<code>EnhancedConditions</code>](#EnhancedConditions)
  774. **Todo**
  775. - [ ] move to chatlog render?
  776. | Param | Type |
  777. | --- | --- |
  778. | app | <code>\*</code> |
  779. | html | <code>\*</code> |
  780. | data | <code>\*</code> |
  781. <a name="EnhancedConditions._onRenderChatLog"></a>
  782. ### EnhancedConditions.\_onRenderChatLog(app, html, data)
  783. ChatLog render hook
  784. **Kind**: static method of [<code>EnhancedConditions</code>](#EnhancedConditions)
  785. | Param | Type |
  786. | --- | --- |
  787. | app | <code>\*</code> |
  788. | html | <code>\*</code> |
  789. | data | <code>\*</code> |
  790. <a name="EnhancedConditions._onRenderCombatTracker"></a>
  791. ### EnhancedConditions.\_onRenderCombatTracker(app, html, data)
  792. **Kind**: static method of [<code>EnhancedConditions</code>](#EnhancedConditions)
  793. | Param | Type |
  794. | --- | --- |
  795. | app | <code>\*</code> |
  796. | html | <code>\*</code> |
  797. | data | <code>\*</code> |
  798. <a name="EnhancedConditions._processActiveEffectChange"></a>
  799. ### EnhancedConditions.\_processActiveEffectChange(effect, type)
  800. Process the addition/removal of an Active Effect
  801. **Kind**: static method of [<code>EnhancedConditions</code>](#EnhancedConditions)
  802. | Param | Type | Default | Description |
  803. | --- | --- | --- | --- |
  804. | effect | <code>ActiveEffect</code> | | the effect |
  805. | type | <code>String</code> | <code>create</code> | the type of change to process |
  806. <a name="EnhancedConditions.lookupEntryMapping"></a>
  807. ### EnhancedConditions.lookupEntryMapping(effectIds, [map])
  808. Checks statusEffect icons against map and returns matching condition mappings
  809. **Kind**: static method of [<code>EnhancedConditions</code>](#EnhancedConditions)
  810. | Param | Type | Default | Description |
  811. | --- | --- | --- | --- |
  812. | effectIds | <code>Array</code> \| <code>String</code> | | A list of effectIds, or a single effectId to check |
  813. | [map] | <code>Array</code> | <code>[]</code> | the condition map to look in |
  814. <a name="EnhancedConditions.outputChatMessage"></a>
  815. ### EnhancedConditions.outputChatMessage()
  816. Output one or more condition entries to chat
  817. **Kind**: static method of [<code>EnhancedConditions</code>](#EnhancedConditions)
  818. **Todo**
  819. - [ ] refactor to use actor or token
  820. <a name="EnhancedConditions._toggleDefeated"></a>
  821. ### EnhancedConditions.\_toggleDefeated(entities)
  822. Marks a Combatants for a particular entity as defeated
  823. **Kind**: static method of [<code>EnhancedConditions</code>](#EnhancedConditions)
  824. | Param | Type | Description |
  825. | --- | --- | --- |
  826. | entities | <code>Actor</code> \| <code>Token</code> | the entity to mark defeated |
  827. | options.markDefeated | <code>Boolean</code> | an optional state flag (default=true) |
  828. <a name="EnhancedConditions._removeOtherConditions"></a>
  829. ### EnhancedConditions.\_removeOtherConditions(entity, conditionId)
  830. For a given entity, removes conditions other than the one supplied
  831. **Kind**: static method of [<code>EnhancedConditions</code>](#EnhancedConditions)
  832. | Param | Type |
  833. | --- | --- |
  834. | entity | <code>\*</code> |
  835. | conditionId | <code>\*</code> |
  836. <a name="EnhancedConditions._migrateConditionIds"></a>
  837. ### EnhancedConditions.\_migrateConditionIds(conditionMap)
  838. Migrates Condition Ids to be truly unique-ish
  839. **Kind**: static method of [<code>EnhancedConditions</code>](#EnhancedConditions)
  840. | Param | Type |
  841. | --- | --- |
  842. | conditionMap | <code>\*</code> |
  843. <a name="EnhancedConditions._processMacros"></a>
  844. ### EnhancedConditions.\_processMacros(macroIds, entity)
  845. Process macros based on given Ids
  846. **Kind**: static method of [<code>EnhancedConditions</code>](#EnhancedConditions)
  847. | Param | Type | Default |
  848. | --- | --- | --- |
  849. | macroIds | <code>\*</code> | |
  850. | entity | <code>\*</code> | <code></code> |
  851. <a name="EnhancedConditions.updateConditionTimestamps"></a>
  852. ### EnhancedConditions.updateConditionTimestamps()
  853. Update condition added/removed timestamps
  854. **Kind**: static method of [<code>EnhancedConditions</code>](#EnhancedConditions)
  855. <a name="EnhancedConditions._createLabButton"></a>
  856. ### EnhancedConditions.\_createLabButton(html)
  857. Creates a button for the Condition Lab
  858. **Kind**: static method of [<code>EnhancedConditions</code>](#EnhancedConditions)
  859. | Param | Type | Description |
  860. | --- | --- | --- |
  861. | html | <code>Object</code> | the html element where the button will be created |
  862. <a name="EnhancedConditions._toggleLabButtonVisibility"></a>
  863. ### EnhancedConditions.\_toggleLabButtonVisibility(display)
  864. Determines whether to display the combat utility belt div in the settings sidebar
  865. **Kind**: static method of [<code>EnhancedConditions</code>](#EnhancedConditions)
  866. **Todo:**: extract to helper in sidekick class?
  867. | Param | Type |
  868. | --- | --- |
  869. | display | <code>Boolean</code> |
  870. <a name="EnhancedConditions._loadDefaultMaps"></a>
  871. ### EnhancedConditions.\_loadDefaultMaps()
  872. Returns the default maps supplied with the module
  873. **Kind**: static method of [<code>EnhancedConditions</code>](#EnhancedConditions)
  874. **Todo:**: map to entryId and then rebuild on import
  875. <a name="EnhancedConditions._prepareMap"></a>
  876. ### EnhancedConditions.\_prepareMap(conditionMap)
  877. Parse the provided Condition Map and prepare it for storage, validating and correcting bad or missing data where possible
  878. **Kind**: static method of [<code>EnhancedConditions</code>](#EnhancedConditions)
  879. | Param | Type |
  880. | --- | --- |
  881. | conditionMap | <code>\*</code> |
  882. <a name="EnhancedConditions._backupCoreEffects"></a>
  883. ### EnhancedConditions.\_backupCoreEffects()
  884. Duplicate the core status icons, freeze the duplicate then store a copy in settings
  885. **Kind**: static method of [<code>EnhancedConditions</code>](#EnhancedConditions)
  886. <a name="EnhancedConditions._createJournalEntry"></a>
  887. ### EnhancedConditions.\_createJournalEntry(condition)
  888. Creates journal entries for any conditions that don't have one
  889. **Kind**: static method of [<code>EnhancedConditions</code>](#EnhancedConditions)
  890. | Param | Type | Description |
  891. | --- | --- | --- |
  892. | condition | <code>String</code> | the condition being evaluated |
  893. <a name="EnhancedConditions._lookupConditionByName"></a>
  894. ### EnhancedConditions.\_lookupConditionByName(conditionName, map)
  895. Gets one or more conditions from the map by their name
  896. **Kind**: static method of [<code>EnhancedConditions</code>](#EnhancedConditions)
  897. | Param | Type | Default | Description |
  898. | --- | --- | --- | --- |
  899. | conditionName | <code>String</code> | | the condition to get |
  900. | map | <code>Array</code> | <code></code> | the condition map to search |
  901. <a name="EnhancedConditions._updateStatusEffects"></a>
  902. ### EnhancedConditions.\_updateStatusEffects(conditionMap)
  903. Updates the CONFIG.statusEffect effects with Condition Map ones
  904. **Kind**: static method of [<code>EnhancedConditions</code>](#EnhancedConditions)
  905. | Param | Type |
  906. | --- | --- |
  907. | conditionMap | <code>\*</code> |
  908. <a name="EnhancedConditions._prepareStatusEffects"></a>
  909. ### EnhancedConditions.\_prepareStatusEffects(conditionMap) ⇒ <code>Array</code>
  910. Converts the given Condition Map (one or more Conditions) into a Status Effects array or object
  911. **Kind**: static method of [<code>EnhancedConditions</code>](#EnhancedConditions)
  912. **Returns**: <code>Array</code> - statusEffects
  913. | Param | Type |
  914. | --- | --- |
  915. | conditionMap | <code>Array</code> \| <code>Object</code> |
  916. <a name="EnhancedConditions._prepareActiveEffects"></a>
  917. ### EnhancedConditions.\_prepareActiveEffects(effects)
  918. Prepares one or more ActiveEffects from Conditions for placement on an actor
  919. **Kind**: static method of [<code>EnhancedConditions</code>](#EnhancedConditions)
  920. | Param | Type | Description |
  921. | --- | --- | --- |
  922. | effects | <code>Object</code> \| <code>Array</code> | a single ActiveEffect data object or an array of ActiveEffect data objects |
  923. <a name="EnhancedConditions.getConditionIcons"></a>
  924. ### EnhancedConditions.getConditionIcons()
  925. Returns just the icon side of the map
  926. **Kind**: static method of [<code>EnhancedConditions</code>](#EnhancedConditions)
  927. <a name="EnhancedConditions.getIconsByCondition"></a>
  928. ### EnhancedConditions.getIconsByCondition(condition)
  929. Retrieves a condition icon by its mapped name
  930. **Kind**: static method of [<code>EnhancedConditions</code>](#EnhancedConditions)
  931. | Param | Type |
  932. | --- | --- |
  933. | condition | <code>\*</code> |
  934. <a name="EnhancedConditions.getConditionsByIcon"></a>
  935. ### EnhancedConditions.getConditionsByIcon(icon)
  936. Retrieves a condition name by its mapped icon
  937. **Kind**: static method of [<code>EnhancedConditions</code>](#EnhancedConditions)
  938. | Param | Type |
  939. | --- | --- |
  940. | icon | <code>\*</code> |
  941. <a name="EnhancedConditions.mapFromJson"></a>
  942. ### EnhancedConditions.mapFromJson(json)
  943. Parses a condition map JSON and returns a map
  944. **Kind**: static method of [<code>EnhancedConditions</code>](#EnhancedConditions)
  945. | Param | Type |
  946. | --- | --- |
  947. | json | <code>\*</code> |
  948. <a name="EnhancedConditions.getDefaultMap"></a>
  949. ### EnhancedConditions.getDefaultMap(system)
  950. Returns the default condition map for a given system
  951. **Kind**: static method of [<code>EnhancedConditions</code>](#EnhancedConditions)
  952. | Param | Type |
  953. | --- | --- |
  954. | system | <code>\*</code> |
  955. <a name="EnhancedConditions.buildDefaultMap"></a>
  956. ### EnhancedConditions.buildDefaultMap(system)
  957. Builds a default map for a given system
  958. **Kind**: static method of [<code>EnhancedConditions</code>](#EnhancedConditions)
  959. **Todo**
  960. - [ ] #281 update for active effects
  961. | Param | Type |
  962. | --- | --- |
  963. | system | <code>\*</code> |
  964. <a name="EnhancedConditions._preventativeSaveReminder"></a>
  965. ### EnhancedConditions.\_preventativeSaveReminder()
  966. Create a dialog reminding users to Save the Condition Lab as a preventation for issues arising from the transition to Active Effects
  967. **Kind**: static method of [<code>EnhancedConditions</code>](#EnhancedConditions)
  968. <a name="EnhancedConditions.applyCondition"></a>
  969. ### ~~EnhancedConditions.applyCondition(...params)~~
  970. ***Deprecated***
  971. Apply the named condition to the provided entities (Actors or Tokens)
  972. **Kind**: static method of [<code>EnhancedConditions</code>](#EnhancedConditions)
  973. **See**: EnhancedConditions#addCondition
  974. | Param | Type |
  975. | --- | --- |
  976. | ...params | <code>any</code> |
  977. <a name="EnhancedConditions.addCondition"></a>
  978. ### EnhancedConditions.addCondition(conditionName, [entities])
  979. Applies the named condition to the provided entities (Actors or Tokens)
  980. **Kind**: static method of [<code>EnhancedConditions</code>](#EnhancedConditions)
  981. | Param | Type | Default | Description |
  982. | --- | --- | --- | --- |
  983. | conditionName | <code>Array.&lt;String&gt;</code> \| <code>String</code> | | the name of the condition to add |
  984. | [entities] | <code>Array.&lt;Actor&gt;</code> \| <code>Array.&lt;Token&gt;</code> \| <code>Actor</code> \| <code>Token</code> | <code></code> | one or more Actors or Tokens to apply the Condition to |
  985. | [options.warn] | <code>Boolean</code> | <code>true</code> | raise warnings on errors |
  986. | [options.allowDuplicates] | <code>Boolean</code> | <code>false</code> | 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 |
  987. | [options.replaceExisting] | <code>Boolean</code> | <code>false</code> | 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` |
  988. **Example**
  989. ```js
  990. // Add the Condition "Blinded" to an Actor named "Bob". Duplicates will not be created.
  991. game.cub.addCondition("Blinded", game.actors.getName("Bob"));
  992. ```
  993. **Example**
  994. ```js
  995. // Add the Condition "Charmed" to the currently controlled Token/s. Duplicates will not be created.
  996. game.cub.addCondition("Charmed");
  997. ```
  998. **Example**
  999. ```js
  1000. // Add the Conditions "Blinded" and "Charmed" to the targeted Token/s and create duplicates, replacing any existing Conditions of the same names.
  1001. game.cub.addCondition(["Blinded", "Charmed"], [...game.user.targets], {allowDuplicates: true, replaceExisting: true});
  1002. ```
  1003. <a name="EnhancedConditions.getCondition"></a>
  1004. ### EnhancedConditions.getCondition(conditionName, map)
  1005. Gets a condition by name from the Condition Map
  1006. **Kind**: static method of [<code>EnhancedConditions</code>](#EnhancedConditions)
  1007. | Param | Type | Default |
  1008. | --- | --- | --- |
  1009. | conditionName | <code>\*</code> | |
  1010. | map | <code>\*</code> | <code></code> |
  1011. | options.warn | <code>\*</code> | |
  1012. <a name="EnhancedConditions.getConditions"></a>
  1013. ### EnhancedConditions.getConditions(entities) ⇒ <code>Array</code>
  1014. Retrieves all active conditions for one or more given entities (Actors or Tokens)
  1015. **Kind**: static method of [<code>EnhancedConditions</code>](#EnhancedConditions)
  1016. **Returns**: <code>Array</code> - entityConditionMap a mapping of conditions for each provided entity
  1017. | Param | Type | Default | Description |
  1018. | --- | --- | --- | --- |
  1019. | entities | <code>Actor</code> \| <code>Token</code> | <code></code> | one or more Actors or Tokens to get Conditions from |
  1020. | options.warn | <code>Boolean</code> | | output notifications |
  1021. **Example**
  1022. ```js
  1023. // Get conditions for an Actor named "Bob"
  1024. game.cub.getConditions(game.actors.getName("Bob"));
  1025. ```
  1026. **Example**
  1027. ```js
  1028. // Get conditions for the currently controlled Token
  1029. game.cub.getConditions();
  1030. ```
  1031. <a name="EnhancedConditions.getActiveEffect"></a>
  1032. ### EnhancedConditions.getActiveEffect(condition)
  1033. Gets the Active Effect data (if any) for the given condition
  1034. **Kind**: static method of [<code>EnhancedConditions</code>](#EnhancedConditions)
  1035. | Param | Type |
  1036. | --- | --- |
  1037. | condition | <code>\*</code> |
  1038. <a name="EnhancedConditions.getConditionEffects"></a>
  1039. ### EnhancedConditions.getConditionEffects(entities, map, warn) ⇒ <code>Map</code> \| <code>Object</code>
  1040. Gets any Active Effect instances present on the entities (Actor/s or Token/s) that are mapped Conditions
  1041. **Kind**: static method of [<code>EnhancedConditions</code>](#EnhancedConditions)
  1042. **Returns**: <code>Map</code> \| <code>Object</code> - A Map containing the Actor Id and the Condition Active Effect instances if any
  1043. | Param | Type | Default | Description |
  1044. | --- | --- | --- | --- |
  1045. | entities | <code>String</code> | | the entities to check |
  1046. | map | <code>Array</code> | <code></code> | the Condition map to check (optional) |
  1047. | warn | <code>Boolean</code> | | output notifications |
  1048. <a name="EnhancedConditions.hasCondition"></a>
  1049. ### EnhancedConditions.hasCondition(conditionName, entities, [options]) ⇒ <code>Boolean</code>
  1050. Checks if the provided Entity (Actor or Token) has the given condition
  1051. **Kind**: static method of [<code>EnhancedConditions</code>](#EnhancedConditions)
  1052. **Returns**: <code>Boolean</code> - hasCondition Returns true if one or more of the provided entities has one or more of the provided conditions
  1053. | Param | Type | Default | Description |
  1054. | --- | --- | --- | --- |
  1055. | conditionName | <code>String</code> \| <code>Array</code> | | the name/s of the condition or conditions to check for |
  1056. | entities | <code>Actor</code> \| <code>Token</code> \| <code>Array</code> | <code></code> | the entity or entities to check (Actor/s or Token/s) |
  1057. | [options] | <code>Object</code> | | options object |
  1058. | [options.warn] | <code>Boolean</code> | | whether or not to output notifications |
  1059. **Example**
  1060. ```js
  1061. // Check for the "Blinded" condition on Actor "Bob"
  1062. game.cub.hasCondition("Blinded", game.actors.getName("Bob"));
  1063. ```
  1064. **Example**
  1065. ```js
  1066. // Check for the "Charmed" and "Deafened" conditions on the controlled tokens
  1067. game.cub.hasCondition(["Charmed", "Deafened"]);
  1068. ```
  1069. <a name="EnhancedConditions.removeCondition"></a>
  1070. ### EnhancedConditions.removeCondition(entities, conditionName, options)
  1071. Removes one or more named conditions from an Entity (Actor/Token)
  1072. **Kind**: static method of [<code>EnhancedConditions</code>](#EnhancedConditions)
  1073. | Param | Type | Default | Description |
  1074. | --- | --- | --- | --- |
  1075. | entities | <code>Actor</code> \| <code>Token</code> | <code></code> | One or more Actors or Tokens |
  1076. | conditionName | <code>String</code> | | the name of the Condition to remove |
  1077. | options | <code>Object</code> | | options for removal |
  1078. | options.warn | <code>Boolean</code> | | whether or not to raise warnings on errors |
  1079. **Example**
  1080. ```js
  1081. // Remove Condition named "Blinded" from an Actor named Bob
  1082. game.cub.removeCondition("Blinded", game.actors.getName("Bob"));
  1083. ```
  1084. **Example**
  1085. ```js
  1086. // Remove Condition named "Charmed" from the currently controlled Token, but don't show any warnings if it fails.
  1087. game.cub.removeCondition("Charmed", {warn=false});
  1088. ```
  1089. <a name="EnhancedConditions.removeAllConditions"></a>
  1090. ### EnhancedConditions.removeAllConditions(entities)
  1091. Removes all conditions from the provided entities
  1092. **Kind**: static method of [<code>EnhancedConditions</code>](#EnhancedConditions)
  1093. | Param | Type | Default | Description |
  1094. | --- | --- | --- | --- |
  1095. | entities | <code>Actors</code> \| <code>Tokens</code> | <code></code> | One or more Actors or Tokens to remove Conditions from |
  1096. | options.warn | <code>Boolean</code> | | output notifications |
  1097. **Example**
  1098. ```js
  1099. // Remove all Conditions on an Actor named Bob
  1100. game.cub.removeAllConditions(game.actors.getName("Bob"));
  1101. ```
  1102. **Example**
  1103. ```js
  1104. // Remove all Conditions on the currently controlled Token
  1105. game.cub.removeAllConditions();
  1106. ```
  1107. <a name="PanSelect"></a>
  1108. ## PanSelect
  1109. Pan/Select Gadget
  1110. **Kind**: global class
  1111. * [PanSelect](#PanSelect)
  1112. * [._onPreUpdateCombat(combat, update, options, userId)](#PanSelect._onPreUpdateCombat)
  1113. * [._onUpdateCombat(combat, update, options, userId)](#PanSelect._onUpdateCombat)
  1114. * [._updateHandler(combatant)](#PanSelect._updateHandler)
  1115. * [._checkPlayerPan(token)](#PanSelect._checkPlayerPan)
  1116. * [._checkGMPan(token)](#PanSelect._checkGMPan)
  1117. * [._panToToken(token)](#PanSelect._panToToken)
  1118. * [._checkGMSelect(token)](#PanSelect._checkGMSelect)
  1119. * [._checkPlayerSelect(token)](#PanSelect._checkPlayerSelect)
  1120. * [._checkObserverDeselect(token)](#PanSelect._checkObserverDeselect)
  1121. <a name="PanSelect._onPreUpdateCombat"></a>
  1122. ### PanSelect.\_onPreUpdateCombat(combat, update, options, userId)
  1123. Pre-update Combat handler
  1124. **Kind**: static method of [<code>PanSelect</code>](#PanSelect)
  1125. | Param | Type |
  1126. | --- | --- |
  1127. | combat | <code>\*</code> |
  1128. | update | <code>\*</code> |
  1129. | options | <code>\*</code> |
  1130. | userId | <code>\*</code> |
  1131. <a name="PanSelect._onUpdateCombat"></a>
  1132. ### PanSelect.\_onUpdateCombat(combat, update, options, userId)
  1133. Update Combat handler
  1134. **Kind**: static method of [<code>PanSelect</code>](#PanSelect)
  1135. | Param | Type |
  1136. | --- | --- |
  1137. | combat | <code>\*</code> |
  1138. | update | <code>\*</code> |
  1139. | options | <code>\*</code> |
  1140. | userId | <code>\*</code> |
  1141. <a name="PanSelect._updateHandler"></a>
  1142. ### PanSelect.\_updateHandler(combatant)
  1143. Determines if a pan/select workflow should begin
  1144. **Kind**: static method of [<code>PanSelect</code>](#PanSelect)
  1145. | Param | Type |
  1146. | --- | --- |
  1147. | combatant | <code>Combatant</code> |
  1148. <a name="PanSelect._checkPlayerPan"></a>
  1149. ### PanSelect.\_checkPlayerPan(token)
  1150. Determine if the player should be panned
  1151. **Kind**: static method of [<code>PanSelect</code>](#PanSelect)
  1152. | Param | Type |
  1153. | --- | --- |
  1154. | token | <code>\*</code> |
  1155. <a name="PanSelect._checkGMPan"></a>
  1156. ### PanSelect.\_checkGMPan(token)
  1157. Determine if the GM should be panned
  1158. **Kind**: static method of [<code>PanSelect</code>](#PanSelect)
  1159. | Param | Type |
  1160. | --- | --- |
  1161. | token | <code>\*</code> |
  1162. <a name="PanSelect._panToToken"></a>
  1163. ### PanSelect.\_panToToken(token)
  1164. Pans user to the token
  1165. **Kind**: static method of [<code>PanSelect</code>](#PanSelect)
  1166. | Param | Type |
  1167. | --- | --- |
  1168. | token | <code>\*</code> |
  1169. <a name="PanSelect._checkGMSelect"></a>
  1170. ### PanSelect.\_checkGMSelect(token)
  1171. Determine if the current combatant token should be selected for the GM
  1172. **Kind**: static method of [<code>PanSelect</code>](#PanSelect)
  1173. | Param | Type |
  1174. | --- | --- |
  1175. | token | <code>\*</code> |
  1176. <a name="PanSelect._checkPlayerSelect"></a>
  1177. ### PanSelect.\_checkPlayerSelect(token)
  1178. Determines if Player can select the current combatant token
  1179. **Kind**: static method of [<code>PanSelect</code>](#PanSelect)
  1180. | Param | Type |
  1181. | --- | --- |
  1182. | token | <code>\*</code> |
  1183. <a name="PanSelect._checkObserverDeselect"></a>
  1184. ### PanSelect.\_checkObserverDeselect(token)
  1185. Determines if tokens should be deselected when a non-owned Combatant has a turn
  1186. **Kind**: static method of [<code>PanSelect</code>](#PanSelect)
  1187. | Param | Type |
  1188. | --- | --- |
  1189. | token | <code>\*</code> |
  1190. <a name="RerollInitiative"></a>
  1191. ## RerollInitiative
  1192. Rerolls initiative for all combatants
  1193. **Kind**: global class
  1194. * [RerollInitiative](#RerollInitiative)
  1195. * [._onPreUpdateCombat(combat, update, options)](#RerollInitiative._onPreUpdateCombat)
  1196. * [._onUpdateCombat(combat, update, options, userId)](#RerollInitiative._onUpdateCombat)
  1197. <a name="RerollInitiative._onPreUpdateCombat"></a>
  1198. ### RerollInitiative.\_onPreUpdateCombat(combat, update, options)
  1199. **Kind**: static method of [<code>RerollInitiative</code>](#RerollInitiative)
  1200. | Param | Type |
  1201. | --- | --- |
  1202. | combat | <code>\*</code> |
  1203. | update | <code>\*</code> |
  1204. | options | <code>\*</code> |
  1205. <a name="RerollInitiative._onUpdateCombat"></a>
  1206. ### RerollInitiative.\_onUpdateCombat(combat, update, options, userId)
  1207. Update Combat handler
  1208. **Kind**: static method of [<code>RerollInitiative</code>](#RerollInitiative)
  1209. | Param | Type |
  1210. | --- | --- |
  1211. | combat | <code>\*</code> |
  1212. | update | <code>\*</code> |
  1213. | options | <code>\*</code> |
  1214. | userId | <code>\*</code> |
  1215. <a name="Sidekick"></a>
  1216. ## Sidekick
  1217. Provides helper methods for use elsewhere in the module (and has your back in a melee)
  1218. **Kind**: global class
  1219. * [Sidekick](#Sidekick)
  1220. * [.createCUBDiv(html)](#Sidekick.createCUBDiv)
  1221. * [.getSetting(key)](#Sidekick.getSetting) ⇒ <code>Object</code>
  1222. * [.getAllSettings()](#Sidekick.getAllSettings) ⇒ <code>Array</code>
  1223. * [.setSetting(key, value, awaitResult)](#Sidekick.setSetting) ⇒ <code>Promise</code> \| <code>ClientSetting</code>
  1224. * [.registerSetting(key, metadata)](#Sidekick.registerSetting) ⇒ <code>ClientSettings.register</code>
  1225. * [.registerMenu(key, metadata)](#Sidekick.registerMenu) ⇒ <code>ClientSettings.registerMenu</code>
  1226. * [.registerAllSettings(settingsData)](#Sidekick.registerAllSettings) ⇒ <code>Array</code>
  1227. * [.getSystemChoices()](#Sidekick.getSystemChoices)
  1228. * [.fetchJsons(source, path)](#Sidekick.fetchJsons)
  1229. * [.fetchJson(file)](#Sidekick.fetchJson) ⇒
  1230. * [.validateObject(object)](#Sidekick.validateObject) ⇒ <code>Boolean</code>
  1231. * [.convertMapToArray(map)](#Sidekick.convertMapToArray)
  1232. * [.getKeyByValue(object, value)](#Sidekick.getKeyByValue)
  1233. * [.getInverseMap()](#Sidekick.getInverseMap)
  1234. * [.handlebarsHelpers()](#Sidekick.handlebarsHelpers)
  1235. * [.jQueryHelpers()](#Sidekick.jQueryHelpers)
  1236. * [.getTerms(arr)](#Sidekick.getTerms)
  1237. * [.escapeRegExp(string)](#Sidekick.escapeRegExp) ⇒ <code>String</code>
  1238. * [.coerceType(target, type)](#Sidekick.coerceType) ⇒ <code>\*</code>
  1239. * [.buildFormData(FD)](#Sidekick.buildFormData)
  1240. * [.createId(existingIds)](#Sidekick.createId)
  1241. * [.toTitleCase(string)](#Sidekick.toTitleCase)
  1242. * [.replaceOnDocument(pattern, string, param2)](#Sidekick.replaceOnDocument)
  1243. * [.getTextNodesIn(el)](#Sidekick.getTextNodesIn) ⇒ <code>jQuery</code>
  1244. * [.generateUniqueSlugId(string, idList)](#Sidekick.generateUniqueSlugId)
  1245. * [.getNameFromFilePath(path)](#Sidekick.getNameFromFilePath) ⇒ <code>String</code>
  1246. * [.getFirstGM()](#Sidekick.getFirstGM) ⇒ <code>GM</code> \| <code>null</code>
  1247. * [.isFirstGM()](#Sidekick.isFirstGM) ⇒ <code>Boolean</code>
  1248. * [.getActorFromUuid(uuid)](#Sidekick.getActorFromUuid)
  1249. * [.findArrayDuplicates(arrayToCheck, filterProperty)](#Sidekick.findArrayDuplicates) ⇒ <code>Array</code>
  1250. * [.identifyArrayDuplicatesByProperty(arrayToCheck, filterProperty)](#Sidekick.identifyArrayDuplicatesByProperty) ⇒ <code>Boolean</code>
  1251. * [.loadTemplates()](#Sidekick.loadTemplates)
  1252. * [.getDocumentOwners(document)](#Sidekick.getDocumentOwners) ⇒ <code>Array</code>
  1253. <a name="Sidekick.createCUBDiv"></a>
  1254. ### Sidekick.createCUBDiv(html)
  1255. Creates the CUB div in the Sidebar
  1256. **Kind**: static method of [<code>Sidekick</code>](#Sidekick)
  1257. | Param | Type |
  1258. | --- | --- |
  1259. | html | <code>\*</code> |
  1260. <a name="Sidekick.getSetting"></a>
  1261. ### Sidekick.getSetting(key) ⇒ <code>Object</code>
  1262. Get a single setting using the provided key
  1263. **Kind**: static method of [<code>Sidekick</code>](#Sidekick)
  1264. **Returns**: <code>Object</code> - setting
  1265. | Param | Type |
  1266. | --- | --- |
  1267. | key | <code>\*</code> |
  1268. <a name="Sidekick.getAllSettings"></a>
  1269. ### Sidekick.getAllSettings() ⇒ <code>Array</code>
  1270. Get all CUB settings
  1271. **Kind**: static method of [<code>Sidekick</code>](#Sidekick)
  1272. **Returns**: <code>Array</code> - settings
  1273. <a name="Sidekick.setSetting"></a>
  1274. ### Sidekick.setSetting(key, value, awaitResult) ⇒ <code>Promise</code> \| <code>ClientSetting</code>
  1275. Sets a single game setting
  1276. **Kind**: static method of [<code>Sidekick</code>](#Sidekick)
  1277. | Param | Type | Default |
  1278. | --- | --- | --- |
  1279. | key | <code>\*</code> | |
  1280. | value | <code>\*</code> | |
  1281. | awaitResult | <code>\*</code> | <code>false</code> |
  1282. <a name="Sidekick.registerSetting"></a>
  1283. ### Sidekick.registerSetting(key, metadata) ⇒ <code>ClientSettings.register</code>
  1284. Register a single setting using the provided key and setting data
  1285. **Kind**: static method of [<code>Sidekick</code>](#Sidekick)
  1286. | Param | Type |
  1287. | --- | --- |
  1288. | key | <code>\*</code> |
  1289. | metadata | <code>\*</code> |
  1290. <a name="Sidekick.registerMenu"></a>
  1291. ### Sidekick.registerMenu(key, metadata) ⇒ <code>ClientSettings.registerMenu</code>
  1292. Register a menu setting using the provided key and setting data
  1293. **Kind**: static method of [<code>Sidekick</code>](#Sidekick)
  1294. | Param | Type |
  1295. | --- | --- |
  1296. | key | <code>\*</code> |
  1297. | metadata | <code>\*</code> |
  1298. <a name="Sidekick.registerAllSettings"></a>
  1299. ### Sidekick.registerAllSettings(settingsData) ⇒ <code>Array</code>
  1300. Register all provided setting data
  1301. **Kind**: static method of [<code>Sidekick</code>](#Sidekick)
  1302. | Param | Type |
  1303. | --- | --- |
  1304. | settingsData | <code>\*</code> |
  1305. <a name="Sidekick.getSystemChoices"></a>
  1306. ### Sidekick.getSystemChoices()
  1307. Gets the default game system names stored in the constants butler class
  1308. **Kind**: static method of [<code>Sidekick</code>](#Sidekick)
  1309. <a name="Sidekick.fetchJsons"></a>
  1310. ### Sidekick.fetchJsons(source, path)
  1311. Use FilePicker to browse then Fetch one or more JSONs and return them
  1312. **Kind**: static method of [<code>Sidekick</code>](#Sidekick)
  1313. | Param | Type |
  1314. | --- | --- |
  1315. | source | <code>\*</code> |
  1316. | path | <code>\*</code> |
  1317. <a name="Sidekick.fetchJson"></a>
  1318. ### Sidekick.fetchJson(file) ⇒
  1319. Fetch a JSON from a given file
  1320. **Kind**: static method of [<code>Sidekick</code>](#Sidekick)
  1321. **Returns**: JSON | null
  1322. | Param | Type |
  1323. | --- | --- |
  1324. | file | <code>File</code> |
  1325. <a name="Sidekick.validateObject"></a>
  1326. ### Sidekick.validateObject(object) ⇒ <code>Boolean</code>
  1327. Validate that an object is actually an object
  1328. **Kind**: static method of [<code>Sidekick</code>](#Sidekick)
  1329. | Param | Type |
  1330. | --- | --- |
  1331. | object | <code>Object</code> |
  1332. <a name="Sidekick.convertMapToArray"></a>
  1333. ### Sidekick.convertMapToArray(map)
  1334. Convert any ES6 Maps/Sets to objects for settings use
  1335. **Kind**: static method of [<code>Sidekick</code>](#Sidekick)
  1336. | Param | Type |
  1337. | --- | --- |
  1338. | map | <code>Map</code> |
  1339. <a name="Sidekick.getKeyByValue"></a>
  1340. ### Sidekick.getKeyByValue(object, value)
  1341. Retrieves a key using the given value
  1342. **Kind**: static method of [<code>Sidekick</code>](#Sidekick)
  1343. | Param | Type | Description |
  1344. | --- | --- | --- |
  1345. | object | <code>Object</code> | - the object that contains the key/value |
  1346. | value | <code>\*</code> | |
  1347. <a name="Sidekick.getInverseMap"></a>
  1348. ### Sidekick.getInverseMap()
  1349. Inverts the key and value in a map
  1350. **Kind**: static method of [<code>Sidekick</code>](#Sidekick)
  1351. **Todo:**: rework
  1352. <a name="Sidekick.handlebarsHelpers"></a>
  1353. ### Sidekick.handlebarsHelpers()
  1354. Adds additional handlebars helpers
  1355. **Kind**: static method of [<code>Sidekick</code>](#Sidekick)
  1356. <a name="Sidekick.jQueryHelpers"></a>
  1357. ### Sidekick.jQueryHelpers()
  1358. Adds additional jquery helpers
  1359. **Kind**: static method of [<code>Sidekick</code>](#Sidekick)
  1360. <a name="Sidekick.getTerms"></a>
  1361. ### Sidekick.getTerms(arr)
  1362. Takes an array of terms (eg. name parts) and returns groups of neighbouring terms
  1363. **Kind**: static method of [<code>Sidekick</code>](#Sidekick)
  1364. | Param | Type |
  1365. | --- | --- |
  1366. | arr | <code>\*</code> |
  1367. <a name="Sidekick.escapeRegExp"></a>
  1368. ### Sidekick.escapeRegExp(string) ⇒ <code>String</code>
  1369. Escapes regex special chars
  1370. **Kind**: static method of [<code>Sidekick</code>](#Sidekick)
  1371. **Returns**: <code>String</code> - escapedString
  1372. | Param | Type |
  1373. | --- | --- |
  1374. | string | <code>String</code> |
  1375. <a name="Sidekick.coerceType"></a>
  1376. ### Sidekick.coerceType(target, type) ⇒ <code>\*</code>
  1377. Attempts to coerce a target value into the exemplar's type
  1378. **Kind**: static method of [<code>Sidekick</code>](#Sidekick)
  1379. **Returns**: <code>\*</code> - coercedValue
  1380. | Param | Type |
  1381. | --- | --- |
  1382. | target | <code>\*</code> |
  1383. | type | <code>\*</code> |
  1384. <a name="Sidekick.buildFormData"></a>
  1385. ### Sidekick.buildFormData(FD)
  1386. Builds a FD returned from FormDataExtended into a formData array
  1387. Borrowed from foundry.js
  1388. **Kind**: static method of [<code>Sidekick</code>](#Sidekick)
  1389. | Param | Type |
  1390. | --- | --- |
  1391. | FD | <code>\*</code> |
  1392. <a name="Sidekick.createId"></a>
  1393. ### Sidekick.createId(existingIds)
  1394. Get a random unique Id, checking an optional supplied array of ids for a match
  1395. **Kind**: static method of [<code>Sidekick</code>](#Sidekick)
  1396. | Param | Type |
  1397. | --- | --- |
  1398. | existingIds | <code>\*</code> |
  1399. <a name="Sidekick.toTitleCase"></a>
  1400. ### Sidekick.toTitleCase(string)
  1401. Sets a string to Title Case
  1402. **Kind**: static method of [<code>Sidekick</code>](#Sidekick)
  1403. | Param | Type |
  1404. | --- | --- |
  1405. | string | <code>\*</code> |
  1406. <a name="Sidekick.replaceOnDocument"></a>
  1407. ### Sidekick.replaceOnDocument(pattern, string, param2)
  1408. Parses HTML and replaces instances of a matched pattern
  1409. **Kind**: static method of [<code>Sidekick</code>](#Sidekick)
  1410. | Param | Type |
  1411. | --- | --- |
  1412. | pattern | <code>\*</code> |
  1413. | string | <code>\*</code> |
  1414. | param2 | <code>\*</code> |
  1415. <a name="Sidekick.getTextNodesIn"></a>
  1416. ### Sidekick.getTextNodesIn(el) ⇒ <code>jQuery</code>
  1417. Get text nodes in a given element
  1418. **Kind**: static method of [<code>Sidekick</code>](#Sidekick)
  1419. | Param | Type |
  1420. | --- | --- |
  1421. | el | <code>\*</code> |
  1422. <a name="Sidekick.generateUniqueSlugId"></a>
  1423. ### Sidekick.generateUniqueSlugId(string, idList)
  1424. For a given string generate a slug, optionally checking a list of existing Ids for uniqueness
  1425. **Kind**: static method of [<code>Sidekick</code>](#Sidekick)
  1426. | Param | Type |
  1427. | --- | --- |
  1428. | string | <code>\*</code> |
  1429. | idList | <code>\*</code> |
  1430. <a name="Sidekick.getNameFromFilePath"></a>
  1431. ### Sidekick.getNameFromFilePath(path) ⇒ <code>String</code>
  1432. For a given file path, find the filename and then apply title case
  1433. **Kind**: static method of [<code>Sidekick</code>](#Sidekick)
  1434. | Param | Type |
  1435. | --- | --- |
  1436. | path | <code>String</code> |
  1437. <a name="Sidekick.getFirstGM"></a>
  1438. ### Sidekick.getFirstGM() ⇒ <code>GM</code> \| <code>null</code>
  1439. Gets the first GM user
  1440. **Kind**: static method of [<code>Sidekick</code>](#Sidekick)
  1441. **Returns**: <code>GM</code> \| <code>null</code> - a GM object or null if none found
  1442. <a name="Sidekick.isFirstGM"></a>
  1443. ### Sidekick.isFirstGM() ⇒ <code>Boolean</code>
  1444. Checks if the current user is the first active GM
  1445. **Kind**: static method of [<code>Sidekick</code>](#Sidekick)
  1446. <a name="Sidekick.getActorFromUuid"></a>
  1447. ### Sidekick.getActorFromUuid(uuid)
  1448. Gets an Actor from an Actor or Token UUID
  1449. **Kind**: static method of [<code>Sidekick</code>](#Sidekick)
  1450. | Param | Type |
  1451. | --- | --- |
  1452. | uuid | <code>\*</code> |
  1453. <a name="Sidekick.findArrayDuplicates"></a>
  1454. ### Sidekick.findArrayDuplicates(arrayToCheck, filterProperty) ⇒ <code>Array</code>
  1455. Filters an array down to just its duplicate elements based on the property specified
  1456. **Kind**: static method of [<code>Sidekick</code>](#Sidekick)
  1457. | Param | Type |
  1458. | --- | --- |
  1459. | arrayToCheck | <code>\*</code> |
  1460. | filterProperty | <code>\*</code> |
  1461. <a name="Sidekick.identifyArrayDuplicatesByProperty"></a>
  1462. ### Sidekick.identifyArrayDuplicatesByProperty(arrayToCheck, filterProperty) ⇒ <code>Boolean</code>
  1463. Returns true for each array element that is a duplicate based on the property specified
  1464. **Kind**: static method of [<code>Sidekick</code>](#Sidekick)
  1465. | Param | Type |
  1466. | --- | --- |
  1467. | arrayToCheck | <code>\*</code> |
  1468. | filterProperty | <code>\*</code> |
  1469. <a name="Sidekick.loadTemplates"></a>
  1470. ### Sidekick.loadTemplates()
  1471. Loads templates for partials
  1472. **Kind**: static method of [<code>Sidekick</code>](#Sidekick)
  1473. <a name="Sidekick.getDocumentOwners"></a>
  1474. ### Sidekick.getDocumentOwners(document) ⇒ <code>Array</code>
  1475. Retrieves all the owners of a given document
  1476. **Kind**: static method of [<code>Sidekick</code>](#Sidekick)
  1477. | Param | Type |
  1478. | --- | --- |
  1479. | document | <code>\*</code> |
  1480. <a name="Signal"></a>
  1481. ## Signal
  1482. Initiates module classes (and shines a light on the dark night sky)
  1483. **Kind**: global class
  1484. * [Signal](#Signal)
  1485. * [.lightUp()](#Signal.lightUp)
  1486. * [._onSocket(message)](#Signal._onSocket)
  1487. <a name="Signal.lightUp"></a>
  1488. ### Signal.lightUp()
  1489. Registers hooks
  1490. **Kind**: static method of [<code>Signal</code>](#Signal)
  1491. <a name="Signal._onSocket"></a>
  1492. ### Signal.\_onSocket(message)
  1493. Socket dispatcher
  1494. **Kind**: static method of [<code>Signal</code>](#Signal)
  1495. | Param | Type |
  1496. | --- | --- |
  1497. | message | <code>\*</code> |
  1498. <a name="TemporaryCombatantForm"></a>
  1499. ## TemporaryCombatantForm
  1500. **Kind**: global class
  1501. <a name="TemporaryCombatantForm+activateListeners"></a>
  1502. ### temporaryCombatantForm.activateListeners(html)
  1503. Activate listeners for the form
  1504. **Kind**: instance method of [<code>TemporaryCombatantForm</code>](#TemporaryCombatantForm)
  1505. | Param | Type |
  1506. | --- | --- |
  1507. | html | <code>\*</code> |
  1508. <a name="Triggler"></a>
  1509. ## Triggler
  1510. Handles triggers for other gadgets in the module... or does it?!
  1511. **Kind**: global class
  1512. * [Triggler](#Triggler)
  1513. * [._createTrigglerButton(html)](#Triggler._createTrigglerButton)
  1514. * [._executeTrigger(trigger, target)](#Triggler._executeTrigger)
  1515. * [._processUpdate(entity, update, entryPoint1, entryPoint2)](#Triggler._processUpdate)
  1516. * [._onUpdateActor(actor, update, options, userId)](#Triggler._onUpdateActor)
  1517. * [._onUpdateToken(token, update, options, userId)](#Triggler._onUpdateToken)
  1518. * [._onRenderMacroConfig(app, html, data)](#Triggler._onRenderMacroConfig)
  1519. <a name="Triggler._createTrigglerButton"></a>
  1520. ### Triggler.\_createTrigglerButton(html)
  1521. Creates a button for the Condition Lab
  1522. **Kind**: static method of [<code>Triggler</code>](#Triggler)
  1523. | Param | Type | Description |
  1524. | --- | --- | --- |
  1525. | html | <code>Object</code> | the html element where the button will be created |
  1526. <a name="Triggler._executeTrigger"></a>
  1527. ### Triggler.\_executeTrigger(trigger, target)
  1528. Executes a trigger calling predefined actions
  1529. **Kind**: static method of [<code>Triggler</code>](#Triggler)
  1530. | Param | Type |
  1531. | --- | --- |
  1532. | trigger | <code>\*</code> |
  1533. | target | <code>\*</code> |
  1534. <a name="Triggler._processUpdate"></a>
  1535. ### Triggler.\_processUpdate(entity, update, entryPoint1, entryPoint2)
  1536. Processes an entity update and evaluates triggers
  1537. **Kind**: static method of [<code>Triggler</code>](#Triggler)
  1538. | Param | Type |
  1539. | --- | --- |
  1540. | entity | <code>\*</code> |
  1541. | update | <code>\*</code> |
  1542. | entryPoint1 | <code>\*</code> |
  1543. | entryPoint2 | <code>\*</code> |
  1544. <a name="Triggler._onUpdateActor"></a>
  1545. ### Triggler.\_onUpdateActor(actor, update, options, userId)
  1546. Update Actor handler
  1547. **Kind**: static method of [<code>Triggler</code>](#Triggler)
  1548. | Param | Type |
  1549. | --- | --- |
  1550. | actor | <code>\*</code> |
  1551. | update | <code>\*</code> |
  1552. | options | <code>\*</code> |
  1553. | userId | <code>\*</code> |
  1554. <a name="Triggler._onUpdateToken"></a>
  1555. ### Triggler.\_onUpdateToken(token, update, options, userId)
  1556. Update token handler
  1557. **Kind**: static method of [<code>Triggler</code>](#Triggler)
  1558. | Param | Type |
  1559. | --- | --- |
  1560. | token | <code>Token</code> |
  1561. | update | <code>\*</code> |
  1562. | options | <code>\*</code> |
  1563. | userId | <code>\*</code> |
  1564. <a name="Triggler._onRenderMacroConfig"></a>
  1565. ### Triggler.\_onRenderMacroConfig(app, html, data)
  1566. **Kind**: static method of [<code>Triggler</code>](#Triggler)
  1567. | Param | Type |
  1568. | --- | --- |
  1569. | app | <code>\*</code> |
  1570. | html | <code>\*</code> |
  1571. | data | <code>\*</code> |
  1572. <a name="DraggableList"></a>
  1573. ## DraggableList
  1574. From Valentin "Moerill" Henkys
  1575. the code is licensed under LGPL v3.
  1576. Original is implemented in his module "Mess":
  1577. https://github.com/Moerill/Mess
  1578. LICENSE: https://github.com/Moerill/Mess/blob/master/LICENSE
  1579. **Kind**: global class
  1580. <a name="KNOWN_GAME_SYSTEMS"></a>
  1581. ## KNOWN\_GAME\_SYSTEMS
  1582. Stores information about well known game systems. All other systems will resolve to "other"
  1583. **Kind**: global constant
  1584. <a name="createCUBPuterButton"></a>
  1585. ## createCUBPuterButton(html)
  1586. Create the sidebar button
  1587. **Kind**: global function
  1588. | Param | Type |
  1589. | --- | --- |
  1590. | html | <code>\*</code> |
  1591. <a name="getData"></a>
  1592. ## getData(options)
  1593. Get data for template rendering
  1594. **Kind**: global function
  1595. | Param | Type |
  1596. | --- | --- |
  1597. | options | <code>\*</code> |
  1598. <a name="_updateObject"></a>
  1599. ## \_updateObject(formData)
  1600. Override default update object behaviour
  1601. **Kind**: global function
  1602. | Param | Type |
  1603. | --- | --- |
  1604. | formData | <code>\*</code> |