Implement the ability to create AE's (closes #177)

This commit is contained in:
Oliver-Akins 2024-04-23 23:17:36 -06:00
parent ec6378092f
commit dbeb511bdc
3 changed files with 12 additions and 1 deletions

View file

@ -58,6 +58,14 @@ export class UntypedItemSheet extends GenericItemSheet {
if (!this.isEditable) return;
console.debug(`.dungeon | Adding event listeners for Untyped Item: ${this.item.id}`);
html.find(`.create-ae`).on(`click`, async () => {
await this.item.createEmbeddedDocuments(
`ActiveEffect`,
[{name: localizer(`dotdungeon.default.name`, { document: `ActiveEffect`, type: `base` })}],
{ renderSheet: true }
);
});
new GenericContextMenu(html, `.effect.panel`, [
{
name: localizer(`dotdungeon.common.edit`),