forked from public/foundryvtt-reve-de-dragon
Edition des items, WIP
This commit is contained in:
@ -48,24 +48,34 @@ export class RdDItemSheet extends ItemSheet {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async getData() {
|
||||
let formData = super.getData();
|
||||
const objectData = Misc.data(this.object);
|
||||
console.log("3", objectData);
|
||||
|
||||
let formData ={
|
||||
title: this.title,
|
||||
id: objectData.id,
|
||||
type: objectData.type,
|
||||
img: objectData.img,
|
||||
name: objectData.name,
|
||||
data: objectData.data,
|
||||
isGM: game.user.isGM
|
||||
}
|
||||
formData.categorieCompetences = RdDItemCompetence.getCategorieCompetences();
|
||||
if ( formData.item.type == 'tache' || formData.item.type == 'livre' || formData.item.type == 'meditation' || formData.item.type == 'oeuvre') {
|
||||
if ( formData.type == 'tache' || formData.type == 'livre' || formData.type == 'meditation' || formData.type == 'oeuvre') {
|
||||
formData.caracList = duplicate(game.system.model.Actor.personnage.carac);
|
||||
formData.competences = await RdDUtility.loadCompendium( 'foundryvtt-reve-de-dragon.competences' );
|
||||
}
|
||||
if (formData.item.type == 'arme') {
|
||||
if (formData.type == 'arme') {
|
||||
formData.competences = await RdDUtility.loadCompendium( 'foundryvtt-reve-de-dragon.competences', it => RdDItemCompetence.isCompetenceArme(it));
|
||||
}
|
||||
if ( formData.item.type == 'recettealchimique' ) {
|
||||
RdDAlchimie.processManipulation(formData.item, this.actor && this.actor._id );
|
||||
if ( formData.type == 'recettealchimique' ) {
|
||||
RdDAlchimie.processManipulation(formData.item, this.actor && this.actor.id );
|
||||
}
|
||||
if ( this.actor ) {
|
||||
formData.isOwned = true;
|
||||
formData.actorId = this.actor._id;
|
||||
formData.actorId = this.actor.id;
|
||||
}
|
||||
formData.bonusCaseList = RdDItemSort.getBonusCaseList(formData, true);
|
||||
formData.isGM = game.user.isGM; // Pour verrouiller certaines éditions
|
||||
|
||||
return formData;
|
||||
}
|
||||
@ -120,14 +130,16 @@ export class RdDItemSheet extends ItemSheet {
|
||||
/* -------------------------------------------- */
|
||||
get template()
|
||||
{
|
||||
let type = this.item.type;
|
||||
//console.log(this);
|
||||
let type = this.object.data.type;
|
||||
return `systems/foundryvtt-reve-de-dragon/templates/item-${type}-sheet.html`;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
||||
/** @override */
|
||||
_updateObject(event, formData) {
|
||||
_updateObject(event, formData) { // Deprecated en v0.8 à clarifier
|
||||
console.log("UPDATE !", formData);
|
||||
// Données de bonus de cases ?
|
||||
formData = RdDItemSort.buildBonusCaseStringFromFormData( formData );
|
||||
|
||||
|
Reference in New Issue
Block a user