From 0bbcc39eca431f6b01c0eec30945f450294fafb0 Mon Sep 17 00:00:00 2001 From: Duan Tao Date: Mon, 1 Apr 2019 09:54:59 +0800 Subject: [PATCH] Avoid future tech blocking ending turn. --- core/src/com/unciv/ui/worldscreen/WorldScreen.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/src/com/unciv/ui/worldscreen/WorldScreen.kt b/core/src/com/unciv/ui/worldscreen/WorldScreen.kt index 9e65b70e..e5fe495e 100644 --- a/core/src/com/unciv/ui/worldscreen/WorldScreen.kt +++ b/core/src/com/unciv/ui/worldscreen/WorldScreen.kt @@ -12,6 +12,7 @@ import com.unciv.logic.civilization.CivilizationInfo import com.unciv.logic.civilization.diplomacy.DiplomaticIncident import com.unciv.logic.civilization.diplomacy.DiplomaticIncidentType import com.unciv.logic.civilization.diplomacy.DiplomaticStatus +import com.unciv.models.gamebasics.GameBasics import com.unciv.models.gamebasics.tile.ResourceType import com.unciv.models.gamebasics.tr import com.unciv.models.gamebasics.unit.UnitType @@ -191,9 +192,12 @@ class WorldScreen : CameraStageBaseScreen() { private fun updateTechButton(civInfo: CivilizationInfo) { techButton.isVisible = civInfo.cities.isNotEmpty() - techButton.clearChildren() + val researchableTechs = GameBasics.Technologies.values.filter { !civInfo.tech.isResearched(it.name) && civInfo.tech.canBeResearched(it.name) } + if (civInfo.tech.currentTechnology() == null && researchableTechs.isEmpty()) + civInfo.tech.techsToResearch.add("Future Tech") + if (civInfo.tech.currentTechnology() == null) { val buttonPic = Table() buttonPic.background = ImageGetter.getDrawable("OtherIcons/civTableBackground.png")