First v10 release

This commit is contained in:
2022-10-19 17:30:47 +02:00
parent 46d666b779
commit 66e83ec8f0
25 changed files with 419 additions and 552 deletions

View File

@@ -5,7 +5,7 @@ export class Imperium5RollDialog extends Dialog {
/* -------------------------------------------- */
static async create(actor, rollData ) {
let options = { classes: ["Imperium5Dialog"], width: 620, height: 380, 'z-index': 99999 }
let options = { classes: ["Imperium5Dialog"], width: 320, height: 380, 'z-index': 99999 }
let html = await renderTemplate('systems/fvtt-imperium5/templates/roll-dialog-generic.html', rollData)
return new Imperium5RollDialog(actor, rollData, html, options )
@@ -41,6 +41,11 @@ export class Imperium5RollDialog extends Dialog {
Imperium5Utility.rollImperium5( this.rollData )
}
/* -------------------------------------------- */
updatePCPool() {
let value = Imperium5Utility.computeDiceReserve(this.rollData)
$('#ame-total').html(value )
}
/* -------------------------------------------- */
activateListeners(html) {
@@ -48,7 +53,29 @@ export class Imperium5RollDialog extends Dialog {
var dialog = this
function onLoad() {
dialog.updatePCPool()
}
$(function () { onLoad(); })
$(function () { onLoad(); })
html.find('#select-realite-dice').change(async (event) => {
this.rollData.realiteDice = Number(event.currentTarget.value)
})
html.find('#select-capacite').change(async (event) => {
this.rollData.usedCapacite = String(event.currentTarget.value)
this.updatePCPool()
})
html.find('#select-use-archetype').change(async (event) => {
this.rollData.useArchetype = event.currentTarget.checked
this.updatePCPool()
})
html.find('#select-use-aide').change(async (event) => {
this.rollData.useAide = event.currentTarget.checked
this.updatePCPool()
})
html.find('#select-use-karma').change(async (event) => {
this.rollData.useKarma = event.currentTarget.checked
this.updatePCPool()
})
}
}