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.

136 lines
8.1 KiB

  1. <form>
  2. <section>
  3. <datalist id="groups">
  4. {{#each groups}}
  5. <option value="{{this}}"></option>
  6. {{/each}}
  7. </datalist>
  8. <ol class="token-variant-table" style="overflow-x: hidden;">
  9. <li class="table-row table-header flexrow">
  10. <div class="mapping-controls">
  11. <a class="create-mapping" title="Add new mapping"> <i class="fas fa-plus"></i></a>
  12. </div>
  13. <div class="mapping-label" title="Optional description for the mapping. Actor mappings will override Global ones if their Labels match."><label>Label</label></div>
  14. <div class="mapping-expression"><label>Expression</label>&nbsp;&nbsp;<i class="fas fa-question-circle" title="Accepted Operators:&#013;• && ( logical AND)&#013;• || (logical OR)&#013;• \! (escaped logical NOT)&#013;• \( (escaped open bracket to group expressions)&#013;• \) (escaped closed bracket to group expressions)&#013;&#013;Accepted hp and Token property Comparators:&#013;• = (equal)&#013;• < (less than)&#013;• > (greater than)&#013;• <= (less than or equal)&#013;• >= (greater than or equal)&#013;• <> (lesser or greater than)&#013;&#013;Accepted wildcards&#013;• \*&#013;• \{ \}&#013;&#013;Examples of valid expressions:&#013;• Flying&#013;• Dead && Burning&#013;• Flying && \! \( Prone || Dead \)&#013;• hp<=50%&#013;• name=&ldquo;Raging Barbarian&ldquo;&#013;• lockRotation=&ldquo;true&ldquo;&#013;• flags.token-variants.test=&ldquo;true&ldquo;&#013;• Exhaustion \*&#013;• Exhaustion \{1,2,3\}&#013;&#013;Special Effect Names:&#013;• token-variants-combat : Actives when Token is in combat&#013;• combat-turn : Activates when it's Token's turn in combat&#013;• combat-turn-next : Actives when Token is next in the initiative order"></i></div>
  15. <div class="mapping-priority" title="The order in which mappings are to be resolved. Which scripts are run first, token configs are prioritized, and overlay display order will all be based off of this value."><label>Priority</label></div>
  16. <div class="mapping-image" title="Image to be applied to the token."><label>Image</label></div>
  17. <div class="mapping-config" title="Token Configuration and Scripts"><label>Config</label></div>
  18. <div class="mapping-overlay" title="Image, text, or shapes to be shown on the token."><label>Overlay</label></div>
  19. <div class="mapping-alwaysOn" title="If checked mapping will always be treated as active, regardless whether the Expression is true or not."><label>Always On</label></div>
  20. <div class="mapping-disable" title="If checked mapping will never be activated regardless of whether the Expression is true or not."><label>Disable</label></div>
  21. {{#if global}}
  22. <div class="mapping-target" title="Actor types that this mapping is applicable to."><i class="fas fa-users"></i></div>
  23. {{/if}}
  24. <div class="mapping-group" title="Mappings sharing Group names will be displayed under the same header."><label>Group</label></div>
  25. </li>
  26. {{#each groupedMappings as |mappings group|}}
  27. <div class="group-title flexrow">
  28. <p><a class="group-delete" data-group="{{group}}"><i class="fas fa-trash fa-xs"></i></a> {{group}}</p>
  29. <div class="group-disable {{#if mappings.active}}active{{/if}}" data-group="{{group}}"><a><i class="fas fa-power-off"></i></a></div>
  30. <div class="group-toggle active {{#if ../global}}global{{/if}}" data-group="{{group}}"><a><i class="fas fa-chevron-double-up"></i></a></div>
  31. </div>
  32. {{#each mappings.list as |mapping|}}
  33. <input type="text" name="mappings.{{mapping.i}}.id" value="{{mapping.id}}" hidden/>
  34. <li class="table-row flexrow" data-group="{{group}}" data-index="{{mapping.i}}">
  35. <div class="mapping-controls">
  36. <a class="clone-mapping" title="Clone mapping"><i class="fas fa-clone"></i></a>
  37. <a class="delete-mapping" title="Delete mapping"><i class="fas fa-trash"></i></a>
  38. </div>
  39. <div class="mapping-label">
  40. <input
  41. type="text"
  42. name="mappings.{{mapping.i}}.label"
  43. value="{{mapping.label}}"
  44. />
  45. </div>
  46. <div class="mapping-expression">
  47. <div class="expression-container">
  48. <a class="expression-switch" title="Toggle between Expression and JavaScript Code"><i class="fad fa-code"></i></a>
  49. <div>
  50. <div class="div-input {{#if hasCodeExp}}hidden{{/if}}" contenteditable="true" title="Expression">{{{mapping.highlightedExpression}}}</div>
  51. <input
  52. type="text"
  53. name="mappings.{{mapping.i}}.expression"
  54. value="{{mapping.expression}}"
  55. hidden/>
  56. </div>
  57. <div class="expression-code {{#unless hasCodeExp}}hidden{{/unless}}">
  58. <textarea name="mappings.{{mapping.i}}.codeExp" title="JavaScript Code&#013;'token' document is available within this context">{{mapping.codeExp}}</textarea>
  59. </div>
  60. </div>
  61. </div>
  62. <div class="mapping-priority">
  63. <input
  64. type="number"
  65. name="mappings.{{mapping.i}}.priority"
  66. value="{{mapping.priority}}"
  67. placeholder="priority"
  68. />
  69. </div>
  70. <div class="mapping-image">
  71. <video
  72. height="32" width="32"
  73. src="{{mapping.imgSrc}}"
  74. title="{{mapping.imgName}}"
  75. autoplay
  76. loop
  77. muted
  78. {{#unless isVideo}}hidden{{/unless}}
  79. >
  80. </video>
  81. <img height="32" width="32" src="{{#if mapping.imgSrc}} {{mapping.imgSrc}} {{else}} {{../NO_IMAGE}} {{/if}}" title="{{mapping.imgName}}" {{#if isVideo}}hidden{{/if}}/>
  82. <input
  83. class="imgSrc"
  84. type="hidden"
  85. name="mappings.{{mapping.i}}.imgSrc"
  86. value="{{mapping.imgSrc}}"
  87. />
  88. <input
  89. class="imgName"
  90. type="hidden"
  91. name="mappings.{{mapping.i}}.imgName"
  92. value="{{mapping.imgName}}"
  93. />
  94. </div>
  95. <div class="mapping-config">
  96. <a><i class="fas fa-cog fa-lg config {{#if mapping.hasTokenConfig}}active{{/if}}"></i></a>
  97. <a><i class="fas fa-edit config-edit {{#if mapping.hasConfig}}active{{/if}}"></i></a>
  98. <a><i class="fas fa-play config-script {{#if mapping.hasScript}}active{{/if}}"></i></a>
  99. <input class="config" type="hidden" name="mappings.{{mapping.i}}.config" value="{{mapping.config}}">
  100. </div>
  101. <div class="mapping-overlay">
  102. <input type="checkbox" name="mappings.{{mapping.i}}.overlay" {{#if mapping.overlay}}checked{{/if}}/>
  103. <a {{#if mapping.parentID}}class="child" title="Child Of: {{mapping.parentID}}"{{/if}}><i class="fas fa-cog fa-lg overlay-config"></i></a>
  104. </div>
  105. <div class="mapping-alwaysOn">
  106. <input type="checkbox" name="mappings.{{mapping.i}}.alwaysOn" {{#if mapping.alwaysOn}}checked{{/if}} title="Enabling will not trigger scripts."/>
  107. </div>
  108. <div class="mapping-disable">
  109. <input type="checkbox" name="mappings.{{mapping.i}}.disabled" {{#if mapping.disabled}}checked{{/if}}/>
  110. </div>
  111. {{#if ../../global}}
  112. <div class="mapping-target" title="Configure Applicable Actors">
  113. <a><i class="fas fa-users"></i></a>
  114. </div>
  115. {{/if}}
  116. <div class="mapping-group">
  117. <input list="groups" name="mappings.{{mapping.i}}.group" value="{{mapping.group}}"/>
  118. </div>
  119. {{#if mapping.tokenIDs}}
  120. <i class="tokens fa-duotone fa-circle-user" title="{{mapping.tokenIDs}}"></i>
  121. <input type="text" name="mappings.{{mapping.i}}.tokens" value="{{mapping.tokensString}}" hidden />
  122. {{/if}}
  123. </li>
  124. {{/each}}
  125. {{/each}}
  126. </ol>
  127. </section>
  128. <footer class="sheet-footer flexrow">
  129. <button class="save-mappings" type="button">
  130. <i class="far fa-save"></i>{{localize "token-variants.common.apply"}}
  131. </button>
  132. </footer>
  133. </form>