Fix Description aléatoire

This commit was merged in pull request #822.
This commit is contained in:
2026-07-17 03:07:30 +02:00
parent a55904742b
commit 5dbd7c3784
2 changed files with 11 additions and 15 deletions
@@ -102,12 +102,8 @@ export class AppPersonnageAleatoire extends FormApplication {
constructor(actor) {
super({})
this.actor = actor
this.current = AppPersonnageAleatoire.getActorValues()
this.checked = Object.fromEntries(CONTROLS.map(it => [it.name, [0, '', undefined].includes(it.getter(this.current))]))
}
static getActorValues() {
return Object.fromEntries(CONTROLS.map(it => [it.name, it.getter(this.actor)]));
this.current = Object.fromEntries(CONTROLS.map(it => [it.name, it.getter(this.actor)]));
this.checked = Object.fromEntries(CONTROLS.map(it => [it.name, [0, '', undefined].includes(this.current[it.name])]))
}
async getData(options) {
@@ -141,7 +137,7 @@ export class AppPersonnageAleatoire extends FormApplication {
async onApply() {
const updates = Object.fromEntries(
CONTROLS.filter(control => game.user.isGM || control.name != 'name')
.map(control => [control.path, control.getter(this.current)])
.map(control => [control.path, this.current[control.name]])
)
await this.actor.update(updates)
await this.close()