Work towards better editing of embedded items
This commit is contained in:
parent
0496be73b0
commit
10dcec3bd7
12 changed files with 136 additions and 77 deletions
|
|
@ -9,7 +9,7 @@ export class PlayerActor {
|
|||
|
||||
/** @this {Actor} */
|
||||
static async genericEmbeddedDelete($event) {
|
||||
let data = $event.delegateTarget.dataset;
|
||||
let data = $event.currentTarget.dataset;
|
||||
let item = await fromUuid(data.embeddedId);
|
||||
|
||||
if (!item) {
|
||||
|
|
@ -36,6 +36,20 @@ export class PlayerActor {
|
|||
});
|
||||
};
|
||||
|
||||
/** @this {Actor} */
|
||||
static async createCustomItem(defaults) {
|
||||
let items = await this.createEmbeddedDocuments(`Item`, defaults);
|
||||
if (items.length == 0) {
|
||||
throw new Error();
|
||||
};
|
||||
this.sheet.render();
|
||||
if (game.settings.get(`dotdungeon`, `openEmbeddedOnCreate`)) {
|
||||
for (const item of items) {
|
||||
item.sheet.render(true);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
/** @this {Actor} */
|
||||
static async createCustomSpell() {
|
||||
let items = await this.createEmbeddedDocuments(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue