Fixed annoying bug which would treat long pans and flings as long clicks

This commit is contained in:
Yair Morgenstern 2019-11-19 23:09:36 +02:00
parent 526a99fb0d
commit 3ea6c63e0b

View File

@ -119,9 +119,12 @@ class TileMapHolder(internal val worldScreen: WorldScreen, internal val tileMap:
if (tileGroup != null) onTileClicked(tileGroup.tileInfo)
}
override fun longPress(actor: Actor, x: Float, y: Float): Boolean {
if (!worldScreen.isPlayersTurn) return false // no long click when it's not your turn
// otherwise it activates,
// since it's been a long time since the touchdown and no touchup has activates
if (isPanning || isFlinging) return false
// x and y are in local coordinates, so convert to stage coordinates
// (we're basically undoing what the ActorGestureListener did)
val coords = Vector2(x, y)