From 03ffa84bd37c2a2ca5fd86338f90046b65cbdc7d Mon Sep 17 00:00:00 2001 From: chr_56 <30681738+chr56@users.noreply.github.com> Date: Wed, 26 Apr 2023 20:43:13 +0800 Subject: [PATCH] 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` --- .../ui/screens/overviewscreen/CityOverviewTable.kt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/core/src/com/unciv/ui/screens/overviewscreen/CityOverviewTable.kt b/core/src/com/unciv/ui/screens/overviewscreen/CityOverviewTable.kt index d1da68ff6e..9c98dcb64b 100644 --- a/core/src/com/unciv/ui/screens/overviewscreen/CityOverviewTable.kt +++ b/core/src/com/unciv/ui/screens/overviewscreen/CityOverviewTable.kt @@ -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()