Add item
This commit is contained in:
parent
2137f88823
commit
e59a815eaf
@ -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");
|
||||
|
@ -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
|
||||
|
@ -482,6 +482,10 @@
|
||||
<span class="item-field-label-medium">
|
||||
<label class="short-label">IDR</label>
|
||||
</span>
|
||||
<div class="item-filler"> </div>
|
||||
<div class="item-controls item-controls-fixed">
|
||||
<a class="item-control item-add" data-type="money" title="Create Item"><i class="fas fa-plus"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
{{#each moneys as |money key|}}
|
||||
<li class="item flexrow list-item list-item-shadow" data-item-id="{{money._id}}">
|
||||
@ -538,6 +542,10 @@
|
||||
<span class="item-field-label-medium">
|
||||
<label class="short-label">IDR</label>
|
||||
</span>
|
||||
<div class="item-filler"> </div>
|
||||
<div class="item-controls item-controls-fixed">
|
||||
<a class="item-control item-add" data-type="weapon" title="Create Item"><i class="fas fa-plus"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
{{#each weapons as |weapon key|}}
|
||||
<li class="item flexrow list-item list-item-shadow" data-item-id="{{weapon._id}}">
|
||||
@ -610,6 +618,11 @@
|
||||
<span class="item-field-label-medium">
|
||||
<label class="short-label">IDR</label>
|
||||
</span>
|
||||
|
||||
<div class="item-filler"> </div>
|
||||
<div class="item-controls item-controls-fixed">
|
||||
<a class="item-control item-add" data-type="armor" title="Create Item"><i class="fas fa-plus"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
{{#each armors as |armor key|}}
|
||||
<li class="item list-item flexrow list-item-shadow" data-item-id="{{armor._id}}">
|
||||
@ -665,8 +678,12 @@
|
||||
<label class="short-label">Weight</label>
|
||||
</span>
|
||||
<span class="item-field-label-medium">
|
||||
<label class="short-label">IDR</label>
|
||||
<label class="short-label">IDR</label>
|
||||
</span>
|
||||
<div class="item-filler"> </div>
|
||||
<div class="item-controls item-controls-fixed">
|
||||
<a class="item-control item-add" data-type="shield" title="Create Item"><i class="fas fa-plus"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
{{#each shields as |shield key|}}
|
||||
<li class="item flexrow list-item list-item-shadow" data-item-id="{{shield._id}}">
|
||||
@ -721,6 +738,11 @@
|
||||
<span class="item-field-label-medium">
|
||||
<label class="short-label">IDR</label>
|
||||
</span>
|
||||
<div class="item-filler"> </div>
|
||||
<div class="item-controls item-controls-fixed">
|
||||
<a class="item-control item-add" data-type="equipment" title="Create Item"><i class="fas fa-plus"></i></a>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
{{#each containersTree as |equip key|}}
|
||||
{{> systems/fvtt-pegasus-rpg/templates/partial-actor-equipment.html equip=equip level=1}}
|
||||
|
Loading…
Reference in New Issue
Block a user