Various fixes
This commit is contained in:
@ -36,16 +36,16 @@ export class RdDActorSheet extends ActorSheet {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async getData() {
|
||||
const objectData = Misc.data(this.object);
|
||||
const objectData = Misc.data(this.object)
|
||||
|
||||
//this.actor.checkMonnaiePresence(this.actor.data.items); // Always check
|
||||
|
||||
let formData = {
|
||||
title: this.title,
|
||||
id: objectData.id,
|
||||
type: objectData.type,
|
||||
img: objectData.img,
|
||||
name: objectData.name,
|
||||
id: this.object.id,
|
||||
type: this.object.type,
|
||||
img: this.object.img,
|
||||
name: this.object.name,
|
||||
editable: this.isEditable,
|
||||
cssClass: this.isEditable ? "editable" : "locked",
|
||||
data: foundry.utils.deepClone(this.object.system),
|
||||
@ -168,12 +168,12 @@ export class RdDActorSheet extends ActorSheet {
|
||||
if (!this.options.editable) return;
|
||||
|
||||
html.find('.item-split').click(async event => {
|
||||
const item = RdDSheetUtility.getItem(event, this.actor);
|
||||
RdDSheetUtility.splitItem(item, this.actor);
|
||||
const item = RdDSheetUtility.getItem(event, this.actor)
|
||||
RdDSheetUtility.splitItem(item, this.actor)
|
||||
});
|
||||
html.find('.item-edit').click(async event => {
|
||||
const item = RdDSheetUtility.getItem(event, this.actor);
|
||||
item.sheet.render(true);
|
||||
const item = RdDSheetUtility.getItem(event, this.actor)
|
||||
item.sheet.render(true)
|
||||
});
|
||||
html.find('.display-label a').click(async event => {
|
||||
const item = RdDSheetUtility.getItem(event, this.actor);
|
||||
@ -549,10 +549,9 @@ export class RdDActorSheet extends ActorSheet {
|
||||
}
|
||||
|
||||
async _onSplitItem(item, split) {
|
||||
if (split >= 1 && split < Misc.data(item).data.quantite) {
|
||||
await item.diminuerQuantite(split);
|
||||
const itemData = duplicate(Misc.data(item));
|
||||
itemData.data.quantite = split;
|
||||
if (split >= 1 && split < item.system.quantite) {
|
||||
await item.diminuerQuantite(split)
|
||||
item.system.quantite = split;
|
||||
await this.actor.createEmbeddedDocuments('Item', [itemData])
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user