Support double-click on unit group buttons. patch by Merolum. fixes #805.
This was SVN commit r9592.
This commit is contained in:
parent
6b0cbd10c3
commit
9906a86a2e
@ -245,6 +245,7 @@ function updateGroups()
|
||||
else
|
||||
button.hidden = false;
|
||||
button.onpress = (function(i) { return function() { performGroup("select", i); } })(i);
|
||||
button.ondoublepress = (function(i) { return function() { performGroup("snap", i); } })(i);
|
||||
}
|
||||
var numButtons = i;
|
||||
var rowLength = 1;
|
||||
|
@ -63,7 +63,16 @@ void IGUIButtonBehavior::HandleMessage(SGUIMessage &Message)
|
||||
{
|
||||
m_Pressed = false;
|
||||
// BUTTON WAS CLICKED
|
||||
SendEvent(GUIM_PRESSED, "press");
|
||||
if (Message.type == GUIM_MOUSE_RELEASE_LEFT)
|
||||
{
|
||||
SendEvent(GUIM_PRESSED, "press");
|
||||
}
|
||||
// BUTTON WAS DOUBLE CLICKED
|
||||
else
|
||||
{
|
||||
if (SendEvent(GUIM_MOUSE_DBLCLICK_LEFT, "doublepress") == IN_PASS)
|
||||
SendEvent(GUIM_PRESSED, "press");
|
||||
}
|
||||
}
|
||||
} break;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user