Merge pull request #618 from ninjatao/future_tech

Avoid future tech blocking ending turn.
This commit is contained in:
Yair Morgenstern
2019-04-01 07:23:11 +03:00
committed by GitHub

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