mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-28 06:16:37 -04:00
Added notification when cities are connected to the capital
This commit is contained in:
parent
556ba11bba
commit
ecc32365f5
@ -535,6 +535,9 @@
|
|||||||
Simplified_Chinese:"真是不知死活![civName]竟然敢谴责我们!"
|
Simplified_Chinese:"真是不知死活![civName]竟然敢谴责我们!"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
"[cityName] has been connected to your capital!":{
|
||||||
|
}
|
||||||
|
|
||||||
// Trade
|
// Trade
|
||||||
"[civName] has accepted your trade request":{
|
"[civName] has accepted your trade request":{
|
||||||
Italian:"[civName] ha accettato la nostra offerta commerciale."
|
Italian:"[civName] ha accettato la nostra offerta commerciale."
|
||||||
|
@ -243,7 +243,7 @@ class GameInfo {
|
|||||||
// Since this depends on the cities of ALL civilizations,
|
// Since this depends on the cities of ALL civilizations,
|
||||||
// we need to wait until we've set the transients of all the cities before we can run this.
|
// we need to wait until we've set the transients of all the cities before we can run this.
|
||||||
// Hence why it's not in CivInfo.setTransients().
|
// Hence why it's not in CivInfo.setTransients().
|
||||||
civInfo.setCitiesConnectedToCapitalTransients()
|
civInfo.initialSetCitiesConnectedToCapitalTransients()
|
||||||
|
|
||||||
// We need to determine the GLOBAL happiness state in order to determine the city stats
|
// We need to determine the GLOBAL happiness state in order to determine the city stats
|
||||||
for(cityInfo in civInfo.cities) cityInfo.cityStats.updateCityHappiness()
|
for(cityInfo in civInfo.cities) cityInfo.cityStats.updateCityHappiness()
|
||||||
|
@ -64,7 +64,8 @@ class CivInfoTransientUpdater(val civInfo: CivilizationInfo){
|
|||||||
civInfo.containsBuildingUnique("Enemy land units must spend 1 extra movement point when inside your territory (obsolete upon Dynamite)")
|
civInfo.containsBuildingUnique("Enemy land units must spend 1 extra movement point when inside your territory (obsolete upon Dynamite)")
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setCitiesConnectedToCapitalTransients(){
|
|
||||||
|
fun setCitiesConnectedToCapitalTransients(initialSetup:Boolean=false){
|
||||||
if(civInfo.cities.isEmpty()) return // eg barbarians
|
if(civInfo.cities.isEmpty()) return // eg barbarians
|
||||||
|
|
||||||
// We map which cities we've reached, to the mediums they've been reached by -
|
// We map which cities we've reached, to the mediums they've been reached by -
|
||||||
@ -124,6 +125,12 @@ class CivInfoTransientUpdater(val civInfo: CivilizationInfo){
|
|||||||
citiesToCheck = newCitiesToCheck
|
citiesToCheck = newCitiesToCheck
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!initialSetup){ // In the initial setup we're loading an old game state, so it doesn't really count
|
||||||
|
for(city in citiesReachedToMediums.keys)
|
||||||
|
if(city !in civInfo.citiesConnectedToCapital)
|
||||||
|
civInfo.addNotification("[${city.name}] has been connected to your capital!",city.location, Color.GOLD)
|
||||||
|
}
|
||||||
|
|
||||||
civInfo.citiesConnectedToCapital = citiesReachedToMediums.keys.toList()
|
civInfo.citiesConnectedToCapital = citiesReachedToMediums.keys.toList()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -327,7 +327,7 @@ class CivilizationInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// implementation in a seperate class, to not clog up CivInfo
|
// implementation in a seperate class, to not clog up CivInfo
|
||||||
fun setCitiesConnectedToCapitalTransients() = transients().setCitiesConnectedToCapitalTransients()
|
fun initialSetCitiesConnectedToCapitalTransients() = transients().setCitiesConnectedToCapitalTransients(true)
|
||||||
fun updateHasActiveGreatWall() = transients().updateHasActiveGreatWall()
|
fun updateHasActiveGreatWall() = transients().updateHasActiveGreatWall()
|
||||||
fun updateViewableTiles() = transients().updateViewableTiles()
|
fun updateViewableTiles() = transients().updateViewableTiles()
|
||||||
fun updateDetailedCivResources() = transients().updateDetailedCivResources()
|
fun updateDetailedCivResources() = transients().updateDetailedCivResources()
|
||||||
@ -343,7 +343,7 @@ class CivilizationInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
updateViewableTiles() // adds explored tiles so that the units will be able to perform automated actions better
|
updateViewableTiles() // adds explored tiles so that the units will be able to perform automated actions better
|
||||||
setCitiesConnectedToCapitalTransients()
|
transients().setCitiesConnectedToCapitalTransients()
|
||||||
for (city in cities) city.startTurn()
|
for (city in cities) city.startTurn()
|
||||||
|
|
||||||
getCivUnits().toList().forEach { it.startTurn() }
|
getCivUnits().toList().forEach { it.startTurn() }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user