forked from public/foundryvtt-reve-de-dragon
Post to chat pour les acteurs
This commit is contained in:
@ -455,20 +455,19 @@ export class RdDItem extends Item {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async postItem(modeOverride) {
|
||||
async postItemToChat(modeOverride) {
|
||||
console.log(this);
|
||||
let chatData = duplicate(this);
|
||||
chatData["properties"] = this.getProprietes();
|
||||
if (this.actor) {
|
||||
chatData.actor = { id: this.actor.id };
|
||||
let chatData = {
|
||||
doctype: 'Item',
|
||||
id: this.id,
|
||||
type: this.type,
|
||||
img: this.img,
|
||||
pack: this.pack,
|
||||
name: this.name,
|
||||
actor : this.actor ? { id: this.actor.id } : undefined,
|
||||
system: { description: this.system.description },
|
||||
properties: this.getProprietes(),
|
||||
}
|
||||
// JSON object for easy creation
|
||||
chatData.jsondata = JSON.stringify(
|
||||
{
|
||||
compendium: "postedItem",
|
||||
payload: chatData,
|
||||
});
|
||||
|
||||
renderTemplate(this.getChatItemTemplate(), chatData).then(html => {
|
||||
let chatOptions = RdDUtility.chatDataSetup(html, modeOverride);
|
||||
ChatMessage.create(chatOptions)
|
||||
|
Reference in New Issue
Block a user