From 2143bcc8db402ddc2b40d2a20ebb489d689ab8e3 Mon Sep 17 00:00:00 2001 From: LeRatierBretonnier Date: Sat, 6 Jun 2026 16:25:00 +0200 Subject: [PATCH] Actor sheet -> working !!!, not WIP for rolls --- module/applications/sheets/base-actor-sheet.mjs | 7 ++++++- module/applications/sheets/character-sheet.mjs | 1 - templates/actor/appv2/character-main.hbs | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/module/applications/sheets/base-actor-sheet.mjs b/module/applications/sheets/base-actor-sheet.mjs index 7b44ade..fb6395a 100644 --- a/module/applications/sheets/base-actor-sheet.mjs +++ b/module/applications/sheets/base-actor-sheet.mjs @@ -131,7 +131,12 @@ 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) + for (const [group, tab] of Object.entries(this.tabGroups ?? {})) { + this.changeTab(tab, group, {force: true}) + } this.#dragDrop.forEach(d => d.bind(this.element)) this.element.querySelectorAll(".rollable").forEach(el => { el.addEventListener("click", this._onRoll.bind(this)) diff --git a/module/applications/sheets/character-sheet.mjs b/module/applications/sheets/character-sheet.mjs index b07cfd8..b24bee6 100644 --- a/module/applications/sheets/character-sheet.mjs +++ b/module/applications/sheets/character-sheet.mjs @@ -12,7 +12,6 @@ export class VermineCharacterSheetV2 extends VermineBaseActorSheet { } static PARTS = { - header: { template: "systems/vermine2047/templates/actor/appv2/character-header.hbs" }, main: { template: "systems/vermine2047/templates/actor/appv2/character-main.hbs" }, tabs: { template: "templates/generic/tab-navigation.hbs" }, abilities: { template: "systems/vermine2047/templates/actor/appv2/character-abilities.hbs" }, diff --git a/templates/actor/appv2/character-main.hbs b/templates/actor/appv2/character-main.hbs index b9e07cc..dbbf9d9 100644 --- a/templates/actor/appv2/character-main.hbs +++ b/templates/actor/appv2/character-main.hbs @@ -1,4 +1,5 @@
+ {{> "systems/vermine2047/templates/actor/appv2/character-header.hbs"}} {{!-- Toggle Edit/Play --}}
{{#if isEditMode}}