mrkwnzl / cyphersystem-foundryvtt

The Cypher System for Foundry VTT
Other
20 stars 14 forks source link

Add more information to chat log file #359

Closed farling42 closed 6 months ago

farling42 commented 7 months ago

Is your feature request related to a problem? Please describe.
Add more of the chat card text into the card log file.

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Setup
Cypher System Version: 2.13.1 Foundry VTT Version: 11.315 Native App/Browser: Chrome Version 121.0.6167.86 (Official Build) (64-bit)

Additional context
Core Foundry only puts the dice roll and formula into the log file. The additional text that is displayed in Foundry's chat card is completely missing, so there is no context to the dice roll added to the chat log file.

For the following chat card: image

The chat log file contains only:

[1/30/2024, 10:43:07 PM] Rory Alexander (Kazron)
8
1d6 + 3 = 5 + 3 = 8
farling42 commented 7 months ago

ChatMessage#export needs to be overridden to provide more text in the output.

(possibly just setting ChatMessage.content to the correct HTML for the other text might be enough.

Note that a normal text message sent to the Chat is put into the log correctly (presumably because content is already set to the normal text).

mrkwnzl commented 7 months ago

Can you elaborate on what problem this solves?

mrkwnzl commented 7 months ago

This also seems like a core Foundry issue. The label text really should be part of the log, regardless of where the roll comes from. If I do it in the Cypher system, this won't work for rolls made with macros, in the chat directly, or using another module.

farling42 commented 7 months ago

Can you elaborate on what problem this solves?

As shown in the images above, the flavor text isn't appearing in the log file, so I have no idea what the logged dice roll was for.

I agree that the flavor field isn't being put into the log by core Foundry, but if core did do this then core might still not pick up the nested information inside the flavor box.

farling42 commented 7 months ago

Actually, it looks like a feature/bug in core Foundry.

Roll.toMessage() isn't putting the flavor text into the chatlog.content, so it won't be put into the log file.

I've raised https://github.com/foundryvtt/foundryvtt/issues/10375 to see if Foundry will add proper support.

mrkwnzl commented 6 months ago

As shown in the images above, the flavor text isn't appearing in the log file, so I have no idea what the logged dice roll was for.

I got that part. What are you using the logs for?

farling42 commented 6 months ago

As shown in the images above, the flavor text isn't appearing in the log file, so I have no idea what the logged dice roll was for.

I got that part. What are you using the logs for?

As a backup to know what happened over the campaign, rather than never clearing out the in-game chat log.

farling42 commented 6 months ago

I'm happy to close this issue, as it is a problem with core Foundry