Fix: afficher les vues détaillées

This commit is contained in:
2023-11-06 23:02:22 +01:00
parent 249d171511
commit 2373acc295
9 changed files with 59 additions and 85 deletions

View File

@ -8,7 +8,14 @@ import { RdDBaseActorSheet } from "./base-actor-sheet.js";
*/
export class RdDBaseActorReveSheet extends RdDBaseActorSheet {
/* -------------------------------------------- */
/** @override */
static get defaultOptions() {
return mergeObject(RdDBaseActorSheet.defaultOptions, {
width: 550
});
}
/* -------------------------------------------- */
/** @override */
activateListeners(html) {
super.activateListeners(html);
@ -16,11 +23,6 @@ export class RdDBaseActorReveSheet extends RdDBaseActorSheet {
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) return;
this.html.find('.item-action').click(async event => {
const item = RdDSheetUtility.getItem(event, this.actor);
item?.actionPrincipale(this.actor, async () => this.render())
});
this.html.find('.encaisser-direct').click(async event => {
this.actor.encaisser();
})
@ -51,25 +53,6 @@ export class RdDBaseActorReveSheet extends RdDBaseActorSheet {
}
});
if (this.options.vueDetaillee) {
// On carac change
this.html.find('.carac-value').change(async event => {
let caracName = event.currentTarget.name.replace(".value", "").replace("system.carac.", "");
this.actor.updateCarac(caracName, parseInt(event.target.value));
});
// On competence change
this.html.find('.competence-value').change(async event => {
let compName = event.currentTarget.attributes.compname.value;
//console.log("Competence changed :", compName);
this.actor.updateCompetence(compName, parseInt(event.target.value));
});
}
this.html.find('.vue-detaillee').click(async event => {
this.options.vueDetaillee = !this.options.vueDetaillee;
this.render(true);
});
this.html.find('.endurance-plus').click(async event => {
this.actor.santeIncDec("endurance", 1);
});