From 53a836201d504b7691df410e60159058659f35bb Mon Sep 17 00:00:00 2001 From: givehub99 <71454921+givehub99@users.noreply.github.com> Date: Mon, 21 Sep 2020 11:45:49 -0700 Subject: [PATCH] This allows mods to override unique text for nations. This is useful for using uniques but phrasing them differently when shown to the player. (#3166) The attribute in the nation json to change this is "uniqueText" A mod to test this is here, it changes Babylon's unique text to "Test Babylon Unique Text" https://cdn.discordapp.com/attachments/670547794951405584/757393404924526672/Test_Custom_Nation_Unique_Text.zip --- core/src/com/unciv/models/ruleset/Nation.kt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/core/src/com/unciv/models/ruleset/Nation.kt b/core/src/com/unciv/models/ruleset/Nation.kt index 3a433d3b82..96915a2cbb 100644 --- a/core/src/com/unciv/models/ruleset/Nation.kt +++ b/core/src/com/unciv/models/ruleset/Nation.kt @@ -39,6 +39,7 @@ class Nation : INamed { var uniqueName = "" var uniques = HashSet() val uniqueObjects: List by lazy { uniques.map { Unique(it) } } + var uniqueText = "" var innerColor: List? = null var startBias = ArrayList() @@ -92,8 +93,13 @@ class Nation : INamed { } if (uniqueName != "") textList += uniqueName.tr() + ":" - textList += " " + uniques.joinToString(", ") { it.tr() } - textList += "" + if (uniqueText != "") { + textList += " " + uniqueText.tr() + } + else { + textList += " " + uniques.joinToString(", ") { it.tr() } + textList += "" + } if (startBias.isNotEmpty()) { textList += "Start bias:".tr() + startBias.joinToString(", ", " ") { it.tr() }