diff --git a/modules/heritiers-actor.js b/modules/heritiers-actor.js index fb8b468..41ece00 100644 --- a/modules/heritiers-actor.js +++ b/modules/heritiers-actor.js @@ -108,43 +108,46 @@ export class HeritiersActor extends Actor { } /* ----------------------- --------------------- */ + getItemSorted( types) { + let items = this.items.filter(item => types.includes(item.type )) || [] + HeritiersUtility.sortArrayObjectsByName(items) + return items + } getEquipments() { - return this.items.filter(item => item.type == "equipement" || item.type == "accessoire") + return this.getItemSorted( ["equipement", "accessoire"] ) } getAvantages() { - return this.items.filter(item => item.type == "avantage") + return this.getItemSorted( ["avantage"]) } getDesavantages() { - return this.items.filter(item => item.type == "desavantage") + return this.getItemSorted( ["desavantage"]) } getMonnaies() { - return this.items.filter(item => item.type == "monnaie") + return this.getItemSorted( ["monnaie"]) } getArmors() { - return this.items.filter(item => item.type == "protection") + return this.getItemSorted( ["protection"]) } getTalents() { - return this.items.filter(item => item.type == "talent") + return this.getItemSorted( ["talent"]) } getContacts() { - return this.items.filter(item => item.type == "contact") + return this.getItemSorted( ["contact"]) } getAtouts() { - return this.items.filter(item => item.type == "atoutfeerique") + return this.getItemSorted( ["atoutfeerique"]) } getCapacites() { - return this.items.filter(item => item.type == "capacitenaturelle") + return this.getItemSorted( ["capacitenaturelle"]) } getFee() { - return this.items.find(item => item.type == "fee") + return this.items.filter(item => item.type =="fee") } getProfils() { - return this.items.filter(item => item.type == "profil") + return this.getItemSorted( ["profil"]) } getPouvoirs() { - let pouvoirs = this.items.filter(item => item.type == "pouvoir") || [] - HeritiersUtility.sortArrayObjectsByName(pouvoirs) - return pouvoirs + return this.getItemSorted( ["pouvoir"]) } /* -------------------------------------------- */ getSkills() { @@ -199,6 +202,9 @@ export class HeritiersActor extends Actor { contactList[item.system.contacttype] = c } } + for (let key in contactList) { + HeritiersUtility.sortArrayObjectsByName(contactList[key].list) + } return contactList } diff --git a/system.json b/system.json index 7f96e8f..07697e3 100644 --- a/system.json +++ b/system.json @@ -1,7 +1,7 @@ { "id": "fvtt-les-heritiers", "description": "Les Héritiers pour FoundryVTT", - "version": "10.0.24", + "version": "10.0.25", "authors": [ { "name": "Uberwald/LeRatierBretonnien", @@ -19,7 +19,7 @@ "gridUnits": "m", "license": "LICENSE.txt", "manifest": "https://www.uberwald.me/gitea/public/fvtt-les-heritiers/raw/branch/master/system.json", - "download": "https://www.uberwald.me/gitea/public/fvtt-les-heritiers/archive/fvtt-les-heritiers-10.0.24.zip", + "download": "https://www.uberwald.me/gitea/public/fvtt-les-heritiers/archive/fvtt-les-heritiers-10.0.25.zip", "languages": [ { "lang": "fr", diff --git a/templates/actor-sheet.html b/templates/actor-sheet.html index c257ea2..8c30d6c 100644 --- a/templates/actor-sheet.html +++ b/templates/actor-sheet.html @@ -14,7 +14,7 @@ {{#each system.caracteristiques as |carac key|}} {{#if (eq kind "physical")}}
  • -

    {{carac.label}}

    +

    {{carac.label}}

    -

    {{carac.label}}

    +

    {{carac.label}}

    - + +
    +
    + {{#each contacts as |contactList idx|}}