foundryvtt-reve-de-dragon/module/actor-vehicule-sheet.js
2022-11-29 11:37:49 +01:00

40 lines
1.2 KiB
JavaScript

import { RdDUtility } from "./rdd-utility.js";
import { RdDActorSheet } from "./actor-sheet.js";
/* -------------------------------------------- */
export class RdDActorVehiculeSheet extends RdDActorSheet {
/** @override */
static get defaultOptions() {
RdDUtility.initAfficheContenu();
return mergeObject(super.defaultOptions, {
classes: ["rdd", "sheet", "actor"],
template: "systems/foundryvtt-reve-de-dragon/templates/actor-vehicule-sheet.html",
width: 640,
height: 720,
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "carac" }],
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: undefined }]
});
}
activateListeners(html) {
super.activateListeners(html);
if (!this.options.editable) return;
html.find('.resistance-moins').click(async event => {
this.actor.vehicleIncDec("resistance", -1);
});
html.find('.resistance-plus').click(async event => {
this.actor.vehicleIncDec("resistance", 1);
});
html.find('.structure-moins').click(async event => {
this.actor.vehicleIncDec("structure", -1);
});
html.find('.structure-plus').click(async event => {
this.actor.vehicleIncDec("structure", 1);
});
}
}