forked from public/foundryvtt-reve-de-dragon
Amélioration fenêtre de Tchat #42
This commit is contained in:
@ -2,6 +2,7 @@ import { ChatUtility } from "./chat-utility.js";
|
||||
import { Misc } from "./misc.js";
|
||||
import { RdDResolutionTable } from "./rdd-resolution-table.js";
|
||||
|
||||
const titleTableDeResolution = 'Table de résolution';
|
||||
/**
|
||||
* Extend the base Dialog entity to select roll parameters
|
||||
* @extends {Dialog}
|
||||
@ -21,6 +22,7 @@ export class RdDRollResolution extends Dialog {
|
||||
static _setDefaultOptions(rollData) {
|
||||
|
||||
let defRollData = {
|
||||
show: {title: titleTableDeResolution, points:true},
|
||||
ajustementsConditions: CONFIG.RDD.ajustementsConditions,
|
||||
difficultesLibres: CONFIG.RDD.difficultesLibres,
|
||||
etat: 0,
|
||||
@ -36,15 +38,13 @@ export class RdDRollResolution extends Dialog {
|
||||
if (rollData.selectedCarac == i) {
|
||||
rollData.selectedCarac = rollData.carac[i];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
constructor(rollData, html) {
|
||||
|
||||
let conf = {
|
||||
title: 'Lancer les dés',
|
||||
title: titleTableDeResolution,
|
||||
content: html,
|
||||
buttons: {
|
||||
'lancer': { label: 'Lancer les dés', callback: html => this.onAction(html) }
|
||||
@ -59,9 +59,7 @@ export class RdDRollResolution extends Dialog {
|
||||
async onAction(html) {
|
||||
await RdDResolutionTable.rollData(this.rollData);
|
||||
console.log("RdDRollResolution -=>", this.rollData, this.rollData.rolled);
|
||||
const message = {
|
||||
content: "Table de résolution: " + RdDResolutionTable.explainRollData(this.rollData)
|
||||
};
|
||||
const message = { content: await RdDResolutionTable.explainRollDataV2(this.rollData)};
|
||||
ChatUtility.chatWithRollMode(message, game.user.name)
|
||||
}
|
||||
|
||||
@ -121,9 +119,4 @@ export class RdDRollResolution extends Dialog {
|
||||
_computeDiffLibre(rollData) {
|
||||
return Misc.toInt(rollData.diffLibre);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
_getTitle(rollData) {
|
||||
return 'Table de résolution';
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user