diff --git a/module/data/actor/character.mjs b/module/data/actor/character.mjs index c40e7e5d..c5e250a4 100644 --- a/module/data/actor/character.mjs +++ b/module/data/actor/character.mjs @@ -351,6 +351,17 @@ export default class DhCharacter extends BaseDataActor { return [...classDomains, ...multiclassDomains]; } + get domainData() { + const allDomainData = CONFIG.DH.DOMAIN.allDomains(); + return this.domains.map(key => { + const domain = allDomainData[key]; + return { + ...domain, + label: game.i18n.localize(domain.label) + }; + }); + } + get domainCards() { const domainCards = this.parent.items.filter(x => x.type === 'domainCard'); const loadout = domainCards.filter(x => !x.system.inVault); diff --git a/module/data/item/class.mjs b/module/data/item/class.mjs index cee17613..45e8b4ab 100644 --- a/module/data/item/class.mjs +++ b/module/data/item/class.mjs @@ -60,17 +60,6 @@ export default class DHClass extends BaseDataItem { /* -------------------------------------------- */ - get domainData() { - const allDomainData = CONFIG.DH.DOMAIN.allDomains(); - return this.domains.map(key => { - const domain = allDomainData[key]; - return { - ...domain, - label: game.i18n.localize(domain.label) - }; - }); - } - get hopeFeatures() { return this.features.filter(x => x.type === CONFIG.DH.ITEM.featureSubTypes.hope).map(x => x.item); } diff --git a/module/data/item/subclass.mjs b/module/data/item/subclass.mjs index 771da897..221785b3 100644 --- a/module/data/item/subclass.mjs +++ b/module/data/item/subclass.mjs @@ -51,7 +51,7 @@ export default class DHSubclass extends BaseDataItem { async _preCreate(data, options, user) { if (this.actor?.type === 'character') { const dataUuid = - data.uuid ?? data._stats?.compendiumSource ?? `Compendium.daggerheart.subclasses.Item.${data._id}`; + (data.uuid ?? data.folder) ? `Compendium.daggerheart.subclasses.Item.${data._id}` : `Item.${data._id}`; if (this.actor.system.class.subclass) { if (this.actor.system.multiclass.subclass) { ui.notifications.warn(game.i18n.localize('DAGGERHEART.UI.Notifications.subclassesAlreadyPresent')); diff --git a/module/helpers/utils.mjs b/module/helpers/utils.mjs index 3dc1f7ed..63507782 100644 --- a/module/helpers/utils.mjs +++ b/module/helpers/utils.mjs @@ -85,13 +85,12 @@ export const chunkify = (array, chunkSize, mappingFunc) => { export const tagifyElement = (element, baseOptions, onChange, tagifyOptions = {}) => { const { maxTags } = tagifyOptions; - const options = - typeof baseOptions === 'object' - ? Object.keys(baseOptions).map(optionKey => ({ - ...baseOptions[optionKey], - id: optionKey - })) - : baseOptions; + const options = Array.isArray(baseOptions) + ? baseOptions + : Object.keys(baseOptions).map(optionKey => ({ + ...baseOptions[optionKey], + id: optionKey + })); const tagifyElement = new Tagify(element, { tagTextProp: 'name', diff --git a/templates/sheets/actors/character/header.hbs b/templates/sheets/actors/character/header.hbs index 7f598f55..9f2d56a1 100644 --- a/templates/sheets/actors/character/header.hbs +++ b/templates/sheets/actors/character/header.hbs @@ -87,7 +87,7 @@ {{#if document.system.class.value}}