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 @@ -
-
+
+

@@ -40,4 +40,4 @@

description

{{editor system.description target="system.description" rollData=rollData button=true owner=owner editable=editable}} - +
diff --git a/templates/item/item-background-sheet.hbs b/templates/item/item-background-sheet.hbs index 71a98da..a2ae6c1 100644 --- a/templates/item/item-background-sheet.hbs +++ b/templates/item/item-background-sheet.hbs @@ -1,8 +1,5 @@ -
-
+
+
description {{editor system.description target="system.description" rollData=rollData button=true owner=owner editable=editable}} -
- - - \ No newline at end of file +
\ No newline at end of file diff --git a/templates/item/item-defense-sheet.hbs b/templates/item/item-defense-sheet.hbs index 6886b50..87f3c63 100644 --- a/templates/item/item-defense-sheet.hbs +++ b/templates/item/item-defense-sheet.hbs @@ -1,5 +1,5 @@ -
- {{> "systems/vermine2047/templates/item/partials/header.hbs"}} +
+{{> "systems/vermine2047/templates/item/partials/header.hbs"}} {{log this}}
@@ -51,4 +51,4 @@ {{> "systems/vermine2047/templates/item/partials/physicalItems.hbs"}}
- +
diff --git a/templates/item/item-evolution-sheet.hbs b/templates/item/item-evolution-sheet.hbs index 3f6338e..04129c0 100644 --- a/templates/item/item-evolution-sheet.hbs +++ b/templates/item/item-evolution-sheet.hbs @@ -1,5 +1,5 @@ -
-
+
+

@@ -17,5 +17,4 @@ {{editor system.description target="system.description" rollData=rollData button=true owner=owner editable=editable}} - - +
diff --git a/templates/item/item-item-sheet.hbs b/templates/item/item-item-sheet.hbs index 26c69f0..3c55a21 100644 --- a/templates/item/item-item-sheet.hbs +++ b/templates/item/item-item-sheet.hbs @@ -1,5 +1,5 @@ -
- {{log this}} +
+{{log this}} {{> "systems/vermine2047/templates/item/partials/header.hbs"}} @@ -35,4 +35,4 @@ {{> "systems/vermine2047/templates/item/partials/physicalItems.hbs"}} - +
diff --git a/templates/item/item-rite-sheet.hbs b/templates/item/item-rite-sheet.hbs index bc08c20..529e5a6 100644 --- a/templates/item/item-rite-sheet.hbs +++ b/templates/item/item-rite-sheet.hbs @@ -1,7 +1,7 @@ +
{{!-- This template is a fallback for when items don't have more specific templates. --}} {{!-- Generally, you'll want to make more specific templates when possible. --}} -
- {{> "systems/vermine2047/templates/item/partials/header.hbs"}} +{{> "systems/vermine2047/templates/item/partials/header.hbs"}} {{!-- Sheet Body --}} @@ -37,5 +37,5 @@
{{editor system.effects target="system.effects" button=true owner=owner editable=editable}}
-
- + +
diff --git a/templates/item/item-rumor-sheet.hbs b/templates/item/item-rumor-sheet.hbs index 49397f7..66f2c5d 100644 --- a/templates/item/item-rumor-sheet.hbs +++ b/templates/item/item-rumor-sheet.hbs @@ -1,5 +1,5 @@ -
- {{> "systems/vermine2047/templates/item/partials/header.hbs"}} +
+{{> "systems/vermine2047/templates/item/partials/header.hbs"}} {{!-- Sheet Body --}} @@ -8,4 +8,4 @@ {{editor system.description target="system.description" rollData=rollData button=true owner=owner editable=editable}} - +
diff --git a/templates/item/item-sheet.hbs b/templates/item/item-sheet.hbs index d247dbc..3f46767 100644 --- a/templates/item/item-sheet.hbs +++ b/templates/item/item-sheet.hbs @@ -1,7 +1,7 @@ {{!-- This template is a fallback for when items don't have more specific templates. --}} {{!-- Generally, you'll want to make more specific templates when possible. --}} -
-
+
+

@@ -27,4 +27,4 @@ {{!-- As you add new fields, add them in here! --}}
- +
diff --git a/templates/item/item-specialty-sheet.hbs b/templates/item/item-specialty-sheet.hbs index fcab41a..2e26b45 100644 --- a/templates/item/item-specialty-sheet.hbs +++ b/templates/item/item-specialty-sheet.hbs @@ -1,8 +1,5 @@ -
- {{log this}} +
+{{log this}}
- - \ No newline at end of file +
\ No newline at end of file diff --git a/templates/item/item-target-sheet.hbs b/templates/item/item-target-sheet.hbs index 49397f7..66f2c5d 100644 --- a/templates/item/item-target-sheet.hbs +++ b/templates/item/item-target-sheet.hbs @@ -1,5 +1,5 @@ -
- {{> "systems/vermine2047/templates/item/partials/header.hbs"}} +
+{{> "systems/vermine2047/templates/item/partials/header.hbs"}} {{!-- Sheet Body --}} @@ -8,4 +8,4 @@ {{editor system.description target="system.description" rollData=rollData button=true owner=owner editable=editable}} - +
diff --git a/templates/item/item-trauma-sheet.hbs b/templates/item/item-trauma-sheet.hbs index d7e22ba..d85073a 100644 --- a/templates/item/item-trauma-sheet.hbs +++ b/templates/item/item-trauma-sheet.hbs @@ -1,5 +1,5 @@ -
- {{> "systems/vermine2047/templates/item/partials/header.hbs"}} +
+{{> "systems/vermine2047/templates/item/partials/header.hbs"}} {{!-- Sheet Body --}} @@ -20,5 +20,4 @@ button=true owner=owner editable=editable}}
- -
+ diff --git a/templates/item/item-vehicle-sheet.hbs b/templates/item/item-vehicle-sheet.hbs index cdf85f3..97e639b 100644 --- a/templates/item/item-vehicle-sheet.hbs +++ b/templates/item/item-vehicle-sheet.hbs @@ -1,5 +1,5 @@ -
- {{> "systems/vermine2047/templates/item/partials/header.hbs"}} +
+{{> "systems/vermine2047/templates/item/partials/header.hbs"}}
@@ -20,4 +20,4 @@
- +
diff --git a/templates/item/item-weapon-sheet.hbs b/templates/item/item-weapon-sheet.hbs index 7516715..705fb3b 100644 --- a/templates/item/item-weapon-sheet.hbs +++ b/templates/item/item-weapon-sheet.hbs @@ -1,5 +1,5 @@ -
- {{> "systems/vermine2047/templates/item/partials/header.hbs"}} +
+{{> "systems/vermine2047/templates/item/partials/header.hbs"}}
@@ -51,5 +51,4 @@ {{> "systems/vermine2047/templates/item/partials/physicalItems.hbs"}}
- - +