Allow to reveal explored resources from a city's demanding resources in CityOverviewTab (#9287)

* allow to locate explored resources from a city's demanding resources in `CityOverviewTab`

* better code of `updateCities` in `CityOverviewTab`
This commit is contained in:
chr_56 2023-04-26 20:43:13 +08:00 committed by GitHub
parent cccaa88456
commit 03ffa84bd3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -229,8 +229,14 @@ class CityOverviewTab(
cityInfoTableDetails.add(image)
}
city.demandedResource.isNotEmpty() -> {
val image = ImageGetter.getResourcePortrait(city.demandedResource, iconSize *0.7f)
image.addTooltip("Demanding [${city.demandedResource}]", 18f, tipAlign = Align.topLeft)
val image = ImageGetter.getResourcePortrait(city.demandedResource, iconSize *0.7f).apply {
addTooltip("Demanding [${city.demandedResource}]", 18f, tipAlign = Align.topLeft)
onClick {
if (gameInfo.notifyExploredResources(viewingPlayer, city.demandedResource, 0, true)) {
overviewScreen.game.popScreen()
}
}
}
cityInfoTableDetails.add(image)
}
else -> cityInfoTableDetails.add()