mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-03-08 06:56:12 +01:00
REFACTOR: remove unused methods
REFACTOR: create method on BaseActorSheet REFACTOR: make Datamodel metadata getter
This commit is contained in:
parent
72e6bf055c
commit
79a4c13a1b
12 changed files with 103 additions and 75 deletions
|
|
@ -2,6 +2,8 @@ import DHApplicationMixin from './application-mixin.mjs';
|
|||
|
||||
const { ActorSheetV2 } = foundry.applications.sheets;
|
||||
|
||||
/**@typedef {import('@client/applications/_types.mjs').ApplicationClickAction} ApplicationClickAction */
|
||||
|
||||
/**
|
||||
* A base actor sheet extending {@link ActorSheetV2} via {@link DHApplicationMixin}
|
||||
* @extends ActorSheetV2
|
||||
|
|
@ -17,14 +19,36 @@ export default class DHBaseActorSheet extends DHApplicationMixin(ActorSheetV2) {
|
|||
form: {
|
||||
submitOnChange: true
|
||||
},
|
||||
actions: {},
|
||||
dragDrop: []
|
||||
actions: {
|
||||
openSettings: DHBaseActorSheet.#openSettings
|
||||
},
|
||||
dragDrop: [],
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
#settingSheet;
|
||||
|
||||
get settingSheet() {
|
||||
const SheetClass = this.document.system.metadata.settingSheet;
|
||||
return this.#settingSheet ??= SheetClass ? new SheetClass(this.document): null;
|
||||
}
|
||||
|
||||
/**@inheritdoc */
|
||||
async _prepareContext(_options) {
|
||||
const context = await super._prepareContext(_options);
|
||||
context.isNPC = this.document.isNPC;
|
||||
|
||||
return context;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @type {ApplicationClickAction}
|
||||
*/
|
||||
static async #openSettings() {
|
||||
await this.settingSheet.render({ force: true });
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue