New fixes around sheets
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user