2023-03-10 22:37:21 +01:00
|
|
|
import { RdDItemSheet } from "../item-sheet.js";
|
|
|
|
|
|
|
|
export class RdDBlessureItemSheet extends RdDItemSheet {
|
|
|
|
|
|
|
|
static get ITEM_TYPE() { return "blessure" };
|
|
|
|
|
|
|
|
async getData() {
|
|
|
|
const formData = await super.getData();
|
|
|
|
formData.disabled = formData.options.isGM || formData.options.isOwned ? '' : 'disabled';
|
|
|
|
return formData;
|
|
|
|
}
|
|
|
|
|
|
|
|
activateListeners(html) {
|
|
|
|
super.activateListeners(html);
|
2023-03-10 22:41:11 +01:00
|
|
|
|
|
|
|
if (!this.options.editable) return;
|
|
|
|
|
|
|
|
this.html.find('[name="premierssoins-done"]').change(async event => {
|
|
|
|
await this.item.setSoinsBlessure({ premierssoins: { done: event.currentTarget.checked } });
|
|
|
|
});
|
|
|
|
this.html.find('[name="soinscomplets-done"]').change(async event => {
|
|
|
|
await this.item.setSoinsBlessure({ soinscomplets: { done: event.currentTarget.checked } })
|
|
|
|
});
|
|
|
|
this.html.find('[name="system-gravite"]').change(async event => {
|
|
|
|
const gravite = Number(event.currentTarget.value)
|
|
|
|
await this.item.setSoinsBlessure({ gravite: gravite, difficulte: - gravite })
|
|
|
|
});
|
2023-03-10 22:37:21 +01:00
|
|
|
}
|
|
|
|
}
|