Bug: turnsLabel accumulates touchFocuses endlessly (#3874)

* Bug: turnsLabel accumulates touchFocuses endlessly

* May resolve #3862: Resource revealed notification can point to all reveals - better
This commit is contained in:
SomeTroglodyte 2021-05-04 21:14:16 +02:00 committed by GitHub
parent a25777f380
commit d679632523
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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() + ")"