22 lines
770 B
JavaScript
22 lines
770 B
JavaScript
import CthulhuEternalRoll from "./roll.mjs"
|
|
|
|
export default class CthulhuEternalChatMessage extends ChatMessage {
|
|
async _renderRollContent(messageData) {
|
|
const data = messageData.message
|
|
if (this.rolls[0] instanceof CthulhuEternalRoll) {
|
|
const isPrivate = !this.isContentVisible
|
|
// _renderRollHTML va appeler render sur tous les rolls
|
|
const rollHTML = await this._renderRollHTML(isPrivate)
|
|
if (isPrivate) {
|
|
data.flavor = game.i18n.format("CHAT.PrivateRollContent", { user: this.user.name })
|
|
messageData.isWhisper = false
|
|
messageData.alias = this.user.name
|
|
}
|
|
data.content = `<section class="dice-rolls">${rollHTML}</section>`
|
|
return
|
|
}
|
|
|
|
return super._renderRollContent(messageData)
|
|
}
|
|
}
|