diff --git a/module/actor-sheet.js b/module/actor-sheet.js index 58cd9dc1..9fbe7f2f 100644 --- a/module/actor-sheet.js +++ b/module/actor-sheet.js @@ -12,6 +12,7 @@ import { DialogRepos } from "./dialog-repos.js"; import { RdDSheetUtility } from "./rdd-sheet-utility.js"; import { STATUSES } from "./settings/status-effects.js"; import { Monnaie } from "./item-monnaie.js"; +import { MAINS_DIRECTRICES } from "./actor.js"; /* -------------------------------------------- */ /** @@ -52,10 +53,10 @@ export class RdDActorSheet extends ActorSheet { limited: this.actor.limited, options: this.options, owner: this.actor.isOwner, - description: await TextEditor.enrichHTML(this.object.system.description, {async: true}), - biographie: await TextEditor.enrichHTML(this.object.system.biographie, {async: true}), - notes: await TextEditor.enrichHTML(this.object.system.notes, {async: true}), - notesmj: await TextEditor.enrichHTML(this.object.system.notesmj, {async: true}), + description: await TextEditor.enrichHTML(this.object.system.description, { async: true }), + biographie: await TextEditor.enrichHTML(this.object.system.biographie, { async: true }), + notes: await TextEditor.enrichHTML(this.object.system.notes, { async: true }), + notesmj: await TextEditor.enrichHTML(this.object.system.notesmj, { async: true }), calc: { fortune: Monnaie.getFortune(this.actor), encTotal: await this.actor.computeEncombrementTotalEtMalusArmure(), @@ -66,7 +67,7 @@ export class RdDActorSheet extends ActorSheet { surEncombrementMessage: this.actor.getMessageSurEncombrement(), }, } - formData.options.isGM = game.user.isGM; + formData.options.isGM = game.user.isGM; RdDUtility.filterItemsPerTypeForSheet(formData, this.actor.itemTypes); this.objetVersConteneur = RdDUtility.buildArbreDeConteneurs(formData.conteneurs, formData.objets); @@ -75,14 +76,14 @@ export class RdDActorSheet extends ActorSheet { if (formData.type == 'personnage') { formData.options.mainsDirectrices = MAINS_DIRECTRICES; formData.byCateg = Misc.classify(formData.competences, it => it.system.categorie) - formData.calc.comptageArchetype = RdDItemCompetence.computeResumeArchetype(formData.competences); - formData.calc.competenceXPTotal= RdDItemCompetence.computeTotalXP(formData.competences); - formData.calc.fatigue= RdDUtility.calculFatigueHtml(formData.system.sante.fatigue.value, formData.system.sante.endurance.max); + formData.calc.comptageArchetype = RdDItemCompetence.computeResumeArchetype(formData.competences); + formData.calc.competenceXPTotal = RdDItemCompetence.computeTotalXP(formData.competences); + formData.calc.fatigue = RdDUtility.calculFatigueHtml(formData.system.sante.fatigue.value, formData.system.sante.endurance.max); formData.competences.forEach(item => { item.system.isVisible = this.options.recherche - ? RdDItemCompetence.nomContientTexte(item, this.options.recherche.text) - : (!this.options.showCompNiveauBase || !RdDItemCompetence.isNiveauBase(item)); + ? RdDItemCompetence.nomContientTexte(item, this.options.recherche.text) + : (!this.options.showCompNiveauBase || !RdDItemCompetence.isNiveauBase(item)); RdDItemCompetence.levelUp(item, formData.system.compteurs.experience.value); }); @@ -386,7 +387,7 @@ export class RdDActorSheet extends ActorSheet { }) .keyup(async event => { const nouvelleRecherche = this._optionRecherche(event.currentTarget); - if (this.options.recherche?.text != nouvelleRecherche?.text){ + if (this.options.recherche?.text != nouvelleRecherche?.text) { this.options.recherche = nouvelleRecherche; if (this.timerRecherche) { clearTimeout(this.timerRecherche); @@ -520,7 +521,7 @@ export class RdDActorSheet extends ActorSheet { } _optionRecherche(target) { - if (!target.value?.length){ + if (!target.value?.length) { return undefined; } return { @@ -549,8 +550,8 @@ export class RdDActorSheet extends ActorSheet { const sheetTabs = this.element.find(".sheet-tabs"); const sheetBody = this.element.find(".sheet-body"); let bodyHeight = position.height - sheetHeader[0].clientHeight; - if (sheetTabs.length>0) { - bodyHeight -= sheetTabs[0].clientHeight; + if (sheetTabs.length > 0) { + bodyHeight -= sheetTabs[0].clientHeight; } sheetBody.css("height", bodyHeight); return position;