Settings Page
I was looking at ways to override the default foundry tab for settings and was wondering if there's a way to use svelte/TRL to display our system settings instead of core behavior. I also tried creating a new settings menu and instead of extending FormApplication using either
SvelteApplication
or TJSDialog
but foundry doesn't seem to register those as clickable buttons in the settings menu.8 Replies
Unfortunately, you'll need to create a shim for the menu button:
https://github.com/fantasycalendar/FoundryVTT-RestRecovery/blob/main/scripts/formapplications/settings/settings.js#L131-L148
I guess that works too
Tyvm
You might check out
TJSGameSettings
from svelte-standard
It automatically creates Svelte stores for all game settings and provides a UI for a component to display settings inside of an app along with a header menu bar component to swap between the main app view and settings. It can also be extended with new sections for custom handling of settings.
Granted there isn't a tutorial on setting all of this up, but it is used in Auto Animations and my new module "TinyMCE Everywhere!". I am building the theme editor solution as an extension to the TJSGameSettings UI that is a drop in section. The theme editor is nice as it automatically updates CSS variables as they change and serializes the entire theme under a single world game setting.@faey
Yeah... More or less use a FormApplication to launch your settings app... Here is how I do it:
https://github.com/typhonjs-fvtt/mce-everywhere/blob/main/src/view/ConfigSettingButton.js
I also setup a hook and make draggable element of the settings app a hotbar / drop macro that invokes the hook to open the settings app. AutoAnimations has this too.
I think there was some mention in the
#dev-support
channel on the mothership about accepting the registration of a function for a button. Not sure what came of that. If there is no issue filed perhaps making that a point to add in v11 in another #dev-support
message is apt as it should be a trivial change.In my efforts to convert my obs-utils module to TJS I ended up writing a generic version of that settings wrapper: https://github.com/FaeyUmbrea/obs-utils/blob/main/src/applications/settingsShell.js
Might be useful to somebody
GitHub
obs-utils/settingsShell.js at main · FaeyUmbrea/obs-utils
For all your streaming needs! Contribute to FaeyUmbrea/obs-utils development by creating an account on GitHub.
This neatly wraps your SvelteApplication into a settings button by just passing
SettingsShell(YourSvelteAppClass)
into the button registration method
You can nab this for svelte-standard if you wantThis could be handy to add something like this to
svelte-standard
.. Yeah... ;P