Adaptation Feuilles Acteurs

This commit is contained in:
Vincent Vandemeulebrouck
2021-03-25 03:18:27 +01:00
parent 5fb8d22a7a
commit 43cf091345
25 changed files with 277 additions and 237 deletions

View File

@ -190,10 +190,13 @@ export class RdDItemCompetence extends Item {
if (competences.length == 0) {
return undefined;
}
const competence = competences[0];
if (competences.length>1) {
const names = competences.map(it => it.name).reduce((a, b) => `${a}<br>${b}`);
ui.notifications.info(`Plusieurs compétences possibles:<br>${names}<br>La première sera choisie: ${competence.name}`);
let competence = competences.find(it => Grammar.toLowerCaseNoAccent(it.name) == name);
if (!competence) {
competence = competences[0];
if (competences.length>1) {
const names = competences.map(it => it.name).reduce((a, b) => `${a}<br>${b}`);
ui.notifications.info(`Plusieurs compétences possibles:<br>${names}<br>La première sera choisie: ${competence.name}`);
}
}
return competence;
}