diff --git a/modules/pegasus-actor-sheet.js b/modules/pegasus-actor-sheet.js index 4d50655..334d276 100644 --- a/modules/pegasus-actor-sheet.js +++ b/modules/pegasus-actor-sheet.js @@ -111,17 +111,21 @@ export class PegasusActorSheet extends ActorSheet { // Update Inventory Item html.find('.item-edit').click(ev => { - const li = $(ev.currentTarget).parents(".item"); - let itemId = li.data("item-id"); + const li = $(ev.currentTarget).parents(".item") + let itemId = li.data("item-id") const item = this.actor.items.get( itemId ); item.sheet.render(true); }); // Delete Inventory Item html.find('.item-delete').click(ev => { - const li = $(ev.currentTarget).parents(".item"); - PegasusUtility.confirmDelete(this, li); - }); - + const li = $(ev.currentTarget).parents(".item") + PegasusUtility.confirmDelete(this, li) + }) + html.find('.item-add').click(ev => { + let dataType = $(ev.currentTarget).data("type") + this.actor.createEmbeddedDocuments('Item', [{ name: "NewItem", type: dataType }], { renderSheet: true }) + }) + html.find('.spec-group-activate').click(ev => { const li = $(ev.currentTarget).parents(".item"); let itemId = li.data("item-id"); diff --git a/modules/pegasus-main.js b/modules/pegasus-main.js index f2c76cf..39b9c92 100644 --- a/modules/pegasus-main.js +++ b/modules/pegasus-main.js @@ -32,12 +32,12 @@ Hooks.once("init", async function () { /* -------------------------------------------- */ game.settings.register("fvtt-pegasus-rpg", "dice-max-level", { name: "Maximum level value for dices lists", - hint: "Se the maximum level value for dices lists", + hint: "Set the maximum level value for dices lists", scope: "world", config: true, default: 20, type: Number - }); + }) /* -------------------------------------------- */ // Set an initiative formula for the system diff --git a/templates/actor-sheet.html b/templates/actor-sheet.html index efa57a7..bd4dce3 100644 --- a/templates/actor-sheet.html +++ b/templates/actor-sheet.html @@ -482,6 +482,10 @@ +