Amélioration rendu équipement

This commit is contained in:
Vincent Vandemeulebrouck 2022-08-27 16:23:22 +02:00
parent 8c0fbf15b6
commit 3ff59d1f07
12 changed files with 155 additions and 191 deletions

View File

@ -122,8 +122,12 @@ export class RdDUtility {
'systems/foundryvtt-reve-de-dragon/templates/actor-liste-blessures-partial.html',
'systems/foundryvtt-reve-de-dragon/templates/actor-blessure-partial.html',
// Conteneur/item in Actor sheet
'systems/foundryvtt-reve-de-dragon/templates/actor-sheet-inventaire-conteneur.html',
'systems/foundryvtt-reve-de-dragon/templates/actor-sheet-inventaire.html',
'systems/foundryvtt-reve-de-dragon/templates/actor-sheet-inventaire-item.html',
"systems/foundryvtt-reve-de-dragon/templates/actor-sheet-inventaire-monnaie.html",
'systems/foundryvtt-reve-de-dragon/templates/actor-sheet-liens-animaux.html',
'systems/foundryvtt-reve-de-dragon/templates/actor-sheet-liens-suivants.html',
'systems/foundryvtt-reve-de-dragon/templates/actor-sheet-liens-vehicules.html',
'systems/foundryvtt-reve-de-dragon/templates/actor-sheet-editor-notes-mj.html',
//Items
'systems/foundryvtt-reve-de-dragon/templates/item-competence-sheet.html',
@ -471,7 +475,7 @@ export class RdDUtility {
const isConteneur = objet.type == 'conteneur';
const isOuvert = isConteneur && this.getAfficheContenu(objet._id);
const isVide = isConteneur && Misc.templateData(objet).contenu.length == 0;
const conteneur = Handlebars.partials['systems/foundryvtt-reve-de-dragon/templates/actor-sheet-inventaire-conteneur.html']({
const conteneur = Handlebars.partials['systems/foundryvtt-reve-de-dragon/templates/actor-sheet-inventaire-item.html']({
item: objet,
vide: isVide,
ouvert: isOuvert

View File

@ -225,6 +225,26 @@ table {border: 1px solid #7a7971;}
flex-grow : 3;
}
/* Styles limited to foundryvtt-reve-de-dragon sheets */
.equipement-nom {
flex-grow : 4;
margin: 0;
justify-content: center;
text-align: left;
}
.equipement-detail {
margin: 0;
flex: 'flex-shrink' ;
align-items: center;
justify-content: center;
text-align: center;
}
.equipement-actions {
margin: 0;
flex-grow: 2;
align-items: center;
justify-content: center;
text-align: left;
}
.foundryvtt-reve-de-dragon .sheet-header {
-webkit-box-flex: 0;
@ -713,8 +733,8 @@ ul, li {
}
.sheet li {
margin: 0.125rem;
padding: 0.25rem;
margin: 0.1rem;
padding: 0.2rem;
}
.header-fields li {
margin: 0;
@ -747,7 +767,9 @@ ul, li {
.fa-arrow-alt-circle-up.allouer-stress-level-up {
color: rgba(191, 149, 63, 0.8);
}
i.fas, i.far {
font-size: smaller;
}
.blessures-list ul {
display: flex;
}
@ -766,18 +788,18 @@ ul, li {
font-weight: bold;
}
.list-item {
margin: 0.125rem;
margin: 0.1rem;
box-shadow: inset 0px 0px 1px #00000096;
border-radius: 0.25rem;
padding: 0.125rem;
padding: 0.1rem;
flex: 1 1 5rem;
display: flex !important;
align-items: baseline !important;
align-items: center !important;
}
.table-row {
margin: 0.125rem;
padding: 0.125rem;
margin: 0.1rem;
padding: 0.1rem;
flex: 1 1 5rem;
}
@ -801,8 +823,11 @@ ul, li {
background: rgb(200, 10, 100, 0.25);
}
.item-quantite {
margin-left: 0.5rem;
.item-column {
margin-left: 0.2rem;
margin-right: 0.2rem;
justify-content: center;
text-align: center;
}
.list-item-margin1 {
@ -872,20 +897,20 @@ ul, li {
.competence-value {
flex-grow: 0;
flex-basis: 2rem;
margin-right: 0.25rem;
margin-left: 0.25rem;
margin-right: 0.2rem;
margin-left: 0.2rem;
}
.description-value {
flex-grow: 0;
flex-basis: 4rem;
margin-right: 0.25rem;
margin-left: 0.25rem;
margin-right: 0.2rem;
margin-left: 0.2rem;
}
.competence-xp {
flex-grow: 0;
flex-basis: 2rem;
margin-right: 0.25rem;
margin-left: 0.25rem;
margin-right: 0.2rem;
margin-left: 0.2rem;
}
.blessures-title {
font-weight: bold;

View File

@ -126,35 +126,7 @@
{{!-- Equipment Tab --}}
<div class="tab items" data-group="primary" data-tab="items">
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-inventaire-monnaie.html" monnaie=monnaie}}
<span class="item-name"><h4>Equipement porté</h4></span>
<span class="item-name">Encombrement total/max : {{numberFormat calc.encTotal decimals=2}} / {{data.attributs.encombrement.value}} <b>{{calc.surEncombrementMessage}}</b></span> -
<span class="item-name"><a class="creer-un-objet">Créer un objet</a></span>
{{#if options.isGM}}
<span class="item-name"> - <a id="nettoyer-conteneurs">Vider tout les conteneurs</a></span>
{{/if}}
<ul class="item-list alterne-list">
<li class="competence-header flexrow">
<img class="sheet-competence-img" src="{{img}}" title="Equipement"/>
<span class="competence-title flex-grow">Nom</span>
<span class="competence-title">Q.</span>
<span class="competence-title">Enc.</span>
<span class="competence-title flex-grow">Equiper/Editer/Suppr.</span>
</li>
{{#each objets as |item id|}}
{{#unless item.estContenu}}
{{#if (ne item.type 'conteneur')}}
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-inventaire-conteneur.html" item=item }}
{{/if}}
{{/unless}}
{{/each}}
{{#each conteneurs as |conteneur id|}}
{{buildConteneur this}}
{{/each}}
</ul>
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-inventaire.html"}}
</div>
{{!-- Biography Tab --}}

View File

@ -1,37 +1,33 @@
<li class="item flexrow list-item" data-item-id="{{item._id}}" draggable="true">
{{#if (eq item.type 'conteneur')}}
<span class="sheet-competence-img conteneur-name">
<span class="equipement-nom {{#if (eq item.type 'conteneur')}}conteneur-name{{/if}} ">
{{#if (eq item.type 'conteneur')}}
{{#if vide}}
<i class="far fa-square"></i>
<i class="far fa-square"></i>
{{else}}
<a data-item-id="{{item._id}}">
{{#if ouvert}}
<i class="far fa-minus-square"></i>
<!-- <i class="far fa-caret-square-down"></i> -->
{{else}}
<i class="far fa-plus-square"></i>
<!-- <i class="fas fa-caret-square-right"></i> -->
{{/if}}
</a>
{{/if}}
</span>
<span class="item-name conteneur-name flex-grow">
<a data-item-id="{{item._id}}">
<img class="sheet-competence-img" src="{{item.img}}" title="{{item.name}}"/>
{{item.name}}
<span>{{item.name}}</span>
</a>
</span>
{{else}}
<img class="sheet-competence-img" src="{{item.img}}" title="{{item.name}}"/>
<span class="item-name flex-grow">{{item.name}}</span>
{{/if}}
<span class="item-quantite">{{item.data.quantite}}
{{else}}
<img class="sheet-competence-img" src="{{item.img}}" title="{{item.name}}"/>
<span>{{item.name}}</span>
{{/if}}
</span>
<span class="equipement-detail">{{item.data.quantite}}
{{#if (gt item.data.quantite 1)}}
<a class="item-control item-split" title="Séparer"><i class="fas fa-unlink"></i></a>
{{/if}}
</span>
<span class="item-quantite">{{numberFormat item.data.encTotal decimals=2}}</span>
<div class="item-controls flex-grow">
<span class="equipement-detail">{{numberFormat item.data.encTotal decimals=2}}</span>
<span class="equipement-actions">
{{#unless item.estContenu}}
{{#if (ne item.type 'conteneur')}}
<a class="item-control item-equip" title="Equiper">{{#if item.data.equipe}}<i class="fas fa-hand-rock"></i>{{else}}<i class="far fa-hand-paper"></i>{{/if}}</a>
@ -39,14 +35,14 @@
{{/unless}}
<a class="item-control item-edit" title="Editer"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Supprimer"><i class="fas fa-trash"></i></a>
{{#if (or (eq item.type 'arme') (eq item.type 'conteneur') item.data.quantite)}}
&nbsp;
{{#if (or (eq item.type 'arme') (eq item.type 'conteneur') item.data.quantite)}}
<a class="item-control item-vendre" title="Vendre ou donner"><i class="fas fa-comments-dollar"></i></a>
{{/if}}
<a class="item-control item-montrer" title="Montrer"><i class="fas fa-comment"></i></a>
{{#if item.data.actionPrincipale}}
<a class="item-name item-action">{{item.data.actionPrincipale}}</a>
<a class="item-action">{{item.data.actionPrincipale}}</a>
{{/if}}
</div>
</span>
</li>

View File

@ -3,16 +3,26 @@
{{#each monnaie as |piece id|}}
<li class="item flexrow list-item" data-item-id="{{piece._id}}">
<img class="sheet-competence-img" src="{{piece.img}}" title="{{piece.name}}"/>
<span class="competence-title competence-label">{{piece.name}}</span>
<span class="competence-title competence-label">{{piece.data.quantite}}</span>
<span class="competence-title">
<a class="monnaie-plus plus-moins">+</a>
<a class="monnaie-moins plus-moins">-</a>
<span class="equipement-nom">{{piece.name}}</span>
<span class="equipement-detail">
<a class="monnaie-moins"><i class="fas fa-minus-square"></i></a>
</span>
<div class="item-controls flex-shrink">
<span class="equipement-detail">
<span>{{piece.data.quantite}}</span>
</span>
<span class="equipement-detail">
<a class="monnaie-plus"><i class="fas fa-plus-square"></i></a>
</span>
<!-- <span class="equipement-detail">
<span class="flex-shrink"><a class="monnaie-moins"><i class="fas fa-minus-square"></i></a></span>
<span>{{piece.data.quantite}}</span>
<span class="flex-shrink"><a class="monnaie-plus"><i class="fas fa-plus-square"></i></a></span>
</span> -->
<span class="equipement-actions">
<a class="item-control item-edit" title="Editer"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Supprimer"><i class="fas fa-trash"></i></a>
</div>
</span>
</li>
{{/each}}
</ul>

View File

@ -0,0 +1,26 @@
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-inventaire-monnaie.html" monnaie=monnaie}}
<span class="item-name"><h4>Equipement</h4></span>
<span class="item-name">Encombrement total/max : {{numberFormat calc.encTotal decimals=2}} / {{data.attributs.encombrement.value}} <b>{{calc.surEncombrementMessage}}</b></span> -
<span class="item-name"><a class="creer-un-objet">Créer un objet</a></span>
{{#if options.isGM}}
<span class="item-name"> - <a id="nettoyer-conteneurs">Vider tout les conteneurs</a></span>
{{/if}}
<ul class="item-list alterne-list">
<li class="competence-header flexrow">
<span class="equipement-nom">Nom</span>
<span class="equipement-detail">Q.</span>
<span class="equipement-detail">Enc.</span>
<span class="equipement-actions">Actions</span>
</li>
{{#each objets as |item id|}}
{{#unless item.estContenu}}
{{#if (ne item.type 'conteneur')}}
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-inventaire-item.html" item=item vide=true ouvert=true }}
{{/if}}
{{/unless}}
{{/each}}
{{#each conteneurs as |conteneur id|}}
{{buildConteneur this}}
{{/each}}
</ul>

View File

@ -0,0 +1,12 @@
<span class="item-name"><h4>Compagnons animaux</h4></span>
<ul class="item-list alterne-list">
{{#each subacteurs.montures as |monture id|}}
<li class="item flexrow list-item" data-actor-id="{{monture.id}}">
<img class="sheet-competence-img" src="{{monture.img}}" title="{{monture.name}}"/>
<span class="subacteur-label"><a>{{monture.name}}</a></span>
<div class="flex-shrink">
<a class="item-control subacteur-delete" title="Supprimer"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>

View File

@ -0,0 +1,12 @@
<span class="item-name"><h4>Suivants</h4></span>
<ul class="item-list alterne-list">
{{#each subacteurs.suivants as |suivant id|}}
<li class="item flexrow list-item" data-actor-id="{{suivant.id}}">
<img class="sheet-competence-img" src="{{suivant.img}}" title="{{suivant.name}}"/>
<span class="competence-title subacteur-label"><a>{{suivant.name}}</a></span>
<div class="item-controls flex-shrink">
<a class="item-control subacteur-delete" title="Supprimer"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>

View File

@ -0,0 +1,15 @@
<span class="item-name"><h4>Véhicules</h4></span>
<ul class="item-list alterne-list">
{{#each subacteurs.vehicules as |vehicule id|}}
<li class="item flexrow list-item" data-actor-id="{{vehicule.id}}">
<img class="sheet-competence-img" src="{{vehicule.img}}" title="{{vehicule.name}}"/>
<span class="flex-grow subacteur-label"><a>{{vehicule.name}}</a></span>
<span>{{vehicule.categorie}}</span>
<span>{{vehicule.structure}}</span>
<div class="flex-shrink">
<a class="item-control subacteur-delete" title="Supprimer"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>

View File

@ -666,79 +666,10 @@
{{!-- Equipment Tab --}}
<div class="tab items" data-group="primary" data-tab="items">
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-inventaire-monnaie.html" monnaie=monnaie}}
<span class="item-name"><h4>Equipement porté</h4></span>
<div>
<span class="item-name">Encombrement total/max : {{numberFormat calc.encTotal decimals=2}} / {{data.attributs.encombrement.value}} <b>{{calc.surEncombrementMessage}}</b></span> -
<span class="item-name">Estimation de l'équipement : {{numberFormat calc.prixTotalEquipement decimals=2}} Sols</span>
</div>
<div>
<span class="item-name"><a class="creer-un-objet">Créer un objet</a></span>
{{#if options.isGM}}
<span class="item-name"> - <a id="nettoyer-conteneurs">Vider tout les conteneurs</a></span>
{{/if}}
</div>
<ul class="item-list alterne-list">
<li class="competence-header flexrow">
<img class="sheet-competence-img" src="{{img}}" title="Equipement"/>
<span class="competence-title flex-grow">Nom</span>
<span class="competence-title">Q.</span>
<span class="competence-title">Enc.</span>
<span class="competence-title flex-grow">Equiper/Editer/Suppr.</span>
</li>
{{#each objets as |item id|}}
{{#unless item.estContenu}}
{{#if (ne item.type 'conteneur')}}
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-inventaire-conteneur.html" item=item vide=true ouvert=true }}
{{/if}}
{{/unless}}
{{/each}}
{{#each conteneurs as |conteneur id|}}
{{buildConteneur this}}
{{/each}}
</ul>
<span class="item-name"><h4>Compagnons animaux</h4></span>
<ul class="item-list alterne-list">
{{#each subacteurs.montures as |monture id|}}
<li class="item flexrow list-item" data-actor-id="{{monture.id}}">
<img class="sheet-competence-img" src="{{monture.img}}" title="{{monture.name}}"/>
<span class="competence-title subacteur-label"><a>{{monture.name}}</a></span>
<div class="item-controls flex-shrink">
<a class="item-control subacteur-delete" title="Supprimer"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
<span class="item-name"><h4>Véhicules</h4></span>
<ul class="item-list alterne-list">
{{#each subacteurs.vehicules as |vehicule id|}}
<li class="item flexrow list-item" data-actor-id="{{vehicule.id}}">
<img class="sheet-competence-img" src="{{vehicule.img}}" title="{{vehicule.name}}"/>
<span class="competence-title subacteur-label"><a>{{vehicule.name}}</a></span>
<span class="competence-title">{{vehicule.categorie}}</span>
<span class="competence-title">{{vehicule.structure}}</span>
<div class="item-controls flex-shrink">
<a class="item-control subacteur-delete" title="Supprimer"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
<span class="item-name"><h4>Suivants</h4></span>
<ul class="item-list alterne-list">
{{#each subacteurs.suivants as |suivant id|}}
<li class="item flexrow list-item" data-actor-id="{{suivant.id}}">
<img class="sheet-competence-img" src="{{suivant.img}}" title="{{suivant.name}}"/>
<span class="competence-title subacteur-label"><a>{{suivant.name}}</a></span>
<div class="item-controls flex-shrink">
<a class="item-control subacteur-delete" title="Supprimer"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-inventaire.html"}}
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-liens-animaux.html"}}
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-liens-suivants.html"}}
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-liens-vehicules.html"}}
</div>

View File

@ -69,45 +69,7 @@
{{!-- Equipment Tab --}}
<div class="tab items" data-group="primary" data-tab="items">
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-inventaire-monnaie.html" monnaie=monnaie}}
<span class="item-name"><h4>Equipement chargé</h4></span>
<span class="item-name">Encombrement total/max : {{numberFormat calc.encTotal decimals=2}} / {{data.capacite_encombrement}} <b>{{calc.surEncombrementMessage}}</b></span> -
<span class="item-name"><a class="creer-un-objet">Créer un objet</a></span>
{{#if options.isGM}}
<span class="item-name"> - <a id="nettoyer-conteneurs">Vider tout les conteneurs</a></span>
{{/if}}
<ul class="item-list alterne-list">
<li class="competence-header flexrow">
<img class="sheet-competence-img" src="{{img}}" title="Equipement"/>
<span class="competence-title competence-label flex-grow">Nom</span>
<span class="competence-title competence-label">Q.</span>
<span class="competence-title competence-value">Enc.</span>
<span class="competence-title competence-value">Equiper/Editer/Suppr.</span>
</li>
{{#each objets as |item id|}}
{{#unless item.estContenu}}
{{#if (ne item.type 'conteneur')}}
<li class="item flexrow list-item" data-item-id="{{item._id}}">
<img class="sheet-competence-img" src="{{item.img}}" title="{{item.name}}"/>
<span class="item-name flex-grow">{{item.name}}</span>
<span class="item-quantite">{{item.data.quantite}}</span>
<span class="item-quantite">{{numberFormat item.data.encTotal decimals=2}}</span>
<div class="item-controls">
<a class="item-control item-equip" title="Equiper">{{#if item.data.equipe}}<i class="fas fa-circle"></i>{{else}}<i class="fas fa-genderless"></i>{{/if}}</a>
<a class="item-control item-edit" title="Editer"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Supprimer"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/if}}
{{/unless}}
{{/each}}
{{#each conteneurs as |conteneur id|}}
{{buildConteneur this}}
{{/each}}
</ul>
</div>
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-inventaire.html"}}
{{!-- Biography Tab --}}

View File

@ -29,11 +29,10 @@
<span><label>Contenu : </label></span>
<ul class="item-list alterne-list">
<li class="competence-header flexrow">
<img class="sheet-competence-img" src="{{img}}" title="Equipement"/>
<span class="competence-title flex-grow">Nom</span>
<span class="competence-title">Q.</span>
<span class="competence-title">Enc.</span>
<span class="competence-title flex-grow">Equiper/Editer/Suppr.</span>
<span class="equipement-nom">Nom</span>
<span class="equipement-detail">Q.</span>
<span class="equipement-detail">Enc.</span>
<span class="equipement-actions">Actions</span>
</li>
{{buildContenu this}}
</ul>