Added an 'empty' styling for tabs. Used for NPC sheet Features tab when it has no features

This commit is contained in:
WBHarry 2026-05-30 20:28:32 +02:00
parent f24d37e935
commit 2f0badf53a
4 changed files with 18 additions and 10 deletions

View file

@ -46,9 +46,14 @@ export default class NPCSheet extends DHBaseActorSheet {
}
};
prepareTabs(context) {
context.tabs.features.empty = this.document.system.features.length === 0;
}
/**@inheritdoc */
async _prepareContext(options) {
const context = await super._prepareContext(options);
this.prepareTabs(context);
return context;
}
@ -88,6 +93,13 @@ export default class NPCSheet extends DHBaseActorSheet {
});
}
/**
* Prepare render context for the Features part.
* @param {ApplicationRenderContext} context
* @param {ApplicationRenderOptions} options
* @returns {Promise<void>}
* @protected
*/
async _prepareFeaturesContext(context, _options) {
const featureForms = ['passive', 'action', 'reaction'];
context.features = this.document.system.features.sort((a, b) =>
@ -124,9 +136,4 @@ export default class NPCSheet extends DHBaseActorSheet {
};
}
}
/**@inheritdoc */
_attachPartListeners(partId, htmlElement, options) {
super._attachPartListeners(partId, htmlElement, options);
}
}