From c647261a18f540fa65dfbd946e4df758ad0a832d Mon Sep 17 00:00:00 2001 From: rh-github-2015 Date: Sun, 22 Mar 2020 20:00:18 +0100 Subject: [PATCH] More civilopedia info for nation and improvement (#2190) * A little more information in civilopedia for improvements and nations * Differentiate civilopedia and picker use * Missing lines in translations template * allTranslationsEndWithASpace test Co-authored-by: Yair Morgenstern --- .../assets/jsons/translations/German.properties | 2 ++ .../assets/jsons/translations/template.properties | 2 ++ core/src/com/unciv/models/ruleset/Nation.kt | 15 ++++++++++++--- .../unciv/models/ruleset/tile/TileImprovement.kt | 6 +++++- core/src/com/unciv/ui/CivilopediaScreen.kt | 4 ++-- 5 files changed, 23 insertions(+), 6 deletions(-) diff --git a/android/assets/jsons/translations/German.properties b/android/assets/jsons/translations/German.properties index cfc972fd..8aca28db 100644 --- a/android/assets/jsons/translations/German.properties +++ b/android/assets/jsons/translations/German.properties @@ -536,6 +536,7 @@ Social policies = Sozialpolitiken Community = Gemeinschaft Close = Schließen Do you want to exit the game? = Willst du das Spiel schließen? +Start bias: = Start-Präferenz: # City screen @@ -708,6 +709,7 @@ Resources = Ressourcen Terrains = Gelände Tile Improvements = Modernisierungen Unique to [civName], replaces [unitName] = Einzigartig für Zivilisation [civName], ersetzt [unitName] +Unique to [civName] = Einzigartig für Zivilisation [civName] Tutorials = Tutorials Cost = Kosten May contain [listOfResources] = kann [listOfResources] enthalten diff --git a/android/assets/jsons/translations/template.properties b/android/assets/jsons/translations/template.properties index b72c898e..f40fe8d7 100644 --- a/android/assets/jsons/translations/template.properties +++ b/android/assets/jsons/translations/template.properties @@ -536,6 +536,7 @@ Social policies = Community = Close = Do you want to exit the game? = +Start bias: = # City screen @@ -708,6 +709,7 @@ Resources = Terrains = Tile Improvements = Unique to [civName], replaces [unitName] = +Unique to [civName] = Tutorials = Cost = May contain [listOfResources] = diff --git a/core/src/com/unciv/models/ruleset/Nation.kt b/core/src/com/unciv/models/ruleset/Nation.kt index 036896ae..13467a4e 100644 --- a/core/src/com/unciv/models/ruleset/Nation.kt +++ b/core/src/com/unciv/models/ruleset/Nation.kt @@ -67,14 +67,23 @@ class Nation : INamed { - fun getUniqueString(ruleset: Ruleset): String { + fun getUniqueString(ruleset: Ruleset, forPickerScreen: Boolean = true): String { val textList = ArrayList() - if (unique != null) { - textList += unique!!.description.tr() + if (leaderName.isNotEmpty() && !forPickerScreen){ + textList += getLeaderDisplayName().tr() textList += "" } + if (unique != null) { + textList += unique!!.displayName.tr() + ":" + textList += " " + unique!!.description.tr() + textList += "" + } + if (startBias.isNotEmpty()) { + textList += "Start bias:".tr() + startBias.joinToString(", ", " ") { it.tr() } + textList += "" + } addUniqueBuildingsText(textList,ruleset) addUniqueUnitsText(textList,ruleset) addUniqueImprovementsText(textList,ruleset) diff --git a/core/src/com/unciv/models/ruleset/tile/TileImprovement.kt b/core/src/com/unciv/models/ruleset/tile/TileImprovement.kt index ac6e0d72..1de39a29 100644 --- a/core/src/com/unciv/models/ruleset/tile/TileImprovement.kt +++ b/core/src/com/unciv/models/ruleset/tile/TileImprovement.kt @@ -30,9 +30,10 @@ class TileImprovement : NamedStats() { return realTurnsToBuild.roundToInt() } - fun getDescription(ruleset: Ruleset): String { + fun getDescription(ruleset: Ruleset, forPickerScreen: Boolean = true): String { val stringBuilder = StringBuilder() if (this.clone().toString().isNotEmpty()) stringBuilder.appendln(this.clone().toString()) + if (uniqueTo!=null && !forPickerScreen) stringBuilder.appendln("Unique to [$uniqueTo]".tr()) if (!terrainsCanBeBuiltOn.isEmpty()) { val terrainsCanBeBuiltOnString: ArrayList = arrayListOf() for (i in terrainsCanBeBuiltOn) { @@ -53,6 +54,9 @@ class TileImprovement : NamedStats() { if (techRequired != null) stringBuilder.appendln("Required tech: [$techRequired]".tr()) + for(unique in uniques) + stringBuilder.appendln (unique.tr()) + return stringBuilder.toString() } } diff --git a/core/src/com/unciv/ui/CivilopediaScreen.kt b/core/src/com/unciv/ui/CivilopediaScreen.kt index 2657a19d..f67c7a92 100644 --- a/core/src/com/unciv/ui/CivilopediaScreen.kt +++ b/core/src/com/unciv/ui/CivilopediaScreen.kt @@ -67,14 +67,14 @@ class CivilopediaScreen(ruleset: Ruleset) : CameraStageBaseScreen() { categoryToEntries["Terrains"] = ruleset.terrains.values .map { CivilopediaEntry(it.name,it.getDescription(ruleset)) } categoryToEntries["Tile Improvements"] = ruleset.tileImprovements.values - .map { CivilopediaEntry(it.name,it.getDescription(ruleset), + .map { CivilopediaEntry(it.name,it.getDescription(ruleset,false), ImageGetter.getImprovementIcon(it.name,50f)) } categoryToEntries["Units"] = ruleset.units.values .map { CivilopediaEntry(it.name,it.getDescription(false), ImageGetter.getConstructionImage(it.name)) } categoryToEntries["Nations"] = ruleset.nations.values .filter { it.isMajorCiv() } - .map { CivilopediaEntry(it.name,it.getUniqueString(ruleset), + .map { CivilopediaEntry(it.name,it.getUniqueString(ruleset,false), ImageGetter.getNationIndicator(it,50f)) } categoryToEntries["Technologies"] = ruleset.technologies.values .map { CivilopediaEntry(it.name,it.getDescription(ruleset),