#srcmoduledocumentsitemSwadeItem.ts ·...
1 messages · Page 1 of 1 (latest)
Let's make a thread for this
Firstly you could use that data, buuuut It's only really meant for our internal chat cards. From what I can tell something like that is exactly what Monk does as well?
Tell me if I'm wrong about this: The SWADE system has the ItemData object with individual keys for things like 'damage' 'minStr' 'parry' etc. But it also has a key 'properties' which is an array with a few item stats specifically selected to display in chat cards (and also formatted into html spans)
That is not corret
ah okay
The properties array you refer to is NOT part of the item data. It's being dynamically built in that function you linked
built when the item is setn to chat?
yes
my infant just woke up so i might have to disappear in a minute (just fyi)
so when you have a reference to the item you could always just call getChatData on it
yeah no worries. Family is more important
The thread will remain anyway 😄
So i'm back to looking at this again but should be going to bed real soon so might not get back online until tomorrow sometime...
That same function as before, getChatData() from https://gitlab.com/peginc/swade/-/blob/develop/src/module/documents/item/SwadeItem.ts#L178 .... I still believe that is the key to what I want to do...
With Monks Journal I can drag an item from the sidebar and into the Shop type journal, and it adds that item to the shops inventory. If the item doesn't have the properties array until it is sent to Chat, I think MEJ must be triggering that getChatData() function as if it were being to sent to Chat. Because the object that is brought into the shop definitely has that properties attribute, and uses it to create the little icon/tag things just like how those item stats are displayed on the bottom of a chat card.
The official implementation of the Savage Worlds Adventure Edition rules for Foundry Virtual Tabletop (http://foundryvtt.com).