Cleanup roll windows

- permettre plusieurs fenêtres de jets en même temps en éliminant les
  id dans le html et les jquery sur id pour éviter les interactions
- génération de la table par handlebars
This commit is contained in:
Vincent Vandemeulebrouck
2022-12-06 01:30:12 +01:00
parent f027e3318b
commit 2122a54db7
43 changed files with 319 additions and 343 deletions

View File

@ -73,7 +73,7 @@ export class DialogFabriquerPotion extends Dialog {
activateListeners(html) {
super.activateListeners(html);
html.find("#nbBrins").change(event => {
html.find("[name='nbBrins']").change(event => {
this.potionData.nbBrins = Misc.toInt(event.currentTarget.value);
const brinsManquants = Math.max(0, DialogFabriquerPotion.nombreBrinsOptimal(this.potionData) - this.potionData.nbBrins);
this.potionData.herbebonus = Math.max(0, this.potionData.system.niveau - brinsManquants)
@ -82,7 +82,7 @@ export class DialogFabriquerPotion extends Dialog {
/* -------------------------------------------- */
async onFabriquer(it) {
await $("#nbBrins").change();
await $("[name='nbBrins']").change();
this.actor.fabriquerPotion(this.potionData);
this.close();
}