2025-01-26 21:29:01 +01:00
|
|
|
import { ChatUtility } from "./chat-utility.js";
|
|
|
|
|
|
|
|
export class RdDRollResult {
|
|
|
|
|
2025-01-27 22:13:33 +01:00
|
|
|
static async displayRollData(rollData, actor = undefined, template = 'chat-resultat-general.hbs') {
|
2025-01-26 21:29:01 +01:00
|
|
|
const chatMessage = await ChatUtility.createChatWithRollMode(
|
|
|
|
{ content: await RdDRollResult.buildRollDataHtml(rollData, template) },
|
|
|
|
actor
|
|
|
|
)
|
|
|
|
return chatMessage
|
|
|
|
}
|
|
|
|
|
2025-01-27 22:13:33 +01:00
|
|
|
static async buildRollDataHtml(rollData, template = 'chat-resultat-general.hbs') {
|
2025-01-26 21:29:01 +01:00
|
|
|
rollData.show = rollData.show || {};
|
|
|
|
return await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/${template}`, rollData);
|
|
|
|
}
|
|
|
|
}
|