diff --git a/module/sheets/GenericSheet.mjs b/module/sheets/GenericSheet.mjs new file mode 100644 index 0000000..cb67430 --- /dev/null +++ b/module/sheets/GenericSheet.mjs @@ -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; + } +} \ No newline at end of file diff --git a/module/sheets/PlayerSheet.mjs b/module/sheets/PlayerSheet.mjs index 2bbe868..604ed6d 100644 --- a/module/sheets/PlayerSheet.mjs +++ b/module/sheets/PlayerSheet.mjs @@ -1,4 +1,6 @@ -export class PlayerSheet extends ActorSheet { +import { GenericSheet } from "./GenericSheet.mjs"; + +export class PlayerSheet extends GenericSheet { static get defaultOptions() { let opts = mergeObject( super.defaultOptions,