make equip icon for items clickable in item list in character sheet
This commit is contained in:
parent
cba20e47e5
commit
6fac2c597f
3 changed files with 18 additions and 11 deletions
|
@ -1,4 +1,4 @@
|
|||
import { DS4ItemDataType } from "../item/item-data";
|
||||
import { DS4ItemDataType, DS4ItemEquipable } from "../item/item-data";
|
||||
import { DS4Actor } from "./actor";
|
||||
import { DS4ActorDataType } from "./actor-data";
|
||||
|
||||
|
@ -62,6 +62,13 @@ export class DS4ActorSheet extends ActorSheet<DS4ActorDataType, DS4Actor, DS4Ite
|
|||
li.slideUp(200, () => this.render(false));
|
||||
});
|
||||
|
||||
html.find(".item-equip").on("click", (ev) => {
|
||||
const id = $(ev.currentTarget).parents(".item").data("itemId");
|
||||
const item = duplicate(this.actor.getEmbeddedEntity("OwnedItem", id));
|
||||
setProperty(item, "data.equipped", !getProperty(item, "data.equipped"));
|
||||
this.actor.updateOwnedItem(item);
|
||||
});
|
||||
|
||||
// Rollable abilities.
|
||||
html.find(".rollable").click(this._onRoll.bind(this));
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ interface DS4ItemPhysical {
|
|||
storageLocation: string;
|
||||
}
|
||||
|
||||
interface DS4ItemEquipable {
|
||||
export interface DS4ItemEquipable {
|
||||
equipped: boolean;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue