From 6de19eb35728718de41c6c0fa1a40c7126b0b1c8 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Mon, 13 Jan 2025 22:27:13 +0100 Subject: [PATCH] =?UTF-8?q?Convertir=20tous=20les=20jets=20de=20d=C3=A9s?= =?UTF-8?q?=20dans=20le=20tchat?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/chat-utility.js | 2 ++ module/rdd-rolltables.js | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/module/chat-utility.js b/module/chat-utility.js index 5f515ce8..9f6c053e 100644 --- a/module/chat-utility.js +++ b/module/chat-utility.js @@ -1,6 +1,7 @@ import { Misc } from "./misc.js"; import { SYSTEM_RDD, SYSTEM_SOCKET_ID } from "./constants.js"; import { RdDTimestamp } from "./time/rdd-timestamp.js"; +import { RdDTextEditor } from "./apps/rdd-text-roll-editor.js"; /** @@ -198,6 +199,7 @@ export class ChatUtility { static async onCreateChatMessage(chatMessage, options, id) { if (chatMessage.isAuthor) { await chatMessage.setFlag(SYSTEM_RDD, 'rdd-timestamp', game.system.rdd.calendrier.getTimestamp()); + await chatMessage.update({ content: await RdDTextEditor.enrichHTML(chatMessage.content, undefined, {showLink:false}) }) } } } diff --git a/module/rdd-rolltables.js b/module/rdd-rolltables.js index 16e74554..d24d474b 100644 --- a/module/rdd-rolltables.js +++ b/module/rdd-rolltables.js @@ -102,10 +102,9 @@ export class RdDRollTables { /* -------------------------------------------- */ static async getMaladresse(options = { toChat: false, arme: false }) { - const maladresse = await RdDRollTables.drawTextFromRollTable( + return await RdDRollTables.drawTextFromRollTable( options.arme ? "Maladresse armé" : "Maladresses non armé", - options); - return await RdDTextEditor.enrichHTML(maladresse, undefined, {showLink:false}) + options) } }