mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-27 13:55:54 -04:00
Resolved #2576 - Clicking on "Encountering" notifications now move the map to the encounter location
This commit is contained in:
parent
7484d2c2cf
commit
2b3a9c14bf
@ -29,19 +29,20 @@ class CivInfoTransientUpdater(val civInfo: CivilizationInfo) {
|
||||
civInfo.exploredTiles.addAll(newlyExploredTiles)
|
||||
|
||||
|
||||
val viewedCivs = HashSet<CivilizationInfo>()
|
||||
val viewedCivs = HashMap<CivilizationInfo,TileInfo>()
|
||||
for (tile in civInfo.viewableTiles) {
|
||||
val tileOwner = tile.getOwner()
|
||||
if (tileOwner != null) viewedCivs += tileOwner
|
||||
for (unit in tile.getUnits()) viewedCivs += unit.civInfo
|
||||
if (tileOwner != null) viewedCivs[civInfo] = tile
|
||||
for (unit in tile.getUnits()) viewedCivs[unit.civInfo] = tile
|
||||
}
|
||||
|
||||
if (!civInfo.isBarbarian()) {
|
||||
for (otherCiv in viewedCivs.filterNot { it == civInfo || it.isBarbarian() }) {
|
||||
if (!civInfo.diplomacy.containsKey(otherCiv.civName)) {
|
||||
civInfo.meetCivilization(otherCiv)
|
||||
civInfo.addNotification("We have encountered [" + otherCiv.civName + "]!", null, Color.GOLD)
|
||||
}
|
||||
for (entry in viewedCivs) {
|
||||
val metCiv = entry.key
|
||||
if (metCiv == civInfo || metCiv.isBarbarian() || civInfo.diplomacy.containsKey(metCiv.civName)) continue
|
||||
civInfo.meetCivilization(metCiv)
|
||||
civInfo.addNotification("We have encountered [" + metCiv.civName + "]!", entry.value.position, Color.GOLD)
|
||||
metCiv.addNotification("We have encountered [" + civInfo.civName + "]!", entry.value.position, Color.GOLD)
|
||||
}
|
||||
|
||||
discoverNaturalWonders()
|
||||
|
@ -252,8 +252,8 @@ class CivilizationInfo {
|
||||
|
||||
otherCiv.diplomacy[civName] = DiplomacyManager(otherCiv, civName)
|
||||
.apply { diplomaticStatus = DiplomaticStatus.Peace }
|
||||
|
||||
popupAlerts.add(PopupAlert(AlertType.FirstContact,otherCiv.civName))
|
||||
|
||||
if(isCurrentPlayer() || otherCiv.isCurrentPlayer())
|
||||
UncivGame.Current.settings.addCompletedTutorialTask("Meet another civilization")
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user