Version 12.0.15 #715

Merged
uberwald merged 7 commits from VincentVk/foundryvtt-reve-de-dragon:v11 into v11 2024-10-17 07:54:00 +02:00
6 changed files with 15 additions and 13 deletions
Showing only changes of commit 5004774a15 - Show all commits

View File

@ -3,6 +3,7 @@
- Les messages de maladies ne sont plus publics
- Les messages privés dans les TMR sont aussi envoyés au GM
- Les informations de compétences pouvant augmenter s'affichent comme tooltips
- Amélioration du rendu des tables de compendiums (commande /table)
## 12.0.14 - Les légions d'Astrobazzarh
- Feuille de PNJ:

View File

@ -236,12 +236,12 @@ export class CompendiumTableHelpers {
let max = 0;
const total = rows.map(it => it.frequence).reduce(Misc.sum(), 0);
return rows.map(row => {
const frequence = row.frequence;
row.min = max + 1;
row.max = max + frequence;
const frequence = row.frequence
row.min = max + 1
row.max = max + frequence
row.total = total
max += frequence;
return row;
max += frequence
return row
})
}
static async getRandom(table, type, subTypes = ['objet'], forcedRoll = undefined, localisation = undefined) {
@ -260,8 +260,8 @@ export class CompendiumTableHelpers {
}
const total = table[0].total;
const formula = `1d${total}`;
if (forcedRoll == undefined && (forcedRoll > total || forcedRoll <= 0)) {
ui.notifications.warn(`Jet de rencontre ${forcedRoll} en dehors de la table [1..${total}], le jet est relancé`);
if (forcedRoll != undefined && (forcedRoll > total || forcedRoll <= 0)) {
ui.notifications.warn(`Jet forcé ${forcedRoll} en dehors de la table [1..${total}], le jet est relancé`);
forcedRoll = undefined;
}
const roll = forcedRoll ? { total: forcedRoll, formula } : await RdDDice.roll(formula, { showDice: HIDE_DICE });
@ -276,7 +276,7 @@ export class CompendiumTableHelpers {
return;
}
const percentages = (row.total == 100) ? '%' : ''
const flavorContent = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-compendium-table-roll.html', {
const flavorContent = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-compendium-table-roll.hbs', {
roll: row.roll,
document: row.document,
percentages,
@ -296,7 +296,7 @@ export class CompendiumTableHelpers {
/* -------------------------------------------- */
static async tableToChatMessage(table, type, subTypes, typeName = undefined) {
const flavorContent = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-compendium-table.html', {
const flavorContent = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-compendium-table.hbs', {
img: RdDItem.getDefaultImg(subTypes[0]),
typeName: typeName ?? Misc.typeName(type, subTypes[0]),
table,

View File

@ -105,7 +105,7 @@ export class TMRRencontres {
/* -------------------------------------------- */
async $chatRolledRencontre(row, rencontre, tmr) {
const flavorContent = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-compendium-table-roll-rencontre.html',
const flavorContent = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-compendium-table-roll-rencontre.hbs',
{
roll: row.roll,
rencontre,

View File

@ -12,8 +12,9 @@
<ul class="flexcol item-list alterne-list">
{{#each table as |row|}}
<li class="item list-item ">
<span>{{row.min}}{{#unless (eq row.min row.max)}}-{{row.max}}{{/unless}} : &nbsp;</span>
<span>{{linkCompendium row.document.pack row.document.id row.document.name}}</span>
<span class="flex-group-left">
{{row.min}}{{#unless (eq row.min row.max)}}-{{row.max}}{{/unless}}&nbsp;: {{linkCompendium row.document.pack row.document.id row.document.name}}
</span>
</li>
{{/each}}
</ul>