This commit is contained in:
YueR 2019-09-25 10:58:48 +08:00
parent 2a63d53f7e
commit 9e24c6e2b9

View file

@ -72,7 +72,7 @@ class TechPickerScreen(internal val civInfo: CivilizationInfo, switchfromWorldSc
val techButton = TechButton(tech.name,civTech,false) val techButton = TechButton(tech.name,civTech,false)
techNameToButton[tech.name] = techButton techNameToButton[tech.name] = techButton
techButton.onClick { selectTechnology(tech) } techButton.onClick { selectTechnology(tech, false, switchfromWorldScreen) }
topTable.add(techButton) topTable.add(techButton)
} }
} }
@ -115,10 +115,10 @@ class TechPickerScreen(internal val civInfo: CivilizationInfo, switchfromWorldSc
// and possibly select it to show description, // and possibly select it to show description,
// which is very helpful when just discovered and clicking the notification // which is very helpful when just discovered and clicking the notification
val tech = if (centerOnTech != null) centerOnTech else civInfo.tech.currentTechnology() val tech = if (centerOnTech != null) centerOnTech else civInfo.tech.currentTechnology()
if (tech != null && switchfromWorldScreen) { if (tech != null) {
// select only if there it doesn't mess up tempTechsToResearch // select only if there it doesn't mess up tempTechsToResearch
if (civInfo.tech.isResearched(tech.name) || civInfo.tech.techsToResearch.size <= 1) if (civInfo.tech.isResearched(tech.name) || civInfo.tech.techsToResearch.size <= 1)
selectTechnology(tech, true) selectTechnology(tech, true, switchfromWorldScreen)
else centerOnTechnology(tech) else centerOnTechnology(tech)
} }