forked from public/foundryvtt-reve-de-dragon
Roll window is now working for simple skills
This commit is contained in:
@ -119,7 +119,11 @@ export class RdDActor extends Actor {
|
||||
}
|
||||
},
|
||||
default: "rollButton"
|
||||
}).render(true);
|
||||
}, {
|
||||
classes: ["rdddialog"],
|
||||
width: 600,
|
||||
height: 320
|
||||
} ).render(true);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -109,41 +109,49 @@ export class RdDUtility {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static __buildHTMLResolutionHead( dataRow ) {
|
||||
static __buildHTMLResolutionHead( dataRow, minLevel=0, maxLevel=32 ) {
|
||||
let r = dataRow;
|
||||
var row = $("<tr/>");
|
||||
$.each(r, function(colIndex, c) {
|
||||
for (var colIndex=minLevel; colIndex <= maxLevel; colIndex++) {
|
||||
let c = dataRow[colIndex];
|
||||
let txt = (c.niveau > 0) ? "+"+c.niveau : c.niveau;
|
||||
row.append($("<th class='table-resolution-level'/>").text(txt) );
|
||||
});
|
||||
}
|
||||
return row;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static __buildHTMLResolutionRow( dataRow ) {
|
||||
static __buildHTMLResolutionRow( dataRow, minLevel=0, maxLevel=32, rowIndex, caracValue, levelValue ) {
|
||||
let r = dataRow;
|
||||
var row = $("<tr/>");
|
||||
$.each(r, function(colIndex, c) {
|
||||
if ( colIndex == 2 )
|
||||
row.append($("<td class='table-resolution-carac'/>").text(c.score));
|
||||
else
|
||||
row.append($("<td/>").text(c.score));
|
||||
});
|
||||
for (var colIndex=minLevel; colIndex <= maxLevel; colIndex++) {
|
||||
let c = dataRow[colIndex];
|
||||
if (rowIndex == caracValue && levelValue+10 == colIndex) {
|
||||
row.append($("<td class='table-resolution-target'/>").text(c.score));
|
||||
} else {
|
||||
if ( colIndex == 2 )
|
||||
row.append($("<td class='table-resolution-carac'/>").text(c.score));
|
||||
else
|
||||
row.append($("<td/>").text(c.score));
|
||||
}
|
||||
}
|
||||
return row;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static makeHTMLResolutionTable(container, minCarac = 1, maxCarac = 21) {
|
||||
static makeHTMLResolutionTable(container, minCarac = 1, maxCarac = 21, minLevel=-10, maxLevel=22, caracValue, levelValue) {
|
||||
minCarac = (minCarac < 1) ? 1 : minCarac;
|
||||
maxCarac = (maxCarac > 21) ? 21 : maxCarac;
|
||||
let data = CONFIG.RDD.resolutionTable;
|
||||
var table = $("<table/>").addClass('table-resolution');
|
||||
// Build first row of levels
|
||||
let row = this.__buildHTMLResolutionHead( data[0] );
|
||||
minLevel = (minLevel < -10) ? 0 : minLevel+10;
|
||||
maxLevel = (maxLevel > 22) ? 32 : maxLevel+10;
|
||||
let row = this.__buildHTMLResolutionHead( data[0], minLevel, maxLevel );
|
||||
table.append(row);
|
||||
// Then the rest...
|
||||
for (var rowIndex=minCarac; rowIndex <= maxCarac; rowIndex++) {
|
||||
let row = this.__buildHTMLResolutionRow( data[rowIndex] );
|
||||
let row = this.__buildHTMLResolutionRow( data[rowIndex], minLevel, maxLevel, rowIndex, caracValue, levelValue );
|
||||
table.append(row);
|
||||
}
|
||||
return container.append(table);
|
||||
|
Reference in New Issue
Block a user