From 83e2d56fd47c27e3eea8a40a84a31af8776ee467 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Wed, 15 Mar 2023 00:46:08 +0100 Subject: [PATCH] Boutons soins&blessures --- module/actor-sheet.js | 15 ++++++--------- module/item/blessure.js | 2 +- templates/actor/blessures.html | 9 ++++++++- templates/actor/chirurgie.html | 8 +++++--- 4 files changed, 20 insertions(+), 14 deletions(-) diff --git a/module/actor-sheet.js b/module/actor-sheet.js index 5e33065a..00f2fa96 100644 --- a/module/actor-sheet.js +++ b/module/actor-sheet.js @@ -152,15 +152,12 @@ export class RdDActorSheet extends RdDBaseActorSheet { this.html.find('.creer-tache').click(async event => { this.createEmptyTache(); }); - this.html.find('.creer-tache-blessure-legere').click(async event => { - RdDItemBlessure.createTacheSoinBlessure(this.actor, 2); - }); - this.html.find('.creer-tache-blessure-grave').click(async event => { - RdDItemBlessure.createTacheSoinBlessure(this.actor, 4); - }); - this.html.find('.creer-tache-blessure-critique').click(async event => { - RdDItemBlessure.createTacheSoinBlessure(this.actor, 6); - }); + this.html.find('.creer-tache-blessure-legere').click(async event => RdDItemBlessure.createTacheSoinBlessure(this.actor, 2)); + this.html.find('.creer-tache-blessure-grave').click(async event => RdDItemBlessure.createTacheSoinBlessure(this.actor, 4)); + this.html.find('.creer-tache-blessure-critique').click(async event => RdDItemBlessure.createTacheSoinBlessure(this.actor, 6)); + this.html.find('.creer-blessure-legere').click(async event => RdDItemBlessure.createBlessure(this.actor, 2)); + this.html.find('.creer-blessure-grave').click(async event => RdDItemBlessure.createBlessure(this.actor, 4)); + this.html.find('.creer-blessure-critique').click(async event => RdDItemBlessure.createBlessure(this.actor, 6)); this.html.find('.creer-une-oeuvre').click(async event => { this.selectTypeOeuvreToCreate(); }); diff --git a/module/item/blessure.js b/module/item/blessure.js index 063b7885..2c59a9be 100644 --- a/module/item/blessure.js +++ b/module/item/blessure.js @@ -40,7 +40,7 @@ export class RdDItemBlessure extends RdDItem { } return mergeObject(duplicate(BASE_TACHE_SOIN_BLESSURE), tache) } - static async createBlessure(actor, gravite, localisation) { + static async createBlessure(actor, gravite, localisation = '') { const definition = RdDItemBlessure.getDefinition(gravite) const blessure = { name: definition.labelGravite, diff --git a/templates/actor/blessures.html b/templates/actor/blessures.html index 0974c2a0..910b2480 100644 --- a/templates/actor/blessures.html +++ b/templates/actor/blessures.html @@ -1,6 +1,13 @@ +

blessures

+
+ légère + grave + critique +
+