Fix mise à jour sur action des herbes/potions

Par exemple, la mise à jour de quantité d'herbe ne se faisait pas
dans les liste d'équipement des feuilles de conteneurs, lors d'une
fabrication de potion dans les items
This commit is contained in:
2023-03-30 02:59:07 +02:00
parent de56fa909a
commit 327943c4aa
5 changed files with 36 additions and 31 deletions

View File

@ -1625,11 +1625,6 @@ export class RdDActor extends RdDBaseActor {
new RdDRollDialogEthylisme(html, rollData, this, r => this.saouler(r.forceAlcool)).render(true);
}
/* -------------------------------------------- */
async actionItem(item, onActionItem = async () => { }) {
item.actionPrincipale(this, onActionItem);
}
async actionNourritureboisson(item, onActionItem) {
switch (item.getUtilisationCuisine()) {
case 'brut': {
@ -1662,9 +1657,9 @@ export class RdDActor extends RdDBaseActor {
await this.rollTache(tache.id);
}
}
async actionHerbe(item) {
async actionHerbe(item, onActionItem = async () => {}) {
if (item.isHerbeAPotion()) {
return this.dialogFabriquerPotion(item);
return DialogFabriquerPotion.create(this, item, onActionItem);
}
return;
}
@ -3607,12 +3602,6 @@ export class RdDActor extends RdDBaseActor {
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-consommer-potion-repos.html`, potionData)
});
}
/* -------------------------------------------- */
dialogFabriquerPotion(herbe) {
DialogFabriquerPotion.create(this, herbe, {
html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-fabriquer-potion-base.html',
}, []);
}
/* -------------------------------------------- */
async fabriquerPotion(herbeData) {