forked from public/foundryvtt-reve-de-dragon
Fix sélection cible parmi multiples
This commit is contained in:
@ -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))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user