mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-21 13:18:56 +07:00
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:
@ -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)
|
||||
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
@ -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),
|
||||
|
Reference in New Issue
Block a user