compacted chat cards
Modules create problems to solve problems... Today's problem: "When I roll an attack, it eats the whole vertical of my monitor with just that one attack..."
The tradeoff with my modular combat modules is that each one creates its own chatcard. So I made a module that will check if a chat card being rendered is from the same actor as the one above it, and if so, collapse it upwards with css. Also various other purely-css tweaks to 5e Roll Cards.
2 Replies
Here's the same-ish view without said new module
how it works:
An async hook on
renderChatMessage
gets the indexOf
the chatMessage being rendered in game.messages.contents
array.
Check some properties (data.speaker
mostly) on both the current and previous message by index.
If they're from the same actor, add a class to the rendered html, if not, do nothing.
From there it's all css based on the added class name.
I'm a little nervous about how much that might blow up with worlds that have lots of chat messages. Not sure how indexOf
works, does it loop through the array or is it fancier than that?
looks like it does iterate, nothing fancy
oof
Well if anyone has any nifty ways I could make that process more efficient I'm all ears.