Skip to content

Commit

Permalink
Resolved #12276 - Free tech pickable in any way you enter the tech sc…
Browse files Browse the repository at this point in the history
…reen
  • Loading branch information
yairm210 committed Oct 13, 2024
1 parent e105a6e commit f0fc40b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -84,8 +84,8 @@ class TechPickerScreen(
topTable.add(techTable)
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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit f0fc40b

Please sign in to comment.