Update the size settings to apply without using the constructor

This commit is contained in:
Eldritch-Oliver 2025-09-17 19:12:23 -06:00
parent dff8a46ebb
commit c29fa3e017

View file

@ -40,29 +40,28 @@ export class PlayerSheet extends HandlebarsApplicationMixin(ActorSheetV2) {
// #endregion Options // #endregion Options
// #region Lifecycle // #region Lifecycle
constructor(options) { _initializeApplicationOptions(options) {
if (options.document) { const sizing = getProperty(options.document, `flags.${__ID__}.PlayerSheet.size`) ?? {};
const sizing = getProperty(options.document, `flags.${__ID__}.PlayerSheet.size`) ?? {};
options.window ??= {}; options.window ??= {};
switch (sizing.resizable) { switch (sizing.resizable) {
case `false`: case `false`:
options.window.resizable ??= false; options.window.resizable ??= false;
break; break;
case `true`: case `true`:
options.window.resizable ??= true; options.window.resizable ??= true;
break; break;
};
options.position ??= {};
if (sizing.width) {
options.position.width ??= sizing.width;
}
if (sizing.height) {
options.position.height ??= sizing.height;
}
}; };
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() { _getHeaderControls() {