mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-19 20:28:56 +07:00
Add city size (population) to TradeOffer.kt (#8956)
* Add city size (population) to TradeOffer.kt * Add .tr() to city name * Improve i18n * Deprove i18n
This commit is contained in:
@ -38,7 +38,11 @@ data class TradeOffer(val name: String, val type: TradeType, var amount: Int = 1
|
|||||||
var offerText = when(type){
|
var offerText = when(type){
|
||||||
TradeType.WarDeclaration -> "Declare war on [$name]"
|
TradeType.WarDeclaration -> "Declare war on [$name]"
|
||||||
TradeType.Introduction -> "Introduction to [$name]"
|
TradeType.Introduction -> "Introduction to [$name]"
|
||||||
TradeType.City -> UncivGame.Current.gameInfo!!.getCities().firstOrNull{ it.id == name }?.name ?: "Non-existent city"
|
TradeType.City -> {
|
||||||
|
val city =
|
||||||
|
UncivGame.Current.gameInfo!!.getCities().firstOrNull { it.id == name }
|
||||||
|
city?.run { "{$name} (${population.population})" } ?: "Non-existent city"
|
||||||
|
}
|
||||||
else -> name
|
else -> name
|
||||||
}.tr()
|
}.tr()
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user