From 038ac1e48b57191a8f0ea5adcfd52bd6b25d417d Mon Sep 17 00:00:00 2001 From: 9kgsofrice <65415105+9kgsofrice@users.noreply.github.com> Date: Sun, 22 Nov 2020 18:52:50 +0000 Subject: [PATCH] Units/buildings with "Will not be displayed in Civilopedia" now will not show in tech tree (#3359) * adds unique "Will not be displayed in Tech Tree" * Changed "Will not be displayed in Tech Tree" to "Will not be displayed in Civilopedia", avoiding bloat --- core/src/com/unciv/models/ruleset/tech/Technology.kt | 6 ++++-- core/src/com/unciv/ui/pickerscreens/TechButton.kt | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/core/src/com/unciv/models/ruleset/tech/Technology.kt b/core/src/com/unciv/models/ruleset/tech/Technology.kt index dc842e4a54..738ca00a52 100644 --- a/core/src/com/unciv/models/ruleset/tech/Technology.kt +++ b/core/src/com/unciv/models/ruleset/tech/Technology.kt @@ -49,7 +49,8 @@ class Technology { val enabledUnits = getEnabledUnits(viewingCiv) if (enabledUnits.isNotEmpty()) { 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() + ")" } @@ -58,7 +59,8 @@ class Technology { val regularBuildings = enabledBuildings.filter { !it.isWonder && !it.isNationalWonder } if (regularBuildings.isNotEmpty()) { 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) + ")" } diff --git a/core/src/com/unciv/ui/pickerscreens/TechButton.kt b/core/src/com/unciv/ui/pickerscreens/TechButton.kt index 151abed4f0..9d684bfc3b 100644 --- a/core/src/com/unciv/ui/pickerscreens/TechButton.kt +++ b/core/src/com/unciv/ui/pickerscreens/TechButton.kt @@ -45,10 +45,12 @@ class TechButton(techName:String, private val techManager: TechManager, isWorldS val tech = ruleset.technologies[techName]!! - for (unit in tech.getEnabledUnits(techManager.civInfo)) + for (unit in tech.getEnabledUnits(techManager.civInfo) + .filter { "Will not be displayed in Civilopedia" !in it.uniques}) techEnabledIcons.add(ImageGetter.getConstructionImage(unit.name).surroundWithCircle(techIconSize)) - for (building in tech.getEnabledBuildings(techManager.civInfo)) + for (building in tech.getEnabledBuildings(techManager.civInfo) + .filter { "Will not be displayed in Civilopedia" !in it.uniques}) techEnabledIcons.add(ImageGetter.getConstructionImage(building.name).surroundWithCircle(techIconSize)) for(building in tech.getObsoletedBuildings(techManager.civInfo) )