Well now I'm downloading lancer
Well now I'm downloading lancer
24 Replies
And starting a thread for moment?
Shoot, I can't download it. My foundry version is too new.
lol I had that same issue myself, now I have two Foundry versions installed 🙂
I've got 11 and 12 co-installed at the moment
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 🙂Yes, I think that'll be your best bet.
Christ this system is as complex as it is expertly written
Conventionally, you should be able to drop a named input, and it automatically gets swept up in the form submission handling onchange.
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 lolIt'd be interesting to see the hooks when changing other fields.
And perhaps what event listeners are on some of the standard inputs.
Let me grab you a quick screen of the former
After changing a dot-line style counter:
(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.)
(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.
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)
They're clearly parsing and filtering the data in their own way, which unfortunately doesn't include flags
So, it appears to be a standard update cycle. Here's an update cycle from a very traditional form application in dnd5e
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 ... 🤔
Re: the standard update cycle, it's this part that makes all the difference I suspect
It won't matter -- I'll just write a custom onChange listener that writes the flag data itself.
Your flags would be in context.document.flags, methinks?
Yeah, the normal place. Namespaced under
eunos-lancer-hacks
.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 😅
Well thanks again for your help --- now at least I know what I have to do to get it to work!
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 😬