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

@ -783,8 +783,16 @@ export class RdDUtility {
}
});
html.on("click", '.rdd-world-content-link', async event => {
const itemId = html.find(event.currentTarget)?.data("id");
game.items.get(itemId)?.sheet.render(true)
const htmlElement = html.find(event.currentTarget);
const id = htmlElement?.data("id");
const doctype= htmlElement?.data("doctype");
switch (doctype ?? 'Item') {
case 'Actor':
return game.actors.get(id)?.sheet.render(true);
case 'Item':
default:
return game.items.get(id)?.sheet.render(true);
}
});
}