From 1edebf04ccce0e4b45cbd7bbfcaa23b6bdd1e0a6 Mon Sep 17 00:00:00 2001 From: Vlyan Date: Mon, 4 Jan 2021 17:47:40 +0100 Subject: [PATCH] Added class "roll" for roll in chat --- system/scripts/dice/roll.js | 1 - system/scripts/main-l5r5e.js | 19 +++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/system/scripts/dice/roll.js b/system/scripts/dice/roll.js index 1e7792a..6bd1182 100644 --- a/system/scripts/dice/roll.js +++ b/system/scripts/dice/roll.js @@ -252,7 +252,6 @@ export class RollL5r5e extends Roll { // Prepare chat data messageData = mergeObject( { - borderColor: game.user.color, user: game.user._id, type: template, content: this._total, diff --git a/system/scripts/main-l5r5e.js b/system/scripts/main-l5r5e.js index 5dd1a74..2506e1d 100644 --- a/system/scripts/main-l5r5e.js +++ b/system/scripts/main-l5r5e.js @@ -177,10 +177,9 @@ Hooks.once("init", async function () { /* ------------------------------------ */ /* Setup system */ /* ------------------------------------ */ -Hooks.once("setup", function () { - // Do anything after initialization but before - // ready -}); +// Hooks.once("setup", function () { +// // Do anything after initialization but before ready +// }); /* ------------------------------------ */ /* Actor Dialog */ @@ -205,6 +204,16 @@ Hooks.on("renderSidebarTab", (app, html, data) => { }); }); +/* ------------------------------------ */ +/* Chat Message */ +/* ------------------------------------ */ +Hooks.on("renderChatMessage", (message, html, data) => { + // Add a extra CSS class to roll + if (message.isRoll) { + html.addClass("roll"); + } +}); + /* ------------------------------------ */ /* DiceSoNice Hook */ /* ------------------------------------ */ @@ -300,5 +309,3 @@ Hooks.once("ready", async function () { liensExt.render(true); }); }); - -// Add any additional hooks if necessary