Well now I'm downloading lancer

Well now I'm downloading lancer
24 Replies
kgar
kgarOP•10mo ago
And starting a thread for moment? Shoot, I can't download it. My foundry version is too new.
Eunomiac
Eunomiac•10mo ago
lol I had that same issue myself, now I have two Foundry versions installed 🙂
kgar
kgarOP•10mo ago
I've got 11 and 12 co-installed at the moment
Eunomiac
Eunomiac•10mo ago
But if you take a peek at lancer-actor-sheet.ts under the src folder of the repo, they do have a lot of code relating to form submission events in there. I think my best strategy is just to bypass all of that and handle the select element with a custom listener. Ah, I've got 10 and 11 🙂
kgar
kgarOP•10mo ago
Yes, I think that'll be your best bet.
Eunomiac
Eunomiac•10mo ago
Christ this system is as complex as it is expertly written
kgar
kgarOP•10mo ago
Conventionally, you should be able to drop a named input, and it automatically gets swept up in the form submission handling onchange.
Eunomiac
Eunomiac•10mo ago
With CONFIG.debug.hooks = true, I'm not seeing any hooks being triggered when that select element is changed, at all. I wonder how they even managed that lol
kgar
kgarOP•10mo ago
It'd be interesting to see the hooks when changing other fields. And perhaps what event listeners are on some of the standard inputs.
Eunomiac
Eunomiac•10mo ago
Let me grab you a quick screen of the former
Eunomiac
Eunomiac•10mo ago
After changing a dot-line style counter:
No description
kgar
kgarOP•10mo ago
(Full disclosure: While I run a sheets module, I have all but abandoned FormApplicationV1-style document handling, but even then, I have an ambient listener that submits the form when someone drops a named input in my forms. I'm running my stuff on svelte. Strangely, as a result, I've had to become pretty familiar with how regular FormApplications work.)
Eunomiac
Eunomiac•10mo ago
(I realize that's less helpful without the ability to expand stuff, but I've never been able to figure out a proper way to export console data 😛 ) I keep hearing about svelte, I have no clue what it is or what it's used for. I should probably look into it.
Eunomiac
Eunomiac•10mo ago
Ahah, they have replaced the select logic with their own stuff --- here is the console log when I change my select element (I was wrong about nothing happening, not sure where I got that idea)
No description
Eunomiac
Eunomiac•10mo ago
They're clearly parsing and filtering the data in their own way, which unfortunately doesn't include flags
kgar
kgarOP•10mo ago
So, it appears to be a standard update cycle. Here's an update cycle from a very traditional form application in dnd5e
No description
kgar
kgarOP•10mo ago
Oh, I see Luckily, if you are managing a whole tab, you can just listen for change from named inputs on the whole tab But will form submission save the flag data ... 🤔
Eunomiac
Eunomiac•10mo ago
Re: the standard update cycle, it's this part that makes all the difference I suspect
No description
Eunomiac
Eunomiac•10mo ago
It won't matter -- I'll just write a custom onChange listener that writes the flag data itself.
kgar
kgarOP•10mo ago
Your flags would be in context.document.flags, methinks?
Eunomiac
Eunomiac•10mo ago
Yeah, the normal place. Namespaced under eunos-lancer-hacks.
kgar
kgarOP•10mo ago
Bummer that it's not automatically picking up your inputs, but your intuition was spot on about both things: the select should have worked, and you're better off doing it manually 😅
Eunomiac
Eunomiac•10mo ago
Well thanks again for your help --- now at least I know what I have to do to get it to work!
kgar
kgarOP•10mo ago
Glad to help. Best of luck to you! I'm around these parts and enjoy talking shop. All the really super smart people were not around to correct me this time 😬
Want results from more Discord servers?
Add your server