FEAT: basic PseudoDocumentSheet

This commit is contained in:
Joaquin Pereyra 2025-06-11 15:02:58 -03:00
parent 27777dddba
commit ff4f6a22d3
8 changed files with 81 additions and 4 deletions

View file

@ -16,7 +16,8 @@ export default function SheetManagementMixin(Base) {
get sheet() {
if (this._sheet) return this._sheet;
const cls = this.constructor.metadata.sheetClass ?? ApplicationV2;
if (!ApplicationV2.isPrototypeOf(cls)) {
if (!foundry.utils.isSubclass(cls, ApplicationV2)) {
return void ui.notifications.error(
'Daggerheart | Error on PseudoDocument | sheetClass must be ApplicationV2'
);
@ -24,6 +25,7 @@ export default function SheetManagementMixin(Base) {
const sheet = new cls({ document: this });
this._sheet = sheet;
return sheet;
}
/* -------------------------------------------- */