ajout du handicap de rareté

This commit is contained in:
rwanoux
2024-11-20 12:08:03 +01:00
parent 6568eb067f
commit 80277f822f
14 changed files with 160 additions and 83 deletions
+4 -6
View File
@@ -156,17 +156,14 @@ export class TraitSelector extends Application {
}
async validateTraits(html) {
let checks = html.find("input.trait-selector");
let val = html.find("input.trait-value");
for (let inp of [...checks, val]) {
for (let inp of checks) {
if (this.targetItem.system.traits[inp.dataset.trait]) {
if (inp.type == "checkbox") {
inp.checked = true
}
if (inp.type == "value") {
inp.value = this.targetItem.system.traits[inp.dataset.trait].value
}
}
}
}
await this.render(true)
}
async onChangeInput(ev) {
@@ -195,5 +192,6 @@ export class TraitSelector extends Application {
} else {
el.closest("label").querySelector('.trait-selector').checked = false;
}
this.render(true)
}
}