This commit is contained in:
sladecraven 2022-03-15 20:57:51 +01:00
parent 2137f88823
commit e59a815eaf
3 changed files with 35 additions and 9 deletions

View File

@ -111,17 +111,21 @@ export class PegasusActorSheet extends ActorSheet {
// Update Inventory Item // Update Inventory Item
html.find('.item-edit').click(ev => { html.find('.item-edit').click(ev => {
const li = $(ev.currentTarget).parents(".item"); const li = $(ev.currentTarget).parents(".item")
let itemId = li.data("item-id"); let itemId = li.data("item-id")
const item = this.actor.items.get( itemId ); const item = this.actor.items.get( itemId );
item.sheet.render(true); item.sheet.render(true);
}); });
// Delete Inventory Item // Delete Inventory Item
html.find('.item-delete').click(ev => { html.find('.item-delete').click(ev => {
const li = $(ev.currentTarget).parents(".item"); const li = $(ev.currentTarget).parents(".item")
PegasusUtility.confirmDelete(this, li); 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 => { html.find('.spec-group-activate').click(ev => {
const li = $(ev.currentTarget).parents(".item"); const li = $(ev.currentTarget).parents(".item");
let itemId = li.data("item-id"); let itemId = li.data("item-id");

View File

@ -32,12 +32,12 @@ Hooks.once("init", async function () {
/* -------------------------------------------- */ /* -------------------------------------------- */
game.settings.register("fvtt-pegasus-rpg", "dice-max-level", { game.settings.register("fvtt-pegasus-rpg", "dice-max-level", {
name: "Maximum level value for dices lists", 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", scope: "world",
config: true, config: true,
default: 20, default: 20,
type: Number type: Number
}); })
/* -------------------------------------------- */ /* -------------------------------------------- */
// Set an initiative formula for the system // Set an initiative formula for the system

View File

@ -482,6 +482,10 @@
<span class="item-field-label-medium"> <span class="item-field-label-medium">
<label class="short-label">IDR</label> <label class="short-label">IDR</label>
</span> </span>
<div class="item-filler">&nbsp;</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> </li>
{{#each moneys as |money key|}} {{#each moneys as |money key|}}
<li class="item flexrow list-item list-item-shadow" data-item-id="{{money._id}}"> <li class="item flexrow list-item list-item-shadow" data-item-id="{{money._id}}">
@ -538,6 +542,10 @@
<span class="item-field-label-medium"> <span class="item-field-label-medium">
<label class="short-label">IDR</label> <label class="short-label">IDR</label>
</span> </span>
<div class="item-filler">&nbsp;</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> </li>
{{#each weapons as |weapon key|}} {{#each weapons as |weapon key|}}
<li class="item flexrow list-item list-item-shadow" data-item-id="{{weapon._id}}"> <li class="item flexrow list-item list-item-shadow" data-item-id="{{weapon._id}}">
@ -610,6 +618,11 @@
<span class="item-field-label-medium"> <span class="item-field-label-medium">
<label class="short-label">IDR</label> <label class="short-label">IDR</label>
</span> </span>
<div class="item-filler">&nbsp;</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> </li>
{{#each armors as |armor key|}} {{#each armors as |armor key|}}
<li class="item list-item flexrow list-item-shadow" data-item-id="{{armor._id}}"> <li class="item list-item flexrow list-item-shadow" data-item-id="{{armor._id}}">
@ -665,8 +678,12 @@
<label class="short-label">Weight</label> <label class="short-label">Weight</label>
</span> </span>
<span class="item-field-label-medium"> <span class="item-field-label-medium">
<label class="short-label">IDR</label> <label class="short-label">IDR</label>
</span> </span>
<div class="item-filler">&nbsp;</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> </li>
{{#each shields as |shield key|}} {{#each shields as |shield key|}}
<li class="item flexrow list-item list-item-shadow" data-item-id="{{shield._id}}"> <li class="item flexrow list-item list-item-shadow" data-item-id="{{shield._id}}">
@ -721,6 +738,11 @@
<span class="item-field-label-medium"> <span class="item-field-label-medium">
<label class="short-label">IDR</label> <label class="short-label">IDR</label>
</span> </span>
<div class="item-filler">&nbsp;</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> </li>
{{#each containersTree as |equip key|}} {{#each containersTree as |equip key|}}
{{> systems/fvtt-pegasus-rpg/templates/partial-actor-equipment.html equip=equip level=1}} {{> systems/fvtt-pegasus-rpg/templates/partial-actor-equipment.html equip=equip level=1}}