PDA

View Full Version : Acceptdrop



statik37
February 10th, 2020, 17:12
Hello,

I have a windowlist that I set up:



<acceptdrop>
<class>item</class>
<field>*</field>
</acceptdrop>


Which works and copies anything from the Items list. However, I would like it to only copy items with type set as "armor". Can I do that, and if so, how?

celestian
February 10th, 2020, 17:27
I've not used this option but there is this in the 5E ruleset.



<acceptdrop>
<type>dice</type>
<type>number</type>
<type>attack</type>
<type>damage</type>
<type>heal</type>
<type>init</type>
<type>save</type>
<type>check</type>
<type>recovery</type>
</acceptdrop>


I'd really be interested in seeing complete docs on all these options. I wasn't aware of these flags so never used them.

statik37
February 10th, 2020, 17:38
That didn't work. I think those are for drag and drop to the chat window not the windowlist. Then again, I could be wrong. Either way, that didn't seem to work for me.

Moon Wizard
February 10th, 2020, 17:43
@statik37,
There's no way to dynamically filter based on what is in the data; only which classes are accepted and which fields to copy. If you want something more complex, you'll need to remove acceptdrop, and write your own onDrop event function.

@celestian,
It's documented in the windowlist tags here:
https://www.fantasygrounds.com/refdoc/windowlist.xcp

Regards,
JPG

celestian
February 10th, 2020, 17:58
@statik37,
There's no way to dynamically filter based on what is in the data; only which classes are accepted and which fields to copy. If you want something more complex, you'll need to remove acceptdrop, and write your own onDrop event function.

@celestian,
It's documented in the windowlist tags here:
https://www.fantasygrounds.com/refdoc/windowlist.xcp

Regards,
JPG

I was mostly referring to something like <type> which isn't documented as far as I could tell. I've a good idea what it does but would be nice to know for sure as well as if there are others not listed.

Currently I think ALL of my onDrops are filtered based on custom code like you mentioned which is why I was interested in this.

Moon Wizard
February 10th, 2020, 18:14
@celestian,
Those are actually part of a script used for the ModifierStack. It's not part of the CoreAPI.

Regards,
JPG