Gestion equipement sur fiche de type 'token'

This commit is contained in:
sladecraven 2020-11-14 20:18:06 +01:00
parent a1f73c0aa8
commit 625e67a300
3 changed files with 8 additions and 6 deletions

View File

@ -122,7 +122,7 @@ export class RdDActorSheet extends ActorSheet {
data.data.potions = this._checkNull(data.itemsByType['potions']);
data.data.ingredients = this._checkNull(data.itemsByType['ingredient']);
data.data.munitions = this._checkNull(data.itemsByType['munition']);
data.data.herbes = this._checkNull(data.itemsByType['herbes']);
data.data.herbes = this._checkNull(data.itemsByType['herbe']);
data.data.sorts = this._checkNull(data.itemsByType['sort']);
data.data.queues = this._checkNull(data.itemsByType['queue']);
data.data.souffles = this._checkNull(data.itemsByType['souffle']);
@ -158,7 +158,7 @@ export class RdDActorSheet extends ActorSheet {
async displayDialogEncaisser( ) {
let data = { bonusmalusTable: CONFIG.RDD.bonusmalus };
let html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/dialog-roll-encaisser.html', data );
new RdDEncaisser(html, this.actor ).render(true);enleverDeConteneur
new RdDEncaisser(html, this.actor ).render(true);
}
/* -------------------------------------------- */

View File

@ -343,10 +343,12 @@ export class RdDActor extends Actor {
let conteneur = this.items.find( conteneur => conteneurId == conteneur._id); // recup conteneur
if ( conteneur ) { // Si présent
//console.log("Suppression du conteneur1", conteneurId, itemId, conteneur.data.data.contenu);
let newContenu = conteneur.data.data.contenu.filter( function(value, index, arr) { return value != itemId } );
let contenu = conteneur.data.data.contenu;
contenu.splice(contenu.indexOf('itemId'), 1);
//let newContenu = conteneur.data.data.contenu.filter( function(value, index, arr) { return value != itemId } );
//console.log("Suppression du conteneur2", conteneurId, itemId, newContenu);
let update = {_id: conteneurId, "data.contenu": newContenu };
await this.updateEmbeddedEntity("OwnedItem", update);
//let update = {_id: conteneurId, "data.contenu": newContenu };
await this.updateEmbeddedEntity("OwnedItem", conteneur.data);
}
}

View File

@ -2,7 +2,7 @@
"name": "foundryvtt-reve-de-dragon",
"title": "Rêve de Dragon",
"description": "Rêve de Dragon RPG for FoundryVTT",
"version": "0.9.38",
"version": "0.9.39",
"minimumCoreVersion": "0.7.5",
"compatibleCoreVersion": "0.7.6",
"templateVersion": 44,