From 02c48f4796018738d68a2ef7bb56c77dab29475f Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Thu, 1 Dec 2022 00:28:13 +0100 Subject: [PATCH 1/3] Fix initiative --- module/rdd-combat.js | 1 - 1 file changed, 1 deletion(-) diff --git a/module/rdd-combat.js b/module/rdd-combat.js index de7c14fb..74dbfb0e 100644 --- a/module/rdd-combat.js +++ b/module/rdd-combat.js @@ -84,7 +84,6 @@ export class RdDCombatManager extends Combat { console.log(`${game.system.title} | Combat.rollInitiative()`, ids, formula, messageOptions); ids = typeof ids === "string" ? [ids] : ids; - const currentId = this.combatant._id; // calculate initiative for (let cId = 0; cId < ids.length; cId++) { const combatant = this.combatants.get(ids[cId]); From 3a29570bae848fdbd8abae40b94d54255e132bf8 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Thu, 1 Dec 2022 01:22:25 +0100 Subject: [PATCH 2/3] =?UTF-8?q?Fix=20message=20d'exp=C3=A9rience=20invisib?= =?UTF-8?q?les?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Les messages d'expérience sur mêlée/tir/lancer (à répartir) n'étaient plus visibles --- module/actor.js | 18 ++++++++++++------ module/misc.js | 11 +++++++++-- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/module/actor.js b/module/actor.js index 2a975124..6b3c214a 100644 --- a/module/actor.js +++ b/module/actor.js @@ -2266,13 +2266,19 @@ export class RdDActor extends Actor { /* -------------------------------------------- */ async appliquerAjoutExperience(rollData, hideChatMessage = 'show') { if (!this.isPersonnage()) return; - hideChatMessage = hideChatMessage == 'hide' || (game.settings.get("core", "rollMode") != 'blindroll' && !game.user.isGM) + hideChatMessage = hideChatMessage == 'hide' || (Misc.isRollModeHiddenToPlayer() && !game.user.isGM) let xpData = await this._appliquerExperience(rollData.rolled, rollData.selectedCarac.label, rollData.competence); - if (xpData && !hideChatMessage) { - ChatMessage.create({ - whisper: ChatUtility.getWhisperRecipientsAndGMs(this.name), - content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-actor-gain-xp.html`, xpData) - }); + if (xpData) { + const content = await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-actor-gain-xp.html`, xpData); + if (hideChatMessage) { + ChatUtility.blindMessageToGM({ content: content}); + } + else{ + ChatMessage.create({ + whisper: ChatUtility.getWhisperRecipientsAndGMs(this.name), + content: content + }); + } } } diff --git a/module/misc.js b/module/misc.js index fb506356..67298074 100644 --- a/module/misc.js +++ b/module/misc.js @@ -120,13 +120,20 @@ export class Misc { return Misc.firstConnectedGM()?.id ?? game.user.id; } + static isRollModeHiddenToPlayer() { + switch (game.settings.get("core", "rollMode")) { + case CONST.DICE_ROLL_MODES.BLIND: + case CONST.DICE_ROLL_MODES.SELF: return true; + } + return false + } + static getActiveUser(id) { return game.users.find(u => u.id == id && u.active); - } + } static firstConnectedGM() { return game.users.filter(u => u.isGM && u.active).sort(Misc.ascending(u => u.id)).find(u => u.isGM && u.active); - } static isOwnerPlayer(actor, user=undefined) { From 8a5cf3cb093a0e4ffcaf0297fa52d5ebc43cb7cf Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Thu, 1 Dec 2022 01:25:06 +0100 Subject: [PATCH 3/3] Version 10.3.2 --- system.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system.json b/system.json index 2259abb3..b6afe971 100644 --- a/system.json +++ b/system.json @@ -1,8 +1,8 @@ { "id": "foundryvtt-reve-de-dragon", "title": "Rêve de Dragon", - "version": "10.3.1", - "download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/archive/foundryvtt-reve-de-dragon-10.3.1.zip", + "version": "10.3.2", + "download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/archive/foundryvtt-reve-de-dragon-10.3.2.zip", "manifest": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/raw/v10/system.json", "compatibility": { "minimum": "10",