Fix mod
This commit is contained in:
parent
f9d3916f3f
commit
7a05d66d0b
@ -192,6 +192,12 @@ export class PegasusActorSheet extends ActorSheet {
|
||||
this.actor.equipItem( li.data("item-id") );
|
||||
this.render(true);
|
||||
});
|
||||
html.find('.power-activate').click(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
this.actor.activatePower( li.data("item-id") );
|
||||
this.render(true);
|
||||
});
|
||||
|
||||
html.find('.update-field').change(ev => {
|
||||
const fieldName = $(ev.currentTarget).data("field-name");
|
||||
let value = ev.currentTarget.value;
|
||||
|
@ -194,6 +194,15 @@ export class PegasusActor extends Actor {
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async activatePower(itemId) {
|
||||
let item = this.data.items.find(item => item.id == itemId);
|
||||
if (item && item.data.data) {
|
||||
let update = { _id: item.id, "data.activated": !item.data.data.activated };
|
||||
await this.updateEmbeddedDocuments('Item', [update]); // Updates one EmbeddedEntity
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async equipItem(itemId) {
|
||||
let item = this.data.items.find(item => item.id == itemId);
|
||||
|
@ -312,6 +312,8 @@
|
||||
</span>
|
||||
<span class="stat-label outfit-label">{{#if power.data.activated}}Activated{{/if}}</span>
|
||||
<div class="item-controls">
|
||||
<a class="item-control power-activate" title="Worn">{{#if power.data.activated}}<i
|
||||
class="fas fa-circle"></i>{{else}}<i class="fas fa-genderless"></i>{{/if}}</a>
|
||||
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
|
||||
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user