Foundry v10 version

This commit is contained in:
2022-07-01 15:48:54 +02:00
parent d27b78d1d2
commit cc1964093d
23 changed files with 320 additions and 330 deletions

View File

@ -7,21 +7,17 @@ export class BoLItem extends Item {
* Augment the basic Item data model with additional dynamic data.
*/
prepareData() {
super.prepareData();
// console.debug("Item prepareData");
// Get the Item's data
const itemData = this.data;
// console.log(itemData);
const actorData = this.actor ? this.actor.data : {};
const data = itemData.data;
}
super.prepareData()
get properties() {
return this.data.properties;
const actorData = this.actor ? this.actor.system : {}
}
/* -------------------------------------------- */
get properties() {
return this.system.properties
}
/* -------------------------------------------- */
/**
* Get the Array of item properties which are used in the small sidebar of the description tab
* @return {Array}
@ -29,11 +25,11 @@ export class BoLItem extends Item {
*/
get itemProperties() {
const props = [];
if ( this.data.type === "item" ) {
const entries = Object.entries(this.data.data.properties);
props.push(...entries.filter(e => e[1] === true).map(e => { return game.bol.config.itemProperties2[e[0]] }));
if ( this.type === "item" ) {
const entries = Object.entries(this.system.properties)
props.push(...entries.filter(e => e[1] === true).map(e => { return game.bol.config.itemProperties2[e[0]] }))
}
return props.filter(p => !!p);
return props.filter(p => !!p)
}