Support des tâches à plusieurs
Release Creation / build (release) Successful in 1m50s

This commit was merged in pull request #820.
This commit is contained in:
2026-07-11 16:12:15 +02:00
parent 66a8eb0e8a
commit 7d5903aa84
20 changed files with 177 additions and 42 deletions
+13 -7
View File
@@ -22,8 +22,8 @@ export class RollPartTache extends RollPartSelect {
refs.forced = selected.forced
refs.all = rollData.active.actor.itemTypes[ITEM_TYPES.tache]
.filter(tache => !selected.forced || tache.id == selected.key)
.filter(tache => tache.system.points_de_tache_courant < tache.system.points_de_tache)
.map(tache => RollPartTache.$extractTache(tache, rollData.active.actor))
.filter(extract => !extract.finished)
refs.taches = refs.all
if (refs.taches.length > 0) {
@@ -34,12 +34,15 @@ export class RollPartTache extends RollPartSelect {
choices(refs) { return refs.taches }
static $extractTache(tache, actor) {
const tacheOuCommune = tache.getTacheOuCommune()
return {
key: tache.id,
label: tache.name,
value: tache.system.difficulte,
tache: tache,
comp: actor.getCompetence(tache.system.competence)
tacheCommune: tache.system.tacheCommune,
value: tacheOuCommune.system.difficulte,
tache: tacheOuCommune,
comp: actor.getCompetence(tacheOuCommune.system.competence),
finished: tacheOuCommune.system.points_de_tache_courant >= tacheOuCommune.system.points_de_tache
}
}
@@ -81,9 +84,12 @@ export class RollPartTache extends RollPartSelect {
}
onCreateUpdateItem(rollDialog, item, options, id) {
if (item.type == ITEM_TYPES.tache && item.parent?.id == rollDialog.rollData.active.actor.id) {
this.loadRefs(rollDialog.rollData)
rollDialog.render()
if (item.type == ITEM_TYPES.tache) {
if (item.parent?.id == rollDialog.rollData.active.actor.id || item.isTacheCommune()) {
// TODO: filtrer davantage
this.loadRefs(rollDialog.rollData)
rollDialog.render()
}
}
}