Suppression de TMR "Inconnu" pour signes

This commit is contained in:
2026-07-10 16:50:41 +02:00
parent e42e12f56f
commit 6c239b8ed9
4 changed files with 13 additions and 7 deletions
+3 -3
View File
@@ -90,9 +90,9 @@ export class DialogCreateSigneDraconique extends Dialog {
this.html.find("[name='signe.system.difficulte']").val(newSigne.system.difficulte);
this.html.find("[name='signe.system.duree']").val(newSigne.system.duree);
this.html.find("[name='signe.system.ephemere']").prop("checked", newSigne.system.ephemere);
this.dialogData.tmrs = TMRUtility.buildSelectionTypesTMR(newSigne.system.typesTMR);
this.dialogData.tmrs.forEach(t => {
this.html.find(`[data-tmr-name='${t.name}']`).prop("checked", t.selected);
this.dialogData.tmrs = TMRUtility.buildSelectionTypesTMR(newSigne.system.typesTMR)
this.dialogData.tmrs.forEach(it => {
this.html.find(`[data-tmr-name='${it.name}']`).prop("checked", it.selected);
})
this.setEphemere(newSigne.system.ephemere);
}
+3 -3
View File
@@ -24,9 +24,9 @@ export class RdDSigneDraconiqueItemSheet extends RdDItemSheetV1 {
/* -------------------------------------------- */
async getData() {
const formData = await super.getData();
this.tmrs = TMRUtility.buildSelectionTypesTMR(this.item.system.typesTMR);
formData.tmrs = this.tmrs;
return formData;
this.tmrs = TMRUtility.buildSelectionTypesTMR(this.item.system.typesTMR)
formData.tmrs = this.tmrs
return formData
}
/* -------------------------------------------- */
+3 -1
View File
@@ -309,7 +309,9 @@ export class TMRUtility {
static buildSelectionTypesTMR(typesTMR) {
typesTMR = typesTMR ?? [];
return Object.values(TMRType).map(value => Misc.upperFirst(value.name))
return Object.values(TMRType)
.filter(it => it.type != TMR_INCONNU)
.map(it => Misc.upperFirst(it.name))
.sort()
.map(name => { return { name: name, selected: typesTMR.includes(name) } });
}