fix that researched tech can be picked when we pick a free tech (#1049)

* systemProp

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* fix that researched tech can be picked when we pick a free tech

* update to master

* update

* Update TechPickerScreen.kt
This commit is contained in:
lishaoxia1985
2019-09-10 03:43:00 +08:00
committed by Yair Morgenstern
parent 6c3c4bf7af
commit a8663dda91
2 changed files with 6 additions and 4 deletions

View File

@ -298,7 +298,7 @@
German:"Kostenloser Solzialgrundsatz"
Dutch:"Gratis sociaalbeleid"
Spanish:"Política social gratis"
Simplified_Chinese:"获得1次免费推行社会政策的机会"
Simplified_Chinese:"免费推行1项社会政策"
Portuguese:"Politica social gratis"
Polish:"Darmowy ustrój społeczny"
}

View File

@ -125,9 +125,10 @@ class TechPickerScreen(internal val civInfo: CivilizationInfo, centerOnTech: Tec
civTech.isResearched(techName) && techName!="Future Tech" -> techButton.color = researchedTechColor
tempTechsToResearch.isNotEmpty() && tempTechsToResearch.first() == techName -> techButton.color = currentTechColor
tempTechsToResearch.contains(techName) -> techButton.color = queuedTechColor
researchableTechs.contains(techName) -> techButton.color = researchableTechColor
else -> techButton.color = Color.BLACK
}
//the tech that can be selected to research immediately should be always researchableTechColor, it's very good when we pick a free tech.
if (researchableTechs.contains(techName)&&!civTech.isResearched(techName)) techButton.color = researchableTechColor
var text = techName.tr()
@ -161,6 +162,7 @@ class TechPickerScreen(internal val civInfo: CivilizationInfo, centerOnTech: Tec
if (isFreeTechPick) {
selectTechnologyForFreeTech(tech)
setButtonsInfo()
return
}
@ -189,7 +191,7 @@ class TechPickerScreen(internal val civInfo: CivilizationInfo, centerOnTech: Tec
private fun selectTechnologyForFreeTech(tech: Technology) {
if (researchableTechs.contains(tech.name)) {
if (researchableTechs.contains(tech.name)&&!civTech.isResearched(tech.name)) {
pick("Pick [${selectedTech!!.name}] as free tech".tr())
} else {
rightSideButton.setText("Pick a free tech".tr())
@ -197,4 +199,4 @@ class TechPickerScreen(internal val civInfo: CivilizationInfo, centerOnTech: Tec
}
}
}
}