mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-03-07 06:26:13 +01:00
parent
4324c3abf2
commit
e79ccd34e9
4 changed files with 29 additions and 23 deletions
|
|
@ -431,18 +431,18 @@ export default function DHApplicationMixin(Base) {
|
||||||
{
|
{
|
||||||
name: 'disableEffect',
|
name: 'disableEffect',
|
||||||
icon: 'fa-solid fa-lightbulb',
|
icon: 'fa-solid fa-lightbulb',
|
||||||
condition: target => {
|
condition: element => {
|
||||||
const doc = getDocFromElementSync(target);
|
const target = element.closest('[data-item-uuid]');
|
||||||
return doc && !doc.disabled && doc.type !== 'beastform';
|
return !target.dataset.disabled && target.dataset.itemType !== 'beastform';
|
||||||
},
|
},
|
||||||
callback: async target => (await getDocFromElement(target)).update({ disabled: true })
|
callback: async target => (await getDocFromElement(target)).update({ disabled: true })
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'enableEffect',
|
name: 'enableEffect',
|
||||||
icon: 'fa-regular fa-lightbulb',
|
icon: 'fa-regular fa-lightbulb',
|
||||||
condition: target => {
|
condition: element => {
|
||||||
const doc = getDocFromElementSync(target);
|
const target = element.closest('[data-item-uuid]');
|
||||||
return doc && doc.disabled && doc.type !== 'beastform';
|
return target.dataset.disabled && target.dataset.itemType !== 'beastform';
|
||||||
},
|
},
|
||||||
callback: async target => (await getDocFromElement(target)).update({ disabled: false })
|
callback: async target => (await getDocFromElement(target)).update({ disabled: false })
|
||||||
}
|
}
|
||||||
|
|
@ -536,9 +536,9 @@ export default function DHApplicationMixin(Base) {
|
||||||
options.push({
|
options.push({
|
||||||
name: 'CONTROLS.CommonDelete',
|
name: 'CONTROLS.CommonDelete',
|
||||||
icon: 'fa-solid fa-trash',
|
icon: 'fa-solid fa-trash',
|
||||||
condition: target => {
|
condition: element => {
|
||||||
const doc = getDocFromElementSync(target);
|
const target = element.closest('[data-item-uuid]');
|
||||||
return doc && doc.type !== 'beastform';
|
return target.dataset.itemType !== 'beastform';
|
||||||
},
|
},
|
||||||
callback: async (target, event) => {
|
callback: async (target, event) => {
|
||||||
const doc = await getDocFromElement(target);
|
const doc = await getDocFromElement(target);
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,7 @@ Parameters:
|
||||||
{{> 'daggerheart.inventory-item'
|
{{> 'daggerheart.inventory-item'
|
||||||
item=item
|
item=item
|
||||||
type=../type
|
type=../type
|
||||||
|
disabledEffect=../disabledEffect
|
||||||
actorType=../actorType
|
actorType=../actorType
|
||||||
hideControls=../hideControls
|
hideControls=../hideControls
|
||||||
hideContextMenu=../hideContextMenu
|
hideContextMenu=../hideContextMenu
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,12 @@ Parameters:
|
||||||
- showActions {boolean} : If true show feature's actions.
|
- showActions {boolean} : If true show feature's actions.
|
||||||
--}}
|
--}}
|
||||||
|
|
||||||
<li class="inventory-item" data-item-id="{{item.id}}" {{#if (or (eq type 'action' ) (eq type 'attack' ))}}
|
<li class="inventory-item" data-item-id="{{item.id}}"
|
||||||
data-action-id="{{item.id}}" {{/if}} data-item-uuid="{{item.uuid}}" data-type="{{type}}" data-no-compendium-edit="{{noCompendiumEdit}}">
|
{{#if (or (eq type 'action' ) (eq type 'attack' ))}}data-action-id="{{item.id}}" {{/if}}
|
||||||
|
{{#if disabledEffect}}data-disabled="true"{{/if}}
|
||||||
|
data-type="{{type}}" data-item-type="{{item.type}}"
|
||||||
|
data-item-uuid="{{item.uuid}}" data-no-compendium-edit="{{noCompendiumEdit}}"
|
||||||
|
>
|
||||||
<div class="inventory-item-header {{#if hideContextMenu}}padded{{/if}}" {{#unless noExtensible}}data-action="toggleExtended" {{/unless}}>
|
<div class="inventory-item-header {{#if hideContextMenu}}padded{{/if}}" {{#unless noExtensible}}data-action="toggleExtended" {{/unless}}>
|
||||||
{{!-- Image --}}
|
{{!-- Image --}}
|
||||||
<div class="img-portait" data-action='{{ifThen (or (hasProperty item "use") (eq type "attack")) "useItem" (ifThen
|
<div class="img-portait" data-action='{{ifThen (or (hasProperty item "use") (eq type "attack")) "useItem" (ifThen
|
||||||
|
|
|
||||||
|
|
@ -2,20 +2,21 @@
|
||||||
data-group='{{tabs.effects.group}}'>
|
data-group='{{tabs.effects.group}}'>
|
||||||
|
|
||||||
{{> 'daggerheart.inventory-items'
|
{{> 'daggerheart.inventory-items'
|
||||||
title='DAGGERHEART.GENERAL.activeEffects'
|
title='DAGGERHEART.GENERAL.activeEffects'
|
||||||
type='effect'
|
type='effect'
|
||||||
isGlassy=true
|
isGlassy=true
|
||||||
collection=effects.actives
|
collection=effects.actives
|
||||||
canCreate=true
|
canCreate=true
|
||||||
hideResources=true
|
hideResources=true
|
||||||
}}
|
}}
|
||||||
|
|
||||||
{{> 'daggerheart.inventory-items'
|
{{> 'daggerheart.inventory-items'
|
||||||
title='DAGGERHEART.GENERAL.inactiveEffects'
|
title='DAGGERHEART.GENERAL.inactiveEffects'
|
||||||
type='effect'
|
type='effect'
|
||||||
isGlassy=true
|
disabledEffect=true
|
||||||
collection=effects.inactives
|
isGlassy=true
|
||||||
canCreate=true
|
collection=effects.inactives
|
||||||
hideResources=true
|
canCreate=true
|
||||||
|
hideResources=true
|
||||||
}}
|
}}
|
||||||
</section>
|
</section>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue