diff --git a/module/rdd-utility.js b/module/rdd-utility.js index 1e14f75c..f3db889f 100644 --- a/module/rdd-utility.js +++ b/module/rdd-utility.js @@ -280,7 +280,7 @@ export class RdDUtility { Handlebars.registerHelper('typeTmr-name', coord => TMRUtility.typeTmrName(coord)); Handlebars.registerHelper('min', (...args) => Math.min(...args.slice(0, -1))); Handlebars.registerHelper('regle-optionnelle', (option) => ReglesOptionelles.isUsing(option)); - + Handlebars.registerHelper('trier', competences => competences.sort((a, b) => a.name.localeCompare(b.name))); Handlebars.registerHelper('filtreTriCompetences', competences => competences.filter(it => it.system.isVisible) .sort((a, b) => { if (a.name.startsWith("Survie") && b.name.startsWith("Survie")) { diff --git a/templates/actor/comp-creature.html b/templates/actor/comp-creature.html index c33df660..7628e807 100644 --- a/templates/actor/comp-creature.html +++ b/templates/actor/comp-creature.html @@ -1,5 +1,5 @@
    - {{#each competences as |comp key|}} + {{#each (trier competences) as |comp key|}}
  1. diff --git a/templates/actor/competence-categorie.html b/templates/actor/competence-categorie.html index c243de13..0f9511a4 100644 --- a/templates/actor/competence-categorie.html +++ b/templates/actor/competence-categorie.html @@ -22,7 +22,7 @@
  2. {{/if}} - {{#each competences as |comp key|}} + {{#each (trier competences) as |comp key|}} {{> "systems/foundryvtt-reve-de-dragon/templates/actor/competence.html" comp}} {{/each}} diff --git a/templates/item-livre-sheet.html b/templates/item-livre-sheet.html index 9a940f3d..952cac89 100644 --- a/templates/item-livre-sheet.html +++ b/templates/item-livre-sheet.html @@ -21,7 +21,7 @@ {{#select system.competence}} - {{#each competences as |competence key|}} + {{#each (trier competences) as |competence key|}} {{/each}} {{/select}} diff --git a/templates/item-oeuvre-sheet.html b/templates/item-oeuvre-sheet.html index 5a7d2d26..013c81f3 100644 --- a/templates/item-oeuvre-sheet.html +++ b/templates/item-oeuvre-sheet.html @@ -20,7 +20,7 @@ {{#select system.competence}} - {{#each competences as |competence key|}} + {{#each (trier competences) as |competence key|}} {{/each}} {{/select}}