Merge branch 'sorts-compendium' into 'dev_1.1'
Fix ouverture sort compendium See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!64
This commit is contained in:
commit
99f1ef1954
@ -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,14 +52,12 @@ export class RdDItemSort extends Item {
|
|||||||
* @param {} item
|
* @param {} item
|
||||||
*/
|
*/
|
||||||
static getBonusCaseList( data, newCase = false ) {
|
static getBonusCaseList( data, newCase = false ) {
|
||||||
|
// Gestion spéciale case bonus
|
||||||
let bonusCaseList = [];
|
if ( data.item.type == 'sort') {
|
||||||
// Gestion spéciale case bonus
|
return this.buildBonusCaseList(data.data.bonuscase, newCase );
|
||||||
if ( data.item.type == 'sort') {
|
|
||||||
bonusCaseList = this.buildBonusCaseList(data.data.bonuscase, newCase );
|
|
||||||
}
|
|
||||||
return bonusCaseList;
|
|
||||||
}
|
}
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
/** Met à jour les données de formulaire
|
/** Met à jour les données de formulaire
|
||||||
|
@ -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">
|
||||||
|
Loading…
Reference in New Issue
Block a user