mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-15 05:01: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 { 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() {
|
async renderHTML() {
|
||||||
/* We can change to fully implementing the renderHTML function if needed, instead of augmenting it. */
|
/* We can change to fully implementing the renderHTML function if needed, instead of augmenting it. */
|
||||||
const html = await super.renderHTML();
|
const html = await super.renderHTML();
|
||||||
|
|
@ -13,8 +13,8 @@ export default class DhpChatMessage extends ChatMessage {
|
||||||
) {
|
) {
|
||||||
html.classList.add('duality');
|
html.classList.add('duality');
|
||||||
const dualityResult = this.system.dualityResult;
|
const dualityResult = this.system.dualityResult;
|
||||||
if (dualityResult === DhpDualityRoll.dualityResult.hope) html.classList.add('hope');
|
if (dualityResult === DHDualityRoll.dualityResult.hope) html.classList.add('hope');
|
||||||
else if (dualityResult === DhpDualityRoll.dualityResult.fear) html.classList.add('fear');
|
else if (dualityResult === DHDualityRoll.dualityResult.fear) html.classList.add('fear');
|
||||||
else html.classList.add('critical');
|
else html.classList.add('critical');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -199,42 +199,32 @@ export default class ClassSheet extends DaggerheartSheet(ItemSheetV2) {
|
||||||
if (item.type === 'subclass') {
|
if (item.type === 'subclass') {
|
||||||
await this.document.update({
|
await this.document.update({
|
||||||
'system.subclasses': [
|
'system.subclasses': [
|
||||||
...this.document.system.subclasses,
|
...this.document.system.subclasses, item.uuid
|
||||||
{ img: item.img, name: item.name, uuid: item.uuid }
|
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
} else if (item.type === 'feature') {
|
} else if (item.type === 'feature') {
|
||||||
await this.document.update({
|
await this.document.update({
|
||||||
'system.features': [
|
'system.features': [
|
||||||
...this.document.system.features,
|
...this.document.system.features, item.uuid
|
||||||
{ img: item.img, name: item.name, uuid: item.uuid }
|
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
} else if (item.type === 'weapon') {
|
} else if (item.type === 'weapon') {
|
||||||
if (event.currentTarget.classList.contains('primary-weapon-section')) {
|
if (event.currentTarget.classList.contains('primary-weapon-section')) {
|
||||||
if (!this.document.system.characterGuide.suggestedPrimaryWeapon && !item.system.secondary)
|
if (!this.document.system.characterGuide.suggestedPrimaryWeapon && !item.system.secondary)
|
||||||
await this.document.update({
|
await this.document.update({
|
||||||
'system.characterGuide.suggestedPrimaryWeapon': {
|
'system.characterGuide.suggestedPrimaryWeapon': item.uuid
|
||||||
img: item.img,
|
|
||||||
name: item.name,
|
|
||||||
uuid: item.uuid
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
} else if (event.currentTarget.classList.contains('secondary-weapon-section')) {
|
} else if (event.currentTarget.classList.contains('secondary-weapon-section')) {
|
||||||
if (!this.document.system.characterGuide.suggestedSecondaryWeapon && item.system.secondary)
|
if (!this.document.system.characterGuide.suggestedSecondaryWeapon && item.system.secondary)
|
||||||
await this.document.update({
|
await this.document.update({
|
||||||
'system.characterGuide.suggestedSecondaryWeapon': {
|
'system.characterGuide.suggestedSecondaryWeapon': item.uuid
|
||||||
img: item.img,
|
|
||||||
name: item.name,
|
|
||||||
uuid: item.uuid
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else if (item.type === 'armor') {
|
} else if (item.type === 'armor') {
|
||||||
if (event.currentTarget.classList.contains('armor-section')) {
|
if (event.currentTarget.classList.contains('armor-section')) {
|
||||||
if (!this.document.system.characterGuide.suggestedArmor)
|
if (!this.document.system.characterGuide.suggestedArmor)
|
||||||
await this.document.update({
|
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')) {
|
} 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)
|
if (this.document.system.inventory.choiceA.length < 2)
|
||||||
await this.document.update({
|
await this.document.update({
|
||||||
'system.inventory.choiceA': [
|
'system.inventory.choiceA': [
|
||||||
...this.document.system.inventory.choiceA,
|
...this.document.system.inventory.choiceA, item.uuid
|
||||||
{ img: item.img, name: item.name, uuid: item.uuid }
|
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -252,16 +241,14 @@ export default class ClassSheet extends DaggerheartSheet(ItemSheetV2) {
|
||||||
if (this.document.system.inventory.take.length < 3)
|
if (this.document.system.inventory.take.length < 3)
|
||||||
await this.document.update({
|
await this.document.update({
|
||||||
'system.inventory.take': [
|
'system.inventory.take': [
|
||||||
...this.document.system.inventory.take,
|
...this.document.system.inventory.take, item.uuid
|
||||||
{ img: item.img, name: item.name, uuid: item.uuid }
|
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
} else if (event.currentTarget.classList.contains('choice-b-section')) {
|
} else if (event.currentTarget.classList.contains('choice-b-section')) {
|
||||||
if (this.document.system.inventory.choiceB.length < 2)
|
if (this.document.system.inventory.choiceB.length < 2)
|
||||||
await this.document.update({
|
await this.document.update({
|
||||||
'system.inventory.choiceB': [
|
'system.inventory.choiceB': [
|
||||||
...this.document.system.inventory.choiceB,
|
...this.document.system.inventory.choiceB, item.uuid
|
||||||
{ img: item.img, name: item.name, uuid: item.uuid }
|
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { DualityRollColor } from './settings/Appearance.mjs';
|
import { DualityRollColor } from "../settings/Appearance.mjs";
|
||||||
|
|
||||||
const fields = foundry.data.fields;
|
const fields = foundry.data.fields;
|
||||||
const diceField = () =>
|
const diceField = () =>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,9 @@
|
||||||
/**
|
/**
|
||||||
|
* Describes metadata about the item data model type
|
||||||
* @typedef {Object} ItemDataModelMetadata
|
* @typedef {Object} ItemDataModelMetadata
|
||||||
* @property {String} type - System type that this type data model represents
|
* @property {string} type - The system type that this data model represents (e.g., "weapon", "armor", "consumable")
|
||||||
* @property {Boolean} hasDescription
|
* @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;
|
const fields = foundry.data.fields;
|
||||||
|
|
|
||||||
|
|
@ -38,10 +38,10 @@
|
||||||
<fieldset class="one-column drop-section primary-weapon-section">
|
<fieldset class="one-column drop-section primary-weapon-section">
|
||||||
<legend>{{localize "DAGGERHEART.Sheets.Class.Guide.SuggestedPrimaryWeaponTitle"}}</legend>
|
<legend>{{localize "DAGGERHEART.Sheets.Class.Guide.SuggestedPrimaryWeaponTitle"}}</legend>
|
||||||
<div class="drop-section-body list-items">
|
<div class="drop-section-body list-items">
|
||||||
{{#if source.system.characterGuide.suggestedPrimaryWeapon}}
|
{{#if document.system.characterGuide.suggestedPrimaryWeapon}}
|
||||||
<div class="suggested-item item-line" data-action="viewItem" data-item="{{source.system.characterGuide.suggestedPrimaryWeapon.uuid}}">
|
<div class="suggested-item item-line" data-action="viewItem" data-item="{{document.system.characterGuide.suggestedPrimaryWeapon.uuid}}">
|
||||||
<img class="image" src="{{source.system.characterGuide.suggestedPrimaryWeapon.img}}" />
|
<img class="image" src="{{document.system.characterGuide.suggestedPrimaryWeapon.img}}" />
|
||||||
<span>{{source.system.characterGuide.suggestedPrimaryWeapon.name}}</span>
|
<span>{{document.system.characterGuide.suggestedPrimaryWeapon.name}}</span>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<i data-action="removePrimaryWeapon" class="fa-solid fa-trash icon-button"></i>
|
<i data-action="removePrimaryWeapon" class="fa-solid fa-trash icon-button"></i>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -53,10 +53,10 @@
|
||||||
<fieldset class="one-column drop-section secondary-weapon-section">
|
<fieldset class="one-column drop-section secondary-weapon-section">
|
||||||
<legend>{{localize "DAGGERHEART.Sheets.Class.Guide.SuggestedSecondaryWeaponTitle"}}</legend>
|
<legend>{{localize "DAGGERHEART.Sheets.Class.Guide.SuggestedSecondaryWeaponTitle"}}</legend>
|
||||||
<div class="drop-section-body list-items">
|
<div class="drop-section-body list-items">
|
||||||
{{#if source.system.characterGuide.suggestedSecondaryWeapon}}
|
{{#if document.system.characterGuide.suggestedSecondaryWeapon}}
|
||||||
<div class="suggested-item item-line" data-action="viewItem" data-item="{{source.system.characterGuide.suggestedSecondaryWeapon.uuid}}">
|
<div class="suggested-item item-line" data-action="viewItem" data-item="{{system.system.characterGuide.suggestedSecondaryWeapon.uuid}}">
|
||||||
<img class="image" src="{{source.system.characterGuide.suggestedSecondaryWeapon.img}}" />
|
<img class="image" src="{{document.system.characterGuide.suggestedSecondaryWeapon.img}}" />
|
||||||
<span>{{source.system.characterGuide.suggestedSecondaryWeapon.name}}</span>
|
<span>{{document.system.characterGuide.suggestedSecondaryWeapon.name}}</span>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<i data-action="removeSecondaryWeapon" class="fa-solid fa-trash icon-button"></i>
|
<i data-action="removeSecondaryWeapon" class="fa-solid fa-trash icon-button"></i>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -68,10 +68,10 @@
|
||||||
<fieldset class="one-column drop-section armor-section">
|
<fieldset class="one-column drop-section armor-section">
|
||||||
<legend>{{localize "DAGGERHEART.Sheets.Class.Guide.SuggestedArmorTitle"}}</legend>
|
<legend>{{localize "DAGGERHEART.Sheets.Class.Guide.SuggestedArmorTitle"}}</legend>
|
||||||
<div class="drop-section-body list-items">
|
<div class="drop-section-body list-items">
|
||||||
{{#if source.system.characterGuide.suggestedArmor}}
|
{{#if document.system.characterGuide.suggestedArmor}}
|
||||||
<div class="suggested-item item-line" data-action="viewItem" data-item="{{source.system.characterGuide.suggestedArmor.uuid}}">
|
<div class="suggested-item item-line" data-action="viewItem" data-item="{{document.system.characterGuide.suggestedArmor.uuid}}">
|
||||||
<img class="image" src="{{source.system.characterGuide.suggestedArmor.img}}" />
|
<img class="image" src="{{document.system.characterGuide.suggestedArmor.img}}" />
|
||||||
<span>{{source.system.characterGuide.suggestedArmor.name}}</span>
|
<span>{{document.system.characterGuide.suggestedArmor.name}}</span>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<i data-action="removeArmor" class="fa-solid fa-trash icon-button"></i>
|
<i data-action="removeArmor" class="fa-solid fa-trash icon-button"></i>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue