mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-13 20:21:06 +01:00
FEAT: basic PseudoDocumentSheet
This commit is contained in:
parent
27777dddba
commit
ff4f6a22d3
8 changed files with 81 additions and 4 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue