Post to chat pour les acteurs

This commit is contained in:
Vincent Vandemeulebrouck
2022-12-29 02:25:45 +01:00
parent 26808d7b49
commit c79298b60a
10 changed files with 76 additions and 24 deletions

View File

@ -1,6 +1,7 @@
import { SYSTEM_SOCKET_ID } from "../constants.js";
import { Monnaie } from "../item-monnaie.js";
import { Misc } from "../misc.js";
import { RdDUtility } from "../rdd-utility.js";
import { SystemCompendiums } from "../settings/system-compendiums.js";
export class RdDBaseActor extends Actor {
@ -146,4 +147,21 @@ export class RdDBaseActor extends Actor {
canReceive(item) {
return false;
}
/* -------------------------------------------- */
async postActorToChat(modeOverride) {
let chatData = {
doctype: 'Actor',
id: this.id,
type: this.type,
img: this.img,
pack: this.pack,
name: this.name,
system: { description: this.system.description }
}
renderTemplate('systems/foundryvtt-reve-de-dragon/templates/post-actor.html', chatData)
.then(html => ChatMessage.create(RdDUtility.chatDataSetup(html, modeOverride)));
}
}