New fixes around sheets
This commit is contained in:
@@ -67,7 +67,7 @@ export class VermineBaseActorSheet extends HandlebarsApplicationMixin(foundry.ap
|
|||||||
// ── Soumission du formulaire ────────────────────────────────────────
|
// ── Soumission du formulaire ────────────────────────────────────────
|
||||||
|
|
||||||
/** @override - coerce string values from HTML form inputs to numbers */
|
/** @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)
|
const fd = foundry.utils.deepClone(formData.object)
|
||||||
|
|
||||||
for (const [key, value] of Object.entries(fd)) {
|
for (const [key, value] of Object.entries(fd)) {
|
||||||
@@ -131,6 +131,7 @@ export class VermineBaseActorSheet extends HandlebarsApplicationMixin(foundry.ap
|
|||||||
// ── Actions ─────────────────────────────────────────────────────────
|
// ── Actions ─────────────────────────────────────────────────────────
|
||||||
|
|
||||||
_onRender(context, options) {
|
_onRender(context, options) {
|
||||||
|
super._onRender(context, options)
|
||||||
// Activate initial tabs (force to bypass changeTab's early-return when the
|
// 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
|
// tab is already set as active in tabGroups — Foundry v12 doesn't call
|
||||||
// changeTab on initial render, so the active class is never applied)
|
// changeTab on initial render, so the active class is never applied)
|
||||||
@@ -151,7 +152,7 @@ export class VermineBaseActorSheet extends HandlebarsApplicationMixin(foundry.ap
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** @override */
|
/** @override */
|
||||||
async _onDropItem(item) {
|
async _onDropItem(event, item) {
|
||||||
const doc = item instanceof foundry.abstract.Document ? item : await fromUuid(item.uuid)
|
const doc = item instanceof foundry.abstract.Document ? item : await fromUuid(item.uuid)
|
||||||
if (!doc) return
|
if (!doc) return
|
||||||
const itemData = doc.toObject()
|
const itemData = doc.toObject()
|
||||||
|
|||||||
@@ -78,6 +78,13 @@ export class VermineBaseItemSheet extends HandlebarsApplicationMixin(foundry.app
|
|||||||
this.#dragDrop.forEach(d => d.bind(this.element))
|
this.#dragDrop.forEach(d => d.bind(this.element))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ── Sauvegarde ───────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
/** @override */
|
||||||
|
_prepareSubmitData(event, form, formData, updateData) {
|
||||||
|
return super._prepareSubmitData(event, form, formData, updateData)
|
||||||
|
}
|
||||||
|
|
||||||
// ── Actions ─────────────────────────────────────────────────────────
|
// ── Actions ─────────────────────────────────────────────────────────
|
||||||
|
|
||||||
static #onToggleSheet() {
|
static #onToggleSheet() {
|
||||||
|
|||||||
@@ -266,7 +266,8 @@ export class VermineUtils {
|
|||||||
*/
|
*/
|
||||||
static async onReroll(message, ev) {
|
static async onReroll(message, ev) {
|
||||||
// Verify user permissions
|
// 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'));
|
ui.notifications.warn(game.i18n.localize('VERMINE.error_cannot_reroll'));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<form class="{{cssClass}}" autocomplete="off">
|
<div class="{{cssClass}}">
|
||||||
<header class="sheet-header">
|
<header class="sheet-header">
|
||||||
<img class="profile-img" src="{{item.img}}" data-edit="img" title="{{item.name}}"/>
|
<img class="profile-img" src="{{item.img}}" data-edit="img" title="{{item.name}}"/>
|
||||||
<div class="header-fields">
|
<div class="header-fields">
|
||||||
@@ -40,4 +40,4 @@
|
|||||||
<h4>description</h4>
|
<h4>description</h4>
|
||||||
{{editor system.description target="system.description" rollData=rollData button=true owner=owner editable=editable}}
|
{{editor system.description target="system.description" rollData=rollData button=true owner=owner editable=editable}}
|
||||||
</section>
|
</section>
|
||||||
</form>
|
</div>
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
<form
|
<div class="{{cssClass}}">
|
||||||
class="{{cssClass}}"
|
|
||||||
autocomplete="off"
|
|
||||||
>
|
|
||||||
<header class="sheet-header">
|
<header class="sheet-header">
|
||||||
<img
|
<img
|
||||||
class="profile-img"
|
class="profile-img"
|
||||||
@@ -36,8 +33,5 @@
|
|||||||
<h4>description</h4>
|
<h4>description</h4>
|
||||||
{{editor system.description target="system.description" rollData=rollData button=true owner=owner editable=editable}}
|
{{editor system.description target="system.description" rollData=rollData button=true owner=owner editable=editable}}
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
|
</div>
|
||||||
</form>
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
<form class="{{cssClass}}" autocomplete="off">
|
<div class="{{cssClass}}">
|
||||||
{{> "systems/vermine2047/templates/item/partials/header.hbs"}}
|
{{> "systems/vermine2047/templates/item/partials/header.hbs"}}
|
||||||
{{log this}}
|
{{log this}}
|
||||||
|
|
||||||
@@ -51,4 +51,4 @@
|
|||||||
{{> "systems/vermine2047/templates/item/partials/physicalItems.hbs"}}
|
{{> "systems/vermine2047/templates/item/partials/physicalItems.hbs"}}
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
</form>
|
</div>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<form class="{{cssClass}}" autocomplete="off">
|
<div class="{{cssClass}}">
|
||||||
<header class="sheet-header">
|
<header class="sheet-header">
|
||||||
<img class="profile-img" src="{{item.img}}" data-edit="img" title="{{item.name}}"/>
|
<img class="profile-img" src="{{item.img}}" data-edit="img" title="{{item.name}}"/>
|
||||||
<div class="header-fields">
|
<div class="header-fields">
|
||||||
@@ -17,5 +17,4 @@
|
|||||||
|
|
||||||
{{editor system.description target="system.description" rollData=rollData button=true owner=owner editable=editable}}
|
{{editor system.description target="system.description" rollData=rollData button=true owner=owner editable=editable}}
|
||||||
</section>
|
</section>
|
||||||
|
</div>
|
||||||
</form>
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<form class="{{cssClass}}" autocomplete="off">
|
<div class="{{cssClass}}">
|
||||||
{{log this}}
|
{{log this}}
|
||||||
{{> "systems/vermine2047/templates/item/partials/header.hbs"}}
|
{{> "systems/vermine2047/templates/item/partials/header.hbs"}}
|
||||||
|
|
||||||
@@ -35,4 +35,4 @@
|
|||||||
{{> "systems/vermine2047/templates/item/partials/physicalItems.hbs"}}
|
{{> "systems/vermine2047/templates/item/partials/physicalItems.hbs"}}
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
</form>
|
</div>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
|
<div class="{{cssClass}}">
|
||||||
{{!-- This template is a fallback for when items don't have more specific templates. --}}
|
{{!-- 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. --}}
|
{{!-- Generally, you'll want to make more specific templates when possible. --}}
|
||||||
<form class="{{cssClass}} form" autocomplete="off">
|
|
||||||
{{> "systems/vermine2047/templates/item/partials/header.hbs"}}
|
{{> "systems/vermine2047/templates/item/partials/header.hbs"}}
|
||||||
|
|
||||||
|
|
||||||
@@ -37,5 +37,5 @@
|
|||||||
<div class="editor-wrapper">
|
<div class="editor-wrapper">
|
||||||
{{editor system.effects target="system.effects" button=true owner=owner editable=editable}}
|
{{editor system.effects target="system.effects" button=true owner=owner editable=editable}}
|
||||||
</div>
|
</div>
|
||||||
|
</section>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<form class="{{cssClass}}" autocomplete="off">
|
<div class="{{cssClass}}">
|
||||||
{{> "systems/vermine2047/templates/item/partials/header.hbs"}}
|
{{> "systems/vermine2047/templates/item/partials/header.hbs"}}
|
||||||
|
|
||||||
|
|
||||||
@@ -8,4 +8,4 @@
|
|||||||
{{editor system.description target="system.description" rollData=rollData button=true owner=owner editable=editable}}
|
{{editor system.description target="system.description" rollData=rollData button=true owner=owner editable=editable}}
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
</form>
|
</div>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{{!-- This template is a fallback for when items don't have more specific templates. --}}
|
{{!-- 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. --}}
|
{{!-- Generally, you'll want to make more specific templates when possible. --}}
|
||||||
<form class="{{cssClass}}" autocomplete="off">
|
<div class="{{cssClass}}">
|
||||||
<header class="sheet-header">
|
<header class="sheet-header">
|
||||||
<img class="profile-img" src="{{item.img}}" data-edit="img" title="{{item.name}}"/>
|
<img class="profile-img" src="{{item.img}}" data-edit="img" title="{{item.name}}"/>
|
||||||
<div class="header-fields">
|
<div class="header-fields">
|
||||||
@@ -27,4 +27,4 @@
|
|||||||
{{!-- As you add new fields, add them in here! --}}
|
{{!-- As you add new fields, add them in here! --}}
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</form>
|
</div>
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
<form
|
<div class="{{cssClass}}">
|
||||||
class="{{cssClass}}"
|
|
||||||
autocomplete="off"
|
|
||||||
>
|
|
||||||
{{log this}}
|
{{log this}}
|
||||||
<header class="sheet-header">
|
<header class="sheet-header">
|
||||||
<img
|
<img
|
||||||
@@ -47,5 +44,4 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
</div>
|
||||||
</form>
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
<form class="{{cssClass}}" autocomplete="off">
|
<div class="{{cssClass}}">
|
||||||
{{> "systems/vermine2047/templates/item/partials/header.hbs"}}
|
{{> "systems/vermine2047/templates/item/partials/header.hbs"}}
|
||||||
|
|
||||||
|
|
||||||
@@ -8,4 +8,4 @@
|
|||||||
{{editor system.description target="system.description" rollData=rollData button=true owner=owner editable=editable}}
|
{{editor system.description target="system.description" rollData=rollData button=true owner=owner editable=editable}}
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
</form>
|
</div>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<form class="{{cssClass}}" autocomplete="off">
|
<div class="{{cssClass}}">
|
||||||
{{> "systems/vermine2047/templates/item/partials/header.hbs"}}
|
{{> "systems/vermine2047/templates/item/partials/header.hbs"}}
|
||||||
|
|
||||||
|
|
||||||
@@ -20,5 +20,4 @@ button=true owner=owner editable=editable}}
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
</div>
|
||||||
</form>
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<form class="{{cssClass}}" autocomplete="off">
|
<div class="{{cssClass}}">
|
||||||
{{> "systems/vermine2047/templates/item/partials/header.hbs"}}
|
{{> "systems/vermine2047/templates/item/partials/header.hbs"}}
|
||||||
|
|
||||||
|
|
||||||
@@ -20,4 +20,4 @@
|
|||||||
|
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
</form>
|
</div>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<form class="{{cssClass}}" autocomplete="off">
|
<div class="{{cssClass}}">
|
||||||
{{> "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"}}
|
{{> "systems/vermine2047/templates/item/partials/physicalItems.hbs"}}
|
||||||
</section>
|
</section>
|
||||||
|
</div>
|
||||||
</form>
|
|
||||||
|
|||||||
Reference in New Issue
Block a user