diff --git a/core/src/com/unciv/ui/tilegroups/CityButton.kt b/core/src/com/unciv/ui/tilegroups/CityButton.kt index a8c8916780..cd54f64b9d 100644 --- a/core/src/com/unciv/ui/tilegroups/CityButton.kt +++ b/core/src/com/unciv/ui/tilegroups/CityButton.kt @@ -41,17 +41,16 @@ class CityButton(val city: CityInfo, internal val tileGroup: WorldTileGroup, ski touchable = Touchable.enabled label.touchable = Touchable.enabled - // clicking on the button swings the button a little down to allow selection of units there. + // clicking swings the button a little down to allow selection of units there. // this also allows to target selected units to move to the city tile from elsewhere. // second tap on the button will go to the city screen onClick { - if (!isButtonMoved) { - moveButtonDown() - if (unitTable.selectedUnit == null || unitTable.selectedUnit!!.currentMovement == 0f) - tileGroup.selectCity(city) - - } else { + if (isButtonMoved) { UnCivGame.Current.screen = CityScreen(city) + } else { + moveButtonDown() + if (unitTable.selectedUnit == null || unitTable.selectedUnit!!.currentMovement==0f) + tileGroup.selectCity(city) } } diff --git a/core/src/com/unciv/ui/worldscreen/TileGroupMap.kt b/core/src/com/unciv/ui/worldscreen/TileGroupMap.kt index 4d473f51ef..9221079294 100644 --- a/core/src/com/unciv/ui/worldscreen/TileGroupMap.kt +++ b/core/src/com/unciv/ui/worldscreen/TileGroupMap.kt @@ -48,8 +48,8 @@ class TileGroupMap(val tileGroups:Collection, padding:Float): G for(group in miscLayers) addActor(group) for(group in circleCrosshairFogLayers) addActor(group) for(group in tileGroups) addActor(group) // The above layers are for the visual layers, this is for the clickability - for(group in unitLayers) addActor(group) // Aaand units above everything else. for(group in cityButtonLayers) addActor(group) // city buttons clickability + for(group in unitLayers) addActor(group) // Aaand units above everything else. // there are tiles "below the zero", diff --git a/core/src/com/unciv/ui/worldscreen/unit/UnitTable.kt b/core/src/com/unciv/ui/worldscreen/unit/UnitTable.kt index 9cce6bed8f..73dd4af712 100644 --- a/core/src/com/unciv/ui/worldscreen/unit/UnitTable.kt +++ b/core/src/com/unciv/ui/worldscreen/unit/UnitTable.kt @@ -181,18 +181,14 @@ class UnitTable(val worldScreen: WorldScreen) : Table(){ fun citySelected(cityInfo: CityInfo) : Boolean { if (cityInfo == selectedCity) return false - lastSelectedCityButton = true selectedCity = cityInfo selectedUnit = null selectedUnitHasChanged = true + worldScreen.shouldUpdate = true return true } fun tileSelected(selectedTile: TileInfo) { - if (lastSelectedCityButton) { - lastSelectedCityButton = false - return - } val previouslySelectedUnit = selectedUnit if(currentlyExecutingAction=="moveTo"){