From c29fa3e0174cd1da47de80da0b9c54d3499a98af Mon Sep 17 00:00:00 2001 From: Eldritch-Oliver Date: Wed, 17 Sep 2025 19:12:23 -0600 Subject: [PATCH] Update the size settings to apply without using the constructor --- module/apps/PlayerSheet.mjs | 41 ++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/module/apps/PlayerSheet.mjs b/module/apps/PlayerSheet.mjs index 54c7d44..e9caf53 100644 --- a/module/apps/PlayerSheet.mjs +++ b/module/apps/PlayerSheet.mjs @@ -40,29 +40,28 @@ export class PlayerSheet extends HandlebarsApplicationMixin(ActorSheetV2) { // #endregion Options // #region Lifecycle - constructor(options) { - if (options.document) { - const sizing = getProperty(options.document, `flags.${__ID__}.PlayerSheet.size`) ?? {}; + _initializeApplicationOptions(options) { + const sizing = getProperty(options.document, `flags.${__ID__}.PlayerSheet.size`) ?? {}; - options.window ??= {}; - switch (sizing.resizable) { - case `false`: - options.window.resizable ??= false; - break; - case `true`: - options.window.resizable ??= true; - break; - }; - - options.position ??= {}; - if (sizing.width) { - options.position.width ??= sizing.width; - } - if (sizing.height) { - options.position.height ??= sizing.height; - } + options.window ??= {}; + switch (sizing.resizable) { + case `false`: + options.window.resizable ??= false; + break; + case `true`: + options.window.resizable ??= true; + break; }; - super(options); + + options.position ??= {}; + if (sizing.width) { + options.position.width ??= sizing.width; + }; + if (sizing.height) { + options.position.height ??= sizing.height; + }; + + return super._initializeApplicationOptions(options); }; _getHeaderControls() {