mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-20 16:44:40 +01:00
Fixed DiceValues placement in InventoryItemV2. Fixed parsing of ITEM.@ paths
This commit is contained in:
parent
7bbbdce739
commit
e7fcd9af99
3 changed files with 29 additions and 36 deletions
|
|
@ -307,8 +307,8 @@ export function updateLinkedItemApps(options, sheet) {
|
|||
export const itemAbleRollParse = (value, actor, item) => {
|
||||
if (!value) return value;
|
||||
|
||||
const isItemTarget = value.toLowerCase().replace('item.@', '@');
|
||||
const slicedValue = isItemTarget ? value.slice(5) : value;
|
||||
const isItemTarget = value.toLowerCase().includes('item.@');
|
||||
const slicedValue = isItemTarget ? value.replaceAll(/item\.@/gi, '@') : value;
|
||||
try {
|
||||
return Roll.replaceFormulaData(slicedValue, isItemTarget ? item : actor);
|
||||
} catch (_) {
|
||||
|
|
|
|||
|
|
@ -241,6 +241,7 @@ Parameters:
|
|||
{{#unless hideDescription}}
|
||||
<div class="invetory-description"></div>
|
||||
{{/unless}}
|
||||
</div>
|
||||
{{!-- Dice Resource --}}
|
||||
{{#if (and (not hideResources) (eq item.system.resource.type 'diceValue'))}}
|
||||
{{> "systems/daggerheart/templates/sheets/global/partials/item-resource.hbs"}}
|
||||
|
|
@ -255,5 +256,4 @@ Parameters:
|
|||
{{/each}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
</li>
|
||||
|
|
|
|||
|
|
@ -1,9 +1,3 @@
|
|||
{{#if (eq item.system.resource.type 'simple')}}
|
||||
<div class="item-resource">
|
||||
<i class="{{#if item.system.resource.icon}}{{item.system.resource.icon}}{{else}}fa-solid fa-hashtag{{/if}}"></i>
|
||||
<input type="number" class="inventory-item-resource" value="{{item.system.resource.value}}" min="0" max="{{rollParsed item.system.resource.max item.actor item true}}" />
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="item-resources">
|
||||
{{#times (rollParsed item.system.resource.max item.parent item numerical=true)}}
|
||||
{{#with (ifThen (lookup ../item.system.resource.diceStates this) (lookup ../item.system.resource.diceStates this) this) as | state |}}
|
||||
|
|
@ -18,4 +12,3 @@
|
|||
{{/times}}
|
||||
<a data-action="handleResourceDice" data-tooltip="DAGGERHEART.APPLICATIONS.ResourceDice.rerollDice"><i class="fa-solid fa-dice resource-edit"></i></a>
|
||||
</div>
|
||||
{{/if}}
|
||||
Loading…
Add table
Add a link
Reference in a new issue