Utilisation de tables custom du monde
This commit is contained in:
parent
3ad6aa01cc
commit
91f9e8832d
@ -2,10 +2,13 @@ export class RdDRollTables {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static async genericGetTableResult(tableName, toChat) {
|
static async genericGetTableResult(tableName, toChat) {
|
||||||
const pack = game.packs.get("foundryvtt-reve-de-dragon.tables-diverses");
|
let table = game.tables.find(table => table.name.toLowerCase() == tableName.toLowerCase())
|
||||||
const index = await pack.getIndex();
|
if ( !table) {
|
||||||
const entry = index.find(e => e.name === tableName);
|
const pack = game.packs.get("foundryvtt-reve-de-dragon.tables-diverses");
|
||||||
const table = await pack.getDocument(entry._id);
|
const index = await pack.getIndex();
|
||||||
|
const entry = index.find(e => e.name === tableName);
|
||||||
|
table = await pack.getDocument(entry._id);
|
||||||
|
}
|
||||||
const draw = await table.draw({ displayChat: toChat, rollMode: "gmroll"});
|
const draw = await table.draw({ displayChat: toChat, rollMode: "gmroll"});
|
||||||
console.log("RdDRollTables", tableName, toChat, ":", draw);
|
console.log("RdDRollTables", tableName, toChat, ":", draw);
|
||||||
return draw.results.length > 0 ? draw.results[0] : undefined;
|
return draw.results.length > 0 ? draw.results[0] : undefined;
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
"name": "foundryvtt-reve-de-dragon",
|
"name": "foundryvtt-reve-de-dragon",
|
||||||
"title": "Rêve de Dragon",
|
"title": "Rêve de Dragon",
|
||||||
"description": "Rêve de Dragon RPG for FoundryVTT",
|
"description": "Rêve de Dragon RPG for FoundryVTT",
|
||||||
"version": "1.5.60",
|
"version": "1.5.61",
|
||||||
"manifestPlusVersion": "1.0.0",
|
"manifestPlusVersion": "1.0.0",
|
||||||
"minimumCoreVersion": "0.8.0",
|
"minimumCoreVersion": "0.8.0",
|
||||||
"compatibleCoreVersion": "9",
|
"compatibleCoreVersion": "9",
|
||||||
|
Loading…
Reference in New Issue
Block a user