forked from public/foundryvtt-reve-de-dragon
Table résolution contextuelle
level - 5 à level + 5 toujours la colonne -8
This commit is contained in:
@ -151,6 +151,10 @@ export class RdDResolutionTable {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static buildHTMLTableExtract(caracValue, levelValue) {
|
||||
return this.buildHTMLTable(caracValue, levelValue, caracValue - 2, caracValue + 2, levelValue - 5, levelValue + 5)
|
||||
}
|
||||
|
||||
static buildHTMLTable(caracValue, levelValue, minCarac = 1, maxCarac = 21, minLevel = -10, maxLevel = 11) {
|
||||
return this._buildHTMLTable(caracValue, levelValue, minCarac, maxCarac, minLevel, maxLevel)
|
||||
}
|
||||
@ -162,7 +166,7 @@ export class RdDResolutionTable {
|
||||
minLevel = Math.max(minLevel, -10);
|
||||
maxLevel = Math.min(maxLevel, 22);
|
||||
|
||||
var table = $("<table class='table-resolution'/>")
|
||||
let table = $("<table class='table-resolution'/>")
|
||||
.append(this._buildHTMLHeader(this.resolutionTable[0], minLevel, maxLevel));
|
||||
|
||||
for (var carac = minCarac; carac <= maxCarac; carac++) {
|
||||
@ -172,8 +176,16 @@ export class RdDResolutionTable {
|
||||
}
|
||||
|
||||
static _buildHTMLHeader(dataRow, minLevel, maxLevel) {
|
||||
var tr = $("<tr/>");
|
||||
for (var difficulte = minLevel; difficulte <= maxLevel; difficulte++) {
|
||||
let tr = $("<tr/>");
|
||||
let max = maxLevel;
|
||||
|
||||
if (minLevel > -8) {
|
||||
tr.append($("<th class='table-resolution-level'/>").text("-8"))
|
||||
}
|
||||
if (minLevel > -7) {
|
||||
tr.append($("<th class='table-resolution-level'/>").text("..."));
|
||||
}
|
||||
for (let difficulte = minLevel; difficulte <= max; difficulte++) {
|
||||
const niveau = dataRow[difficulte + 10].niveau;
|
||||
const txt = (niveau > 0 ? "+" : "") + niveau;
|
||||
tr.append($("<th class='table-resolution-level'/>").text(txt));
|
||||
@ -182,9 +194,18 @@ export class RdDResolutionTable {
|
||||
}
|
||||
|
||||
static _buildHTMLRow(dataRow, rowIndex, caracValue, levelValue, minLevel, maxLevel) {
|
||||
var tr = $("<tr/>");
|
||||
for (var difficulte = minLevel; difficulte <= maxLevel; difficulte++) {
|
||||
var td = $("<td/>");
|
||||
let tr = $("<tr/>");
|
||||
let max = maxLevel;
|
||||
|
||||
if (minLevel > -8) {
|
||||
let score = dataRow[-8 + 10].score;
|
||||
tr.append($("<td class='table-resolution-carac'/>").text(score))
|
||||
}
|
||||
if (minLevel > -7) {
|
||||
tr.append($("<td/>"))
|
||||
}
|
||||
for (let difficulte = minLevel; difficulte <= max; difficulte++) {
|
||||
let td = $("<td/>");
|
||||
let score = dataRow[difficulte + 10].score;
|
||||
if (rowIndex == caracValue && levelValue == difficulte) {
|
||||
td.addClass('table-resolution-target');
|
||||
|
Reference in New Issue
Block a user