-
March 21st, 2019, 06:11 #11
I have a functioning “on demand” pseudo-dragdata object. It uses the genericcontrol as a wrapper. All functionality published in the XML and Scripting Reference document is supported except createBaseData() and one other function. A type(pseudo) will result in “windowcontrol” instead of “dragdata”.
I have a little bit more testing to do and some documentation to think about. I hope to publish in a day or two.
-
March 21st, 2019, 19:09 #12
-
March 21st, 2019, 20:08 #13
I'm curious the use case from your code (the link to the other post). I didn't want to clutter it up there.
It looks like you're coding the drag/drop off a double click? I've recently been tinkering with a custom drag/drop for the "quicknote" system I use for NPCs in AD&D Core. I wanted to be able to drag/drop the quicknotes between the "Ability Notes" and "Weapon" notes. I found a lot of times special weapon/attacks needed an entry and instead of reformatting everything for both, drag/drop was easier.
It ended up like this:
<buttoncontrol>
<script>
...
Code:function onDrop(x, y, draginfo) if draginfo.isType("shortcut") then local node = window.getDatabaseNode(); local sClass, sRecord = draginfo.getShortcutData(); if (sClass == "quicknote") then local nodeEncounter = DB.findNode(sRecord); if (nodeEncounter) then local sName = DB.getValue(nodeEncounter,"name",""); local sText = DB.getValue(nodeEncounter,"text",""); local nLocked = DB.getValue(nodeEncounter,"locked",0); DB.setValue(node,"itemnote.name","string",sName); DB.setValue(node,"itemnote.text","formattedtext",sText); DB.setValue(node,"itemnote.locked","number",nLocked); end end return true; end end function onDragStart(button, x, y, draginfo) local node = window.getDatabaseNode(); local sName = DB.getValue(node,"name",""); local sPathToItem = node.getPath() .. ".itemnote"; draginfo.setType("shortcut"); draginfo.setShortcutData( "quicknote", sPathToItem ); draginfo.setDescription(sName); draginfo.setIcon("button_link_down"); return true; end
<script>
</buttoncontrol>
This might be completely out of your use case but...---
Fantasy Grounds AD&D Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
Documentation for AD&D 2E ruleset.
Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks