diff --git a/android/assets/jsons/translations/template.properties b/android/assets/jsons/translations/template.properties index f97c1236c9..8052a549a8 100644 --- a/android/assets/jsons/translations/template.properties +++ b/android/assets/jsons/translations/template.properties @@ -163,6 +163,7 @@ Introduction to [nation] = Declare war on [nation] = Luxury resources = Strategic resources = +Owned: [amountOwned] = # Nation picker diff --git a/core/src/com/unciv/logic/city/CityInfo.kt b/core/src/com/unciv/logic/city/CityInfo.kt index 570d1b3f48..8cd790aa19 100644 --- a/core/src/com/unciv/logic/city/CityInfo.kt +++ b/core/src/com/unciv/logic/city/CityInfo.kt @@ -184,9 +184,9 @@ class CityInfo { if (resource.revealedBy!=null && !civInfo.tech.isResearched(resource.revealedBy!!)) return 0 // Even if the improvement exists (we conquered an enemy city or somesuch) or we have a city on it, we won't get the resource until the correct tech is researched - if (resource.improvement!=null){ + if (resource.improvement!=null) { val improvement = getRuleset().tileImprovements[resource.improvement!!]!! - if(improvement.techRequired!=null && !civInfo.tech.isResearched(improvement.techRequired!!)) return 0 + if (improvement.techRequired != null && !civInfo.tech.isResearched(improvement.techRequired!!)) return 0 } if (resource.improvement == tileInfo.improvement || tileInfo.isCityCenter() diff --git a/core/src/com/unciv/ui/worldscreen/TradePopup.kt b/core/src/com/unciv/ui/worldscreen/TradePopup.kt index b600d584e3..102e089f56 100644 --- a/core/src/com/unciv/ui/worldscreen/TradePopup.kt +++ b/core/src/com/unciv/ui/worldscreen/TradePopup.kt @@ -7,6 +7,7 @@ import com.unciv.Constants import com.unciv.logic.civilization.diplomacy.DiplomacyFlags import com.unciv.logic.trade.TradeEvaluation import com.unciv.logic.trade.TradeLogic +import com.unciv.logic.trade.TradeOffer import com.unciv.logic.trade.TradeType import com.unciv.models.translations.tr import com.unciv.ui.trade.DiplomacyScreen @@ -34,10 +35,19 @@ class TradePopup(worldScreen: WorldScreen): Popup(worldScreen){ tradeOffersTable.add("[${nation.name}]'s trade offer".toLabel()) tradeOffersTable.add("Our trade offer".toLabel()) tradeOffersTable.row() + val ourResources = viewingCiv.getCivResourcesByName() + + fun getOfferText(offer:TradeOffer): String { + var tradeText = offer.getOfferText() + if (offer.type == TradeType.Luxury_Resource || offer.type == TradeType.Strategic_Resource) + tradeText += "\n" + "Owned: [${ourResources[offer.name]}]" + return tradeText + } + for(i in 0..max(trade.theirOffers.lastIndex, trade.ourOffers.lastIndex)){ - if(trade.theirOffers.lastIndex>=i) tradeOffersTable.add(trade.theirOffers[i].getOfferText().toLabel()) + if(trade.theirOffers.lastIndex>=i) tradeOffersTable.add(getOfferText(trade.theirOffers[i]).toLabel()) else tradeOffersTable.add() - if(trade.ourOffers.lastIndex>=i) tradeOffersTable.add(trade.ourOffers[i].getOfferText().toLabel()) + if(trade.ourOffers.lastIndex>=i) tradeOffersTable.add(getOfferText(trade.ourOffers[i]).toLabel()) else tradeOffersTable.add() tradeOffersTable.row() }