Utilisation de system dans les Item/Actor Sheet
Utilisation de system dans les data de formulaire pour tous les Item/Actor (à la base, ou les sous-éléments) Corrections sur les sorts en réserve (ce ne sont pas des Item) Petites améliorations: * `actor.itemTypes[type]` revient à faire (sans besoin de filtrer) `actor.items.filter(it => it.type == type)` * dans les ItemSheet, this.object et this.document remplacés par this.item * dans les ActorSheet, this.object et this.document remplacés par this.actor Quelques corrections en plus: * parade ne marchait pas * problèmes sur le commerce
This commit is contained in:
@ -25,23 +25,21 @@ export class RdDActorEntiteSheet extends ActorSheet {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async getData() {
|
||||
const objectData = this.object;
|
||||
let formData = {
|
||||
title: this.title,
|
||||
id: objectData.id,
|
||||
type: objectData.type,
|
||||
img: objectData.img,
|
||||
name: objectData.name,
|
||||
// actor: this.object,
|
||||
id: this.actor.id,
|
||||
type: this.actor.type,
|
||||
img: this.actor.img,
|
||||
name: this.actor.name,
|
||||
editable: this.isEditable,
|
||||
cssClass: this.isEditable ? "editable" : "locked",
|
||||
data: foundry.utils.deepClone(this.actor.system),
|
||||
effects: this.object.effects.map(e => foundry.utils.deepClone(e)),
|
||||
system: foundry.utils.deepClone(this.actor.system),
|
||||
effects: this.actor.effects.map(e => foundry.utils.deepClone(e)),
|
||||
// items: items,
|
||||
limited: this.object.limited,
|
||||
limited: this.actor.limited,
|
||||
options: this.options,
|
||||
owner: this.document.isOwner,
|
||||
itemsByType: Misc.classify(this.object.items.map(i => foundry.utils.deepClone(i))),
|
||||
owner: this.actor.isOwner,
|
||||
itemsByType: Misc.classify(this.actor.items.map(i => foundry.utils.deepClone(i))),
|
||||
};
|
||||
|
||||
formData.options.isGM = game.user.isGM;
|
||||
@ -141,6 +139,6 @@ export class RdDActorEntiteSheet extends ActorSheet {
|
||||
/** @override */
|
||||
_updateObject(event, formData) {
|
||||
// Update the Actor
|
||||
return this.object.update(formData);
|
||||
return this.actor.update(formData);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user