From a4881854a3dc81e51d5dbb60bf24c3d049304eb9 Mon Sep 17 00:00:00 2001 From: Joaquin Pereyra Date: Sat, 28 Jun 2025 13:42:18 -0300 Subject: [PATCH] REFACTOR: remove DhpApplicationMixin REFACTOR: remove getEmbeddedDocument method from Item class REFACTOR: remove prepareData method from Actor class REFACTOR: remove _preUpdate method from Actor class --- module/applications/daggerheart-sheet.mjs | 48 ----------------------- module/documents/actor.mjs | 8 ---- module/documents/item.mjs | 10 ----- 3 files changed, 66 deletions(-) delete mode 100644 module/applications/daggerheart-sheet.mjs diff --git a/module/applications/daggerheart-sheet.mjs b/module/applications/daggerheart-sheet.mjs deleted file mode 100644 index 32d5212e..00000000 --- a/module/applications/daggerheart-sheet.mjs +++ /dev/null @@ -1,48 +0,0 @@ -export default function DhpApplicationMixin(Base) { - return class DhpSheet extends Base { - static applicationType = 'sheets'; - static documentType = ''; - - static get defaultOptions() { - return Object.assign(super.defaultOptions, { - classes: ['daggerheart', 'sheet', this.documentType], - template: `systems/${SYSTEM.id}/templates/${this.applicationType}/${this.documentType}.hbs`, - height: 'auto', - submitOnChange: true, - submitOnClose: false, - width: 450 - }); - } - - /** @override */ - get title() { - const { documentName, type, name } = this.object; - // const typeLabel = game.i18n.localize(CONFIG[documentName].typeLabels[type]); - const typeLabel = documentName; - return `[${typeLabel}] ${name}`; - } - - // async _renderOuter() { - // const html = await super._renderOuter(); - // // const overlaySrc = "systems/amia/assets/ThePrimordial.png"; - // const overlay = `
` - // $(html).find('.window-header').prepend(overlay); - // return html; - // } - - activateListeners(html) { - super.activateListeners(html); - html.on('click', '[data-action]', this.#onClickAction.bind(this)); - } - - async #onClickAction(event) { - event.preventDefault(); - const button = event.currentTarget; - const action = button.dataset.action; - - return this._handleAction(action, event, button); - } - - async _handleAction(action, event, button) {} - }; -} diff --git a/module/documents/actor.mjs b/module/documents/actor.mjs index 6af98f31..b1685e3e 100644 --- a/module/documents/actor.mjs +++ b/module/documents/actor.mjs @@ -20,14 +20,6 @@ export default class DhpActor extends Actor { this.updateSource({ prototypeToken }); } - prepareData() { - super.prepareData(); - } - - async _preUpdate(changed, options, user) { - super._preUpdate(changed, options, user); - } - async updateLevel(newLevel) { if (this.type !== 'character' || newLevel === this.system.levelData.level.changed) return; diff --git a/module/documents/item.mjs b/module/documents/item.mjs index ca86ce98..dce2c0e1 100644 --- a/module/documents/item.mjs +++ b/module/documents/item.mjs @@ -1,14 +1,4 @@ export default class DhpItem extends Item { - /** @inheritdoc */ - getEmbeddedDocument(embeddedName, id, { invalid = false, strict = false } = {}) { - const systemEmbeds = this.system.constructor.metadata.embedded ?? {}; - if (embeddedName in systemEmbeds) { - const path = `system.${systemEmbeds[embeddedName]}`; - return foundry.utils.getProperty(this, path).get(id) ?? null; - } - return super.getEmbeddedDocument(embeddedName, id, { invalid, strict }); - } - /** @inheritDoc */ prepareEmbeddedDocuments() { super.prepareEmbeddedDocuments();