5E Product Walkthrough Playlist
  1. #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 ...

  2. #2
    There is no event like that. You should set any custom data necessary for a roll in the drag object.

    JPG

  3. #3

    Join Date
    Jul 2010
    Location
    Germany, Frankfurt
    Posts
    156
    Quote Originally Posted by Moon Wizard View Post
    You should set any custom data necessary for a roll in the drag object.
    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).

  4. #4
    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

  5. #5

    Join Date
    Jul 2010
    Location
    Germany, Frankfurt
    Posts
    156
    Quote Originally Posted by Moon Wizard View Post
    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
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
STAR TREK 2d20

Log in

Log in