diff --git a/core/src/com/unciv/logic/civilization/CivilizationInfo.kt b/core/src/com/unciv/logic/civilization/CivilizationInfo.kt index 1db05b592d..3f6d6edad4 100644 --- a/core/src/com/unciv/logic/civilization/CivilizationInfo.kt +++ b/core/src/com/unciv/logic/civilization/CivilizationInfo.kt @@ -541,13 +541,13 @@ class CivilizationInfo { if (newAllyName != "") { val newAllyCiv = gameInfo.getCivilization(newAllyName) - newAllyCiv.addNotification("We have allied with [${civName}].", Color.GREEN) + newAllyCiv.addNotification("We have allied with [${civName}].", getCapital().location, Color.GREEN) newAllyCiv.updateViewableTiles() newAllyCiv.updateDetailedCivResources() } if (oldAllyName != "") { val oldAllyCiv = gameInfo.getCivilization(oldAllyName) - oldAllyCiv.addNotification("We have lost alliance with [${civName}].", Color.RED) + oldAllyCiv.addNotification("We have lost alliance with [${civName}].", getCapital().location, Color.RED) oldAllyCiv.updateViewableTiles() oldAllyCiv.updateDetailedCivResources() } diff --git a/core/src/com/unciv/logic/civilization/diplomacy/DiplomacyManager.kt b/core/src/com/unciv/logic/civilization/diplomacy/DiplomacyManager.kt index 120f366147..85d845b586 100644 --- a/core/src/com/unciv/logic/civilization/diplomacy/DiplomacyManager.kt +++ b/core/src/com/unciv/logic/civilization/diplomacy/DiplomacyManager.kt @@ -275,10 +275,10 @@ class DiplomacyManager() { else influence = restingPoint if (getTurnsToRelationshipChange() == 1) - otherCiv().addNotification("Your relationship with [${civInfo.civName}] is about to degrade", null, Color.GOLD) + otherCiv().addNotification("Your relationship with [${civInfo.civName}] is about to degrade", civInfo.getCapital().location, Color.GOLD) if (initialRelationshipLevel >= RelationshipLevel.Friend && initialRelationshipLevel != relationshipLevel()) - otherCiv().addNotification("Your relationship with [${civInfo.civName}] degraded", null, Color.GOLD) + otherCiv().addNotification("Your relationship with [${civInfo.civName}] degraded", civInfo.getCapital().location, Color.GOLD) } private fun nextTurnFlags() { diff --git a/core/src/com/unciv/ui/tilegroups/CityButton.kt b/core/src/com/unciv/ui/tilegroups/CityButton.kt index b97f31b8e1..febcb473fc 100644 --- a/core/src/com/unciv/ui/tilegroups/CityButton.kt +++ b/core/src/com/unciv/ui/tilegroups/CityButton.kt @@ -14,6 +14,7 @@ import com.unciv.logic.city.CityConstructions import com.unciv.logic.city.CityInfo import com.unciv.logic.city.SpecialConstruction import com.unciv.ui.cityscreen.CityScreen +import com.unciv.ui.trade.DiplomacyScreen import com.unciv.ui.utils.* class CityButton(val city: CityInfo, internal val tileGroup: WorldTileGroup, skin: Skin): Table(skin){ @@ -61,22 +62,29 @@ class CityButton(val city: CityInfo, internal val tileGroup: WorldTileGroup, ski private fun setButtonActions() { val unitTable = tileGroup.worldScreen.bottomUnitTable - if (UncivGame.Current.viewEntireMapForDebug || belongsToViewingCiv()) { - // So you can click anywhere on the button to go to the city - touchable = Touchable.childrenOnly + // So you can click anywhere on the button to go to the city + touchable = Touchable.childrenOnly + onClick { // 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) { + if (isButtonMoved) { + // second tap on the button will go to the city screen + // if this city belongs to you + if (UncivGame.Current.viewEntireMapForDebug || belongsToViewingCiv()) { UncivGame.Current.setScreen(CityScreen(city)) } else { - moveButtonDown() - if (unitTable.selectedUnit == null || unitTable.selectedUnit!!.currentMovement == 0f) - tileGroup.selectCity(city) + // If city doesn't belong to you, go directly to its owner's diplomacy screen. + val screen = DiplomacyScreen(UncivGame.Current.worldScreen.viewingCiv) + screen.updateRightSide(city.civInfo) + UncivGame.Current.setScreen(screen) } + } else { + moveButtonDown() + if ((unitTable.selectedUnit == null || unitTable.selectedUnit!!.currentMovement == 0f) && + belongsToViewingCiv()) + tileGroup.selectCity(city) } }