Rendu des tables de compendiums
This commit is contained in:
parent
226afc1680
commit
5004774a15
@ -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:
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -11,9 +11,10 @@
|
||||
<div>
|
||||
<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}} : </span>
|
||||
<span>{{linkCompendium row.document.pack row.document.id row.document.name}}</span>
|
||||
<li class="item list-item ">
|
||||
<span class="flex-group-left">
|
||||
{{row.min}}{{#unless (eq row.min row.max)}}-{{row.max}}{{/unless}} : {{linkCompendium row.document.pack row.document.id row.document.name}}
|
||||
</span>
|
||||
</li>
|
||||
{{/each}}
|
||||
</ul>
|
Loading…
Reference in New Issue
Block a user