diff --git a/module/applications/chatMessage.mjs b/module/applications/chatMessage.mjs index a8cf6f50..dfd32b3a 100644 --- a/module/applications/chatMessage.mjs +++ b/module/applications/chatMessage.mjs @@ -1,7 +1,7 @@ -import DhpDualityRoll from '../data/dualityRoll.mjs'; import { DualityRollColor } from '../data/settings/Appearance.mjs'; +import DHDualityRoll from "../data/chat-message/dualityRoll.mjs"; -export default class DhpChatMessage extends ChatMessage { +export default class DhpChatMessage extends foundry.documents.ChatMessage { async renderHTML() { /* We can change to fully implementing the renderHTML function if needed, instead of augmenting it. */ const html = await super.renderHTML(); @@ -13,8 +13,8 @@ export default class DhpChatMessage extends ChatMessage { ) { html.classList.add('duality'); const dualityResult = this.system.dualityResult; - if (dualityResult === DhpDualityRoll.dualityResult.hope) html.classList.add('hope'); - else if (dualityResult === DhpDualityRoll.dualityResult.fear) html.classList.add('fear'); + if (dualityResult === DHDualityRoll.dualityResult.hope) html.classList.add('hope'); + else if (dualityResult === DHDualityRoll.dualityResult.fear) html.classList.add('fear'); else html.classList.add('critical'); } diff --git a/module/applications/sheets/items/class.mjs b/module/applications/sheets/items/class.mjs index 2241a715..978a3f9a 100644 --- a/module/applications/sheets/items/class.mjs +++ b/module/applications/sheets/items/class.mjs @@ -199,42 +199,32 @@ export default class ClassSheet extends DaggerheartSheet(ItemSheetV2) { if (item.type === 'subclass') { await this.document.update({ 'system.subclasses': [ - ...this.document.system.subclasses, - { img: item.img, name: item.name, uuid: item.uuid } + ...this.document.system.subclasses, item.uuid ] }); } else if (item.type === 'feature') { await this.document.update({ 'system.features': [ - ...this.document.system.features, - { img: item.img, name: item.name, uuid: item.uuid } + ...this.document.system.features, item.uuid ] }); } else if (item.type === 'weapon') { if (event.currentTarget.classList.contains('primary-weapon-section')) { if (!this.document.system.characterGuide.suggestedPrimaryWeapon && !item.system.secondary) await this.document.update({ - 'system.characterGuide.suggestedPrimaryWeapon': { - img: item.img, - name: item.name, - uuid: item.uuid - } + 'system.characterGuide.suggestedPrimaryWeapon': item.uuid }); } else if (event.currentTarget.classList.contains('secondary-weapon-section')) { if (!this.document.system.characterGuide.suggestedSecondaryWeapon && item.system.secondary) await this.document.update({ - 'system.characterGuide.suggestedSecondaryWeapon': { - img: item.img, - name: item.name, - uuid: item.uuid - } + 'system.characterGuide.suggestedSecondaryWeapon': item.uuid }); } } else if (item.type === 'armor') { if (event.currentTarget.classList.contains('armor-section')) { if (!this.document.system.characterGuide.suggestedArmor) await this.document.update({ - 'system.characterGuide.suggestedArmor': { img: item.img, name: item.name, uuid: item.uuid } + 'system.characterGuide.suggestedArmor': item.uuid }); } } else if (event.currentTarget.classList.contains('choice-a-section')) { @@ -242,8 +232,7 @@ export default class ClassSheet extends DaggerheartSheet(ItemSheetV2) { if (this.document.system.inventory.choiceA.length < 2) await this.document.update({ 'system.inventory.choiceA': [ - ...this.document.system.inventory.choiceA, - { img: item.img, name: item.name, uuid: item.uuid } + ...this.document.system.inventory.choiceA, item.uuid ] }); } @@ -252,16 +241,14 @@ export default class ClassSheet extends DaggerheartSheet(ItemSheetV2) { if (this.document.system.inventory.take.length < 3) await this.document.update({ 'system.inventory.take': [ - ...this.document.system.inventory.take, - { img: item.img, name: item.name, uuid: item.uuid } + ...this.document.system.inventory.take, item.uuid ] }); } else if (event.currentTarget.classList.contains('choice-b-section')) { if (this.document.system.inventory.choiceB.length < 2) await this.document.update({ 'system.inventory.choiceB': [ - ...this.document.system.inventory.choiceB, - { img: item.img, name: item.name, uuid: item.uuid } + ...this.document.system.inventory.choiceB, item.uuid ] }); } diff --git a/module/data/chat-message/dualityRoll.mjs b/module/data/chat-message/dualityRoll.mjs index f82a913e..965eff01 100644 --- a/module/data/chat-message/dualityRoll.mjs +++ b/module/data/chat-message/dualityRoll.mjs @@ -1,4 +1,4 @@ -import { DualityRollColor } from './settings/Appearance.mjs'; +import { DualityRollColor } from "../settings/Appearance.mjs"; const fields = foundry.data.fields; const diceField = () => diff --git a/module/data/item/base.mjs b/module/data/item/base.mjs index a10c4d69..c7815ccd 100644 --- a/module/data/item/base.mjs +++ b/module/data/item/base.mjs @@ -1,7 +1,9 @@ /** + * Describes metadata about the item data model type * @typedef {Object} ItemDataModelMetadata - * @property {String} type - System type that this type data model represents - * @property {Boolean} hasDescription + * @property {string} type - The system type that this data model represents (e.g., "weapon", "armor", "consumable") + * @property {boolean} hasDescription - Indicates whether items of this type have description field + * @property {boolean} isQuantifiable - Indicates whether items of this type have quantity field */ const fields = foundry.data.fields; diff --git a/templates/sheets/items/class/settings.hbs b/templates/sheets/items/class/settings.hbs index 3ae98111..1333bc9a 100644 --- a/templates/sheets/items/class/settings.hbs +++ b/templates/sheets/items/class/settings.hbs @@ -38,10 +38,10 @@