-
June 22nd, 2022, 10:42 #1
- Join Date
- Jul 2010
- Location
- Germany, Frankfurt
- Posts
- 156
How can i catch a "cdrag&dop" roll, where the dice "is not landed" within Chatframe?
If I start a roll via drag&drop, but the dice does not land in the chat window, the event "onDiceLanded" is not triggered and therefore no result handlers like "onRoll" etc. are triggered.
Is another event triggered for this scenario which I could catch accordingly ?
The background is that an attribute roll should be finished (my result handler "onRoll" should have been evaluated) before a new attribute roll can be performed.
Currently I set a flag (for the used rActor and sAttribute) in my "ActionAttribute.performRoll()", before "ActionManager.performAction()" and delete it again after "ActionAttribute.onRoll().
Since "onRoll" is not reached in the described scenario, the flag then remains forever, so that the program still believes that there is currently still a roll in the evaluation ...
-
June 23rd, 2022, 02:38 #2
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,559
There is no event like that. You should set any custom data necessary for a roll in the drag object.
JPG
-
June 24th, 2022, 05:35 #3
- Join Date
- Jul 2010
- Location
- Germany, Frankfurt
- Posts
- 156
Thanks for the answer, but i am not sure how this could help me to solve my issue. When the dice (the drag object which is initiated by onDragStart by a numberfield control ) is not dropped into the chatwindow then i cannot evaluate that the drop was failed, no matter what custom data i have put into the drag object.
At least a "onDesktopDrop" would be helpfull for that, i guess (The FG frameworks offers onDrop for windowcontrols, for the chatwindow and for the hotkeybar (Interface.onHotkeyDrop), what is left in my opinion, is the desktop).
-
June 24th, 2022, 18:24 #4
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,559
What I’m suggesting is not to determine whether a drop has “failed” at all; but to include any data in the roll needed and resolve the info when the roll actually occurs instead of setting some info on the initial drag to look for later.
JPG
-
June 26th, 2022, 06:58 #5
- Join Date
- Jul 2010
- Location
- Germany, Frankfurt
- Posts
- 156
I probably described my problem incorrectly.
I have to wait for the result of a roll to set a flag on the diceable field depending on it.
Until then the user is not allowed to initiate another roll over this field because it might have to be modified due to the previous roll.
If he tries, he gets a chat message that the previous roll is not finished yet and he has to wait until this one is finished.
I have successfully implemented this, but it doesn't work when the user drags (instead of double-clicking) to initiate the roll and then doesn't drop the die in the chat window because my script is waiting for the "OnDrop" event. When he tries to do another roll after that my script tells him that he has to wait for the result of the previous roll ... which will never come ..Last edited by drvolk; June 26th, 2022 at 07:03.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks