Utilisation Misc.data

This commit is contained in:
Vincent Vandemeulebrouck
2021-03-29 18:08:18 +02:00
parent 592f54af61
commit 31204cbf51
21 changed files with 254 additions and 237 deletions

View File

@ -52,13 +52,16 @@ export class RdDItemSheet extends ItemSheet {
console.log("3", objectData);
let formData ={
title: this.title,
title: objectData.name,
id: objectData.id,
type: objectData.type,
img: objectData.img,
name: objectData.name,
data: objectData.data,
isGM: game.user.isGM
isGM: game.user.isGM,
owner: this.document.isOwner,
editable: this.isEditable,
cssClass: this.isEditable ? "editable" : "locked",
}
formData.categorieCompetences = RdDItemCompetence.getCategorieCompetences();
if ( formData.type == 'tache' || formData.type == 'livre' || formData.type == 'meditation' || formData.type == 'oeuvre') {
@ -90,15 +93,15 @@ export class RdDItemSheet extends ItemSheet {
if (!this.options.editable) return;
// Select competence categorie
html.find("#categorie").on("click", this._onClickSelectCategorie.bind(this) );
html.find(".categorie").on("click", this._onClickSelectCategorie.bind(this) );
html.find('#sheet-competence-xp').change((event) => {
html.find('.sheet-competence-xp').change((event) => {
if ( this.object.data.type == 'competence') {
RdDUtility.checkThanatosXP( this.object.data.name );
}
} );
html.find('#creer-tache-livre').click((event) => {
html.find('.creer-tache-livre').click((event) => {
let actorId = event.currentTarget.attributes['data-actor-id'].value;
let actor = game.actors.get( actorId );
actor.creerTacheDepuisLivre( this.item );