#Freeform Sheet refresh on item update

1 messages · Page 1 of 1 (latest)

vestal badger
#

I will need to check the conditions for the sheet refresh. I would have thought it would update on an item update since I think I am only filtering out freeform sheet flag updates, but apparently that is not the case.

rustic mauve
#

If you want, I can provide the code that I've used. I'm fairly new to macro creation. So, it may be that there is some defect in my code

#

It does update correctly and instantly on the Simple Worldbuilding side, exchanging the item image as expected without a manual refresh

vestal badger
#

not necessary, I am refreshing the sheet on updateActor hook, and I am not sure updating an embedded item calls that hook. The solution might just be to call the hook in your macro. Let me do some testing

rustic mauve
#

Alright. I sincerely appreciate it!

vestal badger
#

My guess was correct, updateItem does not trigger updateActor

rustic mauve
#

Is there a way to call that explicitly from within the script?

vestal badger
#

can you post the script here?

rustic mauve
vestal badger
#

add await before the update and add this line after: ```js
Hooks.call('updateActor', kc.parent, {}, {}, {})

rustic mauve
#

That worked! I really appreciate your help.

#

While I have you, if I could ask one more question. Is there a way to edit the values of a parameter on the freeform sheet?

#

As in, can you edit the value of a parameter through the @ driven reference field?

#

This is my character sheet

#

Most of the numbers are references to the sheet the freeform template is overshadowing. Right now, to edit these numbers, I have to swap the template back to the other side, edit it there, and then switch the template again

vestal badger
#

and you cannot double click them?

rustic mauve
#

Double-clicking them doesn't appear to do anything

#

Right clicking pulls up the reference field

vestal badger
#

do you have this option checked?

rustic mauve
#

I do at the moment

#

Would I need to undo it and then redo the references?

vestal badger
#

no, that isn't the issue. I am testing SWB in v10 now, it might have changed in v11

#

since I do not recognize SPECIAL

rustic mauve
#

Oh, that's an attribute category on the sheet

#

So, the shorthand becomes @attributes.grouping.attribute

vestal badger
#

oh, put attributes. before SPECIAL. And use the @Data thing in the header menu to get the correct references

rustic mauve
#

I see. I just have to pull from the @ menu, and that solves it

#

Again, you've saved me a lot of time

#

That said, do you have a ko-fi or similar? I'd be willing to toss a couple of bucks your way for the help.

vestal badger
#

no need, and about losing access to the items, I never really planned the module around using items. I could possibly give some thought to how to fix that, but it will likely come down to a dialog to display a list of items that could be dragged to the sheet

rustic mauve
#

I think my use case is rather unique

vestal badger
#

unfortunately, how that looks is going to be a bit grating depending on the system, so I might just make it and give it to you

rustic mauve
#

That said, I think I have what I need in the fix you provided

#

Basically, my players wanted to try a fallout system

#

The system uses Karma caps, which you flip over and then flip back up at various points to use advantage

#

It seemed like it'd be a neat flourish to have the caps on the sheet and be able to flip them with a macro as a means of visual tracking

vestal badger
#

sounds doable, the primary use case for this module is implementing unsupported systems, which leads most of my support for it being hacking in ways of doing stuff like that

rustic mauve
#

The only thing I could think that would be a handy general feature is something like a checkbox option, since it isn't clear from the existing documents how you setup those hearts on your example character sheet or if they can be toggled

vestal badger
#

so the number of caps get used in a roll formula?

rustic mauve
#

So, I had to do a really dumb workaround. Basically, the item in the character sheet cannot be accessed from the @Data operator. So, I had to track down the item's UUID and then do "@UUID[item's UUID]"

#

Otherwise, I'm not sure how you access an image-based representation of the item on the character sheet

vestal badger
#

that is what I use for the hearts

#

meant for things with a max and min value

#

like health

rustic mauve
#

Gotcha

#

Well, I think I should be good for the moment. Again, I really appreciate your help!

vestal badger
#

makes a dialog with all item content links that can be dragged to the freeform sheet ```js
new Dialog({
title: actor.name + " Items",
buttons:{},
content: TextEditor.enrichHTML(actor.items.reduce((acc, item)=>acc+= item.link+"<br>",""), {async:false}),
}).render(true)