Fix sélection cible parmi multiples

This commit is contained in:
2024-12-07 23:51:44 +01:00
parent 1c68c34641
commit 2e689f642a
3 changed files with 13 additions and 7 deletions

View File

@ -11,7 +11,12 @@ export class Targets {
}
static extractTokenData(target) {
return { id: target?.id, name: target?.document.name, img: target?.document.texture.src ?? target?.actor.img ?? 'icons/svg/mystery-man.svg' };
return {
id: target?.id,
name: target?.document.name,
img: target?.document.texture.src ?? target?.actor.img ?? 'icons/svg/mystery-man.svg',
target
};
}
static buildActorTokenData(tokenId, actor) {
return { id: tokenId, name: actor.name, img: actor.img ?? 'icons/svg/mystery-man.svg' };
@ -35,7 +40,7 @@ export class Targets {
label: "Choisir une seule des cibles",
list: targets.map(it => Targets.extractTokenData(it))
};
DialogSelect.select(selectData, onSelectTarget)
DialogSelect.select(selectData, t => onSelectTarget(t.target))
}
}
}