mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-10 07:48:31 +07:00
I don't think you should be able to see other tech's tech trees from the victory screen.
This commit is contained in:
BIN
android/Images/FlagIcons/Malay.png
Normal file
BIN
android/Images/FlagIcons/Malay.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.5 KiB |
@ -12,7 +12,6 @@ import com.unciv.models.gamebasics.tr
|
|||||||
import com.unciv.ui.newgamescreen.NewGameScreen
|
import com.unciv.ui.newgamescreen.NewGameScreen
|
||||||
import com.unciv.ui.pickerscreens.PickerScreen
|
import com.unciv.ui.pickerscreens.PickerScreen
|
||||||
import com.unciv.ui.pickerscreens.PolicyPickerScreen
|
import com.unciv.ui.pickerscreens.PolicyPickerScreen
|
||||||
import com.unciv.ui.pickerscreens.TechPickerScreen
|
|
||||||
import com.unciv.ui.utils.addSeparator
|
import com.unciv.ui.utils.addSeparator
|
||||||
import com.unciv.ui.utils.enable
|
import com.unciv.ui.utils.enable
|
||||||
import com.unciv.ui.utils.onClick
|
import com.unciv.ui.utils.onClick
|
||||||
@ -228,11 +227,6 @@ class VictoryScreen : PickerScreen() {
|
|||||||
for (entry in civsToPartsRemaining) {
|
for (entry in civsToPartsRemaining) {
|
||||||
val civToPartsBeRemaining=(EmpireOverviewScreen.getCivGroup(entry.civ, " - " + entry.partsRemaining, playerCivInfo))
|
val civToPartsBeRemaining=(EmpireOverviewScreen.getCivGroup(entry.civ, " - " + entry.partsRemaining, playerCivInfo))
|
||||||
scientificVictoryColumn.add(civToPartsBeRemaining).row()
|
scientificVictoryColumn.add(civToPartsBeRemaining).row()
|
||||||
civToPartsBeRemaining.touchable= Touchable.enabled
|
|
||||||
civToPartsBeRemaining.onClick {
|
|
||||||
game.setScreen(TechPickerScreen(entry.civ, false))
|
|
||||||
dispose()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return scientificVictoryColumn
|
return scientificVictoryColumn
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ import com.unciv.ui.utils.*
|
|||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
|
|
||||||
class TechPickerScreen(internal val civInfo: CivilizationInfo, switchfromWorldScreen: Boolean = true, centerOnTech: Technology? = null) : PickerScreen() {
|
class TechPickerScreen(internal val civInfo: CivilizationInfo, centerOnTech: Technology? = null) : PickerScreen() {
|
||||||
|
|
||||||
private var techNameToButton = HashMap<String, TechButton>()
|
private var techNameToButton = HashMap<String, TechButton>()
|
||||||
private var isFreeTechPick: Boolean = false
|
private var isFreeTechPick: Boolean = false
|
||||||
@ -61,32 +61,10 @@ class TechPickerScreen(internal val civInfo: CivilizationInfo, switchfromWorldSc
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create tech table (row by row)
|
// Create tech table (row by row)
|
||||||
for (i in 0..9) {
|
createTechTable(techMatrix)
|
||||||
topTable.row().pad(5f).padRight(40f)
|
|
||||||
|
|
||||||
for (j in techMatrix.indices) {
|
|
||||||
val tech = techMatrix[j][i]
|
|
||||||
if (tech == null)
|
|
||||||
topTable.add() // empty cell
|
|
||||||
|
|
||||||
else {
|
|
||||||
val techButton = TechButton(tech.name, civTech,false)
|
|
||||||
|
|
||||||
techNameToButton[tech.name] = techButton
|
|
||||||
techButton.onClick { selectTechnology(tech, false, switchfromWorldScreen) }
|
|
||||||
topTable.add(techButton)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
setButtonsInfo()
|
setButtonsInfo()
|
||||||
if (!switchfromWorldScreen){
|
rightSideButton.setText("Pick a tech".tr())
|
||||||
rightSideButton.apply {
|
|
||||||
disable()
|
|
||||||
setText("Tech Tree Of [${civInfo.civName}]".tr())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else rightSideButton.setText("Pick a tech".tr())
|
|
||||||
rightSideButton.onClick("paper") {
|
rightSideButton.onClick("paper") {
|
||||||
if (isFreeTechPick) civTech.getFreeTechnology(selectedTech!!.name)
|
if (isFreeTechPick) civTech.getFreeTechnology(selectedTech!!.name)
|
||||||
else civTech.techsToResearch = tempTechsToResearch
|
else civTech.techsToResearch = tempTechsToResearch
|
||||||
@ -105,12 +83,32 @@ class TechPickerScreen(internal val civInfo: CivilizationInfo, switchfromWorldSc
|
|||||||
if (tech != null) {
|
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, switchfromWorldScreen)
|
selectTechnology(tech, true)
|
||||||
else centerOnTechnology(tech)
|
else centerOnTechnology(tech)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun createTechTable(techMatrix: Array<Array<Technology?>>) {
|
||||||
|
for (i in 0..9) {
|
||||||
|
topTable.row().pad(5f).padRight(40f)
|
||||||
|
|
||||||
|
for (j in techMatrix.indices) {
|
||||||
|
val tech = techMatrix[j][i]
|
||||||
|
if (tech == null)
|
||||||
|
topTable.add() // empty cell
|
||||||
|
|
||||||
|
else {
|
||||||
|
val techButton = TechButton(tech.name, civTech, false)
|
||||||
|
|
||||||
|
techNameToButton[tech.name] = techButton
|
||||||
|
techButton.onClick { selectTechnology(tech, false) }
|
||||||
|
topTable.add(techButton)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun setButtonsInfo() {
|
private fun setButtonsInfo() {
|
||||||
for (techName in techNameToButton.keys) {
|
for (techName in techNameToButton.keys) {
|
||||||
val techButton = techNameToButton[techName]!!
|
val techButton = techNameToButton[techName]!!
|
||||||
|
Reference in New Issue
Block a user