Fix sur armes et affichage

This commit is contained in:
LeRatierBretonnien 2023-03-09 00:04:23 +01:00
parent f00825ea91
commit 2f3a8e91bd
5 changed files with 55 additions and 3 deletions

View File

@ -142,7 +142,9 @@ export class HeritiersActor extends Actor {
return this.items.filter(item => item.type == "profil")
}
getPouvoirs() {
return this.items.filter(item => item.type == "pouvoir")
let pouvoirs = this.items.filter(item => item.type == "pouvoir")
HeritiersUtility.sortArrayObjectsByName(pouvoirs)
return pouvoirs
}
/* -------------------------------------------- */
getSkills() {
@ -182,6 +184,7 @@ export class HeritiersActor extends Actor {
}
}
}
HeritiersUtility.sortArrayObjectsByName(comp)
return comp
}
/* -------------------------------------------- */
@ -207,6 +210,7 @@ export class HeritiersActor extends Actor {
}
}
}
HeritiersUtility.sortArrayObjectsByName(comp)
return HeritiersUtility.sortByName(comp)
}

View File

@ -55,6 +55,21 @@ export class HeritiersUtility {
return 0;
})
}
/* -------------------------------------------- */
static sortArrayObjectsByName(myArray) {
myArray.sort((a, b) => {
let fa = a.name.toLowerCase();
let fb = b.name.toLowerCase();
if (fa < fb) {
return -1;
}
if (fa > fb) {
return 1;
}
return 0;
})
}
/* -------------------------------------------- */
static getSkills() {

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
{
"id": "fvtt-les-heritiers",
"description": "Les Héritiers pour FoundryVTT",
"version": "10.0.19",
"version": "10.0.20",
"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.19.zip",
"download": "https://www.uberwald.me/gitea/public/fvtt-les-heritiers/archive/fvtt-les-heritiers-10.0.20.zip",
"languages": [
{
"lang": "fr",

View File

@ -107,6 +107,7 @@
<div class="item-controls item-controls-fixed">
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}