mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-26 21:35:14 -04:00
Fixed #438 - changing production before answering the "do you want to purchase construction" popup lead to buying the newly chosen production
This commit is contained in:
parent
478a9e6996
commit
665af17ae5
@ -128,7 +128,7 @@ class ConstructionsTable(val cityScreen: CityScreen) : Table(CameraStageBaseScre
|
||||
purchaseConstructionButton = TextButton("Buy for [$buildingGoldCost] gold".tr(), CameraStageBaseScreen.skin)
|
||||
purchaseConstructionButton.onClick("coin") {
|
||||
YesNoPopupTable("Would you like to purchase [${construction.name}] for [$buildingGoldCost] gold?".tr(), {
|
||||
city.cityConstructions.purchaseBuilding(city.cityConstructions.currentConstruction)
|
||||
city.cityConstructions.purchaseBuilding(construction.name)
|
||||
update()
|
||||
}, cityScreen)
|
||||
}
|
||||
|
@ -50,7 +50,6 @@ class TechPickerScreen(internal val civInfo: CivilizationInfo) : PickerScreen()
|
||||
techMatrix[technology.column!!.columnNumber][technology.row - 1] = technology
|
||||
}
|
||||
|
||||
val alreadyDisplayedEras = HashSet<String>()
|
||||
val eras = ArrayList<Label>()
|
||||
for(i in techMatrix.indices) eras.add(Label("",CameraStageBaseScreen.skin).apply { setFontColor(Color.WHITE) })
|
||||
eras.forEach { topTable.add(it) }
|
||||
@ -77,13 +76,14 @@ class TechPickerScreen(internal val civInfo: CivilizationInfo) : PickerScreen()
|
||||
}
|
||||
|
||||
// Set era names (column by column)
|
||||
val alreadyDisplayedEras = HashSet<String>()
|
||||
for(j in techMatrix.indices)
|
||||
for(i in 0..9)
|
||||
{
|
||||
val tech = techMatrix[j][i]
|
||||
if(tech==null) continue
|
||||
val eraName = tech.era().name
|
||||
if(!alreadyDisplayedEras.contains(eraName)) { // name of era was not yet set
|
||||
if(!alreadyDisplayedEras.contains(eraName)) { // name of era was not yet displayed
|
||||
eras[j].setText("$eraName era".tr())
|
||||
alreadyDisplayedEras.add(eraName)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user