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 <yairm210@hotmail.com>
This commit is contained in:
rh-github-2015 2020-03-22 20:00:18 +01:00 committed by GitHub
parent 8836800957
commit c647261a18
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 23 additions and 6 deletions

View file

@ -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

View file

@ -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] =

View file

@ -67,14 +67,23 @@ class Nation : INamed {
fun getUniqueString(ruleset: Ruleset): String {
fun getUniqueString(ruleset: Ruleset, forPickerScreen: Boolean = true): String {
val textList = ArrayList<String>()
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)

View file

@ -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<String> = 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()
}
}

View file

@ -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),