What's the best way to control default header items in a TJS application window?
I tried the ESM example:
<svelte:options accessors={true} /><script>javascript import { ApplicationShell } from "@typhonjs-fvtt/runtime/svelte/component/core"; import { setContext, getContext, onMount } from "svelte"; import { getActorOwner, ucfirst } from "~/src/helpers/utility"; import { SYSTEM_ID } from "~/src/helpers/constants"; import { localize } from "#runtime/svelte/helper"; export let elementRoot; export let documentStore; setContext("#doc", documentStore); const application = getContext("#external").application; const headerButtonNoLabel = application.reactive.storeAppOptions.headerButtonNoLabel; $: if (game.settings.get(SYSTEM_ID, "applicationWindowHeaderIconsOnly") == true) { alert('on'); $headerButtonNoLabel = true; } else { alert('off'); $headerButtonNoLabel = false }
<svelte:options accessors={true} /><script>javascript import { ApplicationShell } from "@typhonjs-fvtt/runtime/svelte/component/core"; import { setContext, getContext, onMount } from "svelte"; import { getActorOwner, ucfirst } from "~/src/helpers/utility"; import { SYSTEM_ID } from "~/src/helpers/constants"; import { localize } from "#runtime/svelte/helper"; export let elementRoot; export let documentStore; setContext("#doc", documentStore); const application = getContext("#external").application; const headerButtonNoLabel = application.reactive.storeAppOptions.headerButtonNoLabel; $: if (game.settings.get(SYSTEM_ID, "applicationWindowHeaderIconsOnly") == true) { alert('on'); $headerButtonNoLabel = true; } else { alert('off'); $headerButtonNoLabel = false }
The alerts trigger every time the actor sheet opens, but the headers only change if I close and open the sheet again for a second time. 1. Start Foundry 2. Open the Actor sheet – see header button labels are on (and alert = "off") 3. Close Actor sheet 4. Change setting and save 5. Open Actor sheet – header button labels are still on (but alert = "on") 6. Close Actor sheet and re-open it – now header button labels are gone (with alert = "on")
Recent Announcements
Continue the conversation
Join the Discord to ask follow-up questions and connect with the community