mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-12 08:49:22 +07:00
Game can now handle modded unique buildings that don't replace anything existing
This commit is contained in:
@ -29,7 +29,7 @@ data class TradeOffer(var name:String, var type: TradeType, var amount:Int=1, va
|
||||
var offerText = when(type){
|
||||
TradeType.WarDeclaration -> "Declare war on [$name]"
|
||||
TradeType.Introduction -> "Introduction to [$name]"
|
||||
TradeType.City -> UncivGame.Current.gameInfo.getCities().first{ it.id == name }.name
|
||||
TradeType.City -> UncivGame.Current.gameInfo.getCities().firstOrNull{ it.id == name }?.name ?: "Non-existent city"
|
||||
else -> name
|
||||
}.tr()
|
||||
if (type !in tradesToNotHaveNumbers || name=="Research Agreement") offerText += " ($amount)"
|
||||
|
@ -100,6 +100,8 @@ class Nation : INamed {
|
||||
private fun addUniqueBuildingsText(textList: ArrayList<String>, ruleset: Ruleset) {
|
||||
for (building in ruleset.buildings.values
|
||||
.filter { it.uniqueTo == name }) {
|
||||
if (building.replaces == null) textList += building.getShortDescription(ruleset)
|
||||
else {
|
||||
val originalBuilding = ruleset.buildings[building.replaces!!]!!
|
||||
|
||||
textList += building.name.tr() + " - " + "Replaces [${originalBuilding.name}]".tr()
|
||||
@ -121,6 +123,7 @@ class Nation : INamed {
|
||||
textList += ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun addUniqueUnitsText(textList: ArrayList<String>, ruleset: Ruleset) {
|
||||
for (unit in ruleset.units.values
|
||||
|
Reference in New Issue
Block a user