mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-23 14:19:15 +07:00
Resolved #12276 - Free tech pickable in any way you enter the tech screen
This commit is contained in:
@ -33,9 +33,9 @@ import kotlin.math.abs
|
|||||||
class TechPickerScreen(
|
class TechPickerScreen(
|
||||||
internal val civInfo: Civilization,
|
internal val civInfo: Civilization,
|
||||||
centerOnTech: Technology? = null,
|
centerOnTech: Technology? = null,
|
||||||
private val freeTechPick: Boolean = false
|
|
||||||
) : PickerScreen() {
|
) : PickerScreen() {
|
||||||
|
|
||||||
|
private val freeTechPick: Boolean = civInfo.tech.freeTechs != 0
|
||||||
private val ruleset = civInfo.gameInfo.ruleset
|
private val ruleset = civInfo.gameInfo.ruleset
|
||||||
private var techNameToButton = HashMap<String, TechButton>()
|
private var techNameToButton = HashMap<String, TechButton>()
|
||||||
private var selectedTech: Technology? = null
|
private var selectedTech: Technology? = null
|
||||||
@ -85,7 +85,7 @@ class TechPickerScreen(
|
|||||||
techTable.background = skinStrings.getUiBackground("TechPickerScreen/Background", tintColor = skinStrings.skinConfig.clearColor)
|
techTable.background = skinStrings.getUiBackground("TechPickerScreen/Background", tintColor = skinStrings.skinConfig.clearColor)
|
||||||
pickerPane.bottomTable.background = skinStrings.getUiBackground("TechPickerScreen/BottomTable", 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() }
|
rightSideButton.onClick(UncivSound.Paper) { tryExit() }
|
||||||
|
|
||||||
// per default show current/recent technology,
|
// per default show current/recent technology,
|
||||||
|
@ -2,7 +2,6 @@ package com.unciv.ui.screens.worldscreen.status
|
|||||||
|
|
||||||
import com.badlogic.gdx.graphics.Color
|
import com.badlogic.gdx.graphics.Color
|
||||||
import com.unciv.Constants
|
import com.unciv.Constants
|
||||||
import com.unciv.UncivGame
|
|
||||||
import com.unciv.logic.civilization.managers.ReligionManager
|
import com.unciv.logic.civilization.managers.ReligionManager
|
||||||
import com.unciv.logic.civilization.managers.ReligionState
|
import com.unciv.logic.civilization.managers.ReligionState
|
||||||
import com.unciv.models.Counter
|
import com.unciv.models.Counter
|
||||||
@ -57,7 +56,7 @@ enum class NextTurnAction(protected val text: String, val color: Color) {
|
|||||||
worldScreen.viewingCiv.shouldOpenTechPicker()
|
worldScreen.viewingCiv.shouldOpenTechPicker()
|
||||||
override fun action(worldScreen: WorldScreen) =
|
override fun action(worldScreen: WorldScreen) =
|
||||||
worldScreen.game.pushScreen(
|
worldScreen.game.pushScreen(
|
||||||
TechPickerScreen(worldScreen.viewingCiv, null, worldScreen.viewingCiv.tech.freeTechs != 0)
|
TechPickerScreen(worldScreen.viewingCiv, null)
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
PickPolicy("Pick a policy", Color.VIOLET) {
|
PickPolicy("Pick a policy", Color.VIOLET) {
|
||||||
|
Reference in New Issue
Block a user