From 782dc38268de0431ceee23cee106146e07f293a6 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Thu, 19 Jan 2023 01:45:30 +0100 Subject: [PATCH] Ajout de message si rencontre perdue MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ajout d'un message pour comprendre comment une rencontre peut être perdue ( Issue #612) --- module/rdd-tmr-dialog.js | 8 +++++++- module/rdd-tmr-rencontre-dialog.js | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/module/rdd-tmr-dialog.js b/module/rdd-tmr-dialog.js index ac450e98..9dc42f28 100644 --- a/module/rdd-tmr-dialog.js +++ b/module/rdd-tmr-dialog.js @@ -285,7 +285,12 @@ export class RdDTMRDialog extends Dialog { } /* -------------------------------------------- */ - async onActionRencontre(action, tmr) { + async onActionRencontre(action, tmr, rencontre) { + if (!this.currentRencontre){ + ui.notifications.warn("#612 Rencontre perdue, récupération en cours. Vous pouvez contacter l'équipe avec les logs pour aider à résoudre ce problème") + console.error("#612 Rencontre perdue", action, tmr, rencontre, this); + this.currentRencontre = rencontre; + } switch (action) { case 'derober': await this.derober(); @@ -589,6 +594,7 @@ export class RdDTMRDialog extends Dialog { return await game.system.rdd.rencontresTMR.getRencontreAleatoire(tmr, this.actor.isMauvaiseRencontre()) } else { this._tellToUser(myRoll + ": Pas de rencontre en " + locTMR); + return undefined; } } diff --git a/module/rdd-tmr-rencontre-dialog.js b/module/rdd-tmr-rencontre-dialog.js index 804dd160..b1a859f2 100644 --- a/module/rdd-tmr-rencontre-dialog.js +++ b/module/rdd-tmr-rencontre-dialog.js @@ -29,12 +29,13 @@ export class RdDTMRRencontreDialog extends Dialog { this.toClose = false; this.tmr = tmr; this.tmrApp = tmrApp; + this.rencontre = rencontre; this.tmrApp.minimize(); } async onButtonAction(action) { this.toClose = true; - this.tmrApp.onActionRencontre(action, this.tmr) + this.tmrApp.onActionRencontre(action, this.tmr, this.rencontre) } /* -------------------------------------------- */