Rename data to formData

This commit is contained in:
Vincent Vandemeulebrouck 2021-03-16 22:56:57 +01:00
parent 830f4fde9a
commit 10ddcf031e
9 changed files with 160 additions and 152 deletions

View File

@ -26,40 +26,40 @@ export class RdDActorCreatureSheet extends RdDActorSheet {
/* -------------------------------------------- */ /* -------------------------------------------- */
getData() { getData() {
let data = super.getData(); let formData = super.getDData();
console.log("Creature : ", data); console.log("Creature : ", formData);
data.itemsByType = {}; formData.itemsByType = {};
for (const item of data.items) { for (const item of formData.items) {
let list = data.itemsByType[item.type]; let list = formData.itemsByType[item.type];
if (!list) { if (!list) {
list = []; list = [];
data.itemsByType[item.type] = list; formData.itemsByType[item.type] = list;
} }
list.push(item); list.push(item);
} }
// Compute current carac sum // Compute current carac sum
let sum = 0; let sum = 0;
Object.values(data.data.carac).forEach(carac => { if (!carac.derivee) { sum += parseInt(carac.value) } }); Object.values(formData.data.carac).forEach(carac => { if (!carac.derivee) { sum += parseInt(carac.value) } });
data.data.caracSum = sum; formData.data.caracSum = sum;
data.data.carac.taille.isTaille = true; // To avoid button link; formData.data.carac.taille.isTaille = true; // To avoid button link;
data.data.blessures.resume = this.actor.computeResumeBlessure(data.data.blessures); formData.data.blessures.resume = this.actor.computeResumeBlessure(formData.data.blessures);
data.data.isGM = game.user.isGM; formData.data.isGM = game.user.isGM;
data.data.competencecreature = data.itemsByType["competencecreature"]; formData.data.competencecreature = formData.itemsByType["competencecreature"];
this.actor.computeEncombrementTotalEtMalusArmure(); this.actor.computeEncombrementTotalEtMalusArmure();
RdDUtility.filterItemsPerTypeForSheet(data); RdDUtility.filterItemsPerTypeForSheet(formData);
RdDUtility.buildArbreDeConteneur(this, data); RdDUtility.buildArbreDeConteneur(this, formData);
data.data.encTotal = this.actor.encTotal; formData.data.encTotal = this.actor.encTotal;
data.data.isGM = game.user.isGM; formData.data.isGM = game.user.isGM;
console.log("Creature : ", this.objetVersConteneur, data); console.log("Creature : ", this.objetVersConteneur, formData);
return data; return formData;
} }
/* -------------------------------------------- */ /* -------------------------------------------- */

View File

@ -30,23 +30,23 @@ export class RdDActorEntiteSheet extends ActorSheet {
/* -------------------------------------------- */ /* -------------------------------------------- */
getData() { getData() {
let data = super.getData(); let formData = super.getData();
data.itemsByType = {}; formData.itemsByType = {};
for (const item of data.items) { for (const item of formData.items) {
let list = data.itemsByType[item.type]; let list = formData.itemsByType[item.type];
if (!list) { if (!list) {
list = []; list = [];
data.itemsByType[item.type] = list; formData.itemsByType[item.type] = list;
} }
list.push(item); list.push(item);
} }
data.data.carac.taille.isTaille = true; // To avoid button link; formData.data.carac.taille.isTaille = true; // To avoid button link;
data.data.competencecreature = data.itemsByType["competencecreature"]; formData.data.competencecreature = formData.itemsByType["competencecreature"];
data.data.isGM = game.user.isGM; formData.data.isGM = game.user.isGM;
return data; return formData;
} }
/* -------------------------------------------- */ /* -------------------------------------------- */

View File

@ -32,113 +32,114 @@ export class RdDActorSheet extends ActorSheet {
/* -------------------------------------------- */ /* -------------------------------------------- */
getData() { getData() {
let data = super.getData(); let formData = super.getData();
if (data.actor.type == 'creature' || data.actor.type == 'humanoide') return data; // Shortcut
data.data.editCaracComp = this.options.editCaracComp; if (formData.actor.type == 'creature' || formData.actor.type == 'humanoide') return formData; // Shortcut
data.data.showCompNiveauBase = this.options.showCompNiveauBase;
data.data.montrerArchetype = this.options.montrerArchetype;
data.itemsByType = Misc.classify(data.items); formData.data.editCaracComp = this.options.editCaracComp;
formData.data.showCompNiveauBase = this.options.showCompNiveauBase;
formData.data.montrerArchetype = this.options.montrerArchetype;
formData.itemsByType = Misc.classify(formData.items);
// Competence per category // Competence per category
data.data.comptageArchetype = RdDUtility.getLimitesArchetypes(); formData.data.comptageArchetype = RdDUtility.getLimitesArchetypes();
data.data.competenceXPTotal = 0; formData.data.competenceXPTotal = 0;
data.competenceByCategory = Misc.classify( formData.competenceByCategory = Misc.classify(
data.itemsByType.competence, formData.itemsByType.competence,
item => item.data.categorie, item => item.data.categorie,
item => { item => {
let archetypeKey = (item.data.niveau_archetype < 0) ? 0 : item.data.niveau_archetype; let archetypeKey = (item.data.niveau_archetype < 0) ? 0 : item.data.niveau_archetype;
if (data.data.comptageArchetype[archetypeKey] == undefined) { if (formData.data.comptageArchetype[archetypeKey] == undefined) {
data.data.comptageArchetype[archetypeKey] = { "niveau": archetypeKey, "nombreMax": 0, "nombre": 0 }; formData.data.comptageArchetype[archetypeKey] = { "niveau": archetypeKey, "nombreMax": 0, "nombre": 0 };
} }
data.data.comptageArchetype[archetypeKey].nombre = (data.data.comptageArchetype[archetypeKey]?.nombre ?? 0) + 1; //Comptage archetype formData.data.comptageArchetype[archetypeKey].nombre = (formData.data.comptageArchetype[archetypeKey]?.nombre ?? 0) + 1; //Comptage archetype
item.data.xpNext = RdDItemCompetence.getCompetenceNextXp(item.data.niveau); item.data.xpNext = RdDItemCompetence.getCompetenceNextXp(item.data.niveau);
item.data.isLevelUp = item.data.xp >= item.data.xpNext; // Flag de niveau à MAJ item.data.isLevelUp = item.data.xp >= item.data.xpNext; // Flag de niveau à MAJ
//this.actor.checkCompetenceXP(item.name); // Petite vérification experience //this.actor.checkCompetenceXP(item.name); // Petite vérification experience
item.data.showCompetence = !data.data.showCompNiveauBase || (Number(item.data.niveau) != Number(RdDItemCompetence.getLevelCategory(item.data.categorie))); item.data.showCompetence = !formData.data.showCompNiveauBase || (Number(item.data.niveau) != Number(RdDItemCompetence.getLevelCategory(item.data.categorie)));
// Ignorer les compétences 'troncs' à ce stade // Ignorer les compétences 'troncs' à ce stade
data.data.competenceXPTotal += RdDItemCompetence.computeCompetenceXPCost(item); formData.data.competenceXPTotal += RdDItemCompetence.computeCompetenceXPCost(item);
return item; return item;
}); });
data.data.competenceXPTotal -= RdDItemCompetence.computeEconomieCompetenceTroncXP(data.itemsByType.competence); formData.data.competenceXPTotal -= RdDItemCompetence.computeEconomieCompetenceTroncXP(formData.itemsByType.competence);
// Compute current carac sum // Compute current carac sum
let sum = 0; let sum = 0;
for (let caracName in data.data.carac) { for (let caracName in formData.data.carac) {
let currentCarac = data.data.carac[caracName]; let currentCarac = formData.data.carac[caracName];
if (!currentCarac.derivee) { if (!currentCarac.derivee) {
sum += parseInt(currentCarac.value); sum += parseInt(currentCarac.value);
} }
currentCarac.xpNext = RdDUtility.getCaracNextXp(currentCarac.value); currentCarac.xpNext = RdDUtility.getCaracNextXp(currentCarac.value);
currentCarac.isLevelUp = (currentCarac.xp >= currentCarac.xpNext); currentCarac.isLevelUp = (currentCarac.xp >= currentCarac.xpNext);
} }
sum += (data.data.beaute >= 0) ? (data.data.beaute - 10) : 0; sum += (formData.data.beaute >= 0) ? (formData.data.beaute - 10) : 0;
data.data.caracSum = sum; formData.data.caracSum = sum;
// Force empty arme, at least for Esquive // Force empty arme, at least for Esquive
if (data.itemsByType.arme == undefined) data.itemsByType.arme = []; if (formData.itemsByType.arme == undefined) formData.itemsByType.arme = [];
for (const arme of data.itemsByType.arme) { for (const arme of formData.itemsByType.arme) {
arme.data.niveau = 0; // Per default, TODO to be fixed arme.data.niveau = 0; // Per default, TODO to be fixed
for (const melee of data.competenceByCategory.melee) { for (const melee of formData.competenceByCategory.melee) {
if (melee.name == arme.data.competence) if (melee.name == arme.data.competence)
arme.data.niveau = melee.data.niveau arme.data.niveau = melee.data.niveau
} }
for (const tir of data.competenceByCategory.tir) { for (const tir of formData.competenceByCategory.tir) {
if (tir.name == arme.data.competence) if (tir.name == arme.data.competence)
arme.data.niveau = tir.data.niveau arme.data.niveau = tir.data.niveau
} }
for (const lancer of data.competenceByCategory.lancer) { for (const lancer of formData.competenceByCategory.lancer) {
if (lancer.name == arme.data.competence) if (lancer.name == arme.data.competence)
arme.data.niveau = lancer.data.niveau arme.data.niveau = lancer.data.niveau
} }
} }
// To avoid armour and so on... // To avoid armour and so on...
data.data.combat = duplicate(RdDUtility.checkNull(data.itemsByType['arme'])); formData.data.combat = duplicate(RdDUtility.checkNull(formData.itemsByType['arme']));
data.data.combat = RdDCombatManager.finalizeArmeList(data.data.combat, data.itemsByType.competence, data.data.carac); formData.data.combat = RdDCombatManager.finalizeArmeList(formData.data.combat, formData.itemsByType.competence, formData.data.carac);
data.esquive = { name: "Esquive", niveau: data.competenceByCategory?.melee.find(it => it.name == 'Esquive')?.data.niveau ?? -6 }; formData.esquive = { name: "Esquive", niveau: formData.competenceByCategory?.melee.find(it => it.name == 'Esquive')?.data.niveau ?? -6 };
let corpsACorps = data.competenceByCategory?.melee.find(it => it.name == 'Corps à corps'); let corpsACorps = formData.competenceByCategory?.melee.find(it => it.name == 'Corps à corps');
if (corpsACorps) { if (corpsACorps) {
let cc_init = RdDCombatManager.calculInitiative(corpsACorps.data.niveau, data.data.carac['melee'].value); let cc_init = RdDCombatManager.calculInitiative(corpsACorps.data.niveau, formData.data.carac['melee'].value);
data.data.combat.push(RdDItemArme.mainsNues({ niveau: corpsACorps.data.niveau, initiative: cc_init })); formData.data.combat.push(RdDItemArme.mainsNues({ niveau: corpsACorps.data.niveau, initiative: cc_init }));
} }
this.armesList = duplicate(data.data.combat); this.armesList = duplicate(formData.data.combat);
data.data.carac.taille.isTaille = true; // To avoid button link; formData.data.carac.taille.isTaille = true; // To avoid button link;
data.data.compteurs.chance.isChance = true; formData.data.compteurs.chance.isChance = true;
data.data.blessures.resume = this.actor.computeResumeBlessure(data.data.blessures); formData.data.blessures.resume = this.actor.computeResumeBlessure(formData.data.blessures);
// Mise à jour de l'encombrement total et du prix de l'équipement // Mise à jour de l'encombrement total et du prix de l'équipement
this.actor.computeEncombrementTotalEtMalusArmure(); this.actor.computeEncombrementTotalEtMalusArmure();
this.actor.computePrixTotalEquipement(); this.actor.computePrixTotalEquipement();
// Common data // Common data
data.data.competenceByCategory = data.competenceByCategory; formData.data.competenceByCategory = formData.competenceByCategory;
data.data.encTotal = this.actor.encTotal; formData.data.encTotal = this.actor.encTotal;
data.data.prixTotalEquipement = this.actor.prixTotalEquipement; formData.data.prixTotalEquipement = this.actor.prixTotalEquipement;
data.data.surprise = RdDBonus.find(this.actor.getSurprise(false)).descr; formData.data.surprise = RdDBonus.find(this.actor.getSurprise(false)).descr;
data.data.isGM = game.user.isGM; formData.data.isGM = game.user.isGM;
data.ajustementsConditions = CONFIG.RDD.ajustementsConditions; formData.ajustementsConditions = CONFIG.RDD.ajustementsConditions;
data.difficultesLibres = CONFIG.RDD.difficultesLibres; formData.difficultesLibres = CONFIG.RDD.difficultesLibres;
// low is normal, this the base used to compute the grid. // low is normal, this the base used to compute the grid.
data.data.fatigue = { formData.data.fatigue = {
malus: RdDUtility.calculMalusFatigue(data.data.sante.fatigue.value, data.data.sante.endurance.max), malus: RdDUtility.calculMalusFatigue(formData.data.sante.fatigue.value, formData.data.sante.endurance.max),
html: "<table class='table-fatigue'>" + RdDUtility.makeHTMLfatigueMatrix(data.data.sante.fatigue.value, data.data.sante.endurance.max).html() + "</table>" html: "<table class='table-fatigue'>" + RdDUtility.makeHTMLfatigueMatrix(formData.data.sante.fatigue.value, formData.data.sante.endurance.max).html() + "</table>"
} }
RdDUtility.filterItemsPerTypeForSheet(data); RdDUtility.filterItemsPerTypeForSheet(formData);
data.data.sortReserve = data.data.reve.reserve.list; formData.data.sortReserve = formData.data.reve.reserve.list;
data.data.rencontres = duplicate(data.data.reve.rencontre.list); formData.data.rencontres = duplicate(formData.data.reve.rencontre.list);
data.data.caseSpeciales = data.itemsByType['casetmr']; formData.data.caseSpeciales = formData.itemsByType['casetmr'];
RdDUtility.buildArbreDeConteneur(this, data); RdDUtility.buildArbreDeConteneur(this, formData);
data.data.surEncombrementMessage = (data.data.compteurs.surenc.value < 0) ? "Sur-Encombrement!" : ""; formData.data.surEncombrementMessage = (formData.data.compteurs.surenc.value < 0) ? "Sur-Encombrement!" : "";
data.data.vehiculesList = this.actor.buildVehiculesList(); formData.data.vehiculesList = this.actor.buildVehiculesList();
data.data.monturesList = this.actor.buildMonturesList(); formData.data.monturesList = this.actor.buildMonturesList();
data.data.suivantsList = this.actor.buildSuivantsList(); formData.data.suivantsList = this.actor.buildSuivantsList();
return data; return formData;
} }
/* -------------------------------------------- */ /* -------------------------------------------- */

View File

@ -34,20 +34,20 @@ export class RdDActorVehiculeSheet extends ActorSheet {
/* -------------------------------------------- */ /* -------------------------------------------- */
getData() { getData() {
let data = super.getData(); let formData = super.getData();
data.itemsByType = Misc.classify(data.items); formData.itemsByType = Misc.classify(formData.items);
RdDUtility.filterItemsPerTypeForSheet(data); RdDUtility.filterItemsPerTypeForSheet(formData);
RdDUtility.buildArbreDeConteneur(this, data); RdDUtility.buildArbreDeConteneur(this, formData);
this.actor.computeEncombrementTotalEtMalusArmure(); this.actor.computeEncombrementTotalEtMalusArmure();
data.data.isGM = game.user.isGM; formData.data.isGM = game.user.isGM;
data.data.surEncombrementMessage = (this.encTotal > data.capacite_encombrement) ? "Sur-Encombrement!" : ""; formData.data.surEncombrementMessage = (this.encTotal > formData.capacite_encombrement) ? "Sur-Encombrement!" : "";
console.log("DATA", data); console.log("DATA", formData);
return data; return formData;
} }
/* -------------------------------------------- */ /* -------------------------------------------- */

View File

@ -47,26 +47,26 @@ export class RdDItemSheet extends ItemSheet {
/* -------------------------------------------- */ /* -------------------------------------------- */
async getData() { async getData() {
let data = super.getData(); let formData = super.getData();
data.categorieCompetences = RdDItemCompetence.getCategorieCompetences(); formData.categorieCompetences = RdDItemCompetence.getCategorieCompetences();
if ( data.item.type == 'tache' || data.item.type == 'livre' || data.item.type == 'meditation' || data.item.type == 'oeuvre') { if ( formData.item.type == 'tache' || formData.item.type == 'livre' || formData.item.type == 'meditation' || formData.item.type == 'oeuvre') {
data.caracList = duplicate(game.system.model.Actor.personnage.carac); formData.caracList = duplicate(game.system.model.Actor.personnage.carac);
data.competences = await RdDUtility.loadCompendiumNames( 'foundryvtt-reve-de-dragon.competences' ); formData.competences = await RdDUtility.loadCompendiumNames( 'foundryvtt-reve-de-dragon.competences' );
} }
if (data.item.type == 'arme') { if (formData.item.type == 'arme') {
data.competences = await RdDUtility.loadCompendium( 'foundryvtt-reve-de-dragon.competences', it => RdDItemCompetence.isCompetenceArme(it)); formData.competences = await RdDUtility.loadCompendium( 'foundryvtt-reve-de-dragon.competences', it => RdDItemCompetence.isCompetenceArme(it));
} }
if ( data.item.type == 'recettealchimique' ) { if ( formData.item.type == 'recettealchimique' ) {
RdDAlchimie.processManipulation(data.item, this.actor && this.actor._id ); RdDAlchimie.processManipulation(formData.item, this.actor && this.actor._id );
} }
if ( this.actor ) { if ( this.actor ) {
data.isOwned = true; formData.isOwned = true;
data.actorId = this.actor._id; formData.actorId = this.actor._id;
} }
data.bonusCaseList = RdDItemSort.getBonusCaseList(data, true); formData.bonusCaseList = RdDItemSort.getBonusCaseList(formData, true);
data.isGM = game.user.isGM; // Pour verrouiller certaines éditions formData.isGM = game.user.isGM; // Pour verrouiller certaines éditions
return data; return formData;
} }
/* -------------------------------------------- */ /* -------------------------------------------- */

View File

@ -211,7 +211,7 @@ export class RdDCalendrier extends Application {
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
fillCalendrierData(data = {}) { fillCalendrierData(formData = {}) {
let moisKey = heuresList[this.calendrier.moisRdD]; let moisKey = heuresList[this.calendrier.moisRdD];
let heureKey = heuresList[this.calendrier.heureRdD]; let heureKey = heuresList[this.calendrier.heureRdD];
@ -219,18 +219,18 @@ export class RdDCalendrier extends Application {
const heure = heuresDef[heureKey]; const heure = heuresDef[heureKey];
//console.log(moisKey, heureKey); //console.log(moisKey, heureKey);
data.heureKey = heureKey; formData.heureKey = heureKey;
data.moisKey = moisKey; formData.moisKey = moisKey;
data.jourMois = this.calendrier.jour + 1; formData.jourMois = this.calendrier.jour + 1;
data.nomMois = mois.label; // heures et mois nommés identiques formData.nomMois = mois.label; // heures et mois nommés identiques
data.iconMois = dossierIconesHeures + mois.icon; formData.iconMois = dossierIconesHeures + mois.icon;
data.nomHeure = heure.label; formData.nomHeure = heure.label;
data.iconHeure = dossierIconesHeures + heure.icon; formData.iconHeure = dossierIconesHeures + heure.icon;
data.nomSaison = saisonsDef[mois.saison].label; formData.nomSaison = saisonsDef[mois.saison].label;
data.heureRdD = this.calendrier.heureRdD; formData.heureRdD = this.calendrier.heureRdD;
data.minutesRelative = this.calendrier.minutesRelative; formData.minutesRelative = this.calendrier.minutesRelative;
data.isGM = game.user.isGM; formData.isGM = game.user.isGM;
return data; return formData;
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
@ -301,12 +301,12 @@ export class RdDCalendrier extends Application {
/* -------------------------------------------- */ /* -------------------------------------------- */
getData() { getData() {
let data = super.getData(); let formData = super.getData();
this.fillCalendrierData(data); this.fillCalendrierData(formData);
this.setPos(this.calendrierPos); this.setPos(this.calendrierPos);
return data; return formData;
} }
/* -------------------------------------------- */ /* -------------------------------------------- */

View File

@ -279,32 +279,39 @@ export class RdDUtility {
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
static filterItemsPerTypeForSheet(data) { static filterItemsPerTypeForSheet(formData) {
data.data.materiel = this.checkNull(data.itemsByType['objet']); formData.data.materiel = this.checkNull(formData.itemsByType['objet']);
data.data.conteneurs = this.checkNull(data.itemsByType['conteneur']); formData.data.conteneurs = this.checkNull(formData.itemsByType['conteneur']);
data.data.armes = this.checkNull(data.itemsByType['arme']); formData.data.armes = this.checkNull(formData.itemsByType['arme']);
data.data.armures = this.checkNull(data.itemsByType['armure']); formData.data.armures = this.checkNull(formData.itemsByType['armure']);
data.data.livres = this.checkNull(data.itemsByType['livre']); formData.data.livres = this.checkNull(formData.itemsByType['livre']);
data.data.potions = this.checkNull(data.itemsByType['potion']); formData.data.potions = this.checkNull(formData.itemsByType['potion']);
data.data.ingredients = this.checkNull(data.itemsByType['ingredient']); formData.data.ingredients = this.checkNull(formData.itemsByType['ingredient']);
data.data.munitions = this.checkNull(data.itemsByType['munition']); formData.data.munitions = this.checkNull(formData.itemsByType['munition']);
data.data.herbes = this.checkNull(data.itemsByType['herbe']); formData.data.herbes = this.checkNull(formData.itemsByType['herbe']);
data.data.sorts = this.checkNull(data.itemsByType['sort']); formData.data.sorts = this.checkNull(formData.itemsByType['sort']);
data.data.queues = this.checkNull(data.itemsByType['queue']); formData.data.queues = this.checkNull(formData.itemsByType['queue']);
data.data.souffles = this.checkNull(data.itemsByType['souffle']); formData.data.souffles = this.checkNull(formData.itemsByType['souffle']);
data.data.ombres = this.checkNull(data.itemsByType['ombre']); formData.data.ombres = this.checkNull(formData.itemsByType['ombre']);
data.data.tetes = this.checkNull(data.itemsByType['tete']); formData.data.tetes = this.checkNull(formData.itemsByType['tete']);
data.data.taches = this.checkNull(data.itemsByType['tache']); formData.data.taches = this.checkNull(formData.itemsByType['tache']);
data.data.monnaie = this.checkNull(data.itemsByType['monnaie']); formData.data.monnaie = this.checkNull(formData.itemsByType['monnaie']);
data.data.meditations = this.checkNull(data.itemsByType['meditation']); formData.data.meditations = this.checkNull(formData.itemsByType['meditation']);
data.data.chants = this.checkNull(data.itemsByType['chant']); formData.data.chants = this.checkNull(formData.itemsByType['chant']);
data.data.danses = this.checkNull(data.itemsByType['danse']); formData.data.danses = this.checkNull(formData.itemsByType['danse']);
data.data.musiques = this.checkNull(data.itemsByType['musique']); formData.data.musiques = this.checkNull(formData.itemsByType['musique']);
data.data.oeuvres = this.checkNull(data.itemsByType['oeuvre']); formData.data.oeuvres = this.checkNull(formData.itemsByType['oeuvre']);
data.data.jeux = this.checkNull(data.itemsByType['jeu']); formData.data.jeux = this.checkNull(formData.itemsByType['jeu']);
data.data.recettescuisine = this.checkNull(data.itemsByType['recettecuisine']); formData.data.recettescuisine = this.checkNull(formData.itemsByType['recettecuisine']);
data.data.recettesAlchimiques = this.checkNull(data.itemsByType['recettealchimique']); formData.data.recettesAlchimiques = this.checkNull(formData.itemsByType['recettealchimique']);
data.data.objets = data.data.conteneurs.concat(data.data.materiel).concat(data.data.armes).concat(data.data.armures).concat(data.data.munitions).concat(data.data.livres).concat(data.data.potions).concat(data.data.herbes).concat(data.data.ingredients); formData.data.objets = formData.data.conteneurs.concat(formData.data.materiel)
.concat(formData.data.armes)
.concat(formData.data.armures)
.concat(formData.data.munitions)
.concat(formData.data.livres)
.concat(formData.data.potions)
.concat(formData.data.herbes)
.concat(formData.data.ingredients);
} }
/* -------------------------------------------- */ /* -------------------------------------------- */

View File

@ -50,14 +50,14 @@ export class ReglesOptionelles extends FormApplication {
} }
getData() { getData() {
let data = super.getData(); let formData = super.getData();
data.regles = listeReglesOptionelles.map(it => { formData.regles = listeReglesOptionelles.map(it => {
let r = duplicate(it); let r = duplicate(it);
r.id = ReglesOptionelles._getIdRegle(r.name); r.id = ReglesOptionelles._getIdRegle(r.name);
r.active = ReglesOptionelles.isUsing(r.name); r.active = ReglesOptionelles.isUsing(r.name);
return r; return r;
}) })
return data; return formData;
} }
static isUsing(name) { static isUsing(name) {

View File

@ -103,9 +103,9 @@ class StatusEffectsSettings extends FormApplication {
} }
getData() { getData() {
let data = super.getData(); let formData = super.getData();
data.effects = CONFIG.RDD.allEffects; formData.effects = CONFIG.RDD.allEffects;
return data; return formData;
} }
activateListeners(html) { activateListeners(html) {