#171 - Gestion potion de soins (WIP)
This commit is contained in:
@ -3,6 +3,7 @@ import { RdDUtility } from "./rdd-utility.js";
|
||||
import { RdDItem } from "./item-rdd.js";
|
||||
import { RdDAlchimie } from "./rdd-alchimie.js";
|
||||
import { RdDItemCompetence } from "./item-competence.js";
|
||||
import { RdDHerbes } from "./rdd-herbes.js";
|
||||
import { Misc } from "./misc.js";
|
||||
|
||||
/**
|
||||
@ -49,7 +50,6 @@ export class RdDItemSheet extends ItemSheet {
|
||||
/* -------------------------------------------- */
|
||||
async getData() {
|
||||
const objectData = Misc.data(this.object);
|
||||
console.log("3", objectData);
|
||||
|
||||
let formData ={
|
||||
title: objectData.name,
|
||||
@ -62,6 +62,8 @@ export class RdDItemSheet extends ItemSheet {
|
||||
owner: this.document.isOwner,
|
||||
editable: this.isEditable,
|
||||
cssClass: this.isEditable ? "editable" : "locked",
|
||||
isSoins: false,
|
||||
isEnchante: false
|
||||
}
|
||||
formData.categorieCompetences = RdDItemCompetence.getCategorieCompetences();
|
||||
if ( formData.type == 'tache' || formData.type == 'livre' || formData.type == 'meditation' || formData.type == 'oeuvre') {
|
||||
@ -75,6 +77,14 @@ export class RdDItemSheet extends ItemSheet {
|
||||
if ( formData.type == 'recettealchimique' ) {
|
||||
RdDAlchimie.processManipulation(objectData, this.actor && this.actor.id );
|
||||
}
|
||||
if ( formData.type == 'potion') {
|
||||
if (this.dateUpdated) {
|
||||
formData.data.prdate = this.dateUpdated;
|
||||
this.dateUpdated = undefined;
|
||||
}
|
||||
RdDHerbes.updatePotionData(formData);
|
||||
}
|
||||
|
||||
if ( this.actor ) {
|
||||
formData.isOwned = true;
|
||||
formData.actorId = this.actor.id;
|
||||
@ -94,6 +104,7 @@ export class RdDItemSheet extends ItemSheet {
|
||||
|
||||
// Select competence categorie
|
||||
html.find(".categorie").on("click", this._onClickSelectCategorie.bind(this) );
|
||||
html.find(".categoriepotion").on("click", this.render(true) );
|
||||
|
||||
html.find('.sheet-competence-xp').change((event) => {
|
||||
if ( this.object.data.type == 'competence') {
|
||||
@ -101,11 +112,22 @@ export class RdDItemSheet extends ItemSheet {
|
||||
}
|
||||
} );
|
||||
|
||||
html.find('.enchanteDate').change((event) => {
|
||||
let jour = Number($('#jourMois').val());
|
||||
let mois = $('#nomMois').val();
|
||||
this.dateUpdated = game.system.rdd.calendrier.getIndexFromDate(jour, mois);
|
||||
});
|
||||
|
||||
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 );
|
||||
});
|
||||
html.find('.consommer-potion').click((event) => {
|
||||
let actorId = event.currentTarget.attributes['data-actor-id'].value;
|
||||
let actor = game.actors.get( actorId );
|
||||
actor.consommerPotion( this.item );
|
||||
});
|
||||
|
||||
html.find('.alchimie-tache a').click((event) => {
|
||||
let actorId = event.currentTarget.attributes['data-actor-id'].value;
|
||||
|
Reference in New Issue
Block a user