Starfinder Playlist
  1. #1
    Minty23185Fresh's Avatar
    Join Date
    Dec 2015
    Location
    Goldstone, CA, USA
    Posts
    1,211
    Blog Entries
    29

    Suppress single click handling for a onDoubleClick( ) event (5E ruleset)

    I'm working on an extension to implement the Druid's Wild Shape feature.

    The extension modifies the Druid's character sheet statistics when an NPC is dragged on to the Portrait control.

    The Portrait control has onDragStart(), onDrop(), onClickDown() and onClickRelease() event handlers. Single click handling brings up token selection so the user can choose a portrait for their character.

    I have added an onDoubleClick() function to revert from Wild Shape (NPC) statistics back to the Druid's statistics.

    Everything is working great except this: the double click fires both the single click and double click handlers. So when I double click the Portrait control, the statistics revert but it also brings up token selection.

    I have tried the various remedies suggested in the forums (a single/double click flag) but have failed to implement them correctly, I guess, or they don't quite fulfill my needs. Searching the 5E and CoreRPG code has also been fruitless. There are coexisting single and double click handlers, but it appears as though they allow the single click handling for the double click (typically just placing a cursor in a text field followed by the double click functionality). I need to suppress the single click handling.

    (The pertinent code is in <template name="portrait_char"> in the campaign/template_char.xml file)

    Any help you can lend, is greatly appreciated.

    [EDIT:]
    I thought I found the "Finder's Stone" but alas, not, whether the onDoubleClick() returns true, false, or nil does not remedy my problem.
    Last edited by Minty23185Fresh; December 2nd, 2018 at 17:26.
    Current Projects:
    Always...
    Community Contributions:
    Extensions: Bardic Inspiration, Druid Wild Shapes, Local Dice Tower, Library Field Filters
    Tutorial Blog Series: "A Neophyte Tackles (coding) the FG Extension".

  2. #2
    Unfortunately, there is no way to tell whether a user click is a single click or a double click, until the second click either happens or doesn't. Therefore, the first click is treated as a single click, even if the second click is treated as a double click.

    JPG

  3. #3
    Minty23185Fresh's Avatar
    Join Date
    Dec 2015
    Location
    Goldstone, CA, USA
    Posts
    1,211
    Blog Entries
    29
    Thank you Moon Wizard. Not particularly pleasing tidings, but we all have to play with what comes up on the dice.

    I guess I'll go with a context menu (right-click) instead.

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
  •  
5E Product Walkthrough Playlist

Log in

Log in