Auto reformat

This commit is contained in:
Vincent Vandemeulebrouck 2022-12-14 20:00:35 +01:00
parent 92643d1c46
commit 1040ec1be2

View File

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