diff --git a/module/actor-sheet.js b/module/actor-sheet.js index e5ac0586..808b1c70 100644 --- a/module/actor-sheet.js +++ b/module/actor-sheet.js @@ -188,6 +188,11 @@ export class RdDActorSheet extends ActorSheet { const item = RdDSheetUtility.getItem(event, this.actor); item?.proposerVente(); }); + html.find('.item-montrer').click(async event => { + const item = RdDSheetUtility.getItem(event, this.actor); + item?.postItem(); + }); + html.find('.item-action').click(async event => { const item = RdDSheetUtility.getItem(event, this.actor); this.actor.actionItem(item); diff --git a/module/item-sheet.js b/module/item-sheet.js index d46a8a83..204fa00b 100644 --- a/module/item-sheet.js +++ b/module/item-sheet.js @@ -34,18 +34,16 @@ export class RdDItemSheet extends ItemSheet { // We previously restricted this to GM and editable items only. If you ever find this comment because it broke something: eh, sorry! if ("cout" in Misc.templateData(this.object) && this.object.isVideOuNonConteneur()) { buttons.unshift({ - class: "post", + class: "vendre", icon: "fas fa-comments-dollar", onclick: ev => this.item.proposerVente() }); } - else { - buttons.unshift({ - class: "post", - icon: "fas fa-comment", - onclick: ev => this.item.postItem() - }); - } + buttons.unshift({ + class: "montrer", + icon: "fas fa-comment", + onclick: ev => this.item.postItem() + }); return buttons } @@ -202,6 +200,10 @@ export class RdDItemSheet extends ItemSheet { const item = RdDSheetUtility.getItem(event, this.actor); item?.proposerVente(); }); + html.find('.item-montrer').click(async event => { + const item = RdDSheetUtility.getItem(event, this.actor); + item?.postItem(); + }); html.find('.item-action').click(async event => { const item = RdDSheetUtility.getItem(event, this.actor); this.actor.actionItem(item, async () => itemSheetDialog.render(true)); diff --git a/module/item.js b/module/item.js index f6fc38d9..23bfb441 100644 --- a/module/item.js +++ b/module/item.js @@ -262,70 +262,6 @@ export class RdDItem extends Item { if (this.actor) { chatData.actor = { id: this.actor.id }; } - //Check if the posted item should have availability/pay buttons - chatData.hasPrice = "cout" in chatData.data; - chatData.data.cout_deniers = 0; - - let dialogResult = [-1, -1]; // dialogResult[0] = quantité, dialogResult[1] = prix - if (chatData.hasPrice) { - chatData.data.cout_deniers = Math.floor(chatData.data.cout * 100); - dialogResult = await new Promise((resolve, reject) => { - new Dialog({ - content: - `
Modifier la quantité?
-Modifier la prix?
-