Comments (6)
I suspect this is "intentional" in that the core roller's flow isn't conducive to how I'm merging the cards together.
I use the timestamp to determine if chat cards relate to each other, for lack of a better mechanism. This works pretty well with MRE and fast-forwarded rolls, as well as for several of my modules that add chat cards in response to item usage hooks (from more-hooks).
I'm not interested in adding any data to the cards created, nor maintaining any state in this modules' code, so the options are fairly limited for that collapse mechanism.
But I'm definitely interested in any ideas for how to remedy this shortcoming.
from foundryvtt-compact-roll-card-5e.
That must be what this check is for then?
if (chatMessage.data.timestamp - previousChatMessage.data.timestamp > 300) {
return;
}
Too bad it only works for fast-forwarded rolls then. Kind of limits the audience. Bummer
from foundryvtt-compact-roll-card-5e.
True, but I'm not overly concerned about a limited audience :)
This whole module is unlisted still.
from foundryvtt-compact-roll-card-5e.
The rolls are adding a flag to the chat message that contains the item ID: flags.dnd5e.roll.itemId
. The catch is, as far as I can tell, the original item chat card does not put the item ID in the chat message's data. It's there in the HTML (e.g. the data-item-id="yAKKtMnSmrFDMCQz"
attribute on the main div
) but not somewhere like a flag on the actual ChatMessageData.
Was thinking you could use that to detect instead of time proximity, but I'm not sure how to get the data-item-id
from the previousChatMessage
.
from foundryvtt-compact-roll-card-5e.
Reading the string position of "data-item-id" will do it. Same way Warp Gate's warpgate.dnd5e.rollItem()
gets the spell level of a casting, for reference.
from foundryvtt-compact-roll-card-5e.
That's an interesting idea.
I don't love the idea that two longsword usages back to back will collapse upwards though.
Could add in something to check that it's the main item card, and if so never collapse those up.
from foundryvtt-compact-roll-card-5e.
Related Issues (6)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from foundryvtt-compact-roll-card-5e.