mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 11:41:08 +01:00
FIX: imports
FIX: items sheet new paths FIX: ItemDataModelMetadata type jsdoc
This commit is contained in:
parent
08a21dcb2f
commit
80cedbe4d2
5 changed files with 29 additions and 40 deletions
|
|
@ -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');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
]
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue