feat: update for v10

This commit is contained in:
Johannes Loher 2022-11-21 03:00:46 +01:00
parent 6277e27056
commit f25b46a226
63 changed files with 41349 additions and 24332 deletions

View file

@ -6,7 +6,6 @@
import { DS4 } from "../config";
import { DS4ActiveEffect } from "../documents/active-effect";
import { isDS4ItemDataTypePhysical } from "../documents/item/item-data-source-base";
import { notifications } from "../ui/notifications";
import { enforce, getGame } from "../utils/utils";
import { disableOverriddenFields } from "./sheet-helpers";
@ -29,19 +28,22 @@ export class DS4ItemSheet extends ItemSheet {
/** @override */
get template() {
const basePath = "systems/ds4/templates/sheets/item";
return `${basePath}/${this.item.data.type}-sheet.hbs`;
return `${basePath}/${this.item.type}-sheet.hbs`;
}
/** @override */
async getData() {
const data = {
...(await super.getData()),
async getData(options = {}) {
const superContext = await super.getData(options);
superContext.data.system.description = await TextEditor.enrichHTML(superContext.data.system.description, {
async: true,
});
const context = {
...superContext,
config: DS4,
isOwned: this.item.isOwned,
actor: this.item.actor,
isPhysical: isDS4ItemDataTypePhysical(this.item.data.data),
};
return data;
return context;
}
/** @override */