Skip to content

Commit

Permalink
feat: leverage get and set to ensure this is not breaking for other m…
Browse files Browse the repository at this point in the history
…odules
  • Loading branch information
akrigline committed Aug 2, 2021
1 parent b067bf1 commit b48969f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions scripts/document-sheet-registrar.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,14 @@ class DocumentSheetRegistrar {
}
}
}

// links the old sheetClass definition to the new 'base' default sheet definition
// big thanks to fvtt-lib-wrapper Rui Pinheiro for inspiring this
Object.defineProperty(CONFIG[doc.name], 'sheetClass', {
get: () => CONFIG[doc.name].sheetClasses['base'][doc.name].cls,
set: (value) => { CONFIG[doc.name].sheetClasses['base'][doc.name].cls = value },
configurable: false
});
}

/**
Expand Down

0 comments on commit b48969f

Please sign in to comment.