Prevent unintentional selection of all units following 8f36ca47a1
/ D326 when doubleclicking while not in selection input mode.
Differential Revision: https://code.wildfiregames.com/D634 Fixes #4631. Refs #4414. Patch By: causative This was SVN commit r19786.
This commit is contained in:
parent
be91dde045
commit
c237b1a1c5
@ -42,8 +42,12 @@ var mouseIsOverObject = false;
|
||||
// Number of pixels the mouse can move before the action is considered a drag
|
||||
var maxDragDelta = 4;
|
||||
|
||||
// Store the clicked entity on mousedown or mouseup
|
||||
var clickedEntity = 0;
|
||||
/**
|
||||
* Store the clicked entity on mousedown or mouseup for single/double/triple clicks to select entities.
|
||||
* If any mousedown or mouseup of a sequence of clicks lands on a unit,
|
||||
* that unit will be selected, which makes it easier to click on moving units.
|
||||
*/
|
||||
var clickedEntity = INVALID_ENTITY;
|
||||
|
||||
// Same double-click behaviour for hotkey presses
|
||||
const doublePressTime = 500;
|
||||
@ -831,6 +835,9 @@ function handleInputAfterGui(ev)
|
||||
updateAdditionalHighlight();
|
||||
}
|
||||
|
||||
if (inputState != INPUT_NORMAL && inputState != INPUT_SELECTING)
|
||||
clickedEntity = INVALID_ENTITY;
|
||||
|
||||
// State-machine processing:
|
||||
|
||||
switch (inputState)
|
||||
|
Loading…
Reference in New Issue
Block a user