Simplification des feuilles de créatures
* Homogénisation des fiches de créatures / entités * Regroupement d'onglets (peu de compétences/caracs) * ajout du bouton vue détaillée/simplifiée pour toutes les feuilles * la santé des créatures est dans l'en-tête * bouton pour boire pour els personnages * agrandissement des caractéristiques dérivées
This commit is contained in:
@ -37,7 +37,7 @@ export class RdDActorSheet extends ActorSheet {
|
||||
/* -------------------------------------------- */
|
||||
async getData() {
|
||||
this.timerRecherche = undefined;
|
||||
|
||||
|
||||
let formData = {
|
||||
title: this.title,
|
||||
id: this.actor.id,
|
||||
@ -51,72 +51,70 @@ export class RdDActorSheet extends ActorSheet {
|
||||
limited: this.actor.limited,
|
||||
options: this.options,
|
||||
owner: this.actor.isOwner,
|
||||
biographie: await TextEditor.enrichHTML(this.object.system.biographie, {async: true}),
|
||||
notes: await TextEditor.enrichHTML(this.object.system.notes, {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: {
|
||||
encTotal: await this.actor.computeEncombrementTotalEtMalusArmure(),
|
||||
prixTotalEquipement: this.actor.computePrixTotalEquipement(),
|
||||
surprise: RdDBonus.find(this.actor.getSurprise(false)).descr,
|
||||
resumeBlessures: this.actor.computeResumeBlessure(this.actor.system.blessures),
|
||||
caracTotal: RdDCarac.computeTotal(this.actor.system.carac, this.actor.system.beaute),
|
||||
surEncombrementMessage: this.actor.getMessageSurEncombrement(),
|
||||
},
|
||||
}
|
||||
formData.options.isGM = game.user.isGM;
|
||||
|
||||
RdDUtility.filterItemsPerTypeForSheet(formData, this.actor.itemTypes);
|
||||
|
||||
formData.options.isGM = game.user.isGM;
|
||||
|
||||
if (formData.type == 'creature') return formData; // Shortcut
|
||||
|
||||
formData.byCateg = Misc.classify(formData.competences, it => it.system.categorie)
|
||||
|
||||
formData.calc = {
|
||||
comptageArchetype: RdDItemCompetence.computeResumeArchetype(formData.competences),
|
||||
competenceXPTotal: RdDItemCompetence.computeTotalXP(formData.competences),
|
||||
caracTotal: RdDCarac.computeTotal(formData.system.carac, formData.system.beaute),
|
||||
// Mise à jour de l'encombrement total et du prix de l'équipement
|
||||
encTotal: await this.actor.computeEncombrementTotalEtMalusArmure(),
|
||||
prixTotalEquipement: this.actor.computePrixTotalEquipement(),
|
||||
surprise: RdDBonus.find(this.actor.getSurprise(false)).descr,
|
||||
fatigue: RdDUtility.calculFatigueHtml(formData.system.sante.fatigue.value, formData.system.sante.endurance.max),
|
||||
resumeBlessures: this.actor.computeResumeBlessure(formData.system.blessures),
|
||||
surEncombrementMessage: this.actor.getMessageSurEncombrement()
|
||||
};
|
||||
|
||||
formData.competences.forEach(item => {
|
||||
item.system.isVisible = this.options.recherche
|
||||
? RdDItemCompetence.nomContientTexte(item, this.options.recherche.text)
|
||||
: (!this.options.showCompNiveauBase || !RdDItemCompetence.isNiveauBase(item));
|
||||
RdDItemCompetence.levelUp(item, formData.system.compteurs.experience.value);
|
||||
});
|
||||
Object.values(formData.system.carac).forEach(c => {
|
||||
RdDCarac.levelUp(c);
|
||||
});
|
||||
|
||||
|
||||
// toujours avoir une liste d'armes (pour mettre esquive et corps à corps)
|
||||
formData.combat = duplicate(formData.armes ?? []);
|
||||
RdDItemArme.computeNiveauArmes(formData.combat, formData.competences);
|
||||
RdDItemArme.ajoutCorpsACorps(formData.combat, formData.competences, formData.system.carac);
|
||||
formData.esquives = this.actor.getCompetences("Esquive");
|
||||
formData.combat = RdDCombatManager.listActionsArmes(formData.combat, formData.competences, formData.system.carac);
|
||||
|
||||
this.armesList = formData.combat;
|
||||
|
||||
// Common data
|
||||
formData.ajustementsConditions = CONFIG.RDD.ajustementsConditions;
|
||||
formData.difficultesLibres = CONFIG.RDD.difficultesLibres;
|
||||
|
||||
formData.hautreve = {
|
||||
isDemiReve: this.actor.getEffect(STATUSES.StatusDemiReve),
|
||||
rencontres: duplicate(formData.system.reve.rencontre.list),
|
||||
cacheTMR: this.actor.isTMRCache()
|
||||
}
|
||||
|
||||
this.objetVersConteneur = RdDUtility.buildArbreDeConteneurs(formData.conteneurs, formData.objets);
|
||||
formData.conteneurs = RdDUtility.conteneursRacine(formData.conteneurs);
|
||||
|
||||
formData.subacteurs = {
|
||||
vehicules: this.actor.listeVehicules(),
|
||||
montures: this.actor.listeMontures(),
|
||||
suivants: this.actor.listeSuivants()
|
||||
}
|
||||
if (this.actor.getBestDraconic().system.niveau > -11 && !this.actor.isHautRevant()) {
|
||||
ui.notifications.error(`${this.actor.name} a des compétences draconiques, mais pas le don de Haut-Rêve!
|
||||
<br>Ajoutez-lui la tête "Don de Haut-Rêve" pour lui permettre d'utiliser ses compétences et d'accéder aux terres médianes du rêve`);
|
||||
if (formData.type == 'personnage') {
|
||||
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.competences.forEach(item => {
|
||||
item.system.isVisible = this.options.recherche
|
||||
? RdDItemCompetence.nomContientTexte(item, this.options.recherche.text)
|
||||
: (!this.options.showCompNiveauBase || !RdDItemCompetence.isNiveauBase(item));
|
||||
RdDItemCompetence.levelUp(item, formData.system.compteurs.experience.value);
|
||||
});
|
||||
|
||||
Object.values(formData.system.carac).forEach(c => {
|
||||
RdDCarac.levelUp(c);
|
||||
});
|
||||
|
||||
// toujours avoir une liste d'armes (pour mettre esquive et corps à corps)
|
||||
formData.combat = duplicate(formData.armes ?? []);
|
||||
RdDItemArme.computeNiveauArmes(formData.combat, formData.competences);
|
||||
RdDItemArme.ajoutCorpsACorps(formData.combat, formData.competences, formData.system.carac);
|
||||
formData.esquives = this.actor.getCompetences("Esquive");
|
||||
formData.combat = RdDCombatManager.listActionsArmes(formData.combat, formData.competences, formData.system.carac);
|
||||
|
||||
this.armesList = formData.combat;
|
||||
|
||||
// Common data
|
||||
formData.ajustementsConditions = CONFIG.RDD.ajustementsConditions;
|
||||
formData.difficultesLibres = CONFIG.RDD.difficultesLibres;
|
||||
|
||||
formData.hautreve = {
|
||||
isDemiReve: this.actor.getEffect(STATUSES.StatusDemiReve),
|
||||
rencontres: duplicate(formData.system.reve.rencontre.list),
|
||||
cacheTMR: this.actor.isTMRCache()
|
||||
}
|
||||
|
||||
formData.subacteurs = {
|
||||
vehicules: this.actor.listeVehicules(),
|
||||
montures: this.actor.listeMontures(),
|
||||
suivants: this.actor.listeSuivants()
|
||||
}
|
||||
if (this.actor.getBestDraconic().system.niveau > -11 && !this.actor.isHautRevant()) {
|
||||
ui.notifications.error(`${this.actor.name} a des compétences draconiques, mais pas le don de Haut-Rêve!
|
||||
<br>Ajoutez-lui la tête "Don de Haut-Rêve" pour lui permettre d'utiliser ses compétences et d'accéder aux terres médianes du rêve`);
|
||||
}
|
||||
}
|
||||
return formData;
|
||||
}
|
||||
@ -156,7 +154,6 @@ export class RdDActorSheet extends ActorSheet {
|
||||
activateListeners(html) {
|
||||
super.activateListeners(html);
|
||||
|
||||
HtmlUtility._showControlWhen($(".gm-only"), game.user.isGM);
|
||||
HtmlUtility._showControlWhen($(".appliquerFatigue"), ReglesOptionelles.isUsing("appliquer-fatigue"));
|
||||
|
||||
// Everything below here is only needed if the sheet is editable
|
||||
@ -168,7 +165,6 @@ export class RdDActorSheet extends ActorSheet {
|
||||
});
|
||||
html.find('.item-edit').click(async event => {
|
||||
const item = RdDSheetUtility.getItem(event, this.actor)
|
||||
console.log("ITEM :", item)
|
||||
item.sheet.render(true)
|
||||
})
|
||||
html.find('.display-label a').click(async event => {
|
||||
@ -497,7 +493,7 @@ export class RdDActorSheet extends ActorSheet {
|
||||
html.find('.moral-heureux').click(async event => {
|
||||
this.actor.jetDeMoral('heureuse');
|
||||
});
|
||||
html.find('#ethylisme-test').click(async event => {
|
||||
html.find('.ethylisme-test').click(async event => {
|
||||
this.actor.jetEthylisme();
|
||||
});
|
||||
|
||||
@ -570,7 +566,10 @@ export class RdDActorSheet extends ActorSheet {
|
||||
const sheetHeader = this.element.find(".sheet-header");
|
||||
const sheetTabs = this.element.find(".sheet-tabs");
|
||||
const sheetBody = this.element.find(".sheet-body");
|
||||
const bodyHeight = position.height - sheetHeader[0].clientHeight - sheetTabs[0].clientHeight;
|
||||
let bodyHeight = position.height - sheetHeader[0].clientHeight;
|
||||
if (sheetTabs.length>0) {
|
||||
bodyHeight -= sheetTabs[0].clientHeight;
|
||||
}
|
||||
sheetBody.css("height", bodyHeight);
|
||||
return position;
|
||||
}
|
||||
|
Reference in New Issue
Block a user