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",
|
"legendaryItem": "Legendary Item",
|
||||||
"spell": "Spell",
|
"spell": "Spell",
|
||||||
"untyped": "Custom"
|
"untyped": "Custom"
|
||||||
|
},
|
||||||
|
"ActiveEffect": {
|
||||||
|
"base": "Effect"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -58,6 +58,14 @@ export class UntypedItemSheet extends GenericItemSheet {
|
||||||
if (!this.isEditable) return;
|
if (!this.isEditable) return;
|
||||||
console.debug(`.dungeon | Adding event listeners for Untyped Item: ${this.item.id}`);
|
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`, [
|
new GenericContextMenu(html, `.effect.panel`, [
|
||||||
{
|
{
|
||||||
name: localizer(`dotdungeon.common.edit`),
|
name: localizer(`dotdungeon.common.edit`),
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@
|
||||||
--}}
|
--}}
|
||||||
</div>
|
</div>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
<button>
|
<button type="button" class="create-ae">
|
||||||
<dd-icon name="ui/plus" var:fill="currentColor"></dd-icon>
|
<dd-icon name="ui/plus" var:fill="currentColor"></dd-icon>
|
||||||
Create Effect
|
Create Effect
|
||||||
</button>
|
</button>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue