PDA

View Full Version : Need a little help with Drag/Drop



nezzir
May 30th, 2007, 17:22
I've been struggling with this for some time now and I just can't seem to get it straight. Can someone that's familiar with the drag/drop code (like on the spell sheet) give me a push in the right direction?

For starters I'd just like to drag a spell from my (custom) database and have it put the name and a link on my spell sheet. I can figure the rest out. The code for this seems to be spread out and I can't seem to put it all together.

Any help would be appreciated.

Nez

Goblin-King
May 31st, 2007, 07:38
Is the issue the same as in this thread (https://www.fantasygrounds.com/forums/showthread.php?t=6205)?

The bit you have posted there looks good, but there is one problem (as I mentioned in that thread earlier).

The problem is on the line:

if draginfo.getShortcutData() == "charsheet_spellitem" then
Essentially, it says "if you drag a spell entry on the character sheet onto itself", when it should say "if you drag the entry in the library onto the character sheet".

Replace "charsheet_spellitem" with the name of the windowclass you use to represent your spells (in the d20 ruleset it would be "spelldesc").

nezzir
May 31st, 2007, 12:19
:rolleyes: I must have... missed that. Once I replaced that everything started falling in place. I finished the sheet in like 10 mins. Thanks for the push :)