mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 11:41:08 +01:00
REFACTOR: remove DhpApplicationMixin
REFACTOR: remove getEmbeddedDocument method from Item class REFACTOR: remove prepareData method from Actor class REFACTOR: remove _preUpdate method from Actor class
This commit is contained in:
parent
1135669d0b
commit
a4881854a3
3 changed files with 0 additions and 66 deletions
|
|
@ -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 = `<div class="outer-render"></div>`
|
||||
// $(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) {}
|
||||
};
|
||||
}
|
||||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue