#srcmoduledocumentsitemSwadeItem.ts ·...

1 messages · Page 1 of 1 (latest)

true frost
#

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?

shell lodge
#

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)

true frost
#

That is not corret

shell lodge
#

ah okay

true frost
#

The properties array you refer to is NOT part of the item data. It's being dynamically built in that function you linked

shell lodge
#

built when the item is setn to chat?

true frost
#

yes

shell lodge
#

my infant just woke up so i might have to disappear in a minute (just fyi)

true frost
#

so when you have a reference to the item you could always just call getChatData on it

true frost
#

The thread will remain anyway 😄

shell lodge
shell lodge
#

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.