forked from public/foundryvtt-reve-de-dragon
Corrections des tirages tmr/rencontres
- on n'affiche plus le compendium d'origine des rencontres dans le tchat - utilisation de ChatMessageData#rolls (compat future v14) - le résultat d'un d100 n'a pas à afficher de signe '%' - utilistaion des types de TMR plutôt que les noms en minuscules
This commit is contained in:
@ -284,23 +284,20 @@ export class CompendiumTableHelpers {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static async tableRowToChatMessage(row, type = 'Item') {
|
||||
static async tableRowToChatMessage(row, type, options = {showSource: true}) {
|
||||
if (!row) {
|
||||
return;
|
||||
}
|
||||
const percentages = (row.total == 100) ? '%' : ''
|
||||
const flavorContent = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-compendium-table-roll.hbs', {
|
||||
roll: row.roll,
|
||||
document: row.document,
|
||||
percentages,
|
||||
typeName: Misc.typeName(type, row.document?.type ?? 'objet'),
|
||||
isGM: game.user.isGM,
|
||||
options
|
||||
});
|
||||
const messageData = {
|
||||
// flavor: flavorContent,
|
||||
user: game.user.id,
|
||||
type: CONST.CHAT_MESSAGE_TYPES.ROLL,
|
||||
roll: row.roll,
|
||||
rolls: [row.roll],
|
||||
sound: CONFIG.sounds.dice,
|
||||
content: flavorContent
|
||||
};
|
||||
|
Reference in New Issue
Block a user