14: Tweak styles, tweak roll template

- Adjusted styles of item buttons.
- Fixed an issue with item buttons when not using shorthand syntax.
- Updated the `roll.toMessage()` call to include the player/actor name
  and the item/attribute name.
This commit is contained in:
Matt Smith 2020-08-09 20:25:48 -05:00
parent 786d4095a9
commit 9ae2cce47a
4 changed files with 49 additions and 11 deletions

View file

@ -40,11 +40,20 @@
<li class="item flexrow" data-item-id="{{item._id}}">
<img src="{{item.img}}" title="{{item.name}}" width="24" height="24"/>
<h4 class="item-name">{{item.name}}</h4>
{{#each item.data.attributes as |itemAttr key|}}
{{#if (eq itemAttr.dtype "Formula")}}
<button class="item-button rollable" data-roll="@items.{{slugify item.name}}.{{key}}" title="{{itemAttr.value}}">{{itemAttr.label}}</button>
{{/if}}
{{/each}}
{{!-- Iterate through all attributes on the item and output buttons for any that are formula. --}}
<div class="item-buttons">
{{#each item.data.attributes as |itemAttr key|}}
{{#if (eq itemAttr.dtype "Formula")}}
{{!-- Use the items.name.key format for shorthand. --}}
{{#if ../../shorthand}}
<button class="item-button rollable" data-roll="@items.{{slugify item.name}}.{{key}}" title="{{itemAttr.value}}">{{itemAttr.label}}</button>
{{!-- Use the items.name.attributes.key.value format otherwise. --}}
{{else}}
<button class="item-button rollable" data-roll="@items.{{slugify item.name}}.attributes.{{key}}.value" title="{{itemAttr.value}}">{{itemAttr.label}}</button>
{{/if}}
{{/if}}
{{/each}}
</div>
<div class="item-controls">
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>