Fabricate

@MisterPotts. Just starting a forum post to keep track of the conversation.
Fabricate doesn't maintain any of its own documents; it only records metadata in its settings. Do you think that would be a problem for TRL? For example, is there an assumption that applications are tied to documents? I would be surprised, but thought it worth asking up front
There are no particular data / document associations for TRL apps. Depending on where you are storing the metadata there are several reactive APIs available that could help out for game settings and web storage. You'll have to describe more about what you are doing currently from a data storage perspective and I can point you in the right direction. The first thing to do though is work out the TRL SvelteApplication extension and configuration through defaultOptions as it is different than what you came up with. The next thing is to use the ApplicationShell component as the outer wrapper for any of your components. With TRL the entire application shell is Svelte powered vs embedding components in the Foundry core app shell. Installing essential-svelte-esm and taking a look at the example code should give you an idea on how that works.
4 Replies
MisterPotts
MisterPotts15mo ago
That's good to know! Fabricate's UI loads data from the API object instances that I'm instantiating the root component with, so the svelte components don't really know they're in a Foundry game world
TyphonJS (Michael)
TyphonJS (Michael)OP15mo ago
API object instances
What storage mechanism? Foundry game settings (world)? or web / local storage?
MisterPotts
MisterPotts15mo ago
My own API, which reads from and writes to game world settings I'm on mobile right now, so can't really point to it too easily However it sounds like that won't be an issue
TyphonJS (Michael)
TyphonJS (Michael)OP15mo ago
It shouldn't be. There are a couple of ways of working with game settings. TJSGameSettings creates Svelte stores wrapping Foundry game settings which is handy. API docs: https://typhonjs-fvtt-lib.github.io/api-docs/modules/_runtime_svelte_store_fvtt_settings.html There also is WorldSettingArrayStore which may be handy if you are storing an array of objects. https://typhonjs-fvtt-lib.github.io/api-docs/classes/_standard_store.WorldSettingArrayStore.html I can point to various sample code and also other packages that use these as they aren't covered in the essential-svelte-esm demos.
Want results from more Discord servers?
Add your server