mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-28 22:37:02 -04:00
Better tech descriptions for increased improvement stats
This commit is contained in:
parent
4876687e48
commit
e92a1dd088
@ -924,6 +924,7 @@ Are you SURE you want to delete this mod? =
|
|||||||
|
|
||||||
[stats] from every [param] =
|
[stats] from every [param] =
|
||||||
[stats] from [param] tiles in this city =
|
[stats] from [param] tiles in this city =
|
||||||
|
[stats] from every [param] on [tileFilter] tiles =
|
||||||
[stats] for each adjacent [param] =
|
[stats] for each adjacent [param] =
|
||||||
Must be next to [terrain] =
|
Must be next to [terrain] =
|
||||||
Must be on [terrain] =
|
Must be on [terrain] =
|
||||||
|
@ -26,43 +26,37 @@ class Technology {
|
|||||||
val lineList = ArrayList<String>() // more readable than StringBuilder, with same performance for our use-case
|
val lineList = ArrayList<String>() // more readable than StringBuilder, with same performance for our use-case
|
||||||
for (unique in uniques) lineList += unique.tr()
|
for (unique in uniques) lineList += unique.tr()
|
||||||
|
|
||||||
val mapOfImprovedImprovements = HashMap<String, ArrayList<String>>()
|
for (improvement in ruleset.tileImprovements.values)
|
||||||
for (improvement in ruleset.tileImprovements.values) for ( unique in improvement.uniqueObjects
|
for (unique in improvement.uniqueObjects) {
|
||||||
.filter { it.placeholderText in setOf("[] once [] is discovered", "[] on [] tiles once [] is discovered")
|
if (unique.placeholderText == "[] once [] is discovered" && unique.params.last() == name)
|
||||||
&& it.params.last() == name }) {
|
lineList += "[${unique.params[0]}] from every [${improvement.name}]"
|
||||||
val key = if (unique.params.size == 2 ) "The following improvements [${unique.params[0]}]:" else "The following improvements on [${unique.params[1]}] tiles [${unique.params[0]}]:"
|
else if (unique.placeholderText == "[] on [] tiles once [] is discovered" && unique.params.last() == name)
|
||||||
if (!mapOfImprovedImprovements.containsKey(key)) mapOfImprovedImprovements[key] = ArrayList()
|
lineList += "[${unique.params[0]}] from every [${improvement.name}] on [${unique.params[1]}] tiles"
|
||||||
mapOfImprovedImprovements[key]!!.add(improvement.name)
|
}
|
||||||
}
|
|
||||||
for (improvements in mapOfImprovedImprovements) {
|
|
||||||
val impimpString = improvements.key.tr() + improvements.value.joinToString(", "," ") { it.tr() }
|
|
||||||
lineList += impimpString
|
|
||||||
}
|
|
||||||
|
|
||||||
val viewingCiv = UncivGame.Current.worldScreen.viewingCiv
|
val viewingCiv = UncivGame.Current.worldScreen.viewingCiv
|
||||||
val enabledUnits = getEnabledUnits(viewingCiv)
|
val enabledUnits = getEnabledUnits(viewingCiv).filter { "Will not be displayed in Civilopedia" !in it.uniques }
|
||||||
if (enabledUnits.any { "Will not be displayed in Civilopedia" !in it.uniques}) {
|
if (enabledUnits.isNotEmpty()) {
|
||||||
lineList += "{Units enabled}: "
|
lineList += "{Units enabled}: "
|
||||||
for (unit in enabledUnits
|
for (unit in enabledUnits)
|
||||||
.filter { "Will not be displayed in Civilopedia" !in it.uniques})
|
|
||||||
lineList += " * " + unit.name.tr() + " (" + unit.getShortDescription() + ")"
|
lineList += " * " + unit.name.tr() + " (" + unit.getShortDescription() + ")"
|
||||||
}
|
}
|
||||||
|
|
||||||
val enabledBuildings = getEnabledBuildings(viewingCiv)
|
val enabledBuildings = getEnabledBuildings(viewingCiv)
|
||||||
|
|
||||||
val regularBuildings = enabledBuildings.filter { !it.isWonder && !it.isNationalWonder }
|
val regularBuildings = enabledBuildings.filter { !it.isWonder && !it.isNationalWonder
|
||||||
if (regularBuildings.any { "Will not be displayed in Civilopedia" !in it.uniques}) {
|
&& "Will not be displayed in Civilopedia" !in it.uniques }
|
||||||
|
if (regularBuildings.isNotEmpty()) {
|
||||||
lineList += "{Buildings enabled}: "
|
lineList += "{Buildings enabled}: "
|
||||||
for (building in regularBuildings
|
for (building in regularBuildings)
|
||||||
.filter { "Will not be displayed in Civilopedia" !in it.uniques})
|
|
||||||
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 { (it.isWonder || it.isNationalWonder)
|
||||||
if (wonders.any { "Will not be displayed in Civilopedia" !in it.uniques }) {
|
&& "Will not be displayed in Civilopedia" !in it.uniques }
|
||||||
|
if (wonders.isNotEmpty()) {
|
||||||
lineList += "{Wonders enabled}: "
|
lineList += "{Wonders enabled}: "
|
||||||
for (wonder in wonders
|
for (wonder in wonders)
|
||||||
.filter { "Will not be displayed in Civilopedia" !in it.uniques})
|
|
||||||
lineList += " * " + wonder.name.tr() + " (" + wonder.getShortDescription(ruleset) + ")"
|
lineList += " * " + wonder.name.tr() + " (" + wonder.getShortDescription(ruleset) + ")"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user