First row of tests and fixes

This commit is contained in:
2026-03-05 22:50:53 +01:00
parent 12458925a1
commit f28df2ae76
23 changed files with 442 additions and 126 deletions
+21 -3
View File
@@ -1,7 +1,25 @@
import AwERoll from "./roll.mjs"
export default class AwEChatMessage extends ChatMessage {
/** @override */
async getHTML(...args) {
const html = await super.getHTML(...args)
return html
async _renderRollContent(messageData) {
if (this.rolls[0] instanceof AwERoll) {
const isPrivate = !this.isContentVisible
const roll = this.rolls[0]
const html = await foundry.applications.handlebars.renderTemplate(
AwERoll.CHAT_TEMPLATE,
{
flavor: this.flavor,
total: roll.total,
outcome: isPrivate ? null : roll.outcome,
dc: roll.dc,
isPrivate
}
)
messageData.message.content = html
return
}
return super._renderRollContent(messageData)
}
}