diff --git a/module/applications/sheets/items/class.mjs b/module/applications/sheets/items/class.mjs index c78e1de1..3dce0a11 100644 --- a/module/applications/sheets/items/class.mjs +++ b/module/applications/sheets/items/class.mjs @@ -113,45 +113,47 @@ export default class ClassSheet extends DHBaseItemSheet { }); } else if (item.type === 'feature') { super._onDrop(event); - } else if (item.type === 'weapon') { - if (target.classList.contains('primary-weapon-section')) { - if (!item.system.secondary) + } else if (this.document.parent?.type !== 'character') { + if (item.type === 'weapon') { + if (target.classList.contains('primary-weapon-section')) { + if (!item.system.secondary) + await this.document.update({ + 'system.characterGuide.suggestedPrimaryWeapon': item.uuid + }); + } else if (target.classList.contains('secondary-weapon-section')) { + if (item.system.secondary) + await this.document.update({ + 'system.characterGuide.suggestedSecondaryWeapon': item.uuid + }); + } + } else if (item.type === 'armor') { + if (target.classList.contains('armor-section')) { await this.document.update({ - 'system.characterGuide.suggestedPrimaryWeapon': item.uuid - }); - } else if (target.classList.contains('secondary-weapon-section')) { - if (item.system.secondary) - await this.document.update({ - 'system.characterGuide.suggestedSecondaryWeapon': item.uuid - }); - } - } else if (item.type === 'armor') { - if (target.classList.contains('armor-section')) { - await this.document.update({ - 'system.characterGuide.suggestedArmor': item.uuid - }); - } - } else if (target.classList.contains('choice-a-section')) { - if (item.type === 'loot' || item.type === 'consumable') { - const filteredChoiceA = this.document.system.inventory.choiceA; - if (filteredChoiceA.length < 2) - await this.document.update({ - 'system.inventory.choiceA': [...filteredChoiceA.map(x => x.uuid), item.uuid] - }); - } - } else if (item.type === 'loot') { - if (target.classList.contains('take-section')) { - const filteredTake = this.document.system.inventory.take.filter(x => x); - if (filteredTake.length < 3) - await this.document.update({ - 'system.inventory.take': [...filteredTake.map(x => x.uuid), item.uuid] - }); - } else if (target.classList.contains('choice-b-section')) { - const filteredChoiceB = this.document.system.inventory.choiceB.filter(x => x); - if (filteredChoiceB.length < 2) - await this.document.update({ - 'system.inventory.choiceB': [...filteredChoiceB.map(x => x.uuid), item.uuid] + 'system.characterGuide.suggestedArmor': item.uuid }); + } + } else if (target.classList.contains('choice-a-section')) { + if (item.type === 'loot' || item.type === 'consumable') { + const filteredChoiceA = this.document.system.inventory.choiceA; + if (filteredChoiceA.length < 2) + await this.document.update({ + 'system.inventory.choiceA': [...filteredChoiceA.map(x => x.uuid), item.uuid] + }); + } + } else if (item.type === 'loot') { + if (target.classList.contains('take-section')) { + const filteredTake = this.document.system.inventory.take.filter(x => x); + if (filteredTake.length < 3) + await this.document.update({ + 'system.inventory.take': [...filteredTake.map(x => x.uuid), item.uuid] + }); + } else if (target.classList.contains('choice-b-section')) { + const filteredChoiceB = this.document.system.inventory.choiceB.filter(x => x); + if (filteredChoiceB.length < 2) + await this.document.update({ + 'system.inventory.choiceB': [...filteredChoiceB.map(x => x.uuid), item.uuid] + }); + } } } } diff --git a/styles/less/global/elements.less b/styles/less/global/elements.less index 8a3677ae..1bdc105e 100755 --- a/styles/less/global/elements.less +++ b/styles/less/global/elements.less @@ -206,6 +206,10 @@ } } + &.inactive { + opacity: 0.5; + } + &.fit-height { height: 95%; } diff --git a/templates/sheets/items/class/settings.hbs b/templates/sheets/items/class/settings.hbs index 662e7507..9ac2b14f 100644 --- a/templates/sheets/items/class/settings.hbs +++ b/templates/sheets/items/class/settings.hbs @@ -31,10 +31,10 @@ {{localize "DAGGERHEART.CONFIG.Traits.knowledge.name"}} - +