new selected constructions will be inserted before infinite output (#3073)

perpetual constructions will replace each other in queue

Spectators no longer can sell buildings
Spectators no longer can rename cities
This commit is contained in:
HadeanLake 2020-09-01 22:48:21 +03:00 committed by GitHub
parent 6c2d597c39
commit d89526b8b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 3 deletions

View File

@ -396,9 +396,15 @@ class CityConstructions {
if (isQueueFull()) return
if (currentConstructionFromQueue == "" || currentConstructionFromQueue == "Nothing") {
currentConstructionFromQueue = constructionName
currentConstructionIsUserSet = true
} else if (getConstruction(constructionQueue.last()) is PerpetualConstruction) {
if (getConstruction(constructionName) is PerpetualConstruction) { // perpetual constructions will replace each other
constructionQueue.removeAt(constructionQueue.size - 1)
constructionQueue.add(constructionName)
} else
constructionQueue.add(constructionQueue.size - 1, constructionName) // insert new construction before perpetual one
} else
constructionQueue.add(constructionName)
currentConstructionIsUserSet = true
}
/** If this was done automatically, we should automatically try to choose a new construction and treat it as such */

View File

@ -115,7 +115,7 @@ class CityInfoTable(private val cityScreen: CityScreen) : Table(CameraStageBaseS
}).open()
}
if ((cityScreen.city.hasSoldBuildingThisTurn && !cityScreen.city.civInfo.gameInfo.gameParameters.godMode) || cityScreen.city.isPuppet
|| !UncivGame.Current.worldScreen.isPlayersTurn)
|| !UncivGame.Current.worldScreen.isPlayersTurn || !cityScreen.canChangeState)
sellBuildingButton.disable()
}
wonderDetailsTable.addSeparator()

View File

@ -47,7 +47,7 @@ class CityScreenCityPickerTable(val cityScreen: CityScreen) : Table(){
}
val currentCityLabel = city.name.toLabel(fontSize = 30, fontColor = civInfo.nation.getInnerColor())
currentCityLabel.onClick {
if (cityScreen.canChangeState) currentCityLabel.onClick {
val editCityNamePopup = Popup(cityScreen)
val textArea = TextField(city.name, CameraStageBaseScreen.skin)
textArea.alignment = Align.center