PDA

View Full Version : Create drag data ?



LilCthulhu
April 13th, 2010, 18:23
Hi,

Ok, I know it sounds silly, but I really need this ;)

I need to create a double-click operation on a dice field. Double-clicking on the dice field would results in throwing the dice in the chat window the same way dragging the dice to the chat window would do !!!

However, I need to provide the "same dragdata" that has custom information in it... I don't seem to find the way to create an empty dragdata ie :

in C# I would write something like this:

DragData tmpDragData = new DragData();

I really need the onDrag(button, x, y, dragdata) and the double-click with the chat window as the target to behave the same... any help would be appreciated...

LilCthulhu
April 14th, 2010, 15:05
And yes, I know I should not try to do that... Since I like things to be clean, I'll find another way to send the proper custom data required... but just in case you have the solution to create a new drag data where there is none to "createBaseData()" from... I'd like to know ;)

Moon Wizard
April 14th, 2010, 19:39
You have to use the throwDice function to handle double-click rolling. You can see examples of this in the d20_JPG and 4E rulesets.

Cheers,
JPG

LilCthulhu
April 15th, 2010, 03:55
hi moon_wizard,

I already use the throwdice("dice", dice, modifier, description) function but i need to pass more information than the dice and modifier and description... I would need to be able to pass another object containing more information about the dice... I'll take a look at 4e ;) thx

chris

Moon Wizard
April 15th, 2010, 08:08
There is an optional custom data parameter to the throwDice function.
https://www.fantasygrounds.com/refdoc/chatwindow.xcp#throwDice

Cheers,
JPG

LilCthulhu
April 17th, 2010, 19:54
Thanks Moon_Wizard,

I never looked at the 4e rulesets, but have been playing with it for the past year... pretty stupid of me heh ? ;) N'way, I took a look at it... wonderfull piece of stuff there... and again, kudos to you for such an amazing work and task... My friend and DM have been posting on the forum re: some fix along the way that got into the ruleset so we're enjoying it a lot ! ;)

N'way, I noticed while my previous attemps at using the throwdice with a custom issue had a problem with it... and will drop the dragdata as the custom info and a custom object instead ;)

Thanks