From e80dc879bb61314796f6907b684e528ddad78332 Mon Sep 17 00:00:00 2001 From: 9kgsofrice <65415105+9kgsofrice@users.noreply.github.com> Date: Mon, 7 Dec 2020 20:26:34 +0000 Subject: [PATCH] wonder text will not be displayed & "[] enabled:" will not show if nothing visible in list (#3399) --- core/src/com/unciv/models/ruleset/tech/Technology.kt | 9 +++++---- 1 file changed, 5 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 738ca00a52..609aa87079 100644 --- a/core/src/com/unciv/models/ruleset/tech/Technology.kt +++ b/core/src/com/unciv/models/ruleset/tech/Technology.kt @@ -47,7 +47,7 @@ class Technology { val viewingCiv = UncivGame.Current.worldScreen.viewingCiv val enabledUnits = getEnabledUnits(viewingCiv) - if (enabledUnits.isNotEmpty()) { + if (enabledUnits.any { "Will not be displayed in Civilopedia" !in it.uniques}) { lineList += "{Units enabled}: " for (unit in enabledUnits .filter { "Will not be displayed in Civilopedia" !in it.uniques}) @@ -57,7 +57,7 @@ class Technology { val enabledBuildings = getEnabledBuildings(viewingCiv) val regularBuildings = enabledBuildings.filter { !it.isWonder && !it.isNationalWonder } - if (regularBuildings.isNotEmpty()) { + if (regularBuildings.any { "Will not be displayed in Civilopedia" !in it.uniques}) { lineList += "{Buildings enabled}: " for (building in regularBuildings .filter { "Will not be displayed in Civilopedia" !in it.uniques}) @@ -65,9 +65,10 @@ class Technology { } val wonders = enabledBuildings.filter { it.isWonder || it.isNationalWonder } - if (wonders.isNotEmpty()) { + if (wonders.any { "Will not be displayed in Civilopedia" !in it.uniques }) { 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) + ")" }