Resolved #12276 - Free tech pickable in any way you enter the tech screen

This commit is contained in:
yairm210
2024-10-13 16:15:50 +03:00
parent e105a6ec6b
commit f0fc40bd3e
2 changed files with 4 additions and 5 deletions

View File

@ -33,9 +33,9 @@ import kotlin.math.abs
class TechPickerScreen(
internal val civInfo: Civilization,
centerOnTech: Technology? = null,
private val freeTechPick: Boolean = false
) : PickerScreen() {
private val freeTechPick: Boolean = civInfo.tech.freeTechs != 0
private val ruleset = civInfo.gameInfo.ruleset
private var techNameToButton = HashMap<String, TechButton>()
private var selectedTech: Technology? = null
@ -85,7 +85,7 @@ class TechPickerScreen(
techTable.background = skinStrings.getUiBackground("TechPickerScreen/Background", tintColor = skinStrings.skinConfig.clearColor)
pickerPane.bottomTable.background = skinStrings.getUiBackground("TechPickerScreen/BottomTable", tintColor = skinStrings.skinConfig.clearColor)
rightSideButton.setText("Pick a tech".tr())
rightSideButton.setText(if (freeTechPick) "Pick a free tech".tr() else "Pick a tech".tr())
rightSideButton.onClick(UncivSound.Paper) { tryExit() }
// per default show current/recent technology,

View File

@ -2,7 +2,6 @@ package com.unciv.ui.screens.worldscreen.status
import com.badlogic.gdx.graphics.Color
import com.unciv.Constants
import com.unciv.UncivGame
import com.unciv.logic.civilization.managers.ReligionManager
import com.unciv.logic.civilization.managers.ReligionState
import com.unciv.models.Counter
@ -57,7 +56,7 @@ enum class NextTurnAction(protected val text: String, val color: Color) {
worldScreen.viewingCiv.shouldOpenTechPicker()
override fun action(worldScreen: WorldScreen) =
worldScreen.game.pushScreen(
TechPickerScreen(worldScreen.viewingCiv, null, worldScreen.viewingCiv.tech.freeTechs != 0)
TechPickerScreen(worldScreen.viewingCiv, null)
)
},
PickPolicy("Pick a policy", Color.VIOLET) {