Update Simple Worldbuilding for Foundry 0.8.x Compatibility

This commit is contained in:
Andrew 2021-05-18 17:36:07 -04:00
parent ee8814b76a
commit fb0add4cbc
11 changed files with 295 additions and 301 deletions

22
module/item.js Normal file
View file

@ -0,0 +1,22 @@
import {EntitySheetHelper} from "./helper.js";
/**
* Extend the base Item document to support attributes and groups with a custom template creation dialog.
* @extends {Item}
*/
export class SimpleItem extends Item {
/** @inheritdoc */
prepareDerivedData() {
super.prepareDerivedData();
this.data.data.groups = this.data.data.groups || {};
this.data.data.attributes = this.data.data.attributes || {};
}
/* -------------------------------------------- */
/** @override */
static async createDialog(data={}, options={}) {
return EntitySheetHelper.createDialog.call(this, data, options);
}
}