diff --git a/module/rdd-commands.js b/module/rdd-commands.js
index 0163d31e..996b6972 100644
--- a/module/rdd-commands.js
+++ b/module/rdd-commands.js
@@ -166,11 +166,25 @@ export class RdDCommands {
}
/* -------------------------------------------- */
- help(msg, table = undefined) {
+ async help(msg) {
+ this.help(msg, undefined);
+ }
+ async help(msg, table) {
let list = []
this._buildSubTableHelp(list, table || this.commandsTable);
- const messageAide = list.reduce((a, b) => a + '
' + b);
- RdDCommands._chatAnswer(msg, `Commandes disponibles`);
+
+ let html = await renderTemplate("systems/foundryvtt-reve-de-dragon/templates/settings/dialog-aide-commands.html", { commands: list });
+ let d = new Dialog(
+ {
+ title: "Commandes disponibles dans le tchat",
+ content: html,
+ buttons: {},
+ },
+ {
+ width: 600, height: 500,
+ });
+
+ d.render(true);
}
/* -------------------------------------------- */
@@ -221,23 +235,23 @@ export class RdDCommands {
}
let actors = canvas.tokens.controlled.map(it => it.actor).filter(it => it);
- if (actors && actors.length > 0){
+ if (actors && actors.length > 0) {
let length = params.length;
- let diff = Number(params[length-1]);
- if (Number.isInteger(Number(diff))){
- length --;
+ let diff = Number(params[length - 1]);
+ if (Number.isInteger(Number(diff))) {
+ length--;
}
else {
diff = 0;
}
const caracName = params[0];
- const compName = length>1 ? params.slice(1, length).reduce((a, b) => `${a} ${b}`): undefined;
+ const compName = length > 1 ? params.slice(1, length).reduce((a, b) => `${a} ${b}`) : undefined;
for (let actor of actors) {
await actor.rollCaracCompetence(caracName, compName, diff);
}
return;
}
- else{
+ else {
ui.notifications.warn("Sélectionnez au moins un personnage pour lancer les dés")
}
}
diff --git a/templates/settings/dialog-aide-commands.html b/templates/settings/dialog-aide-commands.html
new file mode 100644
index 00000000..8d39f597
--- /dev/null
+++ b/templates/settings/dialog-aide-commands.html
@@ -0,0 +1,20 @@
+Dés spéciaux
+
+ -
+ /roll 1d7: lance un dé de rencontre
+
+ -
+ /roll 1dr: lance un dé draconique (de 0à 7, relance et additionne en cas de 7)
+
+ -
+ /roll 1dh: lance le dé des heures (de 1 à 12)
+
+
+Commandes disponibles
+
+ {{#each commands as |command key|}}
+ -
+ {{{command}}}
+
+ {{/each}}
+
\ No newline at end of file