mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-15 13:11:08 +01:00
Using a private accessor to workaround the context being missing in renderChatMessageHTML - I do not like it
This commit is contained in:
parent
0bcb030279
commit
f9aad77484
2 changed files with 19 additions and 17 deletions
|
|
@ -193,11 +193,12 @@ Hooks.on('ready', async () => {
|
|||
|
||||
Hooks.once('dicesoniceready', () => {});
|
||||
|
||||
Hooks.on('renderChatMessageHTML', (_, element, message) => {
|
||||
Hooks.on('renderChatMessageHTML', (app, element, _) => {
|
||||
enricherRenderSetup(element);
|
||||
// Despite documentation, message may be empty. For example, a module's chat message.
|
||||
if (!message) return;
|
||||
const cssClass = message.message.flags?.daggerheart?.cssClass;
|
||||
// Despite documentation, the third parameter may be empty as per
|
||||
// https://github.com/foundryvtt/foundryvtt/issues/11984
|
||||
const message = app._source;
|
||||
const cssClass = message.flags?.daggerheart?.cssClass;
|
||||
if (cssClass) cssClass.split(' ').forEach(cls => element.classList.add(cls));
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue