Opened 3 years ago

Closed 3 years ago

#5920 closed defect (fixed)

Double clicking action gets triggered by selecting different units

Reported by: Feldfeld Owned by: wraitii
Priority: Must Have Milestone: Alpha 24
Component: UI & Simulation Keywords:
Cc: Patch: Phab:D3420

Description

It is possible to trigger the double clicking action by selecting 2 different units of the same type fast enough. Here is an example situation where it poses a problem:

If a player wants to select 2 women from a group of women in the same spot, then he would select one, hold shift and select another so that he has 2 in the selection. If he does that too fast, that will trigger double clicking and all women on the screen will be selected.

Note that I didn't have this problem in A23.

Attachments (1)

double-click.webm (2.0 MB ) - added by Feldfeld 3 years ago.

Download all attachments as: .zip

Change History (5)

by Feldfeld, 3 years ago

Attachment: double-click.webm added

comment:1 by wraitii, 3 years ago

I can reproduce this on A23 and A24 by clicking on the ground next to a unit, then moving the camera using the keyboard and clicking again, this time on a unit.

It seems SDL considers mouse motion only to reset double-clicks, and we use that directly. Fixing it would require storing the 'last clicked entity', which might actually be tricky to do correctly as we would need to reset it...

comment:2 by Silier, 3 years ago

Owner: set to wraitii
Patch: Phab:3420

comment:3 by Silier, 3 years ago

Patch: Phab:3420Phab:D3420

comment:4 by wraitii, 3 years ago

Resolution: fixed
Status: newclosed

In 24698:

Prevent double-click when moving the mouse.

SDL 2.0.9 introduced a 32-pixel leeway for double clicks to register, which makes it possible to trigger "select all units of the same type" behaviour while trying to select different units that are close by.

This effectively reverts that by setting the "hint" to 1.

Fixes #5920

Differential Revision: https://code.wildfiregames.com/D3420

Note: See TracTickets for help on using tickets.