Adaptation Feuilles Acteurs
This commit is contained in:
@ -5,6 +5,7 @@
|
||||
|
||||
import { HtmlUtility } from "./html-utility.js";
|
||||
import { Misc } from "./misc.js";
|
||||
import { RdDUtility } from "./rdd-utility.js";
|
||||
|
||||
/* -------------------------------------------- */
|
||||
export class RdDActorEntiteSheet extends ActorSheet {
|
||||
@ -31,14 +32,27 @@ export class RdDActorEntiteSheet extends ActorSheet {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async getData() {
|
||||
let formData = super.getData();
|
||||
const objectData = Misc.data(this.object);
|
||||
let formData = {
|
||||
title: this.title,
|
||||
id: objectData.id,
|
||||
type: objectData.type,
|
||||
img: objectData.img,
|
||||
name: objectData.name,
|
||||
// actor: this.object,
|
||||
editable: this.isEditable,
|
||||
cssClass: this.isEditable ? "editable" : "locked",
|
||||
data: foundry.utils.deepClone(Misc.templateData(this.object)),
|
||||
effects: this.object.effects.map(e => foundry.utils.deepClone(e.data)),
|
||||
// items: items,
|
||||
limited: this.object.limited,
|
||||
options: this.options,
|
||||
owner: this.document.isOwner,
|
||||
itemsByType: Misc.classify(this.object.items.map(i => foundry.utils.deepClone(i.data))),
|
||||
};
|
||||
|
||||
formData.itemsByType = Misc.classify(formData.items);
|
||||
|
||||
formData.options.isGM = game.user.isGM;
|
||||
|
||||
formData.data.carac.taille.isTaille = true; // To avoid button link;
|
||||
formData.data.competencecreature = formData.itemsByType["competencecreature"];
|
||||
RdDUtility.filterItemsPerTypeForSheet(formData);
|
||||
|
||||
|
||||
return formData;
|
||||
|
Reference in New Issue
Block a user