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 de maladies ne sont plus publics
|
||||||
- Les messages privés dans les TMR sont aussi envoyés au GM
|
- Les messages privés dans les TMR sont aussi envoyés au GM
|
||||||
- Les informations de compétences pouvant augmenter s'affichent comme tooltips
|
- 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
|
## 12.0.14 - Les légions d'Astrobazzarh
|
||||||
- Feuille de PNJ:
|
- Feuille de PNJ:
|
||||||
|
@ -236,12 +236,12 @@ export class CompendiumTableHelpers {
|
|||||||
let max = 0;
|
let max = 0;
|
||||||
const total = rows.map(it => it.frequence).reduce(Misc.sum(), 0);
|
const total = rows.map(it => it.frequence).reduce(Misc.sum(), 0);
|
||||||
return rows.map(row => {
|
return rows.map(row => {
|
||||||
const frequence = row.frequence;
|
const frequence = row.frequence
|
||||||
row.min = max + 1;
|
row.min = max + 1
|
||||||
row.max = max + frequence;
|
row.max = max + frequence
|
||||||
row.total = total
|
row.total = total
|
||||||
max += frequence;
|
max += frequence
|
||||||
return row;
|
return row
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
static async getRandom(table, type, subTypes = ['objet'], forcedRoll = undefined, localisation = undefined) {
|
static async getRandom(table, type, subTypes = ['objet'], forcedRoll = undefined, localisation = undefined) {
|
||||||
@ -260,8 +260,8 @@ export class CompendiumTableHelpers {
|
|||||||
}
|
}
|
||||||
const total = table[0].total;
|
const total = table[0].total;
|
||||||
const formula = `1d${total}`;
|
const formula = `1d${total}`;
|
||||||
if (forcedRoll == undefined && (forcedRoll > total || forcedRoll <= 0)) {
|
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é`);
|
ui.notifications.warn(`Jet forcé ${forcedRoll} en dehors de la table [1..${total}], le jet est relancé`);
|
||||||
forcedRoll = undefined;
|
forcedRoll = undefined;
|
||||||
}
|
}
|
||||||
const roll = forcedRoll ? { total: forcedRoll, formula } : await RdDDice.roll(formula, { showDice: HIDE_DICE });
|
const roll = forcedRoll ? { total: forcedRoll, formula } : await RdDDice.roll(formula, { showDice: HIDE_DICE });
|
||||||
@ -276,7 +276,7 @@ export class CompendiumTableHelpers {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const percentages = (row.total == 100) ? '%' : ''
|
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,
|
roll: row.roll,
|
||||||
document: row.document,
|
document: row.document,
|
||||||
percentages,
|
percentages,
|
||||||
@ -296,7 +296,7 @@ export class CompendiumTableHelpers {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static async tableToChatMessage(table, type, subTypes, typeName = undefined) {
|
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]),
|
img: RdDItem.getDefaultImg(subTypes[0]),
|
||||||
typeName: typeName ?? Misc.typeName(type, subTypes[0]),
|
typeName: typeName ?? Misc.typeName(type, subTypes[0]),
|
||||||
table,
|
table,
|
||||||
|
@ -105,7 +105,7 @@ export class TMRRencontres {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async $chatRolledRencontre(row, rencontre, tmr) {
|
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,
|
roll: row.roll,
|
||||||
rencontre,
|
rencontre,
|
||||||
|
@ -11,9 +11,10 @@
|
|||||||
<div>
|
<div>
|
||||||
<ul class="flexcol item-list alterne-list">
|
<ul class="flexcol item-list alterne-list">
|
||||||
{{#each table as |row|}}
|
{{#each table as |row|}}
|
||||||
<li class="item list-item" >
|
<li class="item list-item ">
|
||||||
<span>{{row.min}}{{#unless (eq row.min row.max)}}-{{row.max}}{{/unless}} : </span>
|
<span class="flex-group-left">
|
||||||
<span>{{linkCompendium row.document.pack row.document.id row.document.name}}</span>
|
{{row.min}}{{#unless (eq row.min row.max)}}-{{row.max}}{{/unless}} : {{linkCompendium row.document.pack row.document.id row.document.name}}
|
||||||
|
</span>
|
||||||
</li>
|
</li>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</ul>
|
</ul>
|
Loading…
Reference in New Issue
Block a user