Override the default configureSheet action in order to open the custom DocumentSheetConfig
This commit is contained in:
parent
6081b8f9e8
commit
4e304f7d22
1 changed files with 14 additions and 11 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
import { __ID__, filePath } from "../consts.mjs";
|
import { __ID__, filePath } from "../consts.mjs";
|
||||||
import { AttributeManager } from "./AttributeManager.mjs";
|
import { AttributeManager } from "./AttributeManager.mjs";
|
||||||
import { attributeSorter } from "../utils/attributeSort.mjs";
|
import { attributeSorter } from "../utils/attributeSort.mjs";
|
||||||
import { ResizeControlManager } from "./ResizeControlManager.mjs";
|
import { TAFDocumentSheetConfig } from "./TAFDocumentSheetConfig.mjs";
|
||||||
|
|
||||||
const { HandlebarsApplicationMixin } = foundry.applications.api;
|
const { HandlebarsApplicationMixin } = foundry.applications.api;
|
||||||
const { ActorSheetV2 } = foundry.applications.sheets;
|
const { ActorSheetV2 } = foundry.applications.sheets;
|
||||||
|
|
@ -28,7 +28,7 @@ export class PlayerSheet extends HandlebarsApplicationMixin(ActorSheetV2) {
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
manageAttributes: this.#manageAttributes,
|
manageAttributes: this.#manageAttributes,
|
||||||
sizeSettings: this.#configureSizeSettings,
|
configureSheet: this.#configureSheet,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -156,15 +156,18 @@ export class PlayerSheet extends HandlebarsApplicationMixin(ActorSheetV2) {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
#sizeSettings = null;
|
static async #configureSheet(event) {
|
||||||
/** @this {PlayerSheet} */
|
event.stopPropagation();
|
||||||
static async #configureSizeSettings() {
|
if ( event.detail > 1 ) { return }
|
||||||
this.#sizeSettings ??= new ResizeControlManager({ document: this.actor });
|
|
||||||
if (this.#sizeSettings.rendered) {
|
// const docSheetConfigWidth = TAFDocumentSheetConfig.DEFAULT_OPTIONS.position.width;
|
||||||
await this.#sizeSettings.bringToFront();
|
new TAFDocumentSheetConfig({
|
||||||
} else {
|
document: this.document,
|
||||||
await this.#sizeSettings.render({ force: true });
|
position: {
|
||||||
};
|
top: this.position.top + 40,
|
||||||
|
left: this.position.left + ((this.position.width - 60) / 2),
|
||||||
|
},
|
||||||
|
}).render({ force: true });
|
||||||
};
|
};
|
||||||
// #endregion Actions
|
// #endregion Actions
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue