Tri alpha + ajout contacts

This commit is contained in:
LeRatierBretonnien 2023-03-10 13:21:06 +01:00
parent 439797e71e
commit 02f8207fb7
3 changed files with 38 additions and 19 deletions

View File

@ -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() { getEquipments() {
return this.items.filter(item => item.type == "equipement" || item.type == "accessoire") return this.getItemSorted( ["equipement", "accessoire"] )
} }
getAvantages() { getAvantages() {
return this.items.filter(item => item.type == "avantage") return this.getItemSorted( ["avantage"])
} }
getDesavantages() { getDesavantages() {
return this.items.filter(item => item.type == "desavantage") return this.getItemSorted( ["desavantage"])
} }
getMonnaies() { getMonnaies() {
return this.items.filter(item => item.type == "monnaie") return this.getItemSorted( ["monnaie"])
} }
getArmors() { getArmors() {
return this.items.filter(item => item.type == "protection") return this.getItemSorted( ["protection"])
} }
getTalents() { getTalents() {
return this.items.filter(item => item.type == "talent") return this.getItemSorted( ["talent"])
} }
getContacts() { getContacts() {
return this.items.filter(item => item.type == "contact") return this.getItemSorted( ["contact"])
} }
getAtouts() { getAtouts() {
return this.items.filter(item => item.type == "atoutfeerique") return this.getItemSorted( ["atoutfeerique"])
} }
getCapacites() { getCapacites() {
return this.items.filter(item => item.type == "capacitenaturelle") return this.getItemSorted( ["capacitenaturelle"])
} }
getFee() { getFee() {
return this.items.find(item => item.type == "fee") return this.items.filter(item => item.type =="fee")
} }
getProfils() { getProfils() {
return this.items.filter(item => item.type == "profil") return this.getItemSorted( ["profil"])
} }
getPouvoirs() { getPouvoirs() {
let pouvoirs = this.items.filter(item => item.type == "pouvoir") || [] return this.getItemSorted( ["pouvoir"])
HeritiersUtility.sortArrayObjectsByName(pouvoirs)
return pouvoirs
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
getSkills() { getSkills() {
@ -199,6 +202,9 @@ export class HeritiersActor extends Actor {
contactList[item.system.contacttype] = c contactList[item.system.contacttype] = c
} }
} }
for (let key in contactList) {
HeritiersUtility.sortArrayObjectsByName(contactList[key].list)
}
return contactList return contactList
} }

View File

@ -1,7 +1,7 @@
{ {
"id": "fvtt-les-heritiers", "id": "fvtt-les-heritiers",
"description": "Les Héritiers pour FoundryVTT", "description": "Les Héritiers pour FoundryVTT",
"version": "10.0.24", "version": "10.0.25",
"authors": [ "authors": [
{ {
"name": "Uberwald/LeRatierBretonnien", "name": "Uberwald/LeRatierBretonnien",
@ -19,7 +19,7 @@
"gridUnits": "m", "gridUnits": "m",
"license": "LICENSE.txt", "license": "LICENSE.txt",
"manifest": "https://www.uberwald.me/gitea/public/fvtt-les-heritiers/raw/branch/master/system.json", "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": [ "languages": [
{ {
"lang": "fr", "lang": "fr",

View File

@ -14,7 +14,7 @@
{{#each system.caracteristiques as |carac key|}} {{#each system.caracteristiques as |carac key|}}
{{#if (eq kind "physical")}} {{#if (eq kind "physical")}}
<li class="item flexrow "> <li class="item flexrow ">
<h4 class="item-name-label competence-name"><a class="roll-carac" data-key="{{key}}">{{carac.label}}</a></h4> <h4 class="item-name-label competence-name roll-style"><a class="roll-carac" data-key="{{key}}">{{carac.label}}</a></h4>
<input type="text" class="padd-right status-small-label color-class-common item-field-label-short" <input type="text" class="padd-right status-small-label color-class-common item-field-label-short"
name="system.caracteristiques.{{key}}.value" value="{{carac.value}}" data-dtype="Number" /> name="system.caracteristiques.{{key}}.value" value="{{carac.value}}" data-dtype="Number" />
<input type="text" class="padd-right status-small-label color-class-common item-field-label-short" <input type="text" class="padd-right status-small-label color-class-common item-field-label-short"
@ -30,7 +30,7 @@
{{#each system.caracteristiques as |carac key|}} {{#each system.caracteristiques as |carac key|}}
{{#if (eq kind "mental")}} {{#if (eq kind "mental")}}
<li class="item flexrow "> <li class="item flexrow ">
<h4 class="item-name-label competence-name"><a class="roll-carac" data-key="{{key}}">{{carac.label}}</a></h4> <h4 class="item-name-label competence-name roll-style"><a class="roll-carac" data-key="{{key}}">{{carac.label}}</a></h4>
<input type="text" class="padd-right status-small-label color-class-common item-field-label-short" <input type="text" class="padd-right status-small-label color-class-common item-field-label-short"
name="system.caracteristiques.{{key}}.value" value="{{carac.value}}" data-dtype="Number" /> name="system.caracteristiques.{{key}}.value" value="{{carac.value}}" data-dtype="Number" />
<input type="text" class="padd-right status-small-label color-class-common item-field-label-short" <input type="text" class="padd-right status-small-label color-class-common item-field-label-short"
@ -482,7 +482,20 @@
{{!-- Contact Tab --}} {{!-- Contact Tab --}}
<div class="tab contact" data-group="primary" data-tab="contact"> <div class="tab contact" data-group="primary" data-tab="contact">
<div class="sheet-box color-bg-archetype">
<ul class="item-list alternate-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header item-field-label-long3">
<h3><label class="items-title-text">Contacts, Allies et Ennemis</label></h3>
</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-add" data-type="contact" title="Créer un contact"><i class="fas fa-plus"></i></a>
</div>
</li>
</div>
{{#each contacts as |contactList idx|}} {{#each contacts as |contactList idx|}}
<div class="sheet-box color-bg-archetype"> <div class="sheet-box color-bg-archetype">
<ul class="item-list alternate-list"> <ul class="item-list alternate-list">