Avoid future tech blocking ending turn.

This commit is contained in:
Duan Tao 2019-04-01 09:54:59 +08:00
parent 9eb9176b2a
commit 0bbcc39eca

View file

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