mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-29 06:51:30 -04:00
Fixed annoying bug which would treat long pans and flings as long clicks
This commit is contained in:
parent
526a99fb0d
commit
3ea6c63e0b
@ -119,9 +119,12 @@ class TileMapHolder(internal val worldScreen: WorldScreen, internal val tileMap:
|
|||||||
if (tileGroup != null) onTileClicked(tileGroup.tileInfo)
|
if (tileGroup != null) onTileClicked(tileGroup.tileInfo)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
override fun longPress(actor: Actor, x: Float, y: Float): Boolean {
|
override fun longPress(actor: Actor, x: Float, y: Float): Boolean {
|
||||||
if (!worldScreen.isPlayersTurn) return false // no long click when it's not your turn
|
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
|
// x and y are in local coordinates, so convert to stage coordinates
|
||||||
// (we're basically undoing what the ActorGestureListener did)
|
// (we're basically undoing what the ActorGestureListener did)
|
||||||
val coords = Vector2(x, y)
|
val coords = Vector2(x, y)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user