From f10691af65571291cf4416ceb669a04c1f638bc1 Mon Sep 17 00:00:00 2001 From: sladecraven Date: Thu, 1 Apr 2021 22:52:41 +0200 Subject: [PATCH] Item structure --- modules/vadentis-actor-sheet.js | 37 +++++---------------------------- modules/vadentis-utility.js | 2 ++ 2 files changed, 7 insertions(+), 32 deletions(-) diff --git a/modules/vadentis-actor-sheet.js b/modules/vadentis-actor-sheet.js index 8e0c41d..9ae479a 100644 --- a/modules/vadentis-actor-sheet.js +++ b/modules/vadentis-actor-sheet.js @@ -17,7 +17,7 @@ export class VadentisActorSheet extends ActorSheet { height: 720, tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "stats" }], dragDrop: [{ dragSelector: ".item-list .item", dropSelector: null }], - editStatSkill: false + editScore: false }); } @@ -28,6 +28,9 @@ export class VadentisActorSheet extends ActorSheet { data.stats = this.actor.stats; data.combat = this.actor.combat; data.magie = this.actor.magie; + data.editScore = this.options.editScore; + console.log("Edit : ", data.editScore); + data.isGM = game.user.isGM; return data; } @@ -37,8 +40,6 @@ export class VadentisActorSheet extends ActorSheet { activateListeners(html) { super.activateListeners(html); - //HtmlUtility._showControlWhen($(".gm-only"), game.user.isGM); - // Everything below here is only needed if the sheet is editable if (!this.options.editable) return; @@ -89,36 +90,8 @@ export class VadentisActorSheet extends ActorSheet { //console.log("Competence changed :", skillName); this.actor.updateSkillExperience(skillName, parseInt(event.target.value)); }); - html.find('.wound-value').change((event) => { - let woundName = event.currentTarget.attributes.woundname.value; - //console.log("Competence changed :", skillName); - this.actor.updateWound(woundName, parseInt(event.target.value)); - }); - html.find('.reset-deck-full').click((event) => { - this.actor.resetDeckFull(); - this.render(true); - }); - html.find('.draw-new-edge').click((event) => { - this.actor.drawNewEdge(); - this.render(true); - }); - html.find('.reset-deck').click((event) => { - this.actor.resetDeck(); - this.render(true); - }); - html.find('.discard-card').click((event) => { - const cardName = $(event.currentTarget).data("discard"); - this.actor.discardEdge( cardName ); - }); - html.find('.consequence-severity').click((event) => { - const li = $(event.currentTarget).parents(".item"); - const item = this.actor.getOwnedItem(li.data("item-id")); - let severity = $(event.currentTarget).val(); - this.actor.updateOwnedItem( { _id: item._id, 'data.severity': severity}); - this.render(true); - }); html.find('.lock-unlock-sheet').click((event) => { - this.options.editStatSkill = !this.options.editStatSkill; + this.options.editScore = !this.options.editScore; this.render(true); }); html.find('.item-link a').click((event) => { diff --git a/modules/vadentis-utility.js b/modules/vadentis-utility.js index 16b9def..4235362 100644 --- a/modules/vadentis-utility.js +++ b/modules/vadentis-utility.js @@ -11,6 +11,8 @@ export class VadentisUtility extends Entity { 'systems/foundryvtt-vadentis/templates/actor-sheet.html', 'systems/foundryvtt-vadentis/templates/item-sheet.html', 'systems/foundryvtt-vadentis/templates/score-option-list.html', + 'systems/foundryvtt-vadentis/templates/malus-option-list.html', + 'systems/foundryvtt-vadentis/templates/bonus-option-list.html', 'systems/foundryvtt-vadentis/templates/editor-notes-gm.html' ] return loadTemplates(templatePaths);