Implement the ability to create AE's (closes #177)
This commit is contained in:
parent
ec6378092f
commit
dbeb511bdc
3 changed files with 12 additions and 1 deletions
|
|
@ -115,6 +115,9 @@
|
|||
"legendaryItem": "Legendary Item",
|
||||
"spell": "Spell",
|
||||
"untyped": "Custom"
|
||||
},
|
||||
"ActiveEffect": {
|
||||
"base": "Effect"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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`),
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
--}}
|
||||
</div>
|
||||
{{/each}}
|
||||
<button>
|
||||
<button type="button" class="create-ae">
|
||||
<dd-icon name="ui/plus" var:fill="currentColor"></dd-icon>
|
||||
Create Effect
|
||||
</button>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue