Fix sur armes et affichage

This commit is contained in:
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() {