mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-06-05 20:34:15 +02:00
Added an 'empty' styling for tabs. Used for NPC sheet Features tab when it has no features
This commit is contained in:
parent
f24d37e935
commit
2f0badf53a
4 changed files with 18 additions and 10 deletions
|
|
@ -46,9 +46,14 @@ export default class NPCSheet extends DHBaseActorSheet {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
prepareTabs(context) {
|
||||||
|
context.tabs.features.empty = this.document.system.features.length === 0;
|
||||||
|
}
|
||||||
|
|
||||||
/**@inheritdoc */
|
/**@inheritdoc */
|
||||||
async _prepareContext(options) {
|
async _prepareContext(options) {
|
||||||
const context = await super._prepareContext(options);
|
const context = await super._prepareContext(options);
|
||||||
|
this.prepareTabs(context);
|
||||||
|
|
||||||
return 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) {
|
async _prepareFeaturesContext(context, _options) {
|
||||||
const featureForms = ['passive', 'action', 'reaction'];
|
const featureForms = ['passive', 'action', 'reaction'];
|
||||||
context.features = this.document.system.features.sort((a, b) =>
|
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,10 @@
|
||||||
|
|
||||||
a {
|
a {
|
||||||
color: @color-text-emphatic;
|
color: @color-text-emphatic;
|
||||||
|
|
||||||
|
&.empty:not(.active) {
|
||||||
|
opacity: 0.4;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,7 @@
|
||||||
data-tab='{{tabs.notes.id}}'
|
data-tab='{{tabs.notes.id}}'
|
||||||
data-group='{{tabs.notes.group}}'
|
data-group='{{tabs.notes.group}}'
|
||||||
>
|
>
|
||||||
<fieldset class="fit-height">
|
|
||||||
<legend>{{localize tabs.notes.label}}</legend>
|
|
||||||
{{formInput notes.field value=notes.value enriched=notes.enriched toggled=true}}
|
{{formInput notes.field value=notes.value enriched=notes.enriched toggled=true}}
|
||||||
</fieldset>
|
|
||||||
|
|
||||||
{{#if (and showAttribution document.system.attribution.artist)}}
|
{{#if (and showAttribution document.system.attribution.artist)}}
|
||||||
<label class="artist-attribution">{{localize "DAGGERHEART.GENERAL.artistAttribution" artist=document.system.attribution.artist}}</label>
|
<label class="artist-attribution">{{localize "DAGGERHEART.GENERAL.artistAttribution" artist=document.system.attribution.artist}}</label>
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
<line-div></line-div>
|
<line-div></line-div>
|
||||||
<nav class='feature-tab sheet-tabs tabs' data-group='primary'>
|
<nav class='feature-tab sheet-tabs tabs' data-group='primary'>
|
||||||
{{#each tabs as |tab|}}
|
{{#each tabs as |tab|}}
|
||||||
<a class='{{tab.id}} {{tab.cssClass}}' data-action='tab' data-group='{{tab.group}}' data-tab='{{tab.id}}'>
|
<a class='{{tab.id}} {{tab.cssClass}} {{#if tab.empty}}empty{{/if}}' data-action='tab' data-group='{{tab.group}}' data-tab='{{tab.id}}'>
|
||||||
<span>{{localize tab.label}}</span>
|
<span>{{localize tab.label}}</span>
|
||||||
</a>
|
</a>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue