Recherche de compétence

Filtrage des compétences contenant le texte saisi
This commit is contained in:
Vincent Vandemeulebrouck
2021-11-26 01:02:44 +01:00
parent addfc46069
commit 1bec52371a
3 changed files with 20 additions and 4 deletions

View File

@ -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;