mirror of
https://github.com/yairm210/Unciv.git
synced 2025-08-04 00:59:41 +07:00
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
This commit is contained in:
@ -39,6 +39,7 @@ class Nation : INamed {
|
|||||||
var uniqueName = ""
|
var uniqueName = ""
|
||||||
var uniques = HashSet<String>()
|
var uniques = HashSet<String>()
|
||||||
val uniqueObjects: List<Unique> by lazy { uniques.map { Unique(it) } }
|
val uniqueObjects: List<Unique> by lazy { uniques.map { Unique(it) } }
|
||||||
|
var uniqueText = ""
|
||||||
var innerColor: List<Int>? = null
|
var innerColor: List<Int>? = null
|
||||||
var startBias = ArrayList<String>()
|
var startBias = ArrayList<String>()
|
||||||
|
|
||||||
@ -92,8 +93,13 @@ class Nation : INamed {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (uniqueName != "") textList += uniqueName.tr() + ":"
|
if (uniqueName != "") textList += uniqueName.tr() + ":"
|
||||||
textList += " " + uniques.joinToString(", ") { it.tr() }
|
if (uniqueText != "") {
|
||||||
textList += ""
|
textList += " " + uniqueText.tr()
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
textList += " " + uniques.joinToString(", ") { it.tr() }
|
||||||
|
textList += ""
|
||||||
|
}
|
||||||
|
|
||||||
if (startBias.isNotEmpty()) {
|
if (startBias.isNotEmpty()) {
|
||||||
textList += "Start bias:".tr() + startBias.joinToString(", ", " ") { it.tr() }
|
textList += "Start bias:".tr() + startBias.joinToString(", ", " ") { it.tr() }
|
||||||
|
Reference in New Issue
Block a user