keep city button out of the way if a unit on the city tile is selected

This commit is contained in:
martin 2019-05-16 17:15:43 +02:00 committed by Yair Morgenstern
parent e8a9157a65
commit 5e97d32898

View File

@ -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) {