Add the item list compatibility for the Attribute Only Sheet

This commit is contained in:
Oliver 2026-03-15 15:47:28 -06:00
parent 40f0e1ea2c
commit 6b03d62234

View file

@ -1,5 +1,7 @@
import { PlayerSheet } from "./PlayerSheet.mjs"; import { PlayerSheet } from "./PlayerSheet.mjs";
const removedParts = new Set([`content`, `tabs`]);
export class AttributeOnlyPlayerSheet extends PlayerSheet { export class AttributeOnlyPlayerSheet extends PlayerSheet {
// #region Options // #region Options
static DEFAULT_OPTIONS = { static DEFAULT_OPTIONS = {
@ -10,6 +12,7 @@ export class AttributeOnlyPlayerSheet extends PlayerSheet {
static get PARTS() { static get PARTS() {
const parts = super.PARTS; const parts = super.PARTS;
delete parts.tabs;
delete parts.content; delete parts.content;
return parts; return parts;
}; };
@ -19,8 +22,15 @@ export class AttributeOnlyPlayerSheet extends PlayerSheet {
_configureRenderOptions(options) { _configureRenderOptions(options) {
super._configureRenderOptions(options); super._configureRenderOptions(options);
// don't attempt to rerender the content // don't attempt to rerender the parts that get removed
options.parts = options.parts?.filter(partID => partID !== `content`); options.parts = options.parts?.filter(partID => !removedParts.has(partID));
}; };
// #endregion Lifecycle // #endregion Lifecycle
// #region Data Prep
async _prepareItems(ctx) {
await super._prepareItems(ctx);
ctx.tabActive = true;
};
// #endregion Data Prep
}; };