Fix Description aléatoire
This commit was merged in pull request #822.
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user