Template and raw sheet for npc

This commit is contained in:
Vlyan
2020-12-13 16:28:25 +01:00
parent 903229c25b
commit ec2acf1648
14 changed files with 352 additions and 48 deletions

View File

@@ -2,7 +2,7 @@ export class ActorSheetL5r5e extends ActorSheet {
static get defaultOptions() {
return mergeObject(super.defaultOptions, {
classes: ["l5r5e", "sheet", "actor"],
template: "systems/l5r5e/templates/sheets/actor-sheet.html",
template: CONFIG.L5r5e.paths.templates + "sheets/actor-sheet.html",
width: 600,
height: 800,
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description" }],
@@ -61,7 +61,7 @@ export class ActorSheetL5r5e extends ActorSheet {
if (!this.options.editable) return;
// Update Inventory Item
html.find(".item-edit").click((ev) => {
html.find(".item-edit").on("click", (ev) => {
const li = $(ev.currentTarget).parents(".item");
const itemId = li.data("itemId");
const item = this.actor.getOwnedItem(itemId);
@@ -69,17 +69,17 @@ export class ActorSheetL5r5e extends ActorSheet {
});
// Delete Inventory Item
html.find(".item-delete").click((ev) => {
html.find(".item-delete").on("click", (ev) => {
const li = $(ev.currentTarget).parents(".item");
const itemId = li.data("itemId");
this.actor.deleteOwnedItem(itemId);
});
html.find(".feat-add").click((ev) => {
html.find(".feat-add").on("click", (ev) => {
this._createFeat();
});
html.find(".feat-delete").click((ev) => {
html.find(".feat-delete").on("click", (ev) => {
const li = $(ev.currentTarget).parents(".feat");
const featId = li.data("featId");
console.log("Remove feat" + featId + " clicked");
@@ -87,21 +87,21 @@ export class ActorSheetL5r5e extends ActorSheet {
this.actor.deleteOwnedItem(featId);
});
html.find(".feat-edit").click((ev) => {
html.find(".feat-edit").on("click", (ev) => {
const li = $(ev.currentTarget).parents(".feat");
const featId = li.data("featId");
const feat = this.actor.getOwnedItem(featId);
feat.sheet.render(true);
});
html.find(".skill-name").click((ev) => {
html.find(".skill-name").on("click", (ev) => {
const li = $(ev.currentTarget).parents(".skill");
const skillId = li.data("skill");
this._onSkillClicked(skillId);
});
html.find(".acquisition-add").click((ev) => {
html.find(".acquisition-add").on("click", (ev) => {
this._createFeat();
});
}