Better Resource order in empire overview screen (#2577)

This commit is contained in:
SomeTroglodyte 2020-05-04 21:10:24 +02:00 committed by GitHub
parent 2b3a9c14bf
commit a940eda4a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -542,8 +542,11 @@ class EmpireOverviewScreen(private val viewingPlayer:CivilizationInfo, private v
// First row of table has all the icons
resourcesTable.add()
// Order of source ResourceSupplyList: by tiles, enumerating the map in that spiral pattern
// UI should not surprise player, thus we need a deterministic and guessable order
val resources = resourceDrilldown.map { it.resource }
.filter { it.resourceType!=ResourceType.Bonus }.distinct().sortedBy { it.resourceType }
.filter { it.resourceType!=ResourceType.Bonus }.distinct()
.sortedWith(compareBy( { it.resourceType }, { it.name.tr() } ))
var visibleLabel: Label? = null
for(resource in resources) {
@ -630,4 +633,4 @@ class EmpireOverviewScreen(private val viewingPlayer:CivilizationInfo, private v
return civGroup
}
}
}
}