Allow creating custom embedded documents of any type from the sheet, and add functionality to the aspect create button
This commit is contained in:
parent
134b13756a
commit
7d990fe64b
7 changed files with 52 additions and 48 deletions
|
|
@ -43,6 +43,14 @@ export class GenericActorSheet extends ActorSheet {
|
|||
|
||||
html.find(`summary`).on(`click`, this._handleSummaryToggle.bind(this));
|
||||
html.find(`.roll`).on(`click`, this._handleRoll.bind(this));
|
||||
html.find(`[data-embedded-update]`)
|
||||
.on(`change`, this.actor.genericEmbeddedUpdate.bind(this.actor));
|
||||
html.find(`[data-embedded-delete]`)
|
||||
.on(`click`, this.actor.genericEmbeddedDelete.bind(this.actor));
|
||||
html.find(`[data-embedded-create]`)
|
||||
.on(`click`, this.actor.genericEmbeddedCreate.bind(this.actor));
|
||||
html.find(`[data-embedded-edit]`)
|
||||
.on(`click`, this.actor.openEmbeddedSheet.bind(this.actor));
|
||||
};
|
||||
|
||||
async _handleRoll($e) {
|
||||
|
|
|
|||
|
|
@ -18,15 +18,6 @@ export class PlayerSheet extends GenericActorSheet {
|
|||
if (this.document.isEmbedded) return;
|
||||
if (!this.isEditable) return;
|
||||
console.debug(`.dungeon | Adding event listeners for Actor: ${this.id}`);
|
||||
|
||||
html.find(`.add-spell`).on(`click`, this.actor.createCustomSpell.bind(this.actor));
|
||||
// TODO: Apparently the `change` event is bad to use in Foundry
|
||||
// html.find(`[data-embedded-update]`)
|
||||
// .on(`change`, this.actor.genericEmbeddedUpdate.bind(this.actor));
|
||||
html.find(`[data-embedded-delete]`)
|
||||
.on(`click`, this.actor.genericEmbeddedDelete.bind(this.actor));
|
||||
html.find(`[data-embedded-edit]`)
|
||||
.on(`click`, this.actor.openEmbeddedSheet.bind(this.actor));
|
||||
};
|
||||
|
||||
async getData() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue