2021-01-10 22:12:07 +01:00
|
|
|
import { RdDUtility } from "./rdd-utility.js";
|
2022-10-05 19:29:16 +02:00
|
|
|
import { RdDActorSheet } from "./actor-sheet.js";
|
2021-01-10 22:12:07 +01:00
|
|
|
|
2022-01-01 14:01:41 +01:00
|
|
|
/* -------------------------------------------- */
|
2022-10-05 19:29:16 +02:00
|
|
|
export class RdDActorVehiculeSheet extends RdDActorSheet {
|
2021-01-10 22:12:07 +01:00
|
|
|
|
|
|
|
/** @override */
|
2022-01-01 14:01:41 +01:00
|
|
|
static get defaultOptions() {
|
2021-01-10 22:12:07 +01:00
|
|
|
RdDUtility.initAfficheContenu();
|
|
|
|
|
2022-01-01 14:01:41 +01:00
|
|
|
return mergeObject(super.defaultOptions, {
|
|
|
|
classes: ["rdd", "sheet", "actor"],
|
|
|
|
template: "systems/foundryvtt-reve-de-dragon/templates/actor-vehicule-sheet.html",
|
2021-01-10 22:12:07 +01:00
|
|
|
width: 640,
|
|
|
|
height: 720,
|
2022-01-01 14:01:41 +01:00
|
|
|
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "carac" }],
|
2022-11-05 18:06:30 +01:00
|
|
|
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: undefined }]
|
2021-01-10 22:12:07 +01:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2022-11-28 21:01:28 +01:00
|
|
|
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);
|
|
|
|
});
|
|
|
|
}
|
2021-03-17 01:21:37 +01:00
|
|
|
|
2021-01-10 22:12:07 +01:00
|
|
|
}
|