Gestion des quantites et de l'argent

This commit is contained in:
2022-12-03 23:57:30 +01:00
parent 5ab6b99ef6
commit 5dde9ac72f
9 changed files with 134 additions and 14 deletions

View File

@ -48,6 +48,9 @@ export class HawkmoonActorSheet extends ActorSheet {
profils: duplicate(this.actor.getProfils() || {}),
combat: this.actor.getCombatValues(),
equipements: duplicate(this.actor.getEquipments()),
monnaies: duplicate(this.actor.getMonnaies()),
richesse: this.actor.computeRichesse(),
valeurEquipement: this.actor.computeValeurEquipement(),
initiative: this.actor.getFlag("world", "last-initiative") || -1,
description: await TextEditor.enrichHTML(this.object.system.biodata.description, {async: true}),
habitat: await TextEditor.enrichHTML(this.object.system.biodata.habitat, {async: true}),
@ -112,15 +115,12 @@ export class HawkmoonActorSheet extends ActorSheet {
let value = Number($(event.currentTarget).data("adversite-value"))
this.actor.incDecAdversite(adv, value)
})
html.find('.quantity-minus').click(event => {
const li = $(event.currentTarget).parents(".item");
this.actor.incDecQuantity( li.data("item-id"), -1 );
} );
html.find('.quantity-plus').click(event => {
const li = $(event.currentTarget).parents(".item");
this.actor.incDecQuantity( li.data("item-id"), +1 );
} );
html.find('.quantity-modify').click(event => {
const li = $(event.currentTarget).parents(".item")
const value = Number($(event.currentTarget).data("quantite-value"))
this.actor.incDecQuantity( li.data("item-id"), value );
})
html.find('.roll-initiative').click((event) => {
this.actor.rollAttribut("pre", true)