Merge branch 'working' into 'master'
Fix choix du rêve pour sort r1+ See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!14
This commit is contained in:
commit
be02d5a137
@ -160,10 +160,11 @@ export class RdDResolutionTable {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static _buildHTMLTable(caracValue, levelValue, minCarac, maxCarac, minLevel, maxLevel) {
|
static _buildHTMLTable(caracValue, levelValue, minCarac, maxCarac, minLevel, maxLevel) {
|
||||||
|
let countColonnes = maxLevel - minLevel;
|
||||||
minCarac = Math.max(minCarac, 1);
|
minCarac = Math.max(minCarac, 1);
|
||||||
maxCarac = Math.min(maxCarac, 30);
|
maxCarac = Math.min(maxCarac, 30);
|
||||||
minLevel = Math.max(minLevel, -10);
|
minLevel = Math.max(minLevel, -10);
|
||||||
maxLevel = Math.min(maxLevel, 22);
|
maxLevel = Math.max(Math.min(maxLevel, 22), minLevel + countColonnes);
|
||||||
|
|
||||||
let table = $("<table class='table-resolution'/>")
|
let table = $("<table class='table-resolution'/>")
|
||||||
.append(this._buildHTMLHeader(this.resolutionTable[0], minLevel, maxLevel));
|
.append(this._buildHTMLHeader(this.resolutionTable[0], minLevel, maxLevel));
|
||||||
@ -176,7 +177,6 @@ export class RdDResolutionTable {
|
|||||||
|
|
||||||
static _buildHTMLHeader(dataRow, minLevel, maxLevel) {
|
static _buildHTMLHeader(dataRow, minLevel, maxLevel) {
|
||||||
let tr = $("<tr/>");
|
let tr = $("<tr/>");
|
||||||
let max = maxLevel;
|
|
||||||
|
|
||||||
if (minLevel > -8) {
|
if (minLevel > -8) {
|
||||||
tr.append($("<th class='table-resolution-level'/>").text("-8"))
|
tr.append($("<th class='table-resolution-level'/>").text("-8"))
|
||||||
@ -184,7 +184,7 @@ export class RdDResolutionTable {
|
|||||||
if (minLevel > -7) {
|
if (minLevel > -7) {
|
||||||
tr.append($("<th class='table-resolution-level'/>").text("..."));
|
tr.append($("<th class='table-resolution-level'/>").text("..."));
|
||||||
}
|
}
|
||||||
for (let difficulte = minLevel; difficulte <= max; difficulte++) {
|
for (let difficulte = minLevel; difficulte <= maxLevel; difficulte++) {
|
||||||
const niveau = dataRow[difficulte + 10].niveau;
|
const niveau = dataRow[difficulte + 10].niveau;
|
||||||
const txt = (niveau > 0 ? "+" : "") + niveau;
|
const txt = (niveau > 0 ? "+" : "") + niveau;
|
||||||
tr.append($("<th class='table-resolution-level'/>").text(txt));
|
tr.append($("<th class='table-resolution-level'/>").text(txt));
|
||||||
|
@ -76,7 +76,7 @@ export class RdDRollDialog extends Dialog {
|
|||||||
} else {
|
} else {
|
||||||
$("#div-sort-difficulte").hide();
|
$("#div-sort-difficulte").hide();
|
||||||
}
|
}
|
||||||
if (rollData.selectedSort.data.ptreve.toLowerCase() == "variable") {
|
if (rollData.selectedSort.data.ptreve.toLowerCase() == "variable" || rollData.selectedSort.data.ptreve.indexOf("+")>=0) {
|
||||||
$("#div-sort-ptreve").show();
|
$("#div-sort-ptreve").show();
|
||||||
} else {
|
} else {
|
||||||
$("#div-sort-ptreve").hide();
|
$("#div-sort-ptreve").hide();
|
||||||
|
Loading…
Reference in New Issue
Block a user