From 4e304f7d229cecb76d0768f4b78a512232406b48 Mon Sep 17 00:00:00 2001 From: Eldritch-Oliver Date: Sat, 4 Oct 2025 19:41:24 -0600 Subject: [PATCH] Override the default configureSheet action in order to open the custom DocumentSheetConfig --- module/apps/PlayerSheet.mjs | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/module/apps/PlayerSheet.mjs b/module/apps/PlayerSheet.mjs index e9caf53..56b8744 100644 --- a/module/apps/PlayerSheet.mjs +++ b/module/apps/PlayerSheet.mjs @@ -1,7 +1,7 @@ import { __ID__, filePath } from "../consts.mjs"; import { AttributeManager } from "./AttributeManager.mjs"; import { attributeSorter } from "../utils/attributeSort.mjs"; -import { ResizeControlManager } from "./ResizeControlManager.mjs"; +import { TAFDocumentSheetConfig } from "./TAFDocumentSheetConfig.mjs"; const { HandlebarsApplicationMixin } = foundry.applications.api; const { ActorSheetV2 } = foundry.applications.sheets; @@ -28,7 +28,7 @@ export class PlayerSheet extends HandlebarsApplicationMixin(ActorSheetV2) { }, actions: { manageAttributes: this.#manageAttributes, - sizeSettings: this.#configureSizeSettings, + configureSheet: this.#configureSheet, }, }; @@ -156,15 +156,18 @@ export class PlayerSheet extends HandlebarsApplicationMixin(ActorSheetV2) { }; }; - #sizeSettings = null; - /** @this {PlayerSheet} */ - static async #configureSizeSettings() { - this.#sizeSettings ??= new ResizeControlManager({ document: this.actor }); - if (this.#sizeSettings.rendered) { - await this.#sizeSettings.bringToFront(); - } else { - await this.#sizeSettings.render({ force: true }); - }; + static async #configureSheet(event) { + event.stopPropagation(); + if ( event.detail > 1 ) { return } + + // const docSheetConfigWidth = TAFDocumentSheetConfig.DEFAULT_OPTIONS.position.width; + new TAFDocumentSheetConfig({ + document: this.document, + position: { + top: this.position.top + 40, + left: this.position.left + ((this.position.width - 60) / 2), + }, + }).render({ force: true }); }; // #endregion Actions };