diff --git a/module/applications/sheets/base-actor-sheet.mjs b/module/applications/sheets/base-actor-sheet.mjs index fb6395a..a2b2863 100644 --- a/module/applications/sheets/base-actor-sheet.mjs +++ b/module/applications/sheets/base-actor-sheet.mjs @@ -67,7 +67,7 @@ export class VermineBaseActorSheet extends HandlebarsApplicationMixin(foundry.ap // ── Soumission du formulaire ──────────────────────────────────────── /** @override - coerce string values from HTML form inputs to numbers */ - _prepareSubmitData(submitData, form, formData) { + _prepareSubmitData(event, form, formData, updateData) { const fd = foundry.utils.deepClone(formData.object) for (const [key, value] of Object.entries(fd)) { @@ -131,6 +131,7 @@ export class VermineBaseActorSheet extends HandlebarsApplicationMixin(foundry.ap // ── Actions ───────────────────────────────────────────────────────── _onRender(context, options) { + super._onRender(context, options) // Activate initial tabs (force to bypass changeTab's early-return when the // tab is already set as active in tabGroups — Foundry v12 doesn't call // changeTab on initial render, so the active class is never applied) @@ -151,7 +152,7 @@ export class VermineBaseActorSheet extends HandlebarsApplicationMixin(foundry.ap } /** @override */ - async _onDropItem(item) { + async _onDropItem(event, item) { const doc = item instanceof foundry.abstract.Document ? item : await fromUuid(item.uuid) if (!doc) return const itemData = doc.toObject() diff --git a/module/applications/sheets/base-item-sheet.mjs b/module/applications/sheets/base-item-sheet.mjs index eaedf12..0d883d9 100644 --- a/module/applications/sheets/base-item-sheet.mjs +++ b/module/applications/sheets/base-item-sheet.mjs @@ -78,6 +78,13 @@ export class VermineBaseItemSheet extends HandlebarsApplicationMixin(foundry.app this.#dragDrop.forEach(d => d.bind(this.element)) } + // ── Sauvegarde ─────────────────────────────────────────────────────── + + /** @override */ + _prepareSubmitData(event, form, formData, updateData) { + return super._prepareSubmitData(event, form, formData, updateData) + } + // ── Actions ───────────────────────────────────────────────────────── static #onToggleSheet() { diff --git a/module/system/roll.mjs b/module/system/roll.mjs index f35dbb2..c612c55 100644 --- a/module/system/roll.mjs +++ b/module/system/roll.mjs @@ -266,7 +266,8 @@ export class VermineUtils { */ static async onReroll(message, ev) { // Verify user permissions - if (game.user?._id !== message.user._id && !game.user?.isGM) { + const msgUserId = message.user?.id ?? message.user; + if (msgUserId !== game.user?.id && !game.user?.isGM) { ui.notifications.warn(game.i18n.localize('VERMINE.error_cannot_reroll')); return false; } diff --git a/templates/item/item-ability-sheet.hbs b/templates/item/item-ability-sheet.hbs index 5e9bed2..0d2944c 100644 --- a/templates/item/item-ability-sheet.hbs +++ b/templates/item/item-ability-sheet.hbs @@ -1,5 +1,5 @@ -