From 5e97d3289802a74b6afd4a832d181f118626caf0 Mon Sep 17 00:00:00 2001 From: martin Date: Thu, 16 May 2019 17:15:43 +0200 Subject: [PATCH] keep city button out of the way if a unit on the city tile is selected --- core/src/com/unciv/ui/tilegroups/CityButton.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/src/com/unciv/ui/tilegroups/CityButton.kt b/core/src/com/unciv/ui/tilegroups/CityButton.kt index fe352d406f..458fdc79d2 100644 --- a/core/src/com/unciv/ui/tilegroups/CityButton.kt +++ b/core/src/com/unciv/ui/tilegroups/CityButton.kt @@ -77,7 +77,11 @@ class CityButton(val city: CityInfo, internal val tileGroup: WorldTileGroup, ski } // when deselected, move city button to its original position - if (tileGroup.worldScreen.bottomBar.unitTable.selectedCity == null && isButtonMoved) { + val unitTable = tileGroup.worldScreen.bottomBar.unitTable + if (isButtonMoved + && unitTable.selectedCity == null + && unitTable.selectedUnit?.currentTile != city.ccenterTile) { + isButtonMoved = false val floatAction = object : FloatAction(0f, 1f, 0.4f) { override fun update(percent: Float) {