Various fixes

This commit is contained in:
2022-02-16 12:14:34 +01:00
parent 6e8e1ec5a3
commit 8dd7217e69
9 changed files with 124 additions and 55 deletions

View File

@ -41,6 +41,7 @@ export class PegasusRollDialog extends Dialog {
PegasusUtility.rollPegasus( this.rollData )
}
/* -------------------------------------------- */
manageEffects( effectIdx, toggled) {
let effect = this.rollData.effectsList[effectIdx]
@ -182,15 +183,20 @@ export class PegasusRollDialog extends Dialog {
}
$(function () { onLoad(); });
html.find('#specList').change((event) => {
html.find('#specList').change(async (event) => {
this.rollData.selectedSpec = event.currentTarget.value
let spec = this.rollData.specList.find(item => item._id == this.rollData.selectedSpec)
if ( spec) {
this.rollData.specDiceLevel = spec.data.level
this.rollData.specName = spec.name
$('#specDicesLevel').val(this.rollData.specDiceLevel)
} else {
this.rollData.specName = undefined
$('#specDicesLevel').val(0)
}
const content = await renderTemplate("systems/fvtt-pegasus-rpg/templates/roll-dialog-generic.html", this.rollData)
this.data.content = content
this.render(true)
});
html.find('#statDicesLevel').change((event) => {
this.rollData.statDicesLevel = Number(event.currentTarget.value)