Merge branch 'dev_1.1' of gitlab.com:LeRatierBretonnien/foundryvtt-reve-de-dragon into dev_1.1

This commit is contained in:
sladecraven 2020-12-10 20:14:42 +01:00
commit e74031be0b
4 changed files with 22 additions and 16 deletions

View File

@ -34,7 +34,7 @@ export class RdDActorSheet extends ActorSheet {
data.data.lockUnlockText = (this.options.editCaracComp) ? "Bloquer" : "Débloquer"; data.data.lockUnlockText = (this.options.editCaracComp) ? "Bloquer" : "Débloquer";
// Gestion de l'affichage total/partiel des compétences // Gestion de l'affichage total/partiel des compétences
data.data.cacherCompetencesNiveauBase = this.options.cacherCompetencesNiveauBase; data.data.cacherCompetencesNiveauBase = this.options.cacherCompetencesNiveauBase;
data.data.showHideCompetenceText = (this.options.cacherCompetencesNiveauBase) ? "Cacher Comp." : "Montrer Comp." ; data.data.showHideCompetenceText = (this.options.cacherCompetencesNiveauBase) ? "Montrer tout" : "Filtrer" ;
let compCategorieNiveau = RdDUtility.getLevelCategory(); // recup catégorie let compCategorieNiveau = RdDUtility.getLevelCategory(); // recup catégorie
data.itemsByType = RdDUtility.buildItemsClassification(data.items); data.itemsByType = RdDUtility.buildItemsClassification(data.items);

View File

@ -32,8 +32,11 @@ export class RdDItemSort extends Item {
/* -------------------------------------------- */ /* -------------------------------------------- */
static buildBonusCaseList( caseBonusString, newCase ) { static buildBonusCaseList( caseBonusString, newCase ) {
if (caseBonusString == undefined) {
return [];
}
let bonusCaseList = []; let bonusCaseList = [];
let bonusCaseArray = caseBonusString.split(','); let bonusCaseArray = caseBonusString == undefined ? [] : caseBonusString.split(',');
for( let bonusCase of bonusCaseArray) { for( let bonusCase of bonusCaseArray) {
let bonusSplit = bonusCase.split(':'); let bonusSplit = bonusCase.split(':');
bonusCaseList.push( { case: bonusSplit[0], bonus: bonusSplit[1] } ); bonusCaseList.push( { case: bonusSplit[0], bonus: bonusSplit[1] } );
@ -49,13 +52,11 @@ export class RdDItemSort extends Item {
* @param {} item * @param {} item
*/ */
static getBonusCaseList( data, newCase = false ) { static getBonusCaseList( data, newCase = false ) {
let bonusCaseList = [];
// Gestion spéciale case bonus // Gestion spéciale case bonus
if ( data.item.type == 'sort') { if ( data.item.type == 'sort') {
bonusCaseList = this.buildBonusCaseList(data.data.bonuscase, newCase ); return this.buildBonusCaseList(data.data.bonuscase, newCase );
} }
return bonusCaseList; return undefined;
} }
/* -------------------------------------------- */ /* -------------------------------------------- */

View File

@ -52,10 +52,6 @@
<a id="ptreve-actuel-plus">+</a> <a id="ptreve-actuel-plus">+</a>
</label> </label>
</li> </li>
<li>
<label><a class="lock-unlock-sheet">{{data.lockUnlockText}}</a></label>
<label><a class="show-hide-competences">{{data.showHideCompetenceText}}</a></label>
</li>
</ul> </ul>
<div class="flex-group-center flex-actions-bar"> <div class="flex-group-center flex-actions-bar">
<div> <div>
@ -72,10 +68,12 @@
<span class="tooltiptext">{{{data.fatigue.html}}}</span> <span class="tooltiptext">{{{data.fatigue.html}}}</span>
</span> </span>
<span>{{data.blessures.resume}}</span> <span>{{data.blessures.resume}}</span>
<span>{{data.compteurs.etat.label}}: {{data.compteurs.etat.value}}</span>
</div> </div>
<div class="flexrow"> <div class="flexrow">
<span>{{data.compteurs.surenc.label}}: {{data.compteurs.surenc.value}}</span> <span>{{data.compteurs.etat.label}}: {{data.compteurs.etat.value}}</span><span></span>
</div>
<div class="flexrow">
<span>{{data.compteurs.surenc.label}}: {{data.compteurs.surenc.value}}</span><span></span>
</div> </div>
</div> </div>
</div> </div>
@ -100,6 +98,7 @@
<div class="tab items" data-group="primary" data-tab="carac"> <div class="tab items" data-group="primary" data-tab="carac">
<div class="grid grid-2col"> <div class="grid grid-2col">
<div class="flex-group-left flexcol"> <div class="flex-group-left flexcol">
<span><a class="lock-unlock-sheet">{{data.lockUnlockText}}</a></span>
<ul class="carac-list alterne-list"> <ul class="carac-list alterne-list">
{{#each data.carac as |carac key|}} {{#each data.carac as |carac key|}}
<li class="competence flexrow list-item" data-attribute="{{key}}"> <li class="competence flexrow list-item" data-attribute="{{key}}">
@ -162,6 +161,10 @@
{{!-- Compétences Tab --}} {{!-- Compétences Tab --}}
<div class="tab competences" data-group="primary" data-tab="competences"> <div class="tab competences" data-group="primary" data-tab="competences">
<div class="flexrow">
<span><a class="lock-unlock-sheet">{{data.lockUnlockText}}</a></span>
<span><a class="show-hide-competences">{{data.showHideCompetenceText}}</a></span>
</div>
<div class="grid grid-2col"> <div class="grid grid-2col">
<div class="flex-group-left flexcol competence-column"> <div class="flex-group-left flexcol competence-column">
<header class="competence-header flexrow"> <header class="competence-header flexrow">

View File

@ -56,6 +56,7 @@
<label for="xp">XP </label> <label for="xp">XP </label>
<input class="attribute-value" type="text" name="data.xp" value="{{data.xp}}" data-dtype="Number"/> <input class="attribute-value" type="text" name="data.xp" value="{{data.xp}}" data-dtype="Number"/>
</div> </div>
{{#if owner}}
{{#each bonusCaseList as |bcData key|}} {{#each bonusCaseList as |bcData key|}}
<div class="form-group"> <div class="form-group">
<label for="bonuscase">Case/Bonus :</label> <label for="bonuscase">Case/Bonus :</label>
@ -63,6 +64,7 @@
<input class="attribute-value" type="text" name="bonusValue" value="{{bcData.bonus}}" data-dtype="Number"/> <input class="attribute-value" type="text" name="bonusValue" value="{{bcData.bonus}}" data-dtype="Number"/>
</div> </div>
{{/each}} {{/each}}
{{/if}}
<div class="flexcol"> <div class="flexcol">
<span><label>Description : </label></span> <span><label>Description : </label></span>
<div class="form-group editor"> <div class="form-group editor">