Recherche de compétence
Filtrage des compétences contenant le texte saisi
This commit is contained in:
parent
addfc46069
commit
1bec52371a
@ -78,7 +78,9 @@ export class RdDActorSheet extends ActorSheet {
|
||||
formData.calc.surEncombrementMessage = (formData.data.compteurs.surenc.value < 0) ? "Sur-Encombrement!" : "";
|
||||
|
||||
formData.competences.forEach(item => {
|
||||
item.visible = !this.options.showCompNiveauBase || !RdDItemCompetence.isNiveauBase(item);
|
||||
item.visible = this.options.cherchercompetence
|
||||
? RdDItemCompetence.nomContientTexte(item, this.options.cherchercompetence)
|
||||
: ( !this.options.showCompNiveauBase || !RdDItemCompetence.isNiveauBase(item) );
|
||||
RdDItemCompetence.levelUp(item, formData.data.compteurs.experience.value);
|
||||
});
|
||||
|
||||
@ -421,6 +423,10 @@ export class RdDActorSheet extends ActorSheet {
|
||||
this.options.editCaracComp = !this.options.editCaracComp;
|
||||
this.render(true);
|
||||
});
|
||||
html.find('.cherchercompetence').change(async event => {
|
||||
this.options.cherchercompetence = event.currentTarget.value;
|
||||
this.render(true);
|
||||
});
|
||||
html.find('.vue-detaillee').click(async event => {
|
||||
console.log("CONTROLS", this.options.vueDetaillee)
|
||||
this.options.vueDetaillee = !this.options.vueDetaillee;
|
||||
|
@ -201,6 +201,10 @@ export class RdDItemCompetence extends Item {
|
||||
return Number(itemData.data.niveau) != RdDItemCompetence.getNiveauBase(itemData.data.categorie);
|
||||
}
|
||||
|
||||
static nomContientTexte(itemData, texte) {
|
||||
return Grammar.toLowerCaseNoAccent(itemData.name).includes(Grammar.toLowerCaseNoAccent(texte))
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static isNiveauBase(itemData) {
|
||||
return Number(itemData.data.niveau) == RdDItemCompetence.getNiveauBase(itemData.data.categorie);
|
||||
|
@ -208,10 +208,16 @@
|
||||
|
||||
{{!-- Compétences Tab --}}
|
||||
<div class="tab competences" data-group="primary" data-tab="competences">
|
||||
<div class="flexrow">
|
||||
<div class="grid grid-4col">
|
||||
<span><a class="lock-unlock-sheet"><img class="small-button-container"
|
||||
src="systems/foundryvtt-reve-de-dragon/icons/{{#if options.editCaracComp}}unlocked.svg{{else}}locked.svg{{/if}}" alt="blocker/débloquer"
|
||||
>{{#if options.editCaracComp}}Verrouiller{{else}}Déverrouiller{{/if}}</a></span>
|
||||
src="systems/foundryvtt-reve-de-dragon/icons/{{#if options.editCaracComp}}unlocked.svg{{else}}locked.svg{{/if}}" alt="blocker/débloquer">
|
||||
{{#if options.editCaracComp}}Verrouiller{{else}}Déverrouiller{{/if}}</a></span>
|
||||
<span class="flexrow">
|
||||
<i class="fas fa-search"></i>
|
||||
<input class="cherchercompetence" type="text" value="{{options.cherchercompetence}}" name="cherchercompetence"
|
||||
size="8" data-dtype="String" placeholder="chercher"/>
|
||||
<span></span>
|
||||
</span>
|
||||
<span><a class="show-hide-competences"><img class="small-button-container"
|
||||
src="systems/foundryvtt-reve-de-dragon/icons/{{#if options.showCompNiveauBase}}no-filter.svg{{else}}filter.svg{{/if}}" alt="filter/montrer tout">
|
||||
{{#if options.showCompNiveauBase}}Montrer tout{{else}}Filtrer{{/if}}</a>
|
||||
|
Loading…
Reference in New Issue
Block a user