Support des maladresses

This commit is contained in:
2025-01-12 22:45:07 +01:00
parent 969bc3b573
commit 135e5e46a0
18 changed files with 98 additions and 92 deletions

View File

@ -1,3 +1,4 @@
import { RdDTextEditor } from "./apps/rdd-text-roll-editor.js";
import { CompendiumTable, CompendiumTableHelpers, SystemCompendiums } from "./settings/system-compendiums.js";
export class RdDRollTables {
@ -28,8 +29,8 @@ export class RdDRollTables {
}
/* -------------------------------------------- */
static async drawTextFromRollTable(tableName, toChat) {
const drawResult = await RdDRollTables.genericGetTableResult(tableName, toChat);
static async drawTextFromRollTable(tableName, options = {}) {
const drawResult = await RdDRollTables.genericGetTableResult(tableName, options.toChat);
return drawResult.text;
}
@ -101,9 +102,10 @@ export class RdDRollTables {
/* -------------------------------------------- */
static async getMaladresse(options = { toChat: false, arme: false }) {
return await RdDRollTables.drawTextFromRollTable(
const maladresse = await RdDRollTables.drawTextFromRollTable(
options.arme ? "Maladresse armé" : "Maladresses non armé",
options.toChat);
options);
return await RdDTextEditor.enrichHTML(maladresse, undefined, {showLink:false})
}
}