forked from public/foundryvtt-reve-de-dragon
Armes sur la fiche de PNJ
This commit is contained in:
@ -39,7 +39,8 @@ export class RdDActorExportSheet extends RdDActorSheet {
|
||||
async getData() {
|
||||
const formData = await super.getData()
|
||||
// Add any structured, precomputed list of data
|
||||
formData.export = this.getMappingValues();
|
||||
formData.context = Mapping.prepareContext(this.actor)
|
||||
formData.export = this.getMappingValues(formData.context, this.actor)
|
||||
formData.competences = this.getCompetences(CATEGORIES_COMPETENCES)
|
||||
formData.draconic = this.getCompetences(CATEGORIES_DRACONIC)
|
||||
const legeres = this.actor.nbBlessuresLegeres()
|
||||
@ -59,13 +60,12 @@ export class RdDActorExportSheet extends RdDActorSheet {
|
||||
return formData
|
||||
}
|
||||
|
||||
getMappingValues() {
|
||||
const context = Mapping.prepareContext(this.actor)
|
||||
getMappingValues(context, actor) {
|
||||
return Object.fromEntries(Mapping.getMapping().map(it => [it.column, {
|
||||
colName: it.colName ?? it.column,
|
||||
column: it.column,
|
||||
rollClass: it.rollClass,
|
||||
value: String(it.getter(this.actor, context))
|
||||
value: String(it.getter(actor, context))
|
||||
}]))
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user