Increase support

This commit is contained in:
2020-05-22 22:37:02 +02:00
parent d7971d8920
commit c144b2473c
8 changed files with 150 additions and 63 deletions

View File

@ -2,6 +2,9 @@
* Extend the basic ActorSheet with some very simple modifications
* @extends {ActorSheet}
*/
import { RdDUtility } from "./rdd-utility.js";
export class RdDActorSheet extends ActorSheet {
/** @override */
@ -16,6 +19,15 @@ export class RdDActorSheet extends ActorSheet {
});
}
/* -------------------------------------------- */
_checkNull(items) {
if (items && items.length) {
return items;
}
return [];
}
/* -------------------------------------------- */
getData() {
@ -33,7 +45,7 @@ export class RdDActorSheet extends ActorSheet {
data.competenceByCategory = {};
if (data.itemsByType.competence) {
for (const item of data.itemsByType.competence) {
console.log("Push...", item, item.data.categorie);
//console.log("Push...", item, item.data.categorie);
let list = data.competenceByCategory[item.data.categorie];
if (!list) {
list = [];
@ -76,6 +88,12 @@ export class RdDActorSheet extends ActorSheet {
li.slideUp(200, () => this.render(false));
});
// Roll Skill
html.find('.competence-label a').click((event) => {
let compName = event.currentTarget.text;
this.actor.rollCompetence( compName);
});
}
/* -------------------------------------------- */