mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-26 07:39:44 +07:00
Tech info can display more than one revealed resource
This commit is contained in:
@ -44,29 +44,34 @@ class Technology {
|
|||||||
|
|
||||||
val enabledBuildings = getEnabledBuildings(viewingCiv)
|
val enabledBuildings = getEnabledBuildings(viewingCiv)
|
||||||
|
|
||||||
val regularBuildings = enabledBuildings.filter { !it.isWonder && !it.isNationalWonder
|
val regularBuildings = enabledBuildings.filter {
|
||||||
&& "Will not be displayed in Civilopedia" !in it.uniques }
|
!it.isWonder && !it.isNationalWonder
|
||||||
|
&& "Will not be displayed in Civilopedia" !in it.uniques
|
||||||
|
}
|
||||||
if (regularBuildings.isNotEmpty()) {
|
if (regularBuildings.isNotEmpty()) {
|
||||||
lineList += "{Buildings enabled}: "
|
lineList += "{Buildings enabled}: "
|
||||||
for (building in regularBuildings)
|
for (building in regularBuildings)
|
||||||
lineList += "* " + building.name.tr() + " (" + building.getShortDescription(ruleset) + ")"
|
lineList += "* " + building.name.tr() + " (" + building.getShortDescription(ruleset) + ")"
|
||||||
}
|
}
|
||||||
|
|
||||||
val wonders = enabledBuildings.filter { (it.isWonder || it.isNationalWonder)
|
val wonders = enabledBuildings.filter {
|
||||||
&& "Will not be displayed in Civilopedia" !in it.uniques }
|
(it.isWonder || it.isNationalWonder)
|
||||||
|
&& "Will not be displayed in Civilopedia" !in it.uniques
|
||||||
|
}
|
||||||
if (wonders.isNotEmpty()) {
|
if (wonders.isNotEmpty()) {
|
||||||
lineList += "{Wonders enabled}: "
|
lineList += "{Wonders enabled}: "
|
||||||
for (wonder in wonders)
|
for (wonder in wonders)
|
||||||
lineList += " * " + wonder.name.tr() + " (" + wonder.getShortDescription(ruleset) + ")"
|
lineList += " * " + wonder.name.tr() + " (" + wonder.getShortDescription(ruleset) + ")"
|
||||||
}
|
}
|
||||||
|
|
||||||
for(building in getObsoletedBuildings(viewingCiv)
|
for (building in getObsoletedBuildings(viewingCiv)
|
||||||
.filter { "Will not be displayed in Civilopedia" !in it.uniques })
|
.filter { "Will not be displayed in Civilopedia" !in it.uniques })
|
||||||
lineList += "[${building.name}] obsoleted"
|
lineList += "[${building.name}] obsoleted"
|
||||||
|
|
||||||
val revealedResource = ruleset.tileResources.values.filter { it.revealedBy == name }
|
|
||||||
.map { it.name }.firstOrNull() // can only be one
|
for (resource in ruleset.tileResources.values.asSequence().filter { it.revealedBy == name }
|
||||||
if (revealedResource != null) lineList += "Reveals [$revealedResource] on the map"
|
.map { it.name })
|
||||||
|
lineList += "Reveals [$resource] on the map"
|
||||||
|
|
||||||
val tileImprovements = ruleset.tileImprovements.values.filter { it.techRequired == name }
|
val tileImprovements = ruleset.tileImprovements.values.filter { it.techRequired == name }
|
||||||
if (tileImprovements.isNotEmpty())
|
if (tileImprovements.isNotEmpty())
|
||||||
|
Reference in New Issue
Block a user