Create a generic sheet that my more specific sheets can extend
This commit is contained in:
parent
2026785b09
commit
9d154cb303
2 changed files with 21 additions and 1 deletions
18
module/sheets/GenericSheet.mjs
Normal file
18
module/sheets/GenericSheet.mjs
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
export class GenericSheet extends ActorSheet {
|
||||||
|
#propogatedSettings = [
|
||||||
|
`devMode`,
|
||||||
|
`showAvatarOnSheet`
|
||||||
|
];
|
||||||
|
|
||||||
|
getData() {
|
||||||
|
const ctx = super.getData();
|
||||||
|
|
||||||
|
// Send all of the settings that sheets need into their context
|
||||||
|
ctx.settings = {};
|
||||||
|
for (const setting of this.#propogatedSettings) {
|
||||||
|
ctx.settings[setting] = game.settings.get(`dotdungeon`, setting);
|
||||||
|
};
|
||||||
|
|
||||||
|
return ctx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
export class PlayerSheet extends ActorSheet {
|
import { GenericSheet } from "./GenericSheet.mjs";
|
||||||
|
|
||||||
|
export class PlayerSheet extends GenericSheet {
|
||||||
static get defaultOptions() {
|
static get defaultOptions() {
|
||||||
let opts = mergeObject(
|
let opts = mergeObject(
|
||||||
super.defaultOptions,
|
super.defaultOptions,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue