From eb96e8b8136c11b858660dff7cd7a9181c62d41e Mon Sep 17 00:00:00 2001 From: WBHarry Date: Sat, 5 Jul 2025 21:34:15 +0200 Subject: [PATCH] Corrected back to actions for right items --- lang/en.json | 2 +- .../applications/sheets/actors/character.mjs | 10 ++- module/applications/sheets/api/base-item.mjs | 83 ++++++++++++++++++- module/applications/sheets/items/armor.mjs | 14 ++-- .../applications/sheets/items/consumable.mjs | 6 +- .../applications/sheets/items/domainCard.mjs | 8 +- .../sheets/items/miscellaneous.mjs | 6 +- module/applications/sheets/items/weapon.mjs | 14 ++-- module/data/item/armor.mjs | 30 ++++--- module/data/item/consumable.mjs | 4 +- module/data/item/domainCard.mjs | 4 +- module/data/item/miscellaneous.mjs | 5 +- module/data/item/weapon.mjs | 12 +-- templates/sheets/actors/adversary/effects.hbs | 2 +- templates/sheets/actors/character/effects.hbs | 2 +- templates/sheets/actors/companion/effects.hbs | 2 +- .../partials/inventory-fieldset-items.hbs | 2 +- 17 files changed, 148 insertions(+), 58 deletions(-) diff --git a/lang/en.json b/lang/en.json index 6acb0aab..b998cf9f 100755 --- a/lang/en.json +++ b/lang/en.json @@ -1478,7 +1478,7 @@ "Features": "Features", "Effects": "Effects", "activeEffects": "Active Effects", - "inativeEffects": "Inative Effects" + "inactiveEffects": "Inactive Effects" }, "DomainCard": { "Type": "Type", diff --git a/module/applications/sheets/actors/character.mjs b/module/applications/sheets/actors/character.mjs index c568d422..5c5109de 100644 --- a/module/applications/sheets/actors/character.mjs +++ b/module/applications/sheets/actors/character.mjs @@ -307,9 +307,13 @@ export default class CharacterSheet extends DaggerheartSheet(ActorSheetV2) { getItem(element) { const listElement = (element.target ?? element).closest('[data-item-id]'); const itemId = listElement.dataset.itemId; - return listElement.dataset.type === 'effect' - ? this.document.effects.get(itemId) - : this.document.items.get(itemId); + + switch (listElement.dataset.type) { + case 'effect': + return this.document.effects.get(itemId); + default: + return this.document.items.get(itemId); + } } static triggerContextMenu(event, button) { diff --git a/module/applications/sheets/api/base-item.mjs b/module/applications/sheets/api/base-item.mjs index d786b31a..e41d1d9f 100644 --- a/module/applications/sheets/api/base-item.mjs +++ b/module/applications/sheets/api/base-item.mjs @@ -1,3 +1,4 @@ +import DHActionConfig from '../../sheets-configs/action-config.mjs'; import DHApplicationMixin from './application-mixin.mjs'; const { ItemSheetV2 } = foundry.applications.sheets; @@ -16,6 +17,9 @@ export default class DHBaseItemSheet extends DHApplicationMixin(ItemSheetV2) { submitOnChange: true }, actions: { + addAction: DHBaseItemSheet.#addAction, + editAction: DHBaseItemSheet.#editAction, + removeAction: DHBaseItemSheet.#removeAction, addFeature: DHBaseItemSheet.#addFeature, editFeature: DHBaseItemSheet.#editFeature, removeFeature: DHBaseItemSheet.#removeFeature @@ -31,7 +35,7 @@ export default class DHBaseItemSheet extends DHApplicationMixin(ItemSheetV2) { /** @inheritdoc */ static TABS = { primary: { - tabs: [{ id: 'description' }, { id: 'features' }, { id: 'settings' }], + tabs: [{ id: 'description' }, { id: 'actions' }, { id: 'settings' }], initial: 'description', labelPrefix: 'DAGGERHEART.Sheets.TABS' } @@ -64,6 +68,83 @@ export default class DHBaseItemSheet extends DHApplicationMixin(ItemSheetV2) { /* Application Clicks Actions */ /* -------------------------------------------- */ + /** + * Render a dialog prompting the user to select an action type. + * + * @returns {Promise} An object containing the selected action type. + */ + static async selectActionType() { + const content = await foundry.applications.handlebars.renderTemplate( + 'systems/daggerheart/templates/actionTypes/actionType.hbs', + { types: CONFIG.DH.ACTIONS.actionTypes } + ), + title = 'Select Action Type'; + + return foundry.applications.api.DialogV2.prompt({ + window: { title }, + content, + ok: { + label: title, + callback: (event, button, dialog) => button.form.elements.type.value + } + }); + } + + /** + * Add a new action to the item, prompting the user for its type. + * @param {PointerEvent} _event - The originating click event + * @param {HTMLElement} _button - The capturing HTML element which defines the [data-action="addAction"] + */ + static async #addAction(_event, _button) { + const actionType = await DHBaseItemSheet.selectActionType(); + if (!actionType) return; + try { + const cls = + game.system.api.models.actions.actionsTypes[actionType] ?? + game.system.api.models.actions.actionsTypes.attack, + action = new cls( + { + _id: foundry.utils.randomID(), + type: actionType, + name: game.i18n.localize(CONFIG.DH.ACTIONS.actionTypes[actionType].name), + ...cls.getSourceConfig(this.document) + }, + { + parent: this.document + } + ); + await this.document.update({ 'system.actions': [...this.document.system.actions, action] }); + await new DHActionConfig(this.document.system.actions[this.document.system.actions.length - 1]).render({ + force: true + }); + } catch (error) { + console.log(error); + } + } + + /** + * Edit an existing action on the item + * @param {PointerEvent} _event - The originating click event + * @param {HTMLElement} button - The capturing HTML element which defines the [data-action="editAction"] + */ + static async #editAction(_event, button) { + const action = this.document.system.actions[button.dataset.index]; + await new DHActionConfig(action).render({ force: true }); + } + + /** + * Remove an action from the item. + * @param {PointerEvent} event - The originating click event + * @param {HTMLElement} button - The capturing HTML element which defines the [data-action="removeAction"] + */ + static async #removeAction(event, button) { + event.stopPropagation(); + const actionIndex = button.closest('[data-index]').dataset.index; + await this.document.update({ + 'system.actions': this.document.system.actions.filter((_, index) => index !== Number.parseInt(actionIndex)) + }); + } + /** * Add a new feature to the item, prompting the user for its type. * @param {PointerEvent} _event - The originating click event diff --git a/module/applications/sheets/items/armor.mjs b/module/applications/sheets/items/armor.mjs index 6bf13ae6..bb98c8c3 100644 --- a/module/applications/sheets/items/armor.mjs +++ b/module/applications/sheets/items/armor.mjs @@ -9,7 +9,7 @@ export default class ArmorSheet extends DHBaseItemSheet { { selector: '.features-input', options: () => CONFIG.DH.ITEM.armorFeatures, - callback: ArmorSheet.#onArmorFeatureSelect + callback: ArmorSheet.#onFeatureSelect } ] }; @@ -19,9 +19,9 @@ export default class ArmorSheet extends DHBaseItemSheet { header: { template: 'systems/daggerheart/templates/sheets/items/armor/header.hbs' }, tabs: { template: 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs' }, description: { template: 'systems/daggerheart/templates/sheets/global/tabs/tab-description.hbs' }, - features: { - template: 'systems/daggerheart/templates/sheets/global/tabs/tab-features.hbs', - scrollable: ['.features'] + actions: { + template: 'systems/daggerheart/templates/sheets/global/tabs/tab-actions.hbs', + scrollable: ['.actions'] }, settings: { template: 'systems/daggerheart/templates/sheets/items/armor/settings.hbs', @@ -35,7 +35,7 @@ export default class ArmorSheet extends DHBaseItemSheet { switch (partId) { case 'settings': - context.armorFeatures = this.document.system.armorFeatures.map(x => x.value); + context.features = this.document.system.features.map(x => x.value); break; } @@ -46,7 +46,7 @@ export default class ArmorSheet extends DHBaseItemSheet { * Callback function used by `tagifyElement`. * @param {Array} selectedOptions - The currently selected tag objects. */ - static async #onArmorFeatureSelect(selectedOptions) { - await this.document.update({ 'system.armorFeatures': selectedOptions.map(x => ({ value: x.value })) }); + static async #onFeatureSelect(selectedOptions) { + await this.document.update({ 'system.features': selectedOptions.map(x => ({ value: x.value })) }); } } diff --git a/module/applications/sheets/items/consumable.mjs b/module/applications/sheets/items/consumable.mjs index 8db63582..f6fb1ba5 100644 --- a/module/applications/sheets/items/consumable.mjs +++ b/module/applications/sheets/items/consumable.mjs @@ -12,9 +12,9 @@ export default class ConsumableSheet extends DHBaseItemSheet { header: { template: 'systems/daggerheart/templates/sheets/items/consumable/header.hbs' }, tabs: { template: 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs' }, description: { template: 'systems/daggerheart/templates/sheets/global/tabs/tab-description.hbs' }, - features: { - template: 'systems/daggerheart/templates/sheets/global/tabs/tab-features.hbs', - scrollable: ['.features'] + actions: { + template: 'systems/daggerheart/templates/sheets/global/tabs/tab-actions.hbs', + scrollable: ['.actions'] }, settings: { template: 'systems/daggerheart/templates/sheets/items/consumable/settings.hbs', diff --git a/module/applications/sheets/items/domainCard.mjs b/module/applications/sheets/items/domainCard.mjs index 75420d38..d7a70741 100644 --- a/module/applications/sheets/items/domainCard.mjs +++ b/module/applications/sheets/items/domainCard.mjs @@ -10,7 +10,7 @@ export default class DomainCardSheet extends DHBaseItemSheet { /** @override */ static TABS = { primary: { - tabs: [{ id: 'description' }, { id: 'features' }, { id: 'settings' }, { id: 'effects' }], + tabs: [{ id: 'description' }, { id: 'actions' }, { id: 'settings' }, { id: 'effects' }], initial: 'description', labelPrefix: 'DAGGERHEART.Sheets.TABS' } @@ -21,9 +21,9 @@ export default class DomainCardSheet extends DHBaseItemSheet { header: { template: 'systems/daggerheart/templates/sheets/items/domainCard/header.hbs' }, tabs: { template: 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs' }, description: { template: 'systems/daggerheart/templates/sheets/global/tabs/tab-description.hbs' }, - features: { - template: 'systems/daggerheart/templates/sheets/global/tabs/tab-features.hbs', - scrollable: ['.features'] + actions: { + template: 'systems/daggerheart/templates/sheets/global/tabs/tab-actions.hbs', + scrollable: ['.actions'] }, settings: { template: 'systems/daggerheart/templates/sheets/items/domainCard/settings.hbs', diff --git a/module/applications/sheets/items/miscellaneous.mjs b/module/applications/sheets/items/miscellaneous.mjs index fbd4f0c1..62df4e8c 100644 --- a/module/applications/sheets/items/miscellaneous.mjs +++ b/module/applications/sheets/items/miscellaneous.mjs @@ -12,9 +12,9 @@ export default class MiscellaneousSheet extends DHBaseItemSheet { header: { template: 'systems/daggerheart/templates/sheets/items/miscellaneous/header.hbs' }, tabs: { template: 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs' }, description: { template: 'systems/daggerheart/templates/sheets/global/tabs/tab-description.hbs' }, - features: { - template: 'systems/daggerheart/templates/sheets/global/tabs/tab-features.hbs', - scrollable: ['.features'] + actions: { + template: 'systems/daggerheart/templates/sheets/global/tabs/tab-actions.hbs', + scrollable: ['.actions'] }, settings: { template: 'systems/daggerheart/templates/sheets/items/miscellaneous/settings.hbs', diff --git a/module/applications/sheets/items/weapon.mjs b/module/applications/sheets/items/weapon.mjs index f3ea918c..fdce55fc 100644 --- a/module/applications/sheets/items/weapon.mjs +++ b/module/applications/sheets/items/weapon.mjs @@ -8,7 +8,7 @@ export default class WeaponSheet extends DHBaseItemSheet { { selector: '.features-input', options: () => CONFIG.DH.ITEM.weaponFeatures, - callback: WeaponSheet.#onWeaponFeatureSelect + callback: WeaponSheet.#onFeatureSelect } ] }; @@ -18,9 +18,9 @@ export default class WeaponSheet extends DHBaseItemSheet { header: { template: 'systems/daggerheart/templates/sheets/items/weapon/header.hbs' }, tabs: { template: 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs' }, description: { template: 'systems/daggerheart/templates/sheets/global/tabs/tab-description.hbs' }, - features: { - template: 'systems/daggerheart/templates/sheets/global/tabs/tab-features.hbs', - scrollable: ['.features'] + actions: { + template: 'systems/daggerheart/templates/sheets/global/tabs/tab-actions.hbs', + scrollable: ['.actions'] }, settings: { template: 'systems/daggerheart/templates/sheets/items/weapon/settings.hbs', @@ -34,7 +34,7 @@ export default class WeaponSheet extends DHBaseItemSheet { switch (partId) { case 'settings': - context.weaponFeatures = this.document.system.weaponFeatures.map(x => x.value); + context.features = this.document.system.features.map(x => x.value); break; } @@ -45,7 +45,7 @@ export default class WeaponSheet extends DHBaseItemSheet { * Callback function used by `tagifyElement`. * @param {Array} selectedOptions - The currently selected tag objects. */ - static async #onWeaponFeatureSelect(selectedOptions) { - await this.document.update({ 'system.weaponFeatures': selectedOptions.map(x => ({ value: x.value })) }); + static async #onFeatureSelect(selectedOptions) { + await this.document.update({ 'system.features': selectedOptions.map(x => ({ value: x.value })) }); } } diff --git a/module/data/item/armor.mjs b/module/data/item/armor.mjs index b3eac15d..4e5a26e6 100644 --- a/module/data/item/armor.mjs +++ b/module/data/item/armor.mjs @@ -1,6 +1,6 @@ import BaseDataItem from './base.mjs'; +import ActionField from '../fields/actionField.mjs'; import { armorFeatures } from '../../config/itemConfig.mjs'; -import ForeignDocumentUUIDArrayField from '../fields/foreignDocumentUUIDArrayField.mjs'; export default class DHArmor extends BaseDataItem { /** @inheritDoc */ @@ -22,7 +22,7 @@ export default class DHArmor extends BaseDataItem { tier: new fields.NumberField({ required: true, integer: true, initial: 1, min: 1 }), equipped: new fields.BooleanField({ initial: false }), baseScore: new fields.NumberField({ integer: true, initial: 0 }), - armorFeatures: new fields.ArrayField( + features: new fields.ArrayField( new fields.SchemaField({ value: new fields.StringField({ required: true, @@ -40,28 +40,32 @@ export default class DHArmor extends BaseDataItem { major: new fields.NumberField({ integer: true, initial: 0 }), severe: new fields.NumberField({ integer: true, initial: 0 }) }), - features: new ForeignDocumentUUIDArrayField({ type: 'Item' }) + actions: new fields.ArrayField(new ActionField()) }; } + get featureInfo() { + return this.feature ? CONFIG.DH.ITEM.armorFeatures[this.feature] : null; + } + async _preUpdate(changes, options, user) { const allowed = await super._preUpdate(changes, options, user); if (allowed === false) return false; - if (changes.system?.armorFeatures) { - const removed = this.armorFeatures.filter(x => !changes.system.armorFeatures.includes(x)); - const added = changes.system.armorFeatures.filter(x => !this.armorFeatures.includes(x)); + if (changes.system.features) { + const removed = this.features.filter(x => !changes.system.features.includes(x)); + const added = changes.system.features.filter(x => !this.features.includes(x)); - for (var armorFeature of removed) { - for (var effectId of armorFeature.effectIds) { + for (var feature of removed) { + for (var effectId of feature.effectIds) { await this.parent.effects.get(effectId).delete(); } - changes.system.actions = this.actions.filter(x => !armorFeature.actionIds.includes(x._id)); + changes.system.actions = this.actions.filter(x => !feature.actionIds.includes(x._id)); } - for (var armorFeature of added) { - const featureData = armorFeatures[armorFeature.value]; + for (var feature of added) { + const featureData = armorFeatures[feature.value]; if (featureData.effects?.length > 0) { const embeddedItems = await this.parent.createEmbeddedDocuments('ActiveEffect', [ { @@ -70,7 +74,7 @@ export default class DHArmor extends BaseDataItem { changes: featureData.effects.flatMap(x => x.changes) } ]); - armorFeature.effectIds = embeddedItems.map(x => x.id); + feature.effectIds = embeddedItems.map(x => x.id); } if (featureData.actions?.length > 0) { const newActions = featureData.actions.map(action => { @@ -81,7 +85,7 @@ export default class DHArmor extends BaseDataItem { ); }); changes.system.actions = [...this.actions, ...newActions]; - armorFeature.actionIds = newActions.map(x => x._id); + feature.actionIds = newActions.map(x => x._id); } } } diff --git a/module/data/item/consumable.mjs b/module/data/item/consumable.mjs index 78c7584a..3e70f97a 100644 --- a/module/data/item/consumable.mjs +++ b/module/data/item/consumable.mjs @@ -1,5 +1,5 @@ import BaseDataItem from './base.mjs'; -import ForeignDocumentUUIDArrayField from '../fields/foreignDocumentUUIDArrayField.mjs'; +import ActionField from '../fields/actionField.mjs'; export default class DHConsumable extends BaseDataItem { /** @inheritDoc */ @@ -19,7 +19,7 @@ export default class DHConsumable extends BaseDataItem { return { ...super.defineSchema(), consumeOnUse: new fields.BooleanField({ initial: false }), - features: new ForeignDocumentUUIDArrayField({ type: 'Item' }) + actions: new fields.ArrayField(new ActionField()) }; } } diff --git a/module/data/item/domainCard.mjs b/module/data/item/domainCard.mjs index 2f6a77ec..3f64d74f 100644 --- a/module/data/item/domainCard.mjs +++ b/module/data/item/domainCard.mjs @@ -1,5 +1,5 @@ import BaseDataItem from './base.mjs'; -import ForeignDocumentUUIDArrayField from '../fields/foreignDocumentUUIDArrayField.mjs'; +import ActionField from '../fields/actionField.mjs'; export default class DHDomainCard extends BaseDataItem { /** @inheritDoc */ @@ -30,7 +30,7 @@ export default class DHDomainCard extends BaseDataItem { }), foundation: new fields.BooleanField({ initial: false }), inVault: new fields.BooleanField({ initial: false }), - features: new ForeignDocumentUUIDArrayField({ type: 'Item' }) + actions: new fields.ArrayField(new ActionField()) }; } diff --git a/module/data/item/miscellaneous.mjs b/module/data/item/miscellaneous.mjs index 87f2b242..cad07f48 100644 --- a/module/data/item/miscellaneous.mjs +++ b/module/data/item/miscellaneous.mjs @@ -1,5 +1,5 @@ import BaseDataItem from './base.mjs'; -import ForeignDocumentUUIDArrayField from '../fields/foreignDocumentUUIDArrayField.mjs'; +import ActionField from '../fields/actionField.mjs'; export default class DHMiscellaneous extends BaseDataItem { /** @inheritDoc */ @@ -15,9 +15,10 @@ export default class DHMiscellaneous extends BaseDataItem { /** @inheritDoc */ static defineSchema() { + const fields = foundry.data.fields; return { ...super.defineSchema(), - features: new ForeignDocumentUUIDArrayField({ type: 'Item' }) + actions: new fields.ArrayField(new ActionField()) }; } } diff --git a/module/data/item/weapon.mjs b/module/data/item/weapon.mjs index a9104f5c..6b760083 100644 --- a/module/data/item/weapon.mjs +++ b/module/data/item/weapon.mjs @@ -1,6 +1,6 @@ import BaseDataItem from './base.mjs'; import { actionsTypes } from '../action/_module.mjs'; -import ForeignDocumentUUIDArrayField from '../fields/foreignDocumentUUIDArrayField.mjs'; +import ActionField from '../fields/actionField.mjs'; export default class DHWeapon extends BaseDataItem { /** @inheritDoc */ @@ -38,7 +38,7 @@ export default class DHWeapon extends BaseDataItem { initial: 'physical' }) }), - weaponFeatures: new fields.ArrayField( + features: new fields.ArrayField( new fields.SchemaField({ value: new fields.StringField({ required: true, @@ -49,7 +49,7 @@ export default class DHWeapon extends BaseDataItem { actionIds: new fields.ArrayField(new fields.StringField({ required: true })) }) ), - features: new ForeignDocumentUUIDArrayField({ type: 'Item' }) + actions: new fields.ArrayField(new ActionField()) }; } @@ -57,9 +57,9 @@ export default class DHWeapon extends BaseDataItem { const allowed = await super._preUpdate(changes, options, user); if (allowed === false) return false; - if (changes.system?.weaponFeatures) { - const removed = this.weaponFeatures.filter(x => !changes.system.weaponFeatures.includes(x)); - const added = changes.system.weaponFeatures.filter(x => !this.weaponFeatures.includes(x)); + if (changes.system?.features) { + const removed = this.features.filter(x => !changes.system.features.includes(x)); + const added = changes.system.features.filter(x => !this.features.includes(x)); for (var weaponFeature of removed) { for (var effectId of weaponFeature.effectIds) { diff --git a/templates/sheets/actors/adversary/effects.hbs b/templates/sheets/actors/adversary/effects.hbs index 9046fff8..817b07ae 100644 --- a/templates/sheets/actors/adversary/effects.hbs +++ b/templates/sheets/actors/adversary/effects.hbs @@ -4,5 +4,5 @@ data-group='{{tabs.effects.group}}' > {{> 'systems/daggerheart/templates/sheets/global/partials/inventory-fieldset-items.hbs' title=(localize 'DAGGERHEART.Sheets.Global.activeEffects') type='effect'}} - {{> 'systems/daggerheart/templates/sheets/global/partials/inventory-fieldset-items.hbs' title=(localize 'DAGGERHEART.Sheets.Global.inativeEffects') type='effect'}} + {{> 'systems/daggerheart/templates/sheets/global/partials/inventory-fieldset-items.hbs' title=(localize 'DAGGERHEART.Sheets.Global.inactiveEffects') type='effect'}} \ No newline at end of file diff --git a/templates/sheets/actors/character/effects.hbs b/templates/sheets/actors/character/effects.hbs index 9046fff8..817b07ae 100644 --- a/templates/sheets/actors/character/effects.hbs +++ b/templates/sheets/actors/character/effects.hbs @@ -4,5 +4,5 @@ data-group='{{tabs.effects.group}}' > {{> 'systems/daggerheart/templates/sheets/global/partials/inventory-fieldset-items.hbs' title=(localize 'DAGGERHEART.Sheets.Global.activeEffects') type='effect'}} - {{> 'systems/daggerheart/templates/sheets/global/partials/inventory-fieldset-items.hbs' title=(localize 'DAGGERHEART.Sheets.Global.inativeEffects') type='effect'}} + {{> 'systems/daggerheart/templates/sheets/global/partials/inventory-fieldset-items.hbs' title=(localize 'DAGGERHEART.Sheets.Global.inactiveEffects') type='effect'}} \ No newline at end of file diff --git a/templates/sheets/actors/companion/effects.hbs b/templates/sheets/actors/companion/effects.hbs index 9046fff8..817b07ae 100644 --- a/templates/sheets/actors/companion/effects.hbs +++ b/templates/sheets/actors/companion/effects.hbs @@ -4,5 +4,5 @@ data-group='{{tabs.effects.group}}' > {{> 'systems/daggerheart/templates/sheets/global/partials/inventory-fieldset-items.hbs' title=(localize 'DAGGERHEART.Sheets.Global.activeEffects') type='effect'}} - {{> 'systems/daggerheart/templates/sheets/global/partials/inventory-fieldset-items.hbs' title=(localize 'DAGGERHEART.Sheets.Global.inativeEffects') type='effect'}} + {{> 'systems/daggerheart/templates/sheets/global/partials/inventory-fieldset-items.hbs' title=(localize 'DAGGERHEART.Sheets.Global.inactiveEffects') type='effect'}} \ No newline at end of file diff --git a/templates/sheets/global/partials/inventory-fieldset-items.hbs b/templates/sheets/global/partials/inventory-fieldset-items.hbs index e73988c7..6a44e4cd 100644 --- a/templates/sheets/global/partials/inventory-fieldset-items.hbs +++ b/templates/sheets/global/partials/inventory-fieldset-items.hbs @@ -2,7 +2,7 @@ {{title}}
    {{#unless (eq cardView 'card') }} - {{#if (eq type 'domainCard')}} + {{#if (or (eq type 'domainCard') (eq type 'armor') (eq type 'consumable') (eq type 'miscellaneous') (eq type 'weapon'))}} {{#each document.items as |item|}} {{#if (eq item.type ../type)}} {{#unless (and (eq ../type 'domainCard') (or (and item.system.inVault (not ../isVault)) (and (not item.system.inVault) ../isVault)))}}