From d679632523e1aa3a608a8ab0b5ce1d14ba5a7300 Mon Sep 17 00:00:00 2001 From: SomeTroglodyte <63000004+SomeTroglodyte@users.noreply.github.com> Date: Tue, 4 May 2021 21:14:16 +0200 Subject: [PATCH] Bug: turnsLabel accumulates touchFocuses endlessly (#3874) * Bug: turnsLabel accumulates touchFocuses endlessly * May resolve #3862: Resource revealed notification can point to all reveals - better --- core/src/com/unciv/ui/worldscreen/WorldScreenTopBar.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/com/unciv/ui/worldscreen/WorldScreenTopBar.kt b/core/src/com/unciv/ui/worldscreen/WorldScreenTopBar.kt index 03b82c506d..ace87d7ed1 100644 --- a/core/src/com/unciv/ui/worldscreen/WorldScreenTopBar.kt +++ b/core/src/com/unciv/ui/worldscreen/WorldScreenTopBar.kt @@ -58,6 +58,7 @@ class WorldScreenTopBar(val worldScreen: WorldScreen) : Table() { private fun getResourceTable(): Table { val resourceTable = Table() resourceTable.defaults().pad(5f) + turnsLabel.onClick { worldScreen.game.setScreen(VictoryScreen(worldScreen)) } resourceTable.add(turnsLabel).padRight(20f) val revealedStrategicResources = worldScreen.gameInfo.ruleSet.tileResources.values .filter { it.resourceType == ResourceType.Strategic } // && currentPlayerCivInfo.tech.isResearched(it.revealedBy!!) } @@ -189,7 +190,6 @@ class WorldScreenTopBar(val worldScreen: WorldScreen) : Table() { val yearText = "[" + abs(year) + "] " + if (year < 0) "BC" else "AD" turnsLabel.setText(Fonts.turn + "" + civInfo.gameInfo.turns + " | " + yearText.tr()) - turnsLabel.onClick { worldScreen.game.setScreen(VictoryScreen(worldScreen)) } val nextTurnStats = civInfo.statsForNextTurn val goldPerTurn = "(" + (if (nextTurnStats.gold > 0) "+" else "") + nextTurnStats.gold.roundToInt() + ")"