mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-28 06:16:37 -04:00
Added icons to resource trades & war declarations (#5376)
This commit is contained in:
parent
091622612c
commit
238cbb782a
@ -56,9 +56,10 @@ class OffersListScroll(
|
||||
|
||||
for (offerType in values()) {
|
||||
val offersOfType = offersToDisplay.filter { it.type == offerType }
|
||||
.sortedWith(compareBy({
|
||||
if (UncivGame.Current.settings.orderTradeOffersByAmount) -it.amount else 0},
|
||||
{if (it.type==City) it.getOfferText() else it.name.tr()}))
|
||||
.sortedWith(compareBy(
|
||||
{ if (UncivGame.Current.settings.orderTradeOffersByAmount) -it.amount else 0 },
|
||||
{ if (it.type==City) it.getOfferText() else it.name.tr() }
|
||||
))
|
||||
|
||||
if (expanderTabs.containsKey(offerType)) {
|
||||
expanderTabs[offerType]!!.innerTable.clear()
|
||||
@ -67,6 +68,15 @@ class OffersListScroll(
|
||||
|
||||
for (offer in offersOfType) {
|
||||
val tradeButton = offer.getOfferText(untradableOffers.filter { it.resource.name == offer.name }.sumOf { it.amount }).toTextButton()
|
||||
tradeButton.labelCell.pad(5f)
|
||||
when (offer.type) {
|
||||
Luxury_Resource, Strategic_Resource ->
|
||||
tradeButton.add(ImageGetter.getResourceImage(offer.name, 30f))
|
||||
WarDeclaration ->
|
||||
tradeButton.add(ImageGetter.getNationIndicator(UncivGame.Current.gameInfo.ruleSet.nations[offer.name]!!, 30f))
|
||||
else -> Unit // Remove warning
|
||||
}
|
||||
|
||||
val amountPerClick =
|
||||
if (offer.type == Gold) 50
|
||||
else 1
|
||||
|
@ -11,7 +11,8 @@ class TradeTable(val otherCivilization: CivilizationInfo, stage: DiplomacyScreen
|
||||
val currentPlayerCiv = otherCivilization.gameInfo.getCurrentPlayerCivilization()
|
||||
var tradeLogic = TradeLogic(currentPlayerCiv,otherCivilization)
|
||||
var offerColumnsTable = OfferColumnsTable(tradeLogic, stage) { onChange() }
|
||||
var offerColumnsTableWrapper = Table() // This is so that after a trade has been traded, we can switch out the offersToDisplay to start anew - this is the easiest way
|
||||
// This is so that after a trade has been traded, we can switch out the offersToDisplay to start anew - this is the easiest way
|
||||
var offerColumnsTableWrapper = Table()
|
||||
val offerButton = "Offer trade".toTextButton()
|
||||
|
||||
fun isTradeOffered() = otherCivilization.tradeRequests.any { it.requestingCiv == currentPlayerCiv.civName }
|
||||
|
Loading…
x
Reference in New Issue
Block a user