Detect double-tap using count
This commit is contained in:
@@ -406,8 +406,6 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
||||
|
||||
stack(
|
||||
new Element(){
|
||||
long tapMillis;
|
||||
|
||||
{
|
||||
//add listener to the background rect, so it doesn't get unnecessary touch input
|
||||
addListener(new ElementGestureListener(){
|
||||
@@ -415,13 +413,12 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
||||
public void tap(InputEvent event, float x, float y, int count, KeyCode button){
|
||||
if(showing()) return;
|
||||
|
||||
if(selected == hovered && Time.timeSinceMillis(tapMillis) < 500){
|
||||
if(selected == hovered && count == 2){
|
||||
playSelected();
|
||||
}
|
||||
|
||||
if(hovered != null && (canSelect(hovered) || debugSelect)){
|
||||
selected = hovered;
|
||||
tapMillis = Time.millis();
|
||||
}
|
||||
|
||||
if(selected != null){
|
||||
|
||||
Reference in New Issue
Block a user