PDA

View Full Version : Issue with AcceptDrop?



neilgfoster
May 16th, 2012, 13:56
Hi All,

I am experiencing an issue in FG2 (v2.8.1) where the rules around <acceptdrop> appear to be ignored. I have a window list which contains the following xml:



<acceptdrop>
<class>item</class>
<fields>*</fields>
</acceptdrop>


What I am experiencing is that I can drop pretty much any shortcut to the window list and it will create an entry. Its as if the <class></class> part of the <acceptdrop> is being ignored.

This is happening in my ruleset, but I have also recreated it in the 3.5E ruleset as well:

Create a new campaign
Create a new story
Drag and drop the story to items - see how the story is added to items.

Has anyone else experienced this issue?

Thanks in advance

phantomwhale
May 16th, 2012, 14:23
Question for the workshop ? (not the lab) ?

I did some work creating a new "base" windowlist for Savage Worlds that gave me some nice XML configuration for more complex drag'n'drop stuff. But from memory, what you've written should work as intended.

You're not overriding the drop handler in any custom LUA are you ?

neilgfoster
May 16th, 2012, 14:34
Question for the workshop ? (not the lab) ?

Sorry, workshop is probably the correct place. How do you move a thread?


You're not overriding the drop handler in any custom LUA are you ?

No, no scripting at all in relation to that area.

Its not a big issue - I am convinced that this used to work though. Its not just my machine as the issue was raised by someone else. In addition, I see it happening in the 3.5E ruleset which uses the exact same xml

Moon Wizard
May 17th, 2012, 00:31
Try "field" instead of "fields".

https://www.fantasygrounds.com/refdoc/windowlist.xcp

Regards,
JPG

neilgfoster
May 17th, 2012, 08:56
Sorry, my example was incorrect. The ruleset is using <field>, not <fields> and I still see this issue.

Moon Wizard
May 17th, 2012, 18:44
Both the NPCs and items in 3.5E/4E use that approach to create copies of module links dropped onto the campaign lists.

Looking at the code, the drop will not copy if:
* The drop class does not match the class in the acceptdrop.class tag
* If the class of the shortcut is not defined in the ruleset.
* If the drag object shortcut data does not point to a database node.

You can add an onDrop event handler for the windowlist control in order to review the dragdata object being used in the drop event. (i.e. dragdata.getType(), dragdata.getShortcutData())

Regards,
JPG